#ifndef _SYS_STACK_H #define _SYS_STACK_H #include <_PDCLIB_aux.h> _PDCLIB_EXTERN_C // unwind and free frames on stack 'stack' from 'from' to 'to' so that 'to' // the frame which originally returned to 'from' now returns to 'to' // * 'stack' can be nullptr if unwinding on local stack // * 'from' can be nullptr if everything from the caller of __dios_unwind should be unwound // * 'to' can be nullptr if all frames from 'from' below should be destroyed // // i.e. __dios_unwind( nullptr, nullptr, nullptr ) destroys complete stack // except for the caller of __dios_unwind, which will have 'parent' set to // nullptr void __dios_unwind( struct _VM_Frame *stack, struct _VM_Frame *from, struct _VM_Frame *to ) _PDCLIB_nothrow __attribute__((__noinline__)); // transfer control to given frame and program counter, if restoreMaskTo is -1 // it does not change mask void __dios_jump( struct _VM_Frame *to, void (*pc)( void ), int restoreMaskTo ) _PDCLIB_nothrow __attribute__((__noinline__)); _PDCLIB_EXTERN_END #endif