diff options
author | Michael Niewöhner <foss@mniewoehner.de> | 2022-06-20 21:32:56 +0200 |
---|---|---|
committer | Michael Niewöhner <foss@mniewoehner.de> | 2022-11-02 18:44:05 +0000 |
commit | df8677c9925f51d6b80cbf912d34a243909a9d5b (patch) | |
tree | 3a80ab84fec22fb7c996ab1b1a3d1ef686bb2022 | |
parent | 9c2d8135fe7bcff50462f8aa216b34ff2793aa59 (diff) |
device/mmio: add clr/setbitsXp macros
Add clr/setbits*p macros as pendant to read/write*p.
Change-Id: I5b10ccab97c3a372051050b28ada854baec91d18
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68790
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | src/include/device/mmio.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/include/device/mmio.h b/src/include/device/mmio.h index 7c8e2bd2fa..b5b79ee5e6 100644 --- a/src/include/device/mmio.h +++ b/src/include/device/mmio.h @@ -26,6 +26,21 @@ #define clrbits32(addr, clear) clrsetbits32(addr, clear, 0) #define clrbits64(addr, clear) clrsetbits64(addr, clear, 0) +#define clrsetbits8p(addr, clear, set) clrsetbits8((void *)((uintptr_t)addr), clear, set) +#define clrsetbits16p(addr, clear, set) clrsetbits16((void *)((uintptr_t)addr), clear, set) +#define clrsetbits32p(addr, clear, set) clrsetbits32((void *)((uintptr_t)addr), clear, set) +#define clrsetbits64p(addr, clear, set) clrsetbits64((void *)((uintptr_t)addr), clear, set) + +#define setbits8p(addr, set) clrsetbits8((void *)((uintptr_t)addr), 0, set) +#define setbits16p(addr, set) clrsetbits16((void *)((uintptr_t)addr), 0, set) +#define setbits32p(addr, set) clrsetbits32((void *)((uintptr_t)addr), 0, set) +#define setbits64p(addr, set) clrsetbits64((void *)((uintptr_t)addr), 0, set) + +#define clrbits8p(addr, clear) clrsetbits8((void *)((uintptr_t)addr), clear, 0) +#define clrbits16p(addr, clear) clrsetbits16((void *)((uintptr_t)addr), clear, 0) +#define clrbits32p(addr, clear) clrsetbits32((void *)((uintptr_t)addr), clear, 0) +#define clrbits64p(addr, clear) clrsetbits64((void *)((uintptr_t)addr), clear, 0) + /* * Reads a transfer buffer from 32-bit FIFO registers. fifo_stride is the * distance in bytes between registers (e.g. pass 4 for a normal array of 32-bit |