1 #ifndef _M68K_IO_H
2 #define _M68K_IO_H
3
4 #ifdef __KERNEL__
5
6 #include <linux/config.h>
7
8 #ifdef CONFIG_ATARI
9 #include <asm/atarihw.h>
10
11 #define SLOW_DOWN_IO do { if (MACH_IS_ATARI) MFPDELAY(); } while (0)
12 #endif
13
14 #include <asm/virtconvert.h>
15
16 /*
17 * These are for PCI shared memory _only_ and should never be used
18 * on any other type of memory, including Zorro memory. They are meant to
19 * access the bus in the bus byte order which is little-endian!.
20 *
21 * readX/writeX() are used to access memory mapped devices. On some
22 * architectures the memory mapped IO stuff needs to be accessed
23 * differently. On the m68k architecture, we just read/write the
24 * memory location directly.
25 */
26 /* ++roman: The assignments to temp. vars avoid that gcc sometimes generates
27 * two accesses to memory, which may be undesireable for some devices.
28 */
29 #define readb(addr) \
30 ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
31 #define readw(addr) \
32 ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
33 #define readl(addr) \
34 ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
35
36 #define writeb(b,addr) (void)((*(volatile unsigned char *) (addr)) = (b))
37 #define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b))
38 #define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b))
39
40 #define memset_io(a,b,c) memset((void *)(a),(b),(c))
41 #define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
42 #define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
43
44 #define inb_p(addr) readb(addr)
45 #define inb(addr) readb(addr)
46
47 #define outb(x,addr) ((void) writeb(x,addr))
48 #define outb_p(x,addr) outb(x,addr)
49
50 #ifndef CONFIG_SUN3
51 #define IO_SPACE_LIMIT 0xffff
52 #else
53 #define IO_SPACE_LIMIT 0x0fffffff
54 #endif
55
56 /* Values for nocacheflag and cmode */
57 #define IOMAP_FULL_CACHING 0
58 #define IOMAP_NOCACHE_SER 1
59 #define IOMAP_NOCACHE_NONSER 2
60 #define IOMAP_WRITETHROUGH 3
61
62 extern void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag);
63 extern void __iounmap(void *addr, unsigned long size);
64
65 extern inline void *ioremap(unsigned long physaddr, unsigned long size)
66 {
67 return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
68 }
69 extern inline void *ioremap_nocache(unsigned long physaddr, unsigned long size)
70 {
71 return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
72 }
73 extern inline void *ioremap_writethrough(unsigned long physaddr, unsigned long size)
74 {
75 return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
76 }
77 extern inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size)
78 {
79 return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
80 }
81
82 extern void iounmap(void *addr);
83
84 /* Nothing to do */
85
86 #define dma_cache_inv(_start,_size) do { } while (0)
87 #define dma_cache_wback(_start,_size) do { } while (0)
88 #define dma_cache_wback_inv(_start,_size) do { } while (0)
89
90 #endif /* __KERNEL__ */
91
92 #endif /* _M68K_IO_H */
93
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.