提交 1a3372bc 编写于 作者: S Steven Miao

blackfin: io: define __raw_readx/writex with bfin_readx/writex

Signed-off-by: NSteven Miao <realmz6@gmail.com>
上级 b3df664b
...@@ -11,27 +11,12 @@ ...@@ -11,27 +11,12 @@
#include <linux/types.h> #include <linux/types.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#define DECLARE_BFIN_RAW_READX(size, type, asm, asm_sign) \ #define __raw_readb bfin_read8
static inline type __raw_read##size(const volatile void __iomem *addr) \ #define __raw_readw bfin_read16
{ \ #define __raw_readl bfin_read32
unsigned int val; \ #define __raw_writeb(val, addr) bfin_write8(addr, val)
int tmp; \ #define __raw_writew(val, addr) bfin_write16(addr, val)
__asm__ __volatile__ ( \ #define __raw_writel(val, addr) bfin_write32(addr, val)
"cli %1;" \
"NOP; NOP; SSYNC;" \
"%0 = "#asm" [%2] "#asm_sign";" \
"sti %1;" \
: "=d"(val), "=d"(tmp) \
: "a"(addr) \
); \
return (type) val; \
}
DECLARE_BFIN_RAW_READX(b, u8, b, (z))
#define __raw_readb __raw_readb
DECLARE_BFIN_RAW_READX(w, u16, w, (z))
#define __raw_readw __raw_readw
DECLARE_BFIN_RAW_READX(l, u32, , )
#define __raw_readl __raw_readl
extern void outsb(unsigned long port, const void *addr, unsigned long count); extern void outsb(unsigned long port, const void *addr, unsigned long count);
extern void outsw(unsigned long port, const void *addr, unsigned long count); extern void outsw(unsigned long port, const void *addr, unsigned long count);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册