pub unsafe fn enter_unprivileged_psp(
psp: *const u32,
entry: extern "C" fn() -> !,
) -> !Expand description
Switch to unprivileged mode using the Process Stack
Sets CONTROL.SPSEL (setting the Process Stack to be the active
stack) and CONTROL.nPRIV (setting unprivileged mode), 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.