Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

m68k: rework raw access macros for the non-MMU case

The primary and fundamental access macros are really the __raw versions.
So make them the actual implementation for access, and not the read/write
access macros. The read/write macros and functions are built on top of
the raw access (with byte swapping or other actions as required).

This in itself causes no functional change right now. But it will make it
easier to fix and resolve problems with PCI bus access in the future.

Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
Reviewed-by: Angelo Dureghello <angelo@sysam.it>
Tested-by: Angelo Dureghello <angelo@sysam.it>

+12 -12
+12 -12
arch/m68k/include/asm/io_no.h
··· 7 7 * functions have always worked in CPU native endian. We need to define 8 8 * that behavior here first before we include asm-generic/io.h. 9 9 */ 10 - #define readb(addr) \ 10 + #define __raw_readb(addr) \ 11 11 ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; }) 12 - #define readw(addr) \ 12 + #define __raw_readw(addr) \ 13 13 ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; }) 14 - #define readl(addr) \ 14 + #define __raw_readl(addr) \ 15 15 ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; }) 16 16 17 - #define writeb(b,addr) (void)((*(volatile unsigned char *) (addr)) = (b)) 18 - #define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b)) 19 - #define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b)) 17 + #define __raw_writeb(b, addr) (void)((*(volatile unsigned char *) (addr)) = (b)) 18 + #define __raw_writew(b, addr) (void)((*(volatile unsigned short *) (addr)) = (b)) 19 + #define __raw_writel(b, addr) (void)((*(volatile unsigned int *) (addr)) = (b)) 20 20 21 - #define __raw_readb readb 22 - #define __raw_readw readw 23 - #define __raw_readl readl 24 - #define __raw_writeb writeb 25 - #define __raw_writew writew 26 - #define __raw_writel writel 21 + #define readb __raw_readb 22 + #define readw __raw_readw 23 + #define readl __raw_readl 24 + #define writeb __raw_writeb 25 + #define writew __raw_writew 26 + #define writel __raw_writel 27 27 28 28 #include <asm/virtconvert.h> 29 29 #include <asm-generic/io.h>