6 ! This code was based on the equivalent code in NetBSD
10 ! The jmp_buf contains the following entries:
18 .type setjmp, @function
20 stx %sp,[%o0+0] ! Callers stack pointer
21 stx %o7,[%o0+8] ! Return pc
22 stx %fp,[%o0+16] ! Frame pointer
30 .type longjmp, @function
32 mov %o1, %g4 ! save return value
33 mov %o0, %g1 ! save target
34 ldx [%g1+16],%g5 ! get callers frame
36 cmp %fp, %g5 ! compare against desired frame
38 restore ! pop frame and loop
40 ldx [%g1+0],%o2 ! fetch return %sp
43 unimp 0 ! ... error ...
46 cmp %o2, %sp ! %sp must not decrease
49 mov %o2, %sp ! it is OK, put it in place
51 ldx [%g1+8],%o3 ! fetch %pc
52 jmp %o3 + 8 ! if sucess...
53 mov %g4,%o0 ! return %g4
55 .size longjmp,.-longjmp