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.
Wrap software_init_hook so that it can be used or extended from outside the
RTOS. This is desirable so that code can be added to the software_init_hook
without making the RTOS depend on new features or libraries.
Cortex-A does not contain primask, there's 7th bit in the CPSR register,
that contains this information. Fixes#1851.
Renames primask variables to interrupts_disabled.
Add the locks and flags necessary to make the IAR standard library
thread safe. These changes consist of:
-Add compiler flag "--guard_calls" to ensure C++ function-static
variables with dynamic initializers are initialized in a
thread safe manner
-Add the linker flag "--threaded_lib" so the thread safe version of
the standard library is used
-Implement mutex functions required for IAR thread safety
-Create a set of stub functions in retarget.c for when the rtos is not present
Routines using __disable_irq and __enable_irq had the effect of
enabling interrupts if called with interrupts disabled.
Some versions of __disable_irq do not return old status to restore it.
Change to use the critical section helper functions instead.
This includes a generic critical section implementation. This
implementation also allow a user to start a critical section while
interrupts are already disabled.