From bd4012d9abbb7b79f537e7adba9627bcd4a50a72 Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Tue, 16 Apr 2019 12:43:58 -0600 Subject: tasks: convert TASK_EVENT_CUSTOM macro to bit We should ensure that all custom task definition are non-zero and fit with the globally defined events. Add compile time check and change semantics to specify bit number (instead of making all callers use the BIT macro). This also fixes an error with TASK_EVENT_PHY_TX_DONE for ITE being 0. The bug that made that happen hasn't landed on any firmware branches that use it though. BRANCH=none BUG=none TEST=builds Cq-Depend:chrome-internal:1178968,chrome-internal:1178952 Change-Id: I5e1d1312382d200280c548e9128e53f4eddd3e61 Signed-off-by: Jett Rink Reviewed-on: https://chromium-review.googlesource.com/1570607 Commit-Ready: ChromeOS CL Exonerator Bot --- extra/lightbar/simulation.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'extra') diff --git a/extra/lightbar/simulation.h b/extra/lightbar/simulation.h index 6028c15dd3..2ed95ccad6 100644 --- a/extra/lightbar/simulation.h +++ b/extra/lightbar/simulation.h @@ -60,11 +60,11 @@ void cprints(int zero, const char *fmt, ...); #define strtoi strtol /* Task events */ -#define TASK_EVENT_CUSTOM(x) (x & 0x0fffffff) -#define TASK_EVENT_I2C_IDLE 0x10000000 -#define TASK_EVENT_WAKE 0x20000000 -#define TASK_EVENT_MUTEX 0x40000000 -#define TASK_EVENT_TIMER 0x80000000 +#define TASK_EVENT_CUSTOM_BIT(x) BUILD_CHECK_INLINE(BIT(x), BIT(x) & 0x0fffffff) +#define TASK_EVENT_I2C_IDLE 0x10000000 +#define TASK_EVENT_WAKE 0x20000000 +#define TASK_EVENT_MUTEX 0x40000000 +#define TASK_EVENT_TIMER 0x80000000 /* Time units in usecs */ #define MSEC 1000 -- cgit v1.2.1