summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Mohr <manuel.mohr@kit.edu>2013-12-09 11:20:49 +0100
committerManuel Mohr <manuel.mohr@kit.edu>2013-12-09 11:26:59 +0100
commit1020df289a88e38150094aff7c798a293679a6c7 (patch)
treed935fc6c2d4be132897281c4dc56811912503fe0
parentbb06136be60d944cd58674c5f70d61d155369f0c (diff)
Replace fragile window overflow trap code with assembly version.
-rw-r--r--mach_dep.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/mach_dep.c b/mach_dep.c
index 3e578a8..bc0cea7 100644
--- a/mach_dep.c
+++ b/mach_dep.c
@@ -200,21 +200,29 @@
:
: "r"(regs)
: "memory");
-
}
# define HAVE_PUSH_REGS
-# elif defined(SPARC)
- __attribute__((noinline, optimize(1)))
- static void recurse(unsigned count)
- {
- if (count > 0)
- recurse(count - 1);
- }
+# elif defined(SPARC)
void GC_push_regs(void)
{
/* Cause window overflow trap. */
- recurse(7);
+ asm volatile (
+ "save %sp, -96, %sp\n\t"
+ "save %sp, -96, %sp\n\t"
+ "save %sp, -96, %sp\n\t"
+ "save %sp, -96, %sp\n\t"
+ "save %sp, -96, %sp\n\t"
+ "save %sp, -96, %sp\n\t"
+ "save %sp, -96, %sp\n\t"
+ "restore\n\t"
+ "restore\n\t"
+ "restore\n\t"
+ "restore\n\t"
+ "restore\n\t"
+ "restore\n\t"
+ "restore"
+ );
}
# define HAVE_PUSH_REGS
# endif