Commit 4478048b authored by Greg Ungerer's avatar Greg Ungerer

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: default avatarGreg Ungerer <gerg@linux-m68k.org>
Reviewed-by: default avatarAngelo Dureghello <angelo@sysam.it>
Tested-by: default avatarAngelo Dureghello <angelo@sysam.it>
parent d97cf70a
...@@ -7,23 +7,23 @@ ...@@ -7,23 +7,23 @@
* functions have always worked in CPU native endian. We need to define * functions have always worked in CPU native endian. We need to define
* that behavior here first before we include asm-generic/io.h. * that behavior here first before we include asm-generic/io.h.
*/ */
#define readb(addr) \ #define __raw_readb(addr) \
({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; }) ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
#define readw(addr) \ #define __raw_readw(addr) \
({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; }) ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
#define readl(addr) \ #define __raw_readl(addr) \
({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; }) ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
#define writeb(b,addr) (void)((*(volatile unsigned char *) (addr)) = (b)) #define __raw_writeb(b, addr) (void)((*(volatile unsigned char *) (addr)) = (b))
#define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b)) #define __raw_writew(b, addr) (void)((*(volatile unsigned short *) (addr)) = (b))
#define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b)) #define __raw_writel(b, addr) (void)((*(volatile unsigned int *) (addr)) = (b))
#define __raw_readb readb #define readb __raw_readb
#define __raw_readw readw #define readw __raw_readw
#define __raw_readl readl #define readl __raw_readl
#define __raw_writeb writeb #define writeb __raw_writeb
#define __raw_writew writew #define writew __raw_writew
#define __raw_writel writel #define writel __raw_writel
#include <asm/virtconvert.h> #include <asm/virtconvert.h>
#include <asm-generic/io.h> #include <asm-generic/io.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment