diff options
Diffstat (limited to 'include/event_internal.h')
-rw-r--r-- | include/event_internal.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/event_internal.h b/include/event_internal.h new file mode 100644 index 0000000000..8432c6f0e5 --- /dev/null +++ b/include/event_internal.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Internal definitions for events + * + * Copyright 2021 Google LLC + * Written by Simon Glass <sjg@chromium.org> + */ + +#ifndef __event_internal_h +#define __event_internal_h + +#include <event.h> +#include <linux/list.h> + +/** + * struct event_spy - a spy that watches for an event of a particular type + * + * @id: Spy ID + * @type: Event type to subscribe to + * @func: Function to call when the event is sent + * @ctx: Context to pass to the function + */ +struct event_spy { + struct list_head sibling_node; + const char *id; + enum event_t type; + event_handler_t func; + void *ctx; +}; + +struct event_state { + struct list_head spy_head; +}; + +#endif |