lib/checkpoint/checkpoint.c
__attribute__((noinline))
void pyrestore(void) {
    /* If we want to return to the stack (so we don't restore a register checkpoint) */
    static volatile uint32_t *pyrestore_return_stack;

    pyrestore_return_stack = _get_sp();
    _set_sp(&_esafestack); // Set SP to the safe stack

    //// WORKING ON THE SAFE STACK
    pyrestore_process();

    // Restore the old SP
    _set_sp((uint32_t *)pyrestore_return_stack);
}
/*
 * Because we restore the stack we can't operate on the normal stack
 * So we need to switch the stack to a dedicated one (_esafestack) and restore
 * the stack afterwards
 *
 * NB. This function can NOT use the stack or funny things will happen
 */
Because we restore the stack we can't operate on the normal stack
So we need to switch the stack to a dedicated one (_esafestack) and restore
the stack afterwards

NB. This function can NOT use the stack or funny things will happen
Because we restore the stack we can ' t operate on the normal stack So we need to switch the stack to a dedicated one ( _esafestack ) and restore the stack afterwards NB . This function can NOT use the stack or funny things will happen
__attribute__((noinline))
void pyrestore(void) {
    static volatile uint32_t *pyrestore_return_stack;
    pyrestore_return_stack = _get_sp();
    _set_sp(&_esafestack); 
    pyrestore_process();
    _set_sp((uint32_t *)pyrestore_return_stack);
}
__attribute__ ( ( noinline ) ) void pyrestore ( void ) { static volatile uint32_t * pyrestore_return_stack ; pyrestore_return_stack = _get_sp ( ) ; _set_sp ( & _esafestack ) ; pyrestore_process ( ) ; _set_sp ( ( uint32_t * ) pyrestore_return_stack ) ; }
Because we restore the stack we can't operate on the normal stack
 So we need to switch the stack to a dedicated one (_esafestack) and restore
 the stack afterwards
Because we restore the stack we can ' t operate on the normal stack So we need to switch the stack to a dedicated one ( _esafestack ) and restore the stack afterwards
/* If we want to return to the stack (so we don't restore a register checkpoint) */ // Set SP to the safe stack //// WORKING ON THE SAFE STACK // Restore the old SP