📄 setjmp.s
字号:
!! setjmp.S!! Basic setjmp/longjmp!! This code was based on the equivalent code in NetBSD!#include <machine/asm.h>#include <machine/trap.h>!! The jmp_buf contains the following entries:! sp! fp! pc!ENTRY(setjmp) st %sp,[%o0+0] ! Callers stack pointer st %o7,[%o0+4] ! Return pc st %fp,[%o0+8] ! Frame pointer retl ! Return clr %o0 ! ...0ENTRY(longjmp) sub %sp, 64, %sp ! set up a local stack frame0: t ST_FLUSHWIN ! flush register windows out to memory ! ! We restore the saved stack pointer to %fp, then issue ! a restore instruction which will reload the register ! window from the stack. ! ld [%o0+4], %o7 /* restore return pc */ ld [%o0+0], %fp /* and stack pointer */ retl ! success, return %g6 restore %o1, 0, %o0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -