提交 b5fc12df 编写于 作者: M Mike Frysinger

Blackfin: add bfin_write_{or,and} helpers

Signed-off-by: NMike Frysinger <vapier@gentoo.org>
上级 4c131c8c
...@@ -58,14 +58,26 @@ ...@@ -58,14 +58,26 @@
({ BUG(); 0; }); \ ({ BUG(); 0; }); \
}) })
#define bfin_write(addr, val) \ #define bfin_write(addr, val) \
({ \ do { \
switch (sizeof(*(addr))) { \ switch (sizeof(*(addr))) { \
case 1: bfin_write8(addr, val); break; \ case 1: bfin_write8(addr, val); break; \
case 2: bfin_write16(addr, val); break; \ case 2: bfin_write16(addr, val); break; \
case 4: bfin_write32(addr, val); break; \ case 4: bfin_write32(addr, val); break; \
default: BUG(); \ default: BUG(); \
} \ } \
}) } while (0)
#define bfin_write_or(addr, bits) \
do { \
void *__addr = (void *)(addr); \
bfin_write(__addr, bfin_read(__addr) | (bits)); \
} while (0)
#define bfin_write_and(addr, bits) \
do { \
void *__addr = (void *)(addr); \
bfin_write(__addr, bfin_read(__addr) & (bits)); \
} while (0)
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册