zephyr/soc/native/inf_clock/native_tasks.c

39 lines
1009 B
C
Raw Normal View History

/*
* Copyright (c) 2017 Oticon A/S
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @brief Run the set of special native tasks corresponding to the given level
*
* @param level One of _NATIVE_*_LEVEL as defined in soc.h
*/
void run_native_tasks(int level)
{
extern void (*__native_PRE_BOOT_1_tasks_start[])(void);
extern void (*__native_PRE_BOOT_2_tasks_start[])(void);
extern void (*__native_PRE_BOOT_3_tasks_start[])(void);
extern void (*__native_FIRST_SLEEP_tasks_start[])(void);
extern void (*__native_ON_EXIT_tasks_start[])(void);
extern void (*__native_tasks_end[])(void);
static void (**native_pre_tasks[])(void) = {
__native_PRE_BOOT_1_tasks_start,
__native_PRE_BOOT_2_tasks_start,
__native_PRE_BOOT_3_tasks_start,
__native_FIRST_SLEEP_tasks_start,
__native_ON_EXIT_tasks_start,
__native_tasks_end
};
void (**fptr)(void);
for (fptr = native_pre_tasks[level]; fptr < native_pre_tasks[level+1];
fptr++) {
if (*fptr) { /* LCOV_EXCL_BR_LINE */
(*fptr)();
}
}
}