From: OpenOCD-Gerrit <ope...@us...> - 2022-03-26 13:36:40
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 6c9dd1c6ba9fba806ed7ed6f6ecb59723beb9cad (commit) from 3fa695be2401c88dbd93b2c9dad1c098a948c4ca (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6c9dd1c6ba9fba806ed7ed6f6ecb59723beb9cad Author: Antonio Borneo <bor...@gm...> Date: Thu Feb 24 11:30:56 2022 +0100 helper/bits: add BIT_ULL and GENMASK macros To support 64 bits bit and masks Replace local definition of BIT in rtos/chromium-ec Change-Id: I1f268d6e8790f1b07bf798680b797878ce81064b Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6857 Tested-by: jenkins diff --git a/src/helper/bits.h b/src/helper/bits.h index 00d3c0270..6151b3340 100644 --- a/src/helper/bits.h +++ b/src/helper/bits.h @@ -28,8 +28,12 @@ #include <helper/types.h> #define BIT(nr) (1UL << (nr)) +#define BIT_ULL(nr) (1ULL << (nr)) #define BITS_PER_BYTE 8 #define BITS_PER_LONG (BITS_PER_BYTE * sizeof(long)) +#define BITS_PER_LONG_LONG (BITS_PER_BYTE * sizeof(long long)) +#define GENMASK(h, l) (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) +#define GENMASK_ULL(h, l) (((~0ULL) - (1ULL << (l)) + 1) & (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h)))) #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) diff --git a/src/rtos/chromium-ec.c b/src/rtos/chromium-ec.c index 2f1a0cf3c..95a228d0d 100644 --- a/src/rtos/chromium-ec.c +++ b/src/rtos/chromium-ec.c @@ -11,6 +11,7 @@ #include "config.h" #endif +#include <helper/bits.h> #include <rtos/rtos.h> #include <target/target.h> #include <target/target_type.h> @@ -20,7 +21,6 @@ #define CROS_EC_MAX_TASKS 32 #define CROS_EC_MAX_NAME 200 #define CROS_EC_IDLE_STRING "<< idle >>" -#define BIT(x) (1 << (x)) struct chromium_ec_params { const char *target_name; ----------------------------------------------------------------------- Summary of changes: src/helper/bits.h | 4 ++++ src/rtos/chromium-ec.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |