Go to the documentation of this file.
37 #define ARCH_HAS_IOREMAP_WC
39 #include <linux/string.h>
40 #include <linux/compiler.h>
43 #define build_mmio_read(name, size, type, reg, barrier) \
44 static inline type name(const volatile void __iomem *addr) \
45 { type ret; asm volatile("mov" size " %1,%0":reg (ret) \
46 :"m" (*(volatile type __force *)addr) barrier); return ret; }
48 #define build_mmio_write(name, size, type, reg, barrier) \
49 static inline void name(type val, volatile void __iomem *addr) \
50 { asm volatile("mov" size " %0,%1": :reg (val), \
51 "m" (*(volatile type __force *)addr) barrier); }
69 #define readb_relaxed(a) __readb(a)
70 #define readw_relaxed(a) __readw(a)
71 #define readl_relaxed(a) __readl(a)
72 #define __raw_readb __readb
73 #define __raw_readw __readw
74 #define __raw_readl __readl
76 #define __raw_writeb __writeb
77 #define __raw_writew __writew
78 #define __raw_writel __writel
80 #define mmiowb() barrier()
87 #define readq_relaxed(a) readq(a)
89 #define __raw_readq(a) readq(a)
90 #define __raw_writeq(val, addr) writeq(val, addr)
113 return __pa(address);
131 return __va(address);
137 #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
144 static inline unsigned int isa_virt_to_bus(
volatile void *
address)
148 #define isa_page_to_bus(page) ((unsigned int)page_to_phys(page))
149 #define isa_bus_to_virt phys_to_virt
157 #define virt_to_bus virt_to_phys
158 #define bus_to_virt phys_to_virt
177 unsigned long prot_val);
200 #define xlate_dev_kmem_ptr(p) p
228 #define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET))
238 static inline void flush_write_buffers(
void)
240 #if defined(CONFIG_X86_OOSTORE) || defined(CONFIG_X86_PPRO_FENCE)
241 asm volatile(
"lock; addl $0,0(%%esp)": : :
"memory");
249 extern int io_delay_type;
252 #if defined(CONFIG_PARAVIRT)
253 #include <asm/paravirt.h>
259 #ifdef REALLY_SLOW_IO
268 #define BUILDIO(bwl, bw, type) \
269 static inline void out##bwl(unsigned type value, int port) \
271 asm volatile("out" #bwl " %" #bw "0, %w1" \
272 : : "a"(value), "Nd"(port)); \
275 static inline unsigned type in##bwl(int port) \
277 unsigned type value; \
278 asm volatile("in" #bwl " %w1, %" #bw "0" \
279 : "=a"(value) : "Nd"(port)); \
283 static inline void out##bwl##_p(unsigned type value, int port) \
285 out##bwl(value, port); \
289 static inline unsigned type in##bwl##_p(int port) \
291 unsigned type value = in##bwl(port); \
296 static inline void outs##bwl(int port, const void *addr, unsigned long count) \
298 asm volatile("rep; outs" #bwl \
299 : "+S"(addr), "+c"(count) : "d"(port)); \
302 static inline void ins##bwl(int port, void *addr, unsigned long count) \
304 asm volatile("rep; ins" #bwl \
305 : "+D"(addr), "+c"(count) : "d"(port)); \
316 unsigned long prot_val);
339 const struct bio_vec *vec2);
341 #define BIOVEC_PHYS_MERGEABLE(vec1, vec2) \
342 (__BIOVEC_PHYS_MERGEABLE(vec1, vec2) && \
343 (!xen_domain() || xen_biovec_phys_mergeable(vec1, vec2)))
346 #define IO_SPACE_LIMIT 0xffff