diff options
| author | Tim J. Robbins <tjr@FreeBSD.org> | 2004-06-07 21:25:16 +0000 |
|---|---|---|
| committer | Tim J. Robbins <tjr@FreeBSD.org> | 2004-06-07 21:25:16 +0000 |
| commit | bf1d6a62b014c84561bc09086f9863329bee9d9e (patch) | |
| tree | 2dcef51980e9fd6c8f42da383ad65057a8d4a345 /lib/libpthread | |
| parent | 4559c1817be8c97bec75ec4b80b046c1ce865619 (diff) | |
Notes
Diffstat (limited to 'lib/libpthread')
| -rw-r--r-- | lib/libpthread/arch/amd64/amd64/context.S | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libpthread/arch/amd64/amd64/context.S b/lib/libpthread/arch/amd64/amd64/context.S index 58c622b54593..25100213447e 100644 --- a/lib/libpthread/arch/amd64/amd64/context.S +++ b/lib/libpthread/arch/amd64/amd64/context.S @@ -109,6 +109,8 @@ __FBSDID("$FreeBSD$"); #define MC_RFLAGS (22 * 8) #define MC_RSP (23 * 8) +#define REDZONE 128 /* size of the red zone */ + /* * _amd64_ctx_save(mcontext_t *mcp) * @@ -188,6 +190,7 @@ ENTRY(_amd64_restore_context) 4: fninit fldcw MC_FP_CW_OFFSET(%rdi) 5: movq MC_RSP(%rdi), %rsp /* switch to context stack */ + subq $REDZONE, %rsp movq MC_RIP(%rdi), %rax /* return address on stack */ pushq %rax movq MC_RDI(%rdi), %rax /* rdi on stack */ @@ -207,4 +210,6 @@ ENTRY(_amd64_restore_context) popq %rsi /* restore rsi, rdx, and rdi */ popq %rdx popq %rdi + leaq (8 + REDZONE)(%rsp), %rsp + jmp *-(8 + REDZONE)(%rsp) /* jump to return address */ 7: ret |
