diff options
author | Steven Miao <realmz6@gmail.com> | 2015-01-20 03:53:38 -0500 |
---|---|---|
committer | Steven Miao <realmz6@gmail.com> | 2015-04-23 09:34:33 -0400 |
commit | 1a3372bc522ef8ba749c019c52d63168267fac0a (patch) | |
tree | aa2648854312904b531f929bb57356a98a096811 | |
parent | b3df664b85c7926619346cddad3aefab6554e0b1 (diff) |
blackfin: io: define __raw_readx/writex with bfin_readx/writex
Signed-off-by: Steven Miao <realmz6@gmail.com>
-rw-r--r-- | arch/blackfin/include/asm/io.h | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/arch/blackfin/include/asm/io.h b/arch/blackfin/include/asm/io.h index dccae26805b0..b03ac90f1411 100644 --- a/arch/blackfin/include/asm/io.h +++ b/arch/blackfin/include/asm/io.h | |||
@@ -11,27 +11,12 @@ | |||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <asm/byteorder.h> | 12 | #include <asm/byteorder.h> |
13 | 13 | ||
14 | #define DECLARE_BFIN_RAW_READX(size, type, asm, asm_sign) \ | 14 | #define __raw_readb bfin_read8 |
15 | static inline type __raw_read##size(const volatile void __iomem *addr) \ | 15 | #define __raw_readw bfin_read16 |
16 | { \ | 16 | #define __raw_readl bfin_read32 |
17 | unsigned int val; \ | 17 | #define __raw_writeb(val, addr) bfin_write8(addr, val) |
18 | int tmp; \ | 18 | #define __raw_writew(val, addr) bfin_write16(addr, val) |
19 | __asm__ __volatile__ ( \ | 19 | #define __raw_writel(val, addr) bfin_write32(addr, val) |
20 | "cli %1;" \ | ||
21 | "NOP; NOP; SSYNC;" \ | ||
22 | "%0 = "#asm" [%2] "#asm_sign";" \ | ||
23 | "sti %1;" \ | ||
24 | : "=d"(val), "=d"(tmp) \ | ||
25 | : "a"(addr) \ | ||
26 | ); \ | ||
27 | return (type) val; \ | ||
28 | } | ||
29 | DECLARE_BFIN_RAW_READX(b, u8, b, (z)) | ||
30 | #define __raw_readb __raw_readb | ||
31 | DECLARE_BFIN_RAW_READX(w, u16, w, (z)) | ||
32 | #define __raw_readw __raw_readw | ||
33 | DECLARE_BFIN_RAW_READX(l, u32, , ) | ||
34 | #define __raw_readl __raw_readl | ||
35 | 20 | ||
36 | extern void outsb(unsigned long port, const void *addr, unsigned long count); | 21 | extern void outsb(unsigned long port, const void *addr, unsigned long count); |
37 | extern void outsw(unsigned long port, const void *addr, unsigned long count); | 22 | extern void outsw(unsigned long port, const void *addr, unsigned long count); |