From df8677c9925f51d6b80cbf912d34a243909a9d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Niew=C3=B6hner?= Date: Mon, 20 Jun 2022 21:32:56 +0200 Subject: device/mmio: add clr/setbitsXp macros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add clr/setbits*p macros as pendant to read/write*p. Change-Id: I5b10ccab97c3a372051050b28ada854baec91d18 Signed-off-by: Michael Niewöhner Reviewed-on: https://review.coreboot.org/c/coreboot/+/68790 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/include/device/mmio.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 -- cgit v1.2.3