Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions include/zephyr/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,15 @@ device_get_dt_nodelabels(const struct device *dev)
(COND_CODE_1(Z_INIT_POST_KERNEL_##level, (), \
(ZERO_OR_COMPILE_ERROR(0)))))))

/**
* @brief Issue an error if the given init priority is not supported.
*
* @param prio Priority level
*/
#define Z_DEVICE_CHECK_INIT_PRIO(prio) \
BUILD_ASSERT(0 <= (prio) && (prio) <= 99, \
Z_STRINGIFY(prio) "invalid priority")

/**
* @brief Define the init entry for a device.
*
Expand All @@ -1262,6 +1271,7 @@ device_get_dt_nodelabels(const struct device *dev)
*/
#define Z_DEVICE_INIT_ENTRY_DEFINE(node_id, dev_id, level, prio) \
Z_DEVICE_CHECK_INIT_LEVEL(level) \
Z_DEVICE_CHECK_INIT_PRIO(prio) \
\
static const Z_DECL_ALIGN(struct init_entry) __used __noasan Z_INIT_ENTRY_SECTION( \
level, prio, Z_DEVICE_INIT_SUB_PRIO(node_id)) \
Expand Down
Loading