1
2
3
4
5
6
7
8#define _REGPARM
9
10
11
12
13
14
15
16
17
18
19
20 .text
21 .align 4
22 .globl setjmp
23 .type setjmp, @function
24setjmp:
25#ifdef _REGPARM
26 movl %eax, %edx
27#else
28 movl 4(%esp), %edx
29#endif
30 popl %ecx
31 xorl %eax, %eax
32 movl %ebx, (%edx)
33 movl %esp, 4(%edx)
34 pushl %ecx
35 movl %ebp, 8(%edx)
36 movl %esi, 12(%edx)
37 movl %edi, 16(%edx)
38 movl %ecx, 20(%edx)
39 ret
40
41
42 .size setjmp, .-setjmp
43
44 .align 4
45 .globl longjmp
46 .type longjmp, @function
47longjmp:
48#ifdef _REGPARM
49 xchgl %eax, %edx
50#else
51 movl 4(%esp), %edx
52#endif
53 movl (%edx), %ebx
54 movl 4(%edx), %esp
55 movl 8(%edx), %ebp
56 movl 12(%edx), %esi
57 movl 16(%edx), %edi
58 jmp *20(%edx)
59
60 .size longjmp, .-longjmp
61