diff options
Diffstat (limited to 'arch/x86/include/asm/io.h')
-rw-r--r-- | arch/x86/include/asm/io.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index ac2abc88cd95..25946449df4f 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #define ARCH_HAS_IOREMAP_WC | 4 | #define ARCH_HAS_IOREMAP_WC |
5 | 5 | ||
6 | #include <linux/compiler.h> | 6 | #include <linux/compiler.h> |
7 | #include <asm-generic/int-ll64.h> | ||
7 | 8 | ||
8 | #define build_mmio_read(name, size, type, reg, barrier) \ | 9 | #define build_mmio_read(name, size, type, reg, barrier) \ |
9 | static inline type name(const volatile void __iomem *addr) \ | 10 | static inline type name(const volatile void __iomem *addr) \ |
@@ -57,6 +58,29 @@ build_mmio_write(__writeq, "q", unsigned long, "r", ) | |||
57 | /* Let people know we have them */ | 58 | /* Let people know we have them */ |
58 | #define readq readq | 59 | #define readq readq |
59 | #define writeq writeq | 60 | #define writeq writeq |
61 | |||
62 | #else /* CONFIG_X86_32 from here */ | ||
63 | |||
64 | static inline __u64 readq(const volatile void __iomem *addr) | ||
65 | { | ||
66 | const volatile u32 __iomem *p = addr; | ||
67 | u32 l, h; | ||
68 | |||
69 | l = readl(p); | ||
70 | h = readl(p + 1); | ||
71 | |||
72 | return l + ((u64)h << 32); | ||
73 | } | ||
74 | |||
75 | static inline void writeq(__u64 val, volatile void __iomem *addr) | ||
76 | { | ||
77 | writel(val, addr); | ||
78 | writel(val >> 32, addr+4); | ||
79 | } | ||
80 | |||
81 | #define readq readq | ||
82 | #define writeq writeq | ||
83 | |||
60 | #endif | 84 | #endif |
61 | 85 | ||
62 | extern int iommu_bio_merge; | 86 | extern int iommu_bio_merge; |