Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2007-08-29 01:56:50 +0400
committerJeff Johnston <jjohnstn@redhat.com>2007-08-29 01:56:50 +0400
commitd4a278865234a6bd207dc12a0305e30f3b759284 (patch)
tree24ab1d88d13f69724625bfc1256933739368da33 /newlib/libc/machine/x86_64/setjmp.S
parent01cd95204efdc980ec2a0ad6bc58b37e2ac32f76 (diff)
2007-08-28 Hans Kester <hans.kester@ellips.nl>
* configure.host: Added support for x86_64. * libc/include/machine/ieeefp.h: Define __IEEE_LITTLE_ENDIAN for x86_64. * libc/include/machine/setjmp.h: Define _JBTYPE and _JBLEN for x86_64. * libc/machine/x86_64/aclocal.m4: Generated. * libc/machine/x86_64/configure.in: New. * libc/machine/x86_64/configure: Generated. * libc/machine/x86_64/Makefile.am: New. * libc/machine/x86_64/Makefile.in: Generated. * libc/machine/x86_64/setjmp.S: New. * libc/machine/x86_64/memcpy.S: New. * libc/machine/x86_64/memset.S: New. * libc/machine/configure.in: Added support for x86_64. * libc/machine/configure: Regenerated.
Diffstat (limited to 'newlib/libc/machine/x86_64/setjmp.S')
-rw-r--r--newlib/libc/machine/x86_64/setjmp.S53
1 files changed, 53 insertions, 0 deletions
diff --git a/newlib/libc/machine/x86_64/setjmp.S b/newlib/libc/machine/x86_64/setjmp.S
new file mode 100644
index 000000000..5f5e03df5
--- /dev/null
+++ b/newlib/libc/machine/x86_64/setjmp.S
@@ -0,0 +1,53 @@
+/*
+ * ====================================================
+ * Copyright (C) 2007 by Ellips BV. All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+ /*
+ ** jmp_buf:
+ ** rbx rbp r12 r13 r14 r15 rsp rip
+ ** 0 8 16 24 32 40 48 56
+ */
+
+ #include "x86_64mach.h"
+
+ .global SYM (setjmp)
+ .global SYM (longjmp)
+ SOTYPE_FUNCTION(setjmp)
+ SOTYPE_FUNCTION(longjmp)
+
+SYM (setjmp):
+ movq rbx, 0 (rdi)
+ movq rbp, 8 (rdi)
+ movq r12, 16 (rdi)
+ movq r13, 24 (rdi)
+ movq r14, 32 (rdi)
+ movq r15, 40 (rdi)
+ leaq 8 (rsp), rax
+ movq rax, 48 (rdi)
+ movq (rsp), rax
+ movq rax, 56 (rdi)
+ movq $0, rax
+ ret
+
+SYM (longjmp):
+ movq rsi, rax /* Return value */
+
+ movq 8 (rdi), rbp
+
+ __CLI
+ movq 48 (rdi), rsp
+ pushq 56 (rdi)
+ movq 0 (rdi), rbx
+ movq 16 (rdi), r12
+ movq 24 (rdi), r13
+ movq 32 (rdi), r14
+ movq 40 (rdi), r15
+ __STI
+
+ ret