mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 01:04:19 +08:00
Blackfin: add bfin_write_{or,and} helpers
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
4c131c8c23
commit
b5fc12df90
@ -58,14 +58,26 @@
|
||||
({ BUG(); 0; }); \
|
||||
})
|
||||
#define bfin_write(addr, val) \
|
||||
({ \
|
||||
do { \
|
||||
switch (sizeof(*(addr))) { \
|
||||
case 1: bfin_write8(addr, val); break; \
|
||||
case 2: bfin_write16(addr, val); break; \
|
||||
case 4: bfin_write32(addr, val); break; \
|
||||
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__ */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user