1 Index: libs/context/src/asm/jump_x86_64_sysv_elf_gas.S
2 ===================================================================
3 --- libs/context/src/asm/jump_x86_64_sysv_elf_gas.S (revision 86799)
4 +++ libs/context/src/asm/jump_x86_64_sysv_elf_gas.S (working copy)
7 * **************************************************************************************/
10 +# define SIZEOF_FCONTEXT_T 0x50
12 +# define SIZEOF_FCONTEXT_T 0x58
17 .type jump_fcontext,@function
18 @@ -53,11 +59,11 @@ jump_fcontext:
22 - stmxcsr 0x50(%rdi) /* save MMX control and status word */
23 - fnstcw 0x54(%rdi) /* save x87 control word */
24 + stmxcsr (SIZEOF_FCONTEXT_T - 8)(%rdi) /* save MMX control and status word */
25 + fnstcw (SIZEOF_FCONTEXT_T - 4)(%rdi) /* save x87 control word */
27 - ldmxcsr 0x50(%rsi) /* restore MMX control and status word */
28 - fldcw 0x54(%rsi) /* restore x87 control word */
29 + ldmxcsr (SIZEOF_FCONTEXT_T - 8)(%rsi) /* restore MMX control and status word */
30 + fldcw (SIZEOF_FCONTEXT_T - 4)(%rsi) /* restore x87 control word */
33 leaq 0x8(%rsp), %rax /* exclude the return address and save as stack pointer */
34 Index: libs/context/src/asm/make_x86_64_sysv_elf_gas.S
35 ===================================================================
36 --- libs/context/src/asm/make_x86_64_sysv_elf_gas.S (revision 86799)
37 +++ libs/context/src/asm/make_x86_64_sysv_elf_gas.S (working copy)
40 * **************************************************************************************/
43 +# define SIZEOF_FCONTEXT_T 0x50
45 +# define SIZEOF_FCONTEXT_T 0x58
50 .type make_fcontext,@function
53 - leaq -0x58(%rdi), %rax /* reserve space for fcontext_t at top of context stack */
54 +make_fcontext: // (rax, rsi, rdx)
55 + leaq -SIZEOF_FCONTEXT_T(%rdi), %rax /* reserve space for fcontext_t at top of context stack */
57 /* shift address in RAX to lower 16 byte boundary */
58 /* == pointer to fcontext_t and address of context stack */
62 + mov %edi, 0x40(%rax) /* save address of context stack pointer (base) in fcontext_t */
63 + mov %esi, 0x44(%rax) /* save context stack size in fcontext_t */
64 + mov %edx, 0x38(%rax) /* save address of context function in fcontext_t */
66 movq %rdi, 0x40(%rax) /* save address of context stack pointer (base) in fcontext_t */
67 movq %rsi, 0x48(%rax) /* save context stack size in fcontext_t */
68 movq %rdx, 0x38(%rax) /* save address of context function in fcontext_t */
71 - stmxcsr 0x50(%rax) /* save MMX control and status word */
72 - fnstcw 0x54(%rax) /* save x87 control word */
73 + stmxcsr (SIZEOF_FCONTEXT_T - 8)(%rax) /* save MMX control and status word */
74 + fnstcw (SIZEOF_FCONTEXT_T - 4)(%rax) /* save x87 control word */
77 + leaq -0x10(%rax), %rdx /* reserve space for the return address on context stack, (RSP - 0x8) % 16 == 0 */
78 + mov %edx, 0x30(%rax) /* save address in RDX as stack pointer for context function */
80 leaq -0x8(%rax), %rdx /* reserve space for the return address on context stack, (RSP - 0x8) % 16 == 0 */
81 movq %rdx, 0x30(%rax) /* save address in RDX as stack pointer for context function */
84 leaq finish(%rip), %rcx /* compute abs address of label finish */
85 movq %rcx, (%rdx) /* save address of finish as return address for context function */