Skip to content

Commit 5d48984

Browse files
Patatermeriac
authored andcommitted
Initialize uvisor-lib
uvisor-lib has an init function that must be called before the RTOS kernel is initialized. Call uvisor_lib_init from software_init_hook to accomplish this.
1 parent 43e595a commit 5d48984

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

hal/common/retarget.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,26 @@ extern "C" WEAK void __cxa_pure_virtual(void) {
413413
#endif
414414

415415
#if defined(TOOLCHAIN_GCC)
416+
#ifdef FEATURE_UVISOR
417+
#include "uvisor-lib/uvisor-lib.h"
418+
#endif/* FEATURE_UVISOR */
419+
416420
extern "C" WEAK void software_init_hook_rtos(void)
417421
{
418422
// Do nothing by default.
419423
}
420424

421425
extern "C" void software_init_hook(void)
422426
{
427+
#ifdef FEATURE_UVISOR
428+
int return_code;
429+
430+
return_code = uvisor_lib_init();
431+
if (return_code) {
432+
mbed_die();
433+
}
434+
#endif/* FEATURE_UVISOR */
435+
423436
software_init_hook_rtos();
424437
}
425438
#endif

0 commit comments

Comments
 (0)