sdei_flags.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (c) 2020, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef SDEI_FLAGS_H
  7. #define SDEI_FLAGS_H
  8. #include <lib/utils_def.h>
  9. /* Internal: SDEI flag bit positions */
  10. #define SDEI_MAPF_DYNAMIC_SHIFT_ 1U
  11. #define SDEI_MAPF_BOUND_SHIFT_ 2U
  12. #define SDEI_MAPF_SIGNALABLE_SHIFT_ 3U
  13. #define SDEI_MAPF_PRIVATE_SHIFT_ 4U
  14. #define SDEI_MAPF_CRITICAL_SHIFT_ 5U
  15. #define SDEI_MAPF_EXPLICIT_SHIFT_ 6U
  16. /* SDEI event 0 */
  17. #define SDEI_EVENT_0 0
  18. /* Placeholder interrupt for dynamic mapping */
  19. #define SDEI_DYN_IRQ 0U
  20. /* SDEI flags */
  21. /*
  22. * These flags determine whether or not an event can be associated with an
  23. * interrupt. Static events are permanently associated with an interrupt, and
  24. * can't be changed at runtime. Association of dynamic events with interrupts
  25. * can be changed at run time using the SDEI_INTERRUPT_BIND and
  26. * SDEI_INTERRUPT_RELEASE calls.
  27. *
  28. * SDEI_MAPF_DYNAMIC only indicates run time configurability, where as
  29. * SDEI_MAPF_BOUND indicates interrupt association. For example:
  30. *
  31. * - Calling SDEI_INTERRUPT_BIND on a dynamic event will have both
  32. * SDEI_MAPF_DYNAMIC and SDEI_MAPF_BOUND set.
  33. *
  34. * - Statically-bound events will always have SDEI_MAPF_BOUND set, and neither
  35. * SDEI_INTERRUPT_BIND nor SDEI_INTERRUPT_RELEASE can be called on them.
  36. *
  37. * See also the is_map_bound() macro.
  38. */
  39. #define SDEI_MAPF_DYNAMIC BIT(SDEI_MAPF_DYNAMIC_SHIFT_)
  40. #define SDEI_MAPF_BOUND BIT(SDEI_MAPF_BOUND_SHIFT_)
  41. #define SDEI_MAPF_EXPLICIT BIT(SDEI_MAPF_EXPLICIT_SHIFT_)
  42. #define SDEI_MAPF_SIGNALABLE BIT(SDEI_MAPF_SIGNALABLE_SHIFT_)
  43. #define SDEI_MAPF_PRIVATE BIT(SDEI_MAPF_PRIVATE_SHIFT_)
  44. #define SDEI_MAPF_NORMAL 0
  45. #define SDEI_MAPF_CRITICAL BIT(SDEI_MAPF_CRITICAL_SHIFT_)
  46. #endif /* SDEI_FLAGS_H */