29#ifndef SBL_HW_VALIDATION_INTERRUPTS_REQUIREMENTS_HPP_
30#define SBL_HW_VALIDATION_INTERRUPTS_REQUIREMENTS_HPP_
45template<
typename T,
typename =
void>
46struct has_save_ceiling : std::false_type {};
48struct has_save_ceiling<T, std::void_t<decltype(T::save_ceiling())>>
49 : std::is_same<decltype(T::save_ceiling()), uint32_t> {};
51template<
typename T,
typename =
void>
52struct has_raise_ceiling : std::false_type {};
54struct has_raise_ceiling<T, std::void_t<decltype(T::raise_ceiling(std::declval<Level>()))>> : std::true_type {};
56template<
typename T,
typename =
void>
57struct has_restore_ceiling : std::false_type {};
59struct has_restore_ceiling<T, std::void_t<decltype(T::restore_ceiling(std::declval<uint32_t>()))>> : std::true_type {};
61template<
typename T,
typename =
void>
62struct has_disable_all : std::false_type {};
64struct has_disable_all<T, std::void_t<decltype(T::disable_all())>>
65 : std::is_same<decltype(T::disable_all()), uint32_t> {};
67template<
typename T,
typename =
void>
68struct has_restore_all : std::false_type {};
70struct has_restore_all<T, std::void_t<decltype(T::restore_all(std::declval<uint32_t>()))>> : std::true_type {};
77template<
typename InterruptsDriver>
80 static constexpr bool validate() {
81 static_assert(detail::has_save_ceiling<InterruptsDriver>::value,
82 "SBL ERROR: Interrupts driver missing save_ceiling().\n"
83 "Required: static uint32_t save_ceiling()");
85 static_assert(detail::has_raise_ceiling<InterruptsDriver>::value,
86 "SBL ERROR: Interrupts driver missing raise_ceiling().\n"
87 "Required: static void raise_ceiling(sbl::system::interrupts::Level)");
89 static_assert(detail::has_restore_ceiling<InterruptsDriver>::value,
90 "SBL ERROR: Interrupts driver missing restore_ceiling().\n"
91 "Required: static void restore_ceiling(uint32_t)");
93 static_assert(detail::has_disable_all<InterruptsDriver>::value,
94 "SBL ERROR: Interrupts driver missing disable_all().\n"
95 "Required: static uint32_t disable_all()");
97 static_assert(detail::has_restore_all<InterruptsDriver>::value,
98 "SBL ERROR: Interrupts driver missing restore_all().\n"
99 "Required: static void restore_all(uint32_t)");
108template<
typename InterruptsDriver>
Interrupts driver requirements validator.
Interrupt execution levels and the control critical section.
Level
Execution levels, most urgent first.
constexpr bool interrupts_driver_valid
Helper to validate an interrupts driver implementation.
Root namespace for all Sound Byte Libs code.