]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iommu/vt-d: Use lo_hi_readq() / lo_hi_writeq()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 16 Mar 2017 14:23:55 +0000 (16:23 +0200)
committerJoerg Roedel <jroedel@suse.de>
Wed, 22 Mar 2017 14:42:17 +0000 (15:42 +0100)
There is already helper functions to do 64-bit I/O on 32-bit machines or
buses, thus we don't need to reinvent the wheel.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
include/linux/intel-iommu.h

index c573a52ae440e83894709328820bacb79391d15c..485a5b48f0380460fa0b46243e34aa6c83796c07 100644 (file)
@@ -30,6 +30,8 @@
 #include <linux/mmu_notifier.h>
 #include <linux/list.h>
 #include <linux/iommu.h>
+#include <linux/io-64-nonatomic-lo-hi.h>
+
 #include <asm/cacheflush.h>
 #include <asm/iommu.h>
 
 
 #define OFFSET_STRIDE          (9)
 
-#ifdef CONFIG_64BIT
 #define dmar_readq(a) readq(a)
 #define dmar_writeq(a,v) writeq(v,a)
-#else
-static inline u64 dmar_readq(void __iomem *addr)
-{
-       u32 lo, hi;
-       lo = readl(addr);
-       hi = readl(addr + 4);
-       return (((u64) hi) << 32) + lo;
-}
-
-static inline void dmar_writeq(void __iomem *addr, u64 val)
-{
-       writel((u32)val, addr);
-       writel((u32)(val >> 32), addr + 4);
-}
-#endif
 
 #define DMAR_VER_MAJOR(v)              (((v) & 0xf0) >> 4)
 #define DMAR_VER_MINOR(v)              ((v) & 0x0f)