1 ! SPARCompiler 3.0 and later apparently no longer handles
2 ! asm outside functions. So we need a separate .s file
3 ! This is only set up for SunOS 5, not SunOS 4.
4 ! Assumes this is called before the stack contents are
8 .globl GC_save_regs_in_stack
10 GC_save_regs_in_stack:
12 #if defined(__arch64__) || defined(__sparcv9)
16 restore %sp,2047+128,%o0
17 #else /* 32 bit SPARC */
18 ta 0x3 ! ST_FLUSH_WINDOWS
22 #endif /* 32 bit SPARC */
23 .GC_save_regs_in_stack_end:
24 .size GC_save_regs_in_stack,.GC_save_regs_in_stack_end-GC_save_regs_in_stack
27 .globl GC_clear_stack_inner
29 #if defined(__arch64__) || defined(__sparcv9)
31 add %sp,2047-8,%o3 ! p = sp+bias-8
32 add %o1,-2047-192,%sp ! Move sp out of the way,
33 ! so that traps still work.
34 ! Includes some extra words
35 ! so we can be sloppy below.
37 stx %g0,[%o3] ! *(long *)p = 0
39 bgu,pt %xcc, loop ! if (p > limit) goto loop
40 add %o3,-8,%o3 ! p -= 8 (delay slot)
42 mov %o2,%sp ! Restore sp., delay slot
43 #else /* 32 bit SPARC */
45 add %sp,-8,%o3 ! p = sp-8
47 add %o1,-0x60,%sp ! Move sp out of the way,
48 ! so that traps still work.
49 ! Includes some extra words
50 ! so we can be sloppy below.
52 std %g0,[%o3] ! *(long long *)p = 0
54 bgu loop ! if (p > limit) goto loop
55 add %o3,-8,%o3 ! p -= 8 (delay slot)
57 mov %o2,%sp ! Restore sp., delay slot
58 #endif /* 32 bit SPARC */
59 .GC_clear_stack_inner_end:
60 .size GC_clear_stack_inner,.GC_clear_stack_inner_end-GC_clear_stack_inner