You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1009 B
38 lines
1009 B
/* |
|
* 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)(); |
|
} |
|
} |
|
}
|
|
|