9 #include <linux/export.h>
25 #ifndef HAVE_ARCH_PIO_SIZE
33 #define PIO_OFFSET 0x10000UL
34 #define PIO_MASK 0x0ffffUL
35 #define PIO_RESERVED 0x40000UL
38 static void bad_io_access(
unsigned long port,
const char *
access)
40 static int count = 10;
43 WARN(1,
KERN_ERR "Bad IO access at port %#lx (%s)\n", port, access);
50 #define IO_COND(addr, is_pio, is_mmio) do { \
51 unsigned long port = (unsigned long __force)addr; \
52 if (port >= PIO_RESERVED) { \
54 } else if (port > PIO_OFFSET) { \
58 bad_io_access(port, #is_pio ); \
62 #define pio_read16be(port) swab16(inw(port))
63 #define pio_read32be(port) swab32(inl(port))
67 #define mmio_read16be(addr) be16_to_cpu(__raw_readw(addr))
68 #define mmio_read32be(addr) be32_to_cpu(__raw_readl(addr))
102 #ifndef pio_write16be
103 #define pio_write16be(val,port) outw(swab16(val),port)
104 #define pio_write32be(val,port) outl(swab32(val),port)
107 #ifndef mmio_write16be
108 #define mmio_write16be(val,port) __raw_writew(be16_to_cpu(val),port)
109 #define mmio_write32be(val,port) __raw_writel(be32_to_cpu(val),port)
147 while (--count >= 0) {
153 static inline void mmio_insw(
void __iomem *addr,
u16 *dst,
int count)
155 while (--count >= 0) {
161 static inline void mmio_insl(
void __iomem *addr,
u32 *dst,
int count)
163 while (--count >= 0) {
172 static inline void mmio_outsb(
void __iomem *addr,
const u8 *
src,
int count)
174 while (--count >= 0) {
179 static inline void mmio_outsw(
void __iomem *addr,
const u16 *src,
int count)
181 while (--count >= 0) {
186 static inline void mmio_outsl(
void __iomem *addr,
const u32 *src,
int count)
188 while (--count >= 0) {
227 #ifdef CONFIG_HAS_IOPORT