1 #ifndef __ASM_SH_IO_TRAPPED_H
2 #define __ASM_SH_IO_TRAPPED_H
4 #include <linux/list.h>
5 #include <linux/ioport.h>
8 #define IO_TRAPPED_MAGIC 0xfeedbeef
12 struct resource *resource;
13 unsigned int num_resources;
14 unsigned int minimum_bus_width;
15 struct list_head list;
16 void __iomem *virt_base;
17 } __aligned(PAGE_SIZE);
19 #ifdef CONFIG_IO_TRAPPED
20 int register_trapped_io(struct trapped_io *tiop);
21 int handle_trapped_io(struct pt_regs *regs, unsigned long address);
23 void __iomem *match_trapped_io_handler(struct list_head *list,
27 #ifdef CONFIG_HAS_IOMEM
28 extern struct list_head trapped_mem;
30 static inline void __iomem *
31 __ioremap_trapped(unsigned long offset, unsigned long size)
33 return match_trapped_io_handler(&trapped_mem, offset, size);
36 #define __ioremap_trapped(offset, size) NULL
39 #ifdef CONFIG_HAS_IOPORT
40 extern struct list_head trapped_io;
42 static inline void __iomem *
43 __ioport_map_trapped(unsigned long offset, unsigned long size)
45 return match_trapped_io_handler(&trapped_io, offset, size);
48 #define __ioport_map_trapped(offset, size) NULL
52 #define register_trapped_io(tiop) (-1)
53 #define handle_trapped_io(tiop, address) 0
54 #define __ioremap_trapped(offset, size) NULL
55 #define __ioport_map_trapped(offset, size) NULL
58 #endif /* __ASM_SH_IO_TRAPPED_H */