sparc_sunos4_mach_dep.s 847 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. .seg "text"
  7. .globl _GC_save_regs_in_stack
  8. .globl _GC_push_regs
  9. _GC_save_regs_in_stack:
  10. _GC_push_regs:
  11. ta 0x3 ! ST_FLUSH_WINDOWS
  12. mov %sp,%o0
  13. retl
  14. nop
  15. .globl _GC_clear_stack_inner
  16. _GC_clear_stack_inner:
  17. mov %sp,%o2 ! Save sp
  18. add %sp,-8,%o3 ! p = sp-8
  19. clr %g1 ! [g0,g1] = 0
  20. add %o1,-0x60,%sp ! Move sp out of the way,
  21. ! so that traps still work.
  22. ! Includes some extra words
  23. ! so we can be sloppy below.
  24. loop:
  25. std %g0,[%o3] ! *(long long *)p = 0
  26. cmp %o3,%o1
  27. bgu loop ! if (p > limit) goto loop
  28. add %o3,-8,%o3 ! p -= 8 (delay slot)
  29. retl
  30. mov %o2,%sp ! Restore sp., delay slot