From 85090d0d30c8569de4709f52580ce98dbb0217c6 Mon Sep 17 00:00:00 2001 From: Aaron Massey Date: Fri, 7 Oct 2022 17:30:58 -0600 Subject: config: Define HOST_EVENT_REPORT_MASK by CONFIG There were two separate masks for clearing the host events. CONFIG_HOST_EVENT_REPORT_MASK for 32 bit host events and CONFIG_HOST_EVENT64_REPORT_MASK for 64 bit host events. Per-build, only one of these would ever be used. At macro-expansion time, set CONFIG_HOST_EVENT_REPORT_MASK to the appropriate mask based on the definition of CONFIG_HOST_EVENT64. BRANCH=none BUG=none TEST=zmake build -a TEST=make runhosttests Signed-off-by: Aaron Massey Change-Id: I40ddf978c3cf3dfa16dc0e486eaff26a6d56fbe4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3939623 Commit-Queue: Keith Short Code-Coverage: Zoss Commit-Queue: Daisuke Nojiri Reviewed-by: Daisuke Nojiri Reviewed-by: Keith Short --- common/host_event_commands.c | 8 -------- include/config.h | 5 ++++- util/config_allowed.txt | 1 - 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/common/host_event_commands.c b/common/host_event_commands.c index 58bca7073e..f0c4b0b929 100644 --- a/common/host_event_commands.c +++ b/common/host_event_commands.c @@ -307,11 +307,7 @@ host_event_t host_get_events(void) void host_set_events(host_event_t mask) { /* ignore host events the rest of board doesn't care about */ -#ifdef CONFIG_HOST_EVENT64 - mask &= CONFIG_HOST_EVENT64_REPORT_MASK; -#else mask &= CONFIG_HOST_EVENT_REPORT_MASK; -#endif #ifdef CONFIG_HOSTCMD_X86 /* @@ -370,11 +366,7 @@ int host_is_event_set(enum host_event_code event) void host_clear_events(host_event_t mask) { /* ignore host events the rest of board doesn't care about */ -#ifdef CONFIG_HOST_EVENT64 - mask &= CONFIG_HOST_EVENT64_REPORT_MASK; -#else mask &= CONFIG_HOST_EVENT_REPORT_MASK; -#endif /* return early if nothing changed */ if (!(events & mask)) diff --git a/include/config.h b/include/config.h index e5397f9703..eba3134131 100644 --- a/include/config.h +++ b/include/config.h @@ -2415,8 +2415,11 @@ #undef CONFIG_HOST_COMMAND_STATUS /* clear bit(s) to mask reporting of an EC_HOST_EVENT_XXX event(s) */ +#ifdef CONFIG_HOST_EVENT64 +#define CONFIG_HOST_EVENT_REPORT_MASK 0xffffffffffffffffULL +#else #define CONFIG_HOST_EVENT_REPORT_MASK 0xffffffff -#define CONFIG_HOST_EVENT64_REPORT_MASK 0xffffffffffffffffULL +#endif /* Config option to support 64-bit hostevents and wake-masks. */ #define CONFIG_HOST_EVENT64 diff --git a/util/config_allowed.txt b/util/config_allowed.txt index 78198e312a..49047152d3 100644 --- a/util/config_allowed.txt +++ b/util/config_allowed.txt @@ -492,7 +492,6 @@ CONFIG_HOSTCMD_SKUID CONFIG_HOSTCMD_X86 CONFIG_HOST_ESPI_VW_POWER_SIGNAL CONFIG_HOST_EVENT64 -CONFIG_HOST_EVENT64_REPORT_MASK CONFIG_HOST_EVENT_REPORT_MASK CONFIG_HOST_INTERFACE_ESPI_EC_CHAN_BITMAP CONFIG_HOST_INTERFACE_ESPI_EC_MAX_FREQ -- cgit v1.2.1