diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-01-12 04:06:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-12 12:09:02 -0500 |
commit | ad9ec4f8de264903c6b5ba7ae8d8e96432188858 (patch) | |
tree | 9ae7f2625eaa777abdb6b5cb2d505361d37ae675 /include/asm-m68k | |
parent | 9a4729118c8851bce709a00eba1b3a8f1fd9ed58 (diff) |
[PATCH] m68k: basic iomem annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-m68k')
-rw-r--r-- | include/asm-m68k/io.h | 49 | ||||
-rw-r--r-- | include/asm-m68k/raw_io.h | 40 | ||||
-rw-r--r-- | include/asm-m68k/zorro.h | 8 |
3 files changed, 49 insertions, 48 deletions
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h index 6bb8b0d8f99d..dcfaa352d34c 100644 --- a/include/asm-m68k/io.h +++ b/include/asm-m68k/io.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #ifdef __KERNEL__ | 24 | #ifdef __KERNEL__ |
25 | 25 | ||
26 | #include <linux/config.h> | 26 | #include <linux/config.h> |
27 | #include <linux/compiler.h> | ||
27 | #include <asm/raw_io.h> | 28 | #include <asm/raw_io.h> |
28 | #include <asm/virtconvert.h> | 29 | #include <asm/virtconvert.h> |
29 | 30 | ||
@@ -120,68 +121,68 @@ extern int isa_sex; | |||
120 | * be compiled in so the case statement will be optimised away | 121 | * be compiled in so the case statement will be optimised away |
121 | */ | 122 | */ |
122 | 123 | ||
123 | static inline u8 *isa_itb(unsigned long addr) | 124 | static inline u8 __iomem *isa_itb(unsigned long addr) |
124 | { | 125 | { |
125 | switch(ISA_TYPE) | 126 | switch(ISA_TYPE) |
126 | { | 127 | { |
127 | #ifdef CONFIG_Q40 | 128 | #ifdef CONFIG_Q40 |
128 | case Q40_ISA: return (u8 *)Q40_ISA_IO_B(addr); | 129 | case Q40_ISA: return (u8 __iomem *)Q40_ISA_IO_B(addr); |
129 | #endif | 130 | #endif |
130 | #ifdef CONFIG_GG2 | 131 | #ifdef CONFIG_GG2 |
131 | case GG2_ISA: return (u8 *)GG2_ISA_IO_B(addr); | 132 | case GG2_ISA: return (u8 __iomem *)GG2_ISA_IO_B(addr); |
132 | #endif | 133 | #endif |
133 | #ifdef CONFIG_AMIGA_PCMCIA | 134 | #ifdef CONFIG_AMIGA_PCMCIA |
134 | case AG_ISA: return (u8 *)AG_ISA_IO_B(addr); | 135 | case AG_ISA: return (u8 __iomem *)AG_ISA_IO_B(addr); |
135 | #endif | 136 | #endif |
136 | default: return 0; /* avoid warnings, just in case */ | 137 | default: return NULL; /* avoid warnings, just in case */ |
137 | } | 138 | } |
138 | } | 139 | } |
139 | static inline u16 *isa_itw(unsigned long addr) | 140 | static inline u16 __iomem *isa_itw(unsigned long addr) |
140 | { | 141 | { |
141 | switch(ISA_TYPE) | 142 | switch(ISA_TYPE) |
142 | { | 143 | { |
143 | #ifdef CONFIG_Q40 | 144 | #ifdef CONFIG_Q40 |
144 | case Q40_ISA: return (u16 *)Q40_ISA_IO_W(addr); | 145 | case Q40_ISA: return (u16 __iomem *)Q40_ISA_IO_W(addr); |
145 | #endif | 146 | #endif |
146 | #ifdef CONFIG_GG2 | 147 | #ifdef CONFIG_GG2 |
147 | case GG2_ISA: return (u16 *)GG2_ISA_IO_W(addr); | 148 | case GG2_ISA: return (u16 __iomem *)GG2_ISA_IO_W(addr); |
148 | #endif | 149 | #endif |
149 | #ifdef CONFIG_AMIGA_PCMCIA | 150 | #ifdef CONFIG_AMIGA_PCMCIA |
150 | case AG_ISA: return (u16 *)AG_ISA_IO_W(addr); | 151 | case AG_ISA: return (u16 __iomem *)AG_ISA_IO_W(addr); |
151 | #endif | 152 | #endif |
152 | default: return 0; /* avoid warnings, just in case */ | 153 | default: return NULL; /* avoid warnings, just in case */ |
153 | } | 154 | } |
154 | } | 155 | } |
155 | static inline u8 *isa_mtb(unsigned long addr) | 156 | static inline u8 __iomem *isa_mtb(unsigned long addr) |
156 | { | 157 | { |
157 | switch(ISA_TYPE) | 158 | switch(ISA_TYPE) |
158 | { | 159 | { |
159 | #ifdef CONFIG_Q40 | 160 | #ifdef CONFIG_Q40 |
160 | case Q40_ISA: return (u8 *)Q40_ISA_MEM_B(addr); | 161 | case Q40_ISA: return (u8 __iomem *)Q40_ISA_MEM_B(addr); |
161 | #endif | 162 | #endif |
162 | #ifdef CONFIG_GG2 | 163 | #ifdef CONFIG_GG2 |
163 | case GG2_ISA: return (u8 *)GG2_ISA_MEM_B(addr); | 164 | case GG2_ISA: return (u8 __iomem *)GG2_ISA_MEM_B(addr); |
164 | #endif | 165 | #endif |
165 | #ifdef CONFIG_AMIGA_PCMCIA | 166 | #ifdef CONFIG_AMIGA_PCMCIA |
166 | case AG_ISA: return (u8 *)addr; | 167 | case AG_ISA: return (u8 __iomem *)addr; |
167 | #endif | 168 | #endif |
168 | default: return 0; /* avoid warnings, just in case */ | 169 | default: return NULL; /* avoid warnings, just in case */ |
169 | } | 170 | } |
170 | } | 171 | } |
171 | static inline u16 *isa_mtw(unsigned long addr) | 172 | static inline u16 __iomem *isa_mtw(unsigned long addr) |
172 | { | 173 | { |
173 | switch(ISA_TYPE) | 174 | switch(ISA_TYPE) |
174 | { | 175 | { |
175 | #ifdef CONFIG_Q40 | 176 | #ifdef CONFIG_Q40 |
176 | case Q40_ISA: return (u16 *)Q40_ISA_MEM_W(addr); | 177 | case Q40_ISA: return (u16 __iomem *)Q40_ISA_MEM_W(addr); |
177 | #endif | 178 | #endif |
178 | #ifdef CONFIG_GG2 | 179 | #ifdef CONFIG_GG2 |
179 | case GG2_ISA: return (u16 *)GG2_ISA_MEM_W(addr); | 180 | case GG2_ISA: return (u16 __iomem *)GG2_ISA_MEM_W(addr); |
180 | #endif | 181 | #endif |
181 | #ifdef CONFIG_AMIGA_PCMCIA | 182 | #ifdef CONFIG_AMIGA_PCMCIA |
182 | case AG_ISA: return (u16 *)addr; | 183 | case AG_ISA: return (u16 __iomem *)addr; |
183 | #endif | 184 | #endif |
184 | default: return 0; /* avoid warnings, just in case */ | 185 | default: return NULL; /* avoid warnings, just in case */ |
185 | } | 186 | } |
186 | } | 187 | } |
187 | 188 | ||
@@ -326,20 +327,20 @@ static inline void isa_delay(void) | |||
326 | 327 | ||
327 | #define mmiowb() | 328 | #define mmiowb() |
328 | 329 | ||
329 | static inline void *ioremap(unsigned long physaddr, unsigned long size) | 330 | static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size) |
330 | { | 331 | { |
331 | return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); | 332 | return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); |
332 | } | 333 | } |
333 | static inline void *ioremap_nocache(unsigned long physaddr, unsigned long size) | 334 | static inline void __iomem *ioremap_nocache(unsigned long physaddr, unsigned long size) |
334 | { | 335 | { |
335 | return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); | 336 | return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); |
336 | } | 337 | } |
337 | static inline void *ioremap_writethrough(unsigned long physaddr, | 338 | static inline void __iomem *ioremap_writethrough(unsigned long physaddr, |
338 | unsigned long size) | 339 | unsigned long size) |
339 | { | 340 | { |
340 | return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); | 341 | return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); |
341 | } | 342 | } |
342 | static inline void *ioremap_fullcache(unsigned long physaddr, | 343 | static inline void __iomem *ioremap_fullcache(unsigned long physaddr, |
343 | unsigned long size) | 344 | unsigned long size) |
344 | { | 345 | { |
345 | return __ioremap(physaddr, size, IOMAP_FULL_CACHING); | 346 | return __ioremap(physaddr, size, IOMAP_FULL_CACHING); |
diff --git a/include/asm-m68k/raw_io.h b/include/asm-m68k/raw_io.h index 041f0a87b25d..5439bcaa57c6 100644 --- a/include/asm-m68k/raw_io.h +++ b/include/asm-m68k/raw_io.h | |||
@@ -19,9 +19,9 @@ | |||
19 | #define IOMAP_NOCACHE_NONSER 2 | 19 | #define IOMAP_NOCACHE_NONSER 2 |
20 | #define IOMAP_WRITETHROUGH 3 | 20 | #define IOMAP_WRITETHROUGH 3 |
21 | 21 | ||
22 | extern void iounmap(void *addr); | 22 | extern void iounmap(void __iomem *addr); |
23 | 23 | ||
24 | extern void *__ioremap(unsigned long physaddr, unsigned long size, | 24 | extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size, |
25 | int cacheflag); | 25 | int cacheflag); |
26 | extern void __iounmap(void *addr, unsigned long size); | 26 | extern void __iounmap(void *addr, unsigned long size); |
27 | 27 | ||
@@ -30,21 +30,21 @@ extern void __iounmap(void *addr, unsigned long size); | |||
30 | * two accesses to memory, which may be undesirable for some devices. | 30 | * two accesses to memory, which may be undesirable for some devices. |
31 | */ | 31 | */ |
32 | #define in_8(addr) \ | 32 | #define in_8(addr) \ |
33 | ({ u8 __v = (*(volatile u8 *) (addr)); __v; }) | 33 | ({ u8 __v = (*(__force volatile u8 *) (addr)); __v; }) |
34 | #define in_be16(addr) \ | 34 | #define in_be16(addr) \ |
35 | ({ u16 __v = (*(volatile u16 *) (addr)); __v; }) | 35 | ({ u16 __v = (*(__force volatile u16 *) (addr)); __v; }) |
36 | #define in_be32(addr) \ | 36 | #define in_be32(addr) \ |
37 | ({ u32 __v = (*(volatile u32 *) (addr)); __v; }) | 37 | ({ u32 __v = (*(__force volatile u32 *) (addr)); __v; }) |
38 | #define in_le16(addr) \ | 38 | #define in_le16(addr) \ |
39 | ({ u16 __v = le16_to_cpu(*(volatile u16 *) (addr)); __v; }) | 39 | ({ u16 __v = le16_to_cpu(*(__force volatile u16 *) (addr)); __v; }) |
40 | #define in_le32(addr) \ | 40 | #define in_le32(addr) \ |
41 | ({ u32 __v = le32_to_cpu(*(volatile u32 *) (addr)); __v; }) | 41 | ({ u32 __v = le32_to_cpu(*(__force volatile u32 *) (addr)); __v; }) |
42 | 42 | ||
43 | #define out_8(addr,b) (void)((*(volatile u8 *) (addr)) = (b)) | 43 | #define out_8(addr,b) (void)((*(__force volatile u8 *) (addr)) = (b)) |
44 | #define out_be16(addr,w) (void)((*(volatile u16 *) (addr)) = (w)) | 44 | #define out_be16(addr,w) (void)((*(__force volatile u16 *) (addr)) = (w)) |
45 | #define out_be32(addr,l) (void)((*(volatile u32 *) (addr)) = (l)) | 45 | #define out_be32(addr,l) (void)((*(__force volatile u32 *) (addr)) = (l)) |
46 | #define out_le16(addr,w) (void)((*(volatile u16 *) (addr)) = cpu_to_le16(w)) | 46 | #define out_le16(addr,w) (void)((*(__force volatile u16 *) (addr)) = cpu_to_le16(w)) |
47 | #define out_le32(addr,l) (void)((*(volatile u32 *) (addr)) = cpu_to_le32(l)) | 47 | #define out_le32(addr,l) (void)((*(__force volatile u32 *) (addr)) = cpu_to_le32(l)) |
48 | 48 | ||
49 | #define raw_inb in_8 | 49 | #define raw_inb in_8 |
50 | #define raw_inw in_be16 | 50 | #define raw_inw in_be16 |
@@ -54,7 +54,7 @@ extern void __iounmap(void *addr, unsigned long size); | |||
54 | #define raw_outw(val,port) out_be16((port),(val)) | 54 | #define raw_outw(val,port) out_be16((port),(val)) |
55 | #define raw_outl(val,port) out_be32((port),(val)) | 55 | #define raw_outl(val,port) out_be32((port),(val)) |
56 | 56 | ||
57 | static inline void raw_insb(volatile u8 *port, u8 *buf, unsigned int len) | 57 | static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) |
58 | { | 58 | { |
59 | unsigned int i; | 59 | unsigned int i; |
60 | 60 | ||
@@ -62,7 +62,7 @@ static inline void raw_insb(volatile u8 *port, u8 *buf, unsigned int len) | |||
62 | *buf++ = in_8(port); | 62 | *buf++ = in_8(port); |
63 | } | 63 | } |
64 | 64 | ||
65 | static inline void raw_outsb(volatile u8 *port, const u8 *buf, | 65 | static inline void raw_outsb(volatile u8 __iomem *port, const u8 *buf, |
66 | unsigned int len) | 66 | unsigned int len) |
67 | { | 67 | { |
68 | unsigned int i; | 68 | unsigned int i; |
@@ -71,7 +71,7 @@ static inline void raw_outsb(volatile u8 *port, const u8 *buf, | |||
71 | out_8(port, *buf++); | 71 | out_8(port, *buf++); |
72 | } | 72 | } |
73 | 73 | ||
74 | static inline void raw_insw(volatile u16 *port, u16 *buf, unsigned int nr) | 74 | static inline void raw_insw(volatile u16 __iomem *port, u16 *buf, unsigned int nr) |
75 | { | 75 | { |
76 | unsigned int tmp; | 76 | unsigned int tmp; |
77 | 77 | ||
@@ -110,7 +110,7 @@ static inline void raw_insw(volatile u16 *port, u16 *buf, unsigned int nr) | |||
110 | } | 110 | } |
111 | } | 111 | } |
112 | 112 | ||
113 | static inline void raw_outsw(volatile u16 *port, const u16 *buf, | 113 | static inline void raw_outsw(volatile u16 __iomem *port, const u16 *buf, |
114 | unsigned int nr) | 114 | unsigned int nr) |
115 | { | 115 | { |
116 | unsigned int tmp; | 116 | unsigned int tmp; |
@@ -150,7 +150,7 @@ static inline void raw_outsw(volatile u16 *port, const u16 *buf, | |||
150 | } | 150 | } |
151 | } | 151 | } |
152 | 152 | ||
153 | static inline void raw_insl(volatile u32 *port, u32 *buf, unsigned int nr) | 153 | static inline void raw_insl(volatile u32 __iomem *port, u32 *buf, unsigned int nr) |
154 | { | 154 | { |
155 | unsigned int tmp; | 155 | unsigned int tmp; |
156 | 156 | ||
@@ -189,7 +189,7 @@ static inline void raw_insl(volatile u32 *port, u32 *buf, unsigned int nr) | |||
189 | } | 189 | } |
190 | } | 190 | } |
191 | 191 | ||
192 | static inline void raw_outsl(volatile u32 *port, const u32 *buf, | 192 | static inline void raw_outsl(volatile u32 __iomem *port, const u32 *buf, |
193 | unsigned int nr) | 193 | unsigned int nr) |
194 | { | 194 | { |
195 | unsigned int tmp; | 195 | unsigned int tmp; |
@@ -230,7 +230,7 @@ static inline void raw_outsl(volatile u32 *port, const u32 *buf, | |||
230 | } | 230 | } |
231 | 231 | ||
232 | 232 | ||
233 | static inline void raw_insw_swapw(volatile u16 *port, u16 *buf, | 233 | static inline void raw_insw_swapw(volatile u16 __iomem *port, u16 *buf, |
234 | unsigned int nr) | 234 | unsigned int nr) |
235 | { | 235 | { |
236 | if ((nr) % 8) | 236 | if ((nr) % 8) |
@@ -283,7 +283,7 @@ static inline void raw_insw_swapw(volatile u16 *port, u16 *buf, | |||
283 | : "d0", "a0", "a1", "d6"); | 283 | : "d0", "a0", "a1", "d6"); |
284 | } | 284 | } |
285 | 285 | ||
286 | static inline void raw_outsw_swapw(volatile u16 *port, const u16 *buf, | 286 | static inline void raw_outsw_swapw(volatile u16 __iomem *port, const u16 *buf, |
287 | unsigned int nr) | 287 | unsigned int nr) |
288 | { | 288 | { |
289 | if ((nr) % 8) | 289 | if ((nr) % 8) |
diff --git a/include/asm-m68k/zorro.h b/include/asm-m68k/zorro.h index cf816588bedb..5ce97c22b582 100644 --- a/include/asm-m68k/zorro.h +++ b/include/asm-m68k/zorro.h | |||
@@ -15,24 +15,24 @@ | |||
15 | #define z_memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) | 15 | #define z_memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) |
16 | #define z_memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) | 16 | #define z_memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) |
17 | 17 | ||
18 | static inline void *z_remap_nocache_ser(unsigned long physaddr, | 18 | static inline void __iomem *z_remap_nocache_ser(unsigned long physaddr, |
19 | unsigned long size) | 19 | unsigned long size) |
20 | { | 20 | { |
21 | return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); | 21 | return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); |
22 | } | 22 | } |
23 | 23 | ||
24 | static inline void *z_remap_nocache_nonser(unsigned long physaddr, | 24 | static inline void __iomem *z_remap_nocache_nonser(unsigned long physaddr, |
25 | unsigned long size) | 25 | unsigned long size) |
26 | { | 26 | { |
27 | return __ioremap(physaddr, size, IOMAP_NOCACHE_NONSER); | 27 | return __ioremap(physaddr, size, IOMAP_NOCACHE_NONSER); |
28 | } | 28 | } |
29 | 29 | ||
30 | static inline void *z_remap_writethrough(unsigned long physaddr, | 30 | static inline void __iomem *z_remap_writethrough(unsigned long physaddr, |
31 | unsigned long size) | 31 | unsigned long size) |
32 | { | 32 | { |
33 | return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); | 33 | return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); |
34 | } | 34 | } |
35 | static inline void *z_remap_fullcache(unsigned long physaddr, | 35 | static inline void __iomem *z_remap_fullcache(unsigned long physaddr, |
36 | unsigned long size) | 36 | unsigned long size) |
37 | { | 37 | { |
38 | return __ioremap(physaddr, size, IOMAP_FULL_CACHING); | 38 | return __ioremap(physaddr, size, IOMAP_FULL_CACHING); |