pub unsafe fn enter_privileged_psp(
psp: *const u32,
entry: extern "C" fn() -> !,
) -> !Expand description
Switch to using the Process Stack, but remain in Privileged Mode
Sets CONTROL.SPSEL (setting the Process Stack to be the active stack) but
leaves CONTROL.nPRIV alone, updates the program stack pointer to the
address in psp, then jumps to the address in entry.
ยงSafety
pspandentrymust point to valid stack memory and executable code, respectively.pspmust be 8 bytes aligned and point to stack top as stack grows towards lower addresses.- The size of the stack provided here must be large enough for your
program - stack overflows are obviously UB. If your processor supports
it, you may wish to set the
PSPLIMregister to guard against this.