1 /* 2 * Copyright (c) 2023 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 /** 8 * @brief Run the set of special NSI tasks corresponding to the given level 9 * 10 * @param level One of NSITASK_*_LEVEL as defined in nsi_tasks.h 11 */ nsi_run_tasks(int level)12void nsi_run_tasks(int level) 13 { 14 extern void (*__nsi_PRE_BOOT_1_tasks_start[])(void); 15 extern void (*__nsi_PRE_BOOT_2_tasks_start[])(void); 16 extern void (*__nsi_HW_INIT_tasks_start[])(void); 17 extern void (*__nsi_PRE_BOOT_3_tasks_start[])(void); 18 extern void (*__nsi_FIRST_SLEEP_tasks_start[])(void); 19 extern void (*__nsi_ON_EXIT_PRE_tasks_start[])(void); 20 extern void (*__nsi_ON_EXIT_POST_tasks_start[])(void); 21 extern void (*__nsi_tasks_end[])(void); 22 23 static void (**nsi_pre_tasks[])(void) = { 24 __nsi_PRE_BOOT_1_tasks_start, 25 __nsi_PRE_BOOT_2_tasks_start, 26 __nsi_HW_INIT_tasks_start, 27 __nsi_PRE_BOOT_3_tasks_start, 28 __nsi_FIRST_SLEEP_tasks_start, 29 __nsi_ON_EXIT_PRE_tasks_start, 30 __nsi_ON_EXIT_POST_tasks_start, 31 __nsi_tasks_end 32 }; 33 34 void (**fptr)(void); 35 36 for (fptr = nsi_pre_tasks[level]; fptr < nsi_pre_tasks[level+1]; 37 fptr++) { 38 if (*fptr) { /* LCOV_EXCL_BR_LINE */ 39 (*fptr)(); 40 } 41 } 42 } 43