sparc_mach_dep.S 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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
  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. #if defined(__arch64__) || defined(__sparcv9)
  12. save %sp,-128,%sp
  13. flushw
  14. ret
  15. restore %sp,2047+128,%o0
  16. #else /* 32 bit SPARC */
  17. ta 0x3 ! ST_FLUSH_WINDOWS
  18. mov %sp,%o0
  19. retl
  20. nop
  21. #endif /* 32 bit SPARC */
  22. .GC_save_regs_in_stack_end:
  23. .size GC_save_regs_in_stack,.GC_save_regs_in_stack_end-GC_save_regs_in_stack
  24. .globl GC_clear_stack_inner
  25. GC_clear_stack_inner:
  26. #if defined(__arch64__) || defined(__sparcv9)
  27. mov %sp,%o2 ! Save sp
  28. add %sp,2047-8,%o3 ! p = sp+bias-8
  29. add %o1,-2047-192,%sp ! Move sp out of the way,
  30. ! so that traps still work.
  31. ! Includes some extra words
  32. ! so we can be sloppy below.
  33. loop:
  34. stx %g0,[%o3] ! *(long *)p = 0
  35. cmp %o3,%o1
  36. bgu,pt %xcc, loop ! if (p > limit) goto loop
  37. add %o3,-8,%o3 ! p -= 8 (delay slot)
  38. retl
  39. mov %o2,%sp ! Restore sp., delay slot
  40. #else /* 32 bit SPARC */
  41. mov %sp,%o2 ! Save sp
  42. add %sp,-8,%o3 ! p = sp-8
  43. clr %g1 ! [g0,g1] = 0
  44. add %o1,-0x60,%sp ! Move sp out of the way,
  45. ! so that traps still work.
  46. ! Includes some extra words
  47. ! so we can be sloppy below.
  48. loop:
  49. std %g0,[%o3] ! *(long long *)p = 0
  50. cmp %o3,%o1
  51. bgu loop ! if (p > limit) goto loop
  52. add %o3,-8,%o3 ! p -= 8 (delay slot)
  53. retl
  54. mov %o2,%sp ! Restore sp., delay slot
  55. #endif /* 32 bit SPARC */
  56. .GC_clear_stack_inner_end:
  57. .size GC_clear_stack_inner,.GC_clear_stack_inner_end-GC_clear_stack_inner