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 #if defined(__arch64__) || defined(__sparcv9)
14 restore %sp,2047+128,%o0
15 #else /* 32 bit SPARC */
16 ta 0x3 ! ST_FLUSH_WINDOWS
20 #endif /* 32 bit SPARC */
21 .GC_save_regs_in_stack_end:
22 .size GC_save_regs_in_stack,.GC_save_regs_in_stack_end-GC_save_regs_in_stack
24 ! GC_clear_stack_inner(arg, limit) clears stack area up to limit and
25 ! returns arg. Stack clearing is crucial on SPARC, so we supply
26 ! an assembly version that s more careful. Assumes limit is hotter
27 ! than sp, and limit is 8 byte aligned.
28 .globl GC_clear_stack_inner
30 #if defined(__arch64__) || defined(__sparcv9)
32 add %sp,2047-8,%o3 ! p = sp+bias-8
33 add %o1,-2047-192,%sp ! Move sp out of the way,
34 ! so that traps still work.
35 ! Includes some extra words
36 ! so we can be sloppy below.
38 stx %g0,[%o3] ! *(long *)p = 0
40 bgu,pt %xcc, loop ! if (p > limit) goto loop
41 add %o3,-8,%o3 ! p -= 8 (delay slot)
43 mov %o2,%sp ! Restore sp., delay slot
44 #else /* 32 bit SPARC */
46 add %sp,-8,%o3 ! p = sp-8
48 add %o1,-0x60,%sp ! Move sp out of the way,
49 ! so that traps still work.
50 ! Includes some extra words
51 ! so we can be sloppy below.
53 std %g0,[%o3] ! *(long long *)p = 0
55 bgu loop ! if (p > limit) goto loop
56 add %o3,-8,%o3 ! p -= 8 (delay slot)
58 mov %o2,%sp ! Restore sp., delay slot
59 #endif /* 32 bit SPARC */
60 .GC_clear_stack_inner_end:
61 .size GC_clear_stack_inner,.GC_clear_stack_inner_end-GC_clear_stack_inner