summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Massey <aaronmassey@google.com>2022-10-07 17:30:58 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-10-10 17:42:53 +0000
commit85090d0d30c8569de4709f52580ce98dbb0217c6 (patch)
treed6e8e9f11d6fc46ab315ad38907bff4dc58f12c5
parentcb8c0d8c265e962b46cfa826f3a3510ddda60f51 (diff)
downloadchrome-ec-85090d0d30c8569de4709f52580ce98dbb0217c6.tar.gz
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 <aaronmassey@google.com> Change-Id: I40ddf978c3cf3dfa16dc0e486eaff26a6d56fbe4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3939623 Commit-Queue: Keith Short <keithshort@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--common/host_event_commands.c8
-rw-r--r--include/config.h5
-rw-r--r--util/config_allowed.txt1
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