summaryrefslogtreecommitdiff
path: root/include/event_internal.h
blob: 8432c6f0e5ff54c2fca4e21e0a4240c5100d00a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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