aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-01-12 04:06:24 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-12 12:09:02 -0500
commitad9ec4f8de264903c6b5ba7ae8d8e96432188858 (patch)
tree9ae7f2625eaa777abdb6b5cb2d505361d37ae675
parent9a4729118c8851bce709a00eba1b3a8f1fd9ed58 (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>
-rw-r--r--arch/m68k/mm/kmap.c12
-rw-r--r--include/asm-m68k/io.h49
-rw-r--r--include/asm-m68k/raw_io.h40
-rw-r--r--include/asm-m68k/zorro.h8
4 files changed, 55 insertions, 54 deletions
diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c
index fe2383e36b06..85ad19a0ac79 100644
--- a/arch/m68k/mm/kmap.c
+++ b/arch/m68k/mm/kmap.c
@@ -102,7 +102,7 @@ static inline void free_io_area(void *addr)
102 */ 102 */
103/* Rewritten by Andreas Schwab to remove all races. */ 103/* Rewritten by Andreas Schwab to remove all races. */
104 104
105void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag) 105void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag)
106{ 106{
107 struct vm_struct *area; 107 struct vm_struct *area;
108 unsigned long virtaddr, retaddr; 108 unsigned long virtaddr, retaddr;
@@ -121,7 +121,7 @@ void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag)
121 if (MACH_IS_AMIGA) { 121 if (MACH_IS_AMIGA) {
122 if ((physaddr >= 0x40000000) && (physaddr + size < 0x60000000) 122 if ((physaddr >= 0x40000000) && (physaddr + size < 0x60000000)
123 && (cacheflag == IOMAP_NOCACHE_SER)) 123 && (cacheflag == IOMAP_NOCACHE_SER))
124 return (void *)physaddr; 124 return (void __iomem *)physaddr;
125 } 125 }
126#endif 126#endif
127 127
@@ -218,21 +218,21 @@ void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag)
218#endif 218#endif
219 flush_tlb_all(); 219 flush_tlb_all();
220 220
221 return (void *)retaddr; 221 return (void __iomem *)retaddr;
222} 222}
223 223
224/* 224/*
225 * Unmap a ioremap()ed region again 225 * Unmap a ioremap()ed region again
226 */ 226 */
227void iounmap(void *addr) 227void iounmap(void __iomem *addr)
228{ 228{
229#ifdef CONFIG_AMIGA 229#ifdef CONFIG_AMIGA
230 if ((!MACH_IS_AMIGA) || 230 if ((!MACH_IS_AMIGA) ||
231 (((unsigned long)addr < 0x40000000) || 231 (((unsigned long)addr < 0x40000000) ||
232 ((unsigned long)addr > 0x60000000))) 232 ((unsigned long)addr > 0x60000000)))
233 free_io_area(addr); 233 free_io_area((__force void *)addr);
234#else 234#else
235 free_io_area(addr); 235 free_io_area((__force void *)addr);
236#endif 236#endif
237} 237}
238 238
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
123static inline u8 *isa_itb(unsigned long addr) 124static 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}
139static inline u16 *isa_itw(unsigned long addr) 140static 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}
155static inline u8 *isa_mtb(unsigned long addr) 156static 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}
171static inline u16 *isa_mtw(unsigned long addr) 172static 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
329static inline void *ioremap(unsigned long physaddr, unsigned long size) 330static 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}
333static inline void *ioremap_nocache(unsigned long physaddr, unsigned long size) 334static 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}
337static inline void *ioremap_writethrough(unsigned long physaddr, 338static 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}
342static inline void *ioremap_fullcache(unsigned long physaddr, 343static 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
22extern void iounmap(void *addr); 22extern void iounmap(void __iomem *addr);
23 23
24extern void *__ioremap(unsigned long physaddr, unsigned long size, 24extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size,
25 int cacheflag); 25 int cacheflag);
26extern void __iounmap(void *addr, unsigned long size); 26extern 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
57static inline void raw_insb(volatile u8 *port, u8 *buf, unsigned int len) 57static 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
65static inline void raw_outsb(volatile u8 *port, const u8 *buf, 65static 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
74static inline void raw_insw(volatile u16 *port, u16 *buf, unsigned int nr) 74static 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
113static inline void raw_outsw(volatile u16 *port, const u16 *buf, 113static 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
153static inline void raw_insl(volatile u32 *port, u32 *buf, unsigned int nr) 153static 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
192static inline void raw_outsl(volatile u32 *port, const u32 *buf, 192static 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
233static inline void raw_insw_swapw(volatile u16 *port, u16 *buf, 233static 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
286static inline void raw_outsw_swapw(volatile u16 *port, const u16 *buf, 286static 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
18static inline void *z_remap_nocache_ser(unsigned long physaddr, 18static 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
24static inline void *z_remap_nocache_nonser(unsigned long physaddr, 24static 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
30static inline void *z_remap_writethrough(unsigned long physaddr, 30static 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}
35static inline void *z_remap_fullcache(unsigned long physaddr, 35static 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);