aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/io.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/io.h')
-rw-r--r--arch/x86/include/asm/io.h39
1 files changed, 17 insertions, 22 deletions
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 30a3e9776123..d02804d650c4 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -38,9 +38,10 @@
38 38
39#include <linux/string.h> 39#include <linux/string.h>
40#include <linux/compiler.h> 40#include <linux/compiler.h>
41#include <asm-generic/int-ll64.h>
42#include <asm/page.h> 41#include <asm/page.h>
43 42
43#include <xen/xen.h>
44
44#define build_mmio_read(name, size, type, reg, barrier) \ 45#define build_mmio_read(name, size, type, reg, barrier) \
45static inline type name(const volatile void __iomem *addr) \ 46static inline type name(const volatile void __iomem *addr) \
46{ type ret; asm volatile("mov" size " %1,%0":reg (ret) \ 47{ type ret; asm volatile("mov" size " %1,%0":reg (ret) \
@@ -85,27 +86,6 @@ build_mmio_write(__writel, "l", unsigned int, "r", )
85build_mmio_read(readq, "q", unsigned long, "=r", :"memory") 86build_mmio_read(readq, "q", unsigned long, "=r", :"memory")
86build_mmio_write(writeq, "q", unsigned long, "r", :"memory") 87build_mmio_write(writeq, "q", unsigned long, "r", :"memory")
87 88
88#else
89
90static inline __u64 readq(const volatile void __iomem *addr)
91{
92 const volatile u32 __iomem *p = addr;
93 u32 low, high;
94
95 low = readl(p);
96 high = readl(p + 1);
97
98 return low + ((u64)high << 32);
99}
100
101static inline void writeq(__u64 val, volatile void __iomem *addr)
102{
103 writel(val, addr);
104 writel(val >> 32, addr+4);
105}
106
107#endif
108
109#define readq_relaxed(a) readq(a) 89#define readq_relaxed(a) readq(a)
110 90
111#define __raw_readq(a) readq(a) 91#define __raw_readq(a) readq(a)
@@ -115,6 +95,8 @@ static inline void writeq(__u64 val, volatile void __iomem *addr)
115#define readq readq 95#define readq readq
116#define writeq writeq 96#define writeq writeq
117 97
98#endif
99
118/** 100/**
119 * virt_to_phys - map virtual addresses to physical 101 * virt_to_phys - map virtual addresses to physical
120 * @address: address to remap 102 * @address: address to remap
@@ -206,6 +188,7 @@ static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
206 188
207extern void iounmap(volatile void __iomem *addr); 189extern void iounmap(volatile void __iomem *addr);
208 190
191extern void set_iounmap_nonlazy(void);
209 192
210#ifdef __KERNEL__ 193#ifdef __KERNEL__
211 194
@@ -348,6 +331,18 @@ extern void __iomem *early_memremap(resource_size_t phys_addr,
348 unsigned long size); 331 unsigned long size);
349extern void early_iounmap(void __iomem *addr, unsigned long size); 332extern void early_iounmap(void __iomem *addr, unsigned long size);
350extern void fixup_early_ioremap(void); 333extern void fixup_early_ioremap(void);
334extern bool is_early_ioremap_ptep(pte_t *ptep);
335
336#ifdef CONFIG_XEN
337struct bio_vec;
338
339extern bool xen_biovec_phys_mergeable(const struct bio_vec *vec1,
340 const struct bio_vec *vec2);
341
342#define BIOVEC_PHYS_MERGEABLE(vec1, vec2) \
343 (__BIOVEC_PHYS_MERGEABLE(vec1, vec2) && \
344 (!xen_domain() || xen_biovec_phys_mergeable(vec1, vec2)))
345#endif /* CONFIG_XEN */
351 346
352#define IO_SPACE_LIMIT 0xffff 347#define IO_SPACE_LIMIT 0xffff
353 348