From 269a36876f36a3a586e58ac9122bcd2453d98648 Mon Sep 17 00:00:00 2001 From: tromey Date: Thu, 27 Apr 2000 00:43:33 +0000 Subject: <<<<<<< ChangeLog 2000-04-26 Jakub Jelinek * gcconfig.h (SPARC): Define ALIGNMENT to 8 for 64bit SPARC. (SPARC/LINUX): Use GC_SysVGetDataStart instead of LINUX_DATA_START - sparc glibc does not provide it. (SAVE_CALL_CHAIN, ASM_CLEAR_CODE): Define on sparc*-linux*. Make STACKBOTTOM depend on the wordsize. * os_dep.c (GC_SysVGetDataStart): Compile in on sparc*-linux*. (struct frame): Declare on sparc*-linux*. (GC_save_callers): Bias the frame pointers if needed (sparc64). * mach_dep.c (GC_save_regs_in_stack): Optimize on sparc32. Implement on sparc64. (GC_clear_stack_inner): Implement on sparc64. * gc_priv.h (GC_test_and_set): Implement for sparc. * linux_threads.c (GC_suspend_handler, GC_push_all_stacks): Use git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33452 138bc75d-0d04-0410-961f-82ee72b054a4 --- boehm-gc/mach_dep.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'boehm-gc/mach_dep.c') diff --git a/boehm-gc/mach_dep.c b/boehm-gc/mach_dep.c index 12c3f07603f..2936fd7f992 100644 --- a/boehm-gc/mach_dep.c +++ b/boehm-gc/mach_dep.c @@ -437,10 +437,16 @@ ptr_t cold_gc_frame; asm(" .globl _GC_save_regs_in_stack"); asm("_GC_save_regs_in_stack:"); # endif +# if defined(__arch64__) || defined(__sparcv9) + asm(" save %sp,-128,%sp"); + asm(" flushw"); + asm(" ret"); + asm(" restore %sp,2047+128,%o0"); +# else asm(" ta 0x3 ! ST_FLUSH_WINDOWS"); - asm(" mov %sp,%o0"); asm(" retl"); - asm(" nop"); + asm(" mov %sp,%o0"); +#endif # ifdef SVR4 asm(" .GC_save_regs_in_stack_end:"); asm(" .size GC_save_regs_in_stack,.GC_save_regs_in_stack_end-GC_save_regs_in_stack"); @@ -488,6 +494,21 @@ ptr_t cold_gc_frame; asm("GC_clear_stack_inner:"); asm(".type GC_save_regs_in_stack,#function"); # endif +#if defined(__arch64__) || defined(__sparcv9) + asm("mov %sp,%o2"); /* Save sp */ + asm("add %sp,2047-8,%o3"); /* p = sp+bias-8 */ + asm("add %o1,-2047-192,%sp"); /* Move sp out of the way, */ + /* so that traps still work. */ + /* Includes some extra words */ + /* so we can be sloppy below. */ + asm("loop:"); + asm("stx %g0,[%o3]"); /* *(long *)p = 0 */ + asm("cmp %o3,%o1"); + asm("bgu,pt %xcc, loop"); /* if (p > limit) goto loop */ + asm("add %o3,-8,%o3"); /* p -= 8 (delay slot) */ + asm("retl"); + asm("mov %o2,%sp"); /* Restore sp., delay slot */ +#else asm("mov %sp,%o2"); /* Save sp */ asm("add %sp,-8,%o3"); /* p = sp-8 */ asm("clr %g1"); /* [g0,g1] = 0 */ @@ -502,6 +523,7 @@ ptr_t cold_gc_frame; asm("add %o3,-8,%o3"); /* p -= 8 (delay slot) */ asm("retl"); asm("mov %o2,%sp"); /* Restore sp., delay slot */ +#endif /* First argument = %o0 = return value */ # ifdef SVR4 asm(" .GC_clear_stack_inner_end:"); -- cgit v1.2.1