event_internal.h 675 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Internal definitions for events
  4. *
  5. * Copyright 2021 Google LLC
  6. * Written by Simon Glass <sjg@chromium.org>
  7. */
  8. #ifndef __event_internal_h
  9. #define __event_internal_h
  10. #include <event.h>
  11. #include <linux/list.h>
  12. /**
  13. * struct event_spy - a spy that watches for an event of a particular type
  14. *
  15. * @id: Spy ID
  16. * @type: Event type to subscribe to
  17. * @func: Function to call when the event is sent
  18. * @ctx: Context to pass to the function
  19. */
  20. struct event_spy {
  21. struct list_head sibling_node;
  22. const char *id;
  23. enum event_t type;
  24. event_handler_t func;
  25. void *ctx;
  26. };
  27. struct event_state {
  28. struct list_head spy_head;
  29. };
  30. #endif