4 #define ARCH_HAS_IOREMAP_WC
6 #include <linux/compiler.h>
9 * early_ioremap() and early_iounmap() are for temporary early boot-time
10 * mappings, before the real ioremap() is functional.
11 * A boot-time mapping is currently limited to at most 16 pages.
14 extern void early_ioremap_init(void);
15 extern void early_ioremap_clear(void);
16 extern void early_ioremap_reset(void);
17 extern void *early_ioremap(unsigned long offset
, unsigned long size
);
18 extern void early_iounmap(void *addr
, unsigned long size
);
19 extern void __iomem
*fix_ioremap(unsigned idx
, unsigned long phys
);
22 #define build_mmio_read(name, size, type, reg, barrier) \
23 static inline type name(const volatile void __iomem *addr) \
24 { type ret; asm volatile("mov" size " %1,%0":reg (ret) \
25 :"m" (*(volatile type __force *)addr) barrier); return ret; }
27 #define build_mmio_write(name, size, type, reg, barrier) \
28 static inline void name(type val, volatile void __iomem *addr) \
29 { asm volatile("mov" size " %0,%1": :reg (val), \
30 "m" (*(volatile type __force *)addr) barrier); }
32 build_mmio_read(readb
, "b", unsigned char, "=q", :"memory")
33 build_mmio_read(readw
, "w", unsigned short, "=r", :"memory")
34 build_mmio_read(readl
, "l", unsigned int, "=r", :"memory")
36 build_mmio_read(__readb
, "b", unsigned char, "=q", )
37 build_mmio_read(__readw
, "w", unsigned short, "=r", )
38 build_mmio_read(__readl
, "l", unsigned int, "=r", )
40 build_mmio_write(writeb
, "b", unsigned char, "q", :"memory")
41 build_mmio_write(writew
, "w", unsigned short, "r", :"memory")
42 build_mmio_write(writel
, "l", unsigned int, "r", :"memory")
44 build_mmio_write(__writeb
, "b", unsigned char, "q", )
45 build_mmio_write(__writew
, "w", unsigned short, "r", )
46 build_mmio_write(__writel
, "l", unsigned int, "r", )
48 #define readb_relaxed(a) __readb(a)
49 #define readw_relaxed(a) __readw(a)
50 #define readl_relaxed(a) __readl(a)
51 #define __raw_readb __readb
52 #define __raw_readw __readw
53 #define __raw_readl __readl
55 #define __raw_writeb __writeb
56 #define __raw_writew __writew
57 #define __raw_writel __writel
59 #define mmiowb() barrier()
62 build_mmio_read(readq
, "q", unsigned long, "=r", :"memory")
63 build_mmio_read(__readq
, "q", unsigned long, "=r", )
64 build_mmio_write(writeq
, "q", unsigned long, "r", :"memory")
65 build_mmio_write(__writeq
, "q", unsigned long, "r", )
67 #define readq_relaxed(a) __readq(a)
68 #define __raw_readq __readq
69 #define __raw_writeq writeq
71 /* Let people know we have them */
82 extern void *xlate_dev_mem_ptr(unsigned long phys
);
83 extern void unxlate_dev_mem_ptr(unsigned long phys
, void *addr
);
85 extern int ioremap_change_attr(unsigned long vaddr
, unsigned long size
,
86 unsigned long prot_val
);
87 extern void __iomem
*ioremap_wc(unsigned long offset
, unsigned long size
);
90 * early_ioremap() and early_iounmap() are for temporary early boot-time
91 * mappings, before the real ioremap() is functional.
92 * A boot-time mapping is currently limited to at most 16 pages.
94 extern void early_ioremap_init(void);
95 extern void early_ioremap_clear(void);
96 extern void early_ioremap_reset(void);
97 extern void *early_ioremap(unsigned long offset
, unsigned long size
);
98 extern void early_iounmap(void *addr
, unsigned long size
);
99 extern void __iomem
*fix_ioremap(unsigned idx
, unsigned long phys
);
102 #endif /* _ASM_X86_IO_H */