--- arch/m68k/mm/kmap.c | 13 ++++--- include/asm-m68k/io.h | 13 ++++--- include/asm-m68k/raw_io.h | 80 +++++++++++++++++++++++++++++++--------------- include/asm-m68k/zorro.h | 16 ++++----- 4 files changed, 77 insertions(+), 45 deletions(-) --- linux-2.6.9-rc3/arch/m68k/mm/kmap.c 2004-08-04 12:13:35.000000000 +0200 +++ linux-m68k-2.6.9-rc3-sparse/arch/m68k/mm/kmap.c 2004-09-29 14:45:38.000000000 +0200 @@ -43,7 +43,7 @@ } -static inline void free_io_area(void *addr) +static inline void free_io_area(void __iomem *addr) { vfree((void *)(PAGE_MASK & (unsigned long)addr)); } @@ -77,7 +77,7 @@ return area; } -static inline void free_io_area(void *addr) +static inline void free_io_area(void __iomem *addr) { struct vm_struct **p, *tmp; @@ -102,7 +102,8 @@ */ /* Rewritten by Andreas Schwab to remove all races. */ -void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag) +void __iomem *__ioremap(unsigned long physaddr, unsigned long size, + int cacheflag) { struct vm_struct *area; unsigned long virtaddr, retaddr; @@ -121,7 +122,7 @@ if (MACH_IS_AMIGA) { if ((physaddr >= 0x40000000) && (physaddr + size < 0x60000000) && (cacheflag == IOMAP_NOCACHE_SER)) - return (void *)physaddr; + return (void __iomem *)physaddr; } #endif @@ -218,13 +219,13 @@ #endif flush_tlb_all(); - return (void *)retaddr; + return (void __iomem *)retaddr; } /* * Unmap a ioremap()ed region again */ -void iounmap(void *addr) +void iounmap(void __iomem *addr) { #ifdef CONFIG_AMIGA if ((!MACH_IS_AMIGA) || --- linux-2.6.9-rc3/include/asm-m68k/io.h 2004-08-14 15:35:40.000000000 +0200 +++ linux-m68k-2.6.9-rc3-sparse/include/asm-m68k/io.h 2004-09-29 14:27:55.000000000 +0200 @@ -322,21 +322,22 @@ #define writeb(val,addr) out_8((addr),(val)) #endif -static inline void *ioremap(unsigned long physaddr, unsigned long size) +static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size) { return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); } -static inline void *ioremap_nocache(unsigned long physaddr, unsigned long size) +static inline void __iomem *ioremap_nocache(unsigned long physaddr, + unsigned long size) { return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); } -static inline void *ioremap_writethrough(unsigned long physaddr, - unsigned long size) +static inline void __iomem *ioremap_writethrough(unsigned long physaddr, + unsigned long size) { return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); } -static inline void *ioremap_fullcache(unsigned long physaddr, - unsigned long size) +static inline void __iomem *ioremap_fullcache(unsigned long physaddr, + unsigned long size) { return __ioremap(physaddr, size, IOMAP_FULL_CACHING); } --- linux-2.6.9-rc3/include/asm-m68k/raw_io.h 2004-05-24 11:13:53.000000000 +0200 +++ linux-m68k-2.6.9-rc3-sparse/include/asm-m68k/raw_io.h 2004-09-29 14:36:08.000000000 +0200 @@ -19,32 +19,62 @@ #define IOMAP_NOCACHE_NONSER 2 #define IOMAP_WRITETHROUGH 3 -extern void iounmap(void *addr); +extern void iounmap(void __iomem *addr); -extern void *__ioremap(unsigned long physaddr, unsigned long size, - int cacheflag); -extern void __iounmap(void *addr, unsigned long size); - - -/* ++roman: The assignments to temp. vars avoid that gcc sometimes generates - * two accesses to memory, which may be undesirable for some devices. - */ -#define in_8(addr) \ - ({ u8 __v = (*(volatile u8 *) (addr)); __v; }) -#define in_be16(addr) \ - ({ u16 __v = (*(volatile u16 *) (addr)); __v; }) -#define in_be32(addr) \ - ({ u32 __v = (*(volatile u32 *) (addr)); __v; }) -#define in_le16(addr) \ - ({ u16 __v = le16_to_cpu(*(volatile u16 *) (addr)); __v; }) -#define in_le32(addr) \ - ({ u32 __v = le32_to_cpu(*(volatile u32 *) (addr)); __v; }) - -#define out_8(addr,b) (void)((*(volatile u8 *) (addr)) = (b)) -#define out_be16(addr,w) (void)((*(volatile u16 *) (addr)) = (w)) -#define out_be32(addr,l) (void)((*(volatile u32 *) (addr)) = (l)) -#define out_le16(addr,w) (void)((*(volatile u16 *) (addr)) = cpu_to_le16(w)) -#define out_le32(addr,l) (void)((*(volatile u32 *) (addr)) = cpu_to_le32(l)) +extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size, + int cacheflag); +extern void __iounmap(void __iomem *addr, unsigned long size); + + +static inline u8 in_8(const volatile void __iomem *addr) +{ + return *(volatile u8 __force *)addr; +} + +static inline u16 in_be16(const volatile void __iomem *addr) +{ + return *(volatile u16 __force *)addr; +} + +static inline u32 in_be32(const volatile void __iomem *addr) +{ + return *(volatile u32 __force *)addr; +} + +static inline u16 in_le16(const volatile void __iomem *addr) +{ + return le16_to_cpu(*(volatile u16 __force *)addr); +} + +static inline u32 in_le32(const volatile void __iomem *addr) +{ + return le32_to_cpu(*(volatile u32 __force *)addr); +} + +static inline void out_8(const volatile void __iomem *addr, u8 b) +{ + *(volatile u8 __force *)addr = b; +} + +static inline void out_be16(const volatile void __iomem *addr, u16 w) +{ + *(volatile u16 __force *)addr = w; +} + +static inline void out_be32(const volatile void __iomem *addr, u32 l) +{ + *(volatile u32 __force *)addr = l; +} + +static inline void out_le16(const volatile void __iomem *addr, u16 w) +{ + *(volatile u16 __force *)addr = cpu_to_le16(w); +} + +static inline void out_le32(const volatile void __iomem *addr, u32 l) +{ + *(volatile u32 __force *)addr = cpu_to_le32(l); +} #define raw_inb in_8 #define raw_inw in_be16 --- linux-2.6.9-rc3/include/asm-m68k/zorro.h 2004-04-28 15:47:30.000000000 +0200 +++ linux-m68k-2.6.9-rc3-sparse/include/asm-m68k/zorro.h 2004-09-29 14:30:09.000000000 +0200 @@ -15,25 +15,25 @@ #define z_memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) #define z_memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) -static inline void *z_remap_nocache_ser(unsigned long physaddr, - unsigned long size) +static inline void __iomem *z_remap_nocache_ser(unsigned long physaddr, + unsigned long size) { return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); } -static inline void *z_remap_nocache_nonser(unsigned long physaddr, - unsigned long size) +static inline void __iomem *z_remap_nocache_nonser(unsigned long physaddr, + unsigned long size) { return __ioremap(physaddr, size, IOMAP_NOCACHE_NONSER); } -static inline void *z_remap_writethrough(unsigned long physaddr, - unsigned long size) +static inline void __iomem *z_remap_writethrough(unsigned long physaddr, + unsigned long size) { return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); } -static inline void *z_remap_fullcache(unsigned long physaddr, - unsigned long size) +static inline void __iomem *z_remap_fullcache(unsigned long physaddr, + unsigned long size) { return __ioremap(physaddr, size, IOMAP_FULL_CACHING); }