sparc_netbsd_mach_dep.s 907 B

1234567891011121314151617181920212223242526272829303132333435
  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 4.
  4. ! Assumes this is called before the stack contents are
  5. ! examined.
  6. #include "machine/asm.h"
  7. .seg "text"
  8. .globl _C_LABEL(GC_save_regs_in_stack)
  9. .globl _C_LABEL(GC_push_regs)
  10. _C_LABEL(GC_save_regs_in_stack):
  11. _C_LABEL(GC_push_regs):
  12. ta 0x3 ! ST_FLUSH_WINDOWS
  13. mov %sp,%o0
  14. retl
  15. nop
  16. .globl _C_LABEL(GC_clear_stack_inner)
  17. _C_LABEL(GC_clear_stack_inner):
  18. mov %sp,%o2 ! Save sp
  19. add %sp,-8,%o3 ! p = sp-8
  20. clr %g1 ! [g0,g1] = 0
  21. add %o1,-0x60,%sp ! Move sp out of the way,
  22. ! so that traps still work.
  23. ! Includes some extra words
  24. ! so we can be sloppy below.
  25. loop:
  26. std %g0,[%o3] ! *(long long *)p = 0
  27. cmp %o3,%o1
  28. bgu loop ! if (p > limit) goto loop
  29. add %o3,-8,%o3 ! p -= 8 (delay slot)
  30. retl
  31. mov %o2,%sp ! Restore sp., delay slot