X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fasm-m68k%2Fio.h;h=50ea08751f1453ebd256ed1783393b45fc697e2f;hb=3405f38a15eec5092ac47efe0829f10a24491c6e;hp=91d759219de94d72afe3b417b4ef8399cf24c2ec;hpb=74ac5facb988fc488a707db228b177ead63a6541;p=platform%2Fkernel%2Fu-boot.git diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h index 91d7592..50ea087 100644 --- a/include/asm-m68k/io.h +++ b/include/asm-m68k/io.h @@ -28,19 +28,13 @@ #include -/* ++roman: The assignments to temp. vars avoid that gcc sometimes generates - * two accesses to memory, which may be undesirable for some devices. - */ -#define __raw_readb(addr) \ - ({ u8 __v = (*(volatile u8 *) (addr)); __v; }) -#define __raw_readw(addr) \ - ({ u16 __v = (*(volatile u16 *) (addr)); __v; }) -#define __raw_readl(addr) \ - ({ u32 __v = (*(volatile u32 *) (addr)); __v; }) +#define __raw_readb(addr) (*(volatile u8 *)(addr)) +#define __raw_readw(addr) (*(volatile u16 *)(addr)) +#define __raw_readl(addr) (*(volatile u32 *)(addr)) -#define __raw_writeb(addr,b) (void)((*(volatile u8 *) (addr)) = (b)) -#define __raw_writew(addr,w) (void)((*(volatile u16 *) (addr)) = (w)) -#define __raw_writel(addr,l) (void)((*(volatile u32 *) (addr)) = (l)) +#define __raw_writeb(b,addr) ((*(volatile u8 *) (addr)) = (b)) +#define __raw_writew(w,addr) ((*(volatile u16 *) (addr)) = (w)) +#define __raw_writel(l,addr) ((*(volatile u32 *) (addr)) = (l)) #define readb(addr) in_8((volatile u8 *)(addr)) #define writeb(b,addr) out_8((volatile u8 *)(addr), (b)) @@ -238,15 +232,13 @@ static inline void sync(void) * that can be used to access the memory range with the caching * properties specified by "flags". */ -typedef unsigned long phys_addr_t; - #define MAP_NOCACHE (0) #define MAP_WRCOMBINE (0) #define MAP_WRBACK (0) #define MAP_WRTHROUGH (0) -static inline void * -map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags) +static inline void *map_physmem(phys_addr_t paddr, unsigned long len, + unsigned long flags) { return (void *)paddr; } @@ -259,4 +251,9 @@ static inline void unmap_physmem(void *vaddr, unsigned long flags) } +static inline phys_addr_t virt_to_phys(void * vaddr) +{ + return (phys_addr_t)(vaddr); +} + #endif /* __ASM_M68K_IO_H__ */