diff options
Diffstat (limited to 'arch/blackfin/include/asm/def_LPBlackfin.h')
-rw-r--r-- | arch/blackfin/include/asm/def_LPBlackfin.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/blackfin/include/asm/def_LPBlackfin.h b/arch/blackfin/include/asm/def_LPBlackfin.h index e3f0f4c49819..7600fe0696af 100644 --- a/arch/blackfin/include/asm/def_LPBlackfin.h +++ b/arch/blackfin/include/asm/def_LPBlackfin.h | |||
@@ -58,14 +58,26 @@ | |||
58 | ({ BUG(); 0; }); \ | 58 | ({ BUG(); 0; }); \ |
59 | }) | 59 | }) |
60 | #define bfin_write(addr, val) \ | 60 | #define bfin_write(addr, val) \ |
61 | ({ \ | 61 | do { \ |
62 | switch (sizeof(*(addr))) { \ | 62 | switch (sizeof(*(addr))) { \ |
63 | case 1: bfin_write8(addr, val); break; \ | 63 | case 1: bfin_write8(addr, val); break; \ |
64 | case 2: bfin_write16(addr, val); break; \ | 64 | case 2: bfin_write16(addr, val); break; \ |
65 | case 4: bfin_write32(addr, val); break; \ | 65 | case 4: bfin_write32(addr, val); break; \ |
66 | default: BUG(); \ | 66 | default: BUG(); \ |
67 | } \ | 67 | } \ |
68 | }) | 68 | } while (0) |
69 | |||
70 | #define bfin_write_or(addr, bits) \ | ||
71 | do { \ | ||
72 | void *__addr = (void *)(addr); \ | ||
73 | bfin_write(__addr, bfin_read(__addr) | (bits)); \ | ||
74 | } while (0) | ||
75 | |||
76 | #define bfin_write_and(addr, bits) \ | ||
77 | do { \ | ||
78 | void *__addr = (void *)(addr); \ | ||
79 | bfin_write(__addr, bfin_read(__addr) & (bits)); \ | ||
80 | } while (0) | ||
69 | 81 | ||
70 | #endif /* __ASSEMBLY__ */ | 82 | #endif /* __ASSEMBLY__ */ |
71 | 83 | ||