summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-04-30 18:09:33 +0000
committerpeter <peter@FreeBSD.org>2003-04-30 18:09:33 +0000
commit0b2f0dc371819e7bddf414569bb64b90cdd8e457 (patch)
tree56f57238a922bf1873ba8893658d7ad5a11224dc /lib
parent9e23a6c68f6f8b5901e8360fb7e59f9e682a1d2a (diff)
downloadFreeBSD-src-0b2f0dc371819e7bddf414569bb64b90cdd8e457.zip
FreeBSD-src-0b2f0dc371819e7bddf414569bb64b90cdd8e457.tar.gz
Update for AMD64 contexts. Note that this still has some x87-style FPU
instructions here, these may need to be updated for SSE. (Repocopied from i386/gen)
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/amd64/gen/_setjmp.S48
-rw-r--r--lib/libc/amd64/gen/setjmp.S78
-rw-r--r--lib/libc/amd64/gen/sigsetjmp.S91
3 files changed, 112 insertions, 105 deletions
diff --git a/lib/libc/amd64/gen/_setjmp.S b/lib/libc/amd64/gen/_setjmp.S
index d2b7b6e..12544a7 100644
--- a/lib/libc/amd64/gen/_setjmp.S
+++ b/lib/libc/amd64/gen/_setjmp.S
@@ -51,33 +51,37 @@ __FBSDID("$FreeBSD$");
*/
ENTRY(_setjmp)
- movl 4(%esp),%eax
- movl 0(%esp),%edx
- movl %edx, 0(%eax) /* rta */
- movl %ebx, 4(%eax)
- movl %esp, 8(%eax)
- movl %ebp,12(%eax)
- movl %esi,16(%eax)
- movl %edi,20(%eax)
- fnstcw 24(%eax)
- xorl %eax,%eax
+ movq %rdi,%rax
+ movq 0(%rsp),%rdx /* retval */
+ movq %rdx, 0(%rax) /* retval */
+ movq %rbx, 8(%rax)
+ movq %rsp,16(%rax)
+ movq %rbp,24(%rax)
+ movq %r12,32(%rax)
+ movq %r13,40(%rax)
+ movq %r14,48(%rax)
+ movq %r15,56(%rax)
+ fnstcw 64(%rax)
+ xorq %rax,%rax
ret
.weak CNAME(_longjmp)
.set CNAME(_longjmp),CNAME(___longjmp)
ENTRY(___longjmp)
- movl 4(%esp),%edx
- movl 8(%esp),%eax
- movl 0(%edx),%ecx
- movl 4(%edx),%ebx
- movl 8(%edx),%esp
- movl 12(%edx),%ebp
- movl 16(%edx),%esi
- movl 20(%edx),%edi
+ movq %rdi,%rdx
+ movq %rsi,%rax /* retval */
+ movq 0(%rdx),%rcx
+ movq 8(%rdx),%rbx
+ movq 16(%rdx),%rsp
+ movq 24(%rdx),%rbp
+ movq 32(%rdx),%r12
+ movq 40(%rdx),%r13
+ movq 48(%rdx),%r14
+ movq 56(%rdx),%r15
fninit
- fldcw 24(%edx)
- testl %eax,%eax
+ fldcw 64(%rdx)
+ testq %rax,%rax
jnz 1f
- incl %eax
-1: movl %ecx,0(%esp)
+ incq %rax
+1: movq %rcx,0(%rsp)
ret
diff --git a/lib/libc/amd64/gen/setjmp.S b/lib/libc/amd64/gen/setjmp.S
index f64c77f..214bbb6 100644
--- a/lib/libc/amd64/gen/setjmp.S
+++ b/lib/libc/amd64/gen/setjmp.S
@@ -53,51 +53,53 @@ __FBSDID("$FreeBSD$");
#include "SYS.h"
ENTRY(setjmp)
- movl 4(%esp),%ecx
- PIC_PROLOGUE
- leal 28(%ecx), %eax
- pushl %eax /* (sigset_t*)oset */
- pushl $0 /* (sigset_t*)set */
- pushl $1 /* SIG_BLOCK */
+ pushq %rdi
+ movq %rdi,%rcx
+ leaq 72(%rcx),%rdi /* (sigset_t*)oset */
+ movq $0,%rsi /* (sigset_t*)set */
+ movq $1,%rdx /* SIG_BLOCK */
call PIC_PLT(CNAME(_sigprocmask))
- addl $12,%esp
- PIC_EPILOGUE
- movl 4(%esp),%ecx
- movl 0(%esp),%edx
- movl %edx, 0(%ecx)
- movl %ebx, 4(%ecx)
- movl %esp, 8(%ecx)
- movl %ebp,12(%ecx)
- movl %esi,16(%ecx)
- movl %edi,20(%ecx)
- fnstcw 24(%ecx)
- xorl %eax,%eax
+ popq %rdi
+ movq %rdi,%rcx
+ movq 0(%rsp),%rdx /* retval */
+ movq %rdx, 0(%rcx) /* retval */
+ movq %rbx, 8(%rcx)
+ movq %rsp,16(%rcx)
+ movq %rbp,24(%rcx)
+ movq %r12,32(%rcx)
+ movq %r13,40(%rcx)
+ movq %r14,48(%rcx)
+ movq %r15,56(%rcx)
+ fnstcw 64(%rcx)
+ xorq %rax,%rax
ret
.weak CNAME(longjmp)
.set CNAME(longjmp),CNAME(__longjmp)
ENTRY(__longjmp)
- movl 4(%esp),%edx
- PIC_PROLOGUE
- pushl $0 /* (sigset_t*)oset */
- leal 28(%edx), %eax
- pushl %eax /* (sigset_t*)set */
- pushl $3 /* SIG_SETMASK */
+ pushq %rdi
+ pushq %rsi
+ movq %rdi,%rdx
+ movq $0,%rdi /* (sigset_t*)oset */
+ leaq 72(%rdx),%rsi /* (sigset_t*)set */
+ movq $3,%rdx /* SIG_SETMASK */
call PIC_PLT(CNAME(_sigprocmask))
- addl $12,%esp
- PIC_EPILOGUE
- movl 4(%esp),%edx
- movl 8(%esp),%eax
- movl 0(%edx),%ecx
- movl 4(%edx),%ebx
- movl 8(%edx),%esp
- movl 12(%edx),%ebp
- movl 16(%edx),%esi
- movl 20(%edx),%edi
+ popq %rsi
+ popq %rdi /* jmpbuf */
+ movq %rdi,%rdx
+ movq %rsi,%rax /* retval */
+ movq 0(%rdx),%rcx
+ movq 8(%rdx),%rbx
+ movq 16(%rdx),%rsp
+ movq 24(%rdx),%rbp
+ movq 32(%rdx),%r12
+ movq 40(%rdx),%r13
+ movq 48(%rdx),%r14
+ movq 56(%rdx),%r15
fninit
- fldcw 24(%edx)
- testl %eax,%eax
+ fldcw 64(%rdx)
+ testq %rax,%rax
jnz 1f
- incl %eax
-1: movl %ecx,0(%esp)
+ incq %rax
+1: movq %rcx,0(%rsp)
ret
diff --git a/lib/libc/amd64/gen/sigsetjmp.S b/lib/libc/amd64/gen/sigsetjmp.S
index 09b512d..7dd32a5 100644
--- a/lib/libc/amd64/gen/sigsetjmp.S
+++ b/lib/libc/amd64/gen/sigsetjmp.S
@@ -58,57 +58,58 @@ __FBSDID("$FreeBSD$");
*/
ENTRY(sigsetjmp)
- movl 8(%esp),%eax
- movl 4(%esp),%ecx
- movl %eax,44(%ecx)
- testl %eax,%eax
+ pushq %rdi
+ movq %rdi,%rcx
+ movl %esi,88(%rcx)
+ testl %esi,%esi
jz 2f
- PIC_PROLOGUE
- leal 28(%ecx), %eax
- pushl %eax /* (sigset_t*)oset */
- pushl $0 /* (sigset_t*)set */
- pushl $1 /* SIG_BLOCK */
+ leaq 72(%rcx),%rdi /* (sigset_t*)oset */
+ movq $0,%rsi /* (sigset_t*)set */
+ movq $1,%rdx /* SIG_BLOCK */
call PIC_PLT(CNAME(_sigprocmask))
- addl $12,%esp
- PIC_EPILOGUE
- movl 4(%esp),%ecx
-2: movl 0(%esp),%edx
- movl %edx, 0(%ecx)
- movl %ebx, 4(%ecx)
- movl %esp, 8(%ecx)
- movl %ebp,12(%ecx)
- movl %esi,16(%ecx)
- movl %edi,20(%ecx)
- fnstcw 24(%ecx)
- xorl %eax,%eax
+ popq %rdi
+ movq %rdi,%rcx
+2: movq 0(%rsp),%rdx /* retval */
+ movq %rdx, 0(%rcx) /* retval */
+ movq %rbx, 8(%rcx)
+ movq %rsp,16(%rcx)
+ movq %rbp,24(%rcx)
+ movq %r12,32(%rcx)
+ movq %r13,40(%rcx)
+ movq %r14,48(%rcx)
+ movq %r15,56(%rcx)
+ fnstcw 64(%rcx)
+ xorq %rax,%rax
ret
- .weak CNAME(siglongjmp);
- .set CNAME(siglongjmp),CNAME(__siglongjmp);
-ENTRY(__siglongjmp);
- movl 4(%esp),%edx
- cmpl $0,44(%edx)
+ .weak CNAME(siglongjmp)
+ .set CNAME(siglongjmp),CNAME(__siglongjmp)
+ENTRY(__siglongjmp)
+ cmpl $0,88(%rdi)
jz 2f
- PIC_PROLOGUE
- pushl $0 /* (sigset_t*)oset */
- leal 28(%edx), %eax
- pushl %eax /* (sigset_t*)set */
- pushl $3 /* SIG_SETMASK */
+ movq %rdi,%rdx
+ pushq %rdi
+ pushq %rsi
+ movq $0,%rdi /* (sigset_t*)oset */
+ leaq 72(%rdx),%rsi /* (sigset_t*)set */
+ movq $3,%rdx /* SIG_SETMASK */
call PIC_PLT(CNAME(_sigprocmask))
- addl $12,%esp
- PIC_EPILOGUE
- movl 4(%esp),%edx
-2: movl 8(%esp),%eax
- movl 0(%edx),%ecx
- movl 4(%edx),%ebx
- movl 8(%edx),%esp
- movl 12(%edx),%ebp
- movl 16(%edx),%esi
- movl 20(%edx),%edi
+ popq %rsi
+ popq %rdi /* jmpbuf */
+2: movq %rdi,%rdx
+ movq %rsi,%rax /* retval */
+ movq 0(%rdx),%rcx
+ movq 8(%rdx),%rbx
+ movq 16(%rdx),%rsp
+ movq 24(%rdx),%rbp
+ movq 32(%rdx),%r12
+ movq 40(%rdx),%r13
+ movq 48(%rdx),%r14
+ movq 56(%rdx),%r15
fninit
- fldcw 24(%edx)
- testl %eax,%eax
+ fldcw 64(%rdx)
+ testq %rax,%rax
jnz 1f
- incl %eax
-1: movl %ecx,0(%esp)
+ incq %rax
+1: movq %rcx,0(%rsp)
ret
OpenPOWER on IntegriCloud