summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Mohr <manuel.mohr@kit.edu>2015-09-15 17:25:53 +0200
committerManuel Mohr <manuel.mohr@kit.edu>2015-09-15 17:25:53 +0200
commit3ef38f2f8cccd950a6e5bf228f44085f0dbf689d (patch)
treee74e46a00775549a4741e728c56d6cac998f31a6
parent9822e7ccfad1a0e07f6cf1ce5bfd20be218c51a2 (diff)
Provide GC_push_regs() for x86-64.
-rw-r--r--mach_dep.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/mach_dep.c b/mach_dep.c
index d91eed8..4971cd6 100644
--- a/mach_dep.c
+++ b/mach_dep.c
@@ -203,6 +203,31 @@
}
# define HAVE_PUSH_REGS
+# elif defined(__x86_64__)
+ void GC_push_regs(void)
+ {
+ volatile uint64_t regs[14];
+ asm volatile (
+ "movq %%rax, 0(%0)\n\t"
+ "movq %%rbx, 8(%0)\n\t"
+ "movq %%rcx, 16(%0)\n\t"
+ "movq %%rdx, 24(%0)\n\t"
+ "movq %%rsi, 32(%0)\n\t"
+ "movq %%rdi, 40(%0)\n\t"
+ "movq %%r8, 48(%0)\n\t"
+ "movq %%r9, 56(%0)\n\t"
+ "movq %%r10, 64(%0)\n\t"
+ "movq %%r11, 72(%0)\n\t"
+ "movq %%r12, 80(%0)\n\t"
+ "movq %%r13, 88(%0)\n\t"
+ "movq %%r14, 96(%0)\n\t"
+ "movq %%r15, 104(%0)"
+ :
+ : "r"(regs)
+ : "memory");
+ }
+# define HAVE_PUSH_REGS
+
# elif defined(SPARC)
void GC_push_regs(void)
{