diff options
Diffstat (limited to 'include/mkbp_event.h')
-rw-r--r-- | include/mkbp_event.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/include/mkbp_event.h b/include/mkbp_event.h index d9237dd33b..d31bd82cb2 100644 --- a/include/mkbp_event.h +++ b/include/mkbp_event.h @@ -1,4 +1,4 @@ -/* Copyright 2014 The Chromium OS Authors. All rights reserved. +/* Copyright 2014 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * @@ -51,11 +51,22 @@ struct mkbp_event_source { #ifdef CONFIG_PLATFORM_EC_MKBP_EVENT #include "zephyr_mkbp_event.h" #else -#define DECLARE_EVENT_SOURCE(type, func) \ - const struct mkbp_event_source __keep \ - __no_sanitize_address _evt_src_##type \ - __attribute__((section(".rodata.evtsrcs"))) \ - = {type, func} +#define DECLARE_EVENT_SOURCE(type, func) \ + const struct mkbp_event_source __keep __no_sanitize_address \ + _evt_src_##type \ + __attribute__((section(".rodata.evtsrcs"))) = { type, func } #endif -#endif /* __CROS_EC_MKBP_EVENT_H */ +#ifdef TEST_BUILD +/* Allow directly raising events in unit tests */ +void activate_mkbp_with_events(uint32_t events_to_add); + +/** + * @brief Force the event bits to zero, causing the event handling code to + * believe there are no pending events to service. This has no effect on + * any event sources' internal queues or logic. + */ +__test_only void mkbp_event_clear_all(void); +#endif /* TEST_BUILD */ + +#endif /* __CROS_EC_MKBP_EVENT_H */ |