machdep.s 897 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. .globl ___Get_PC, ___Set_PC
  2. ! $Id$
  3. ! This is the machine-dependant part of the ACK debugger support.
  4. ! ___Get_PC takes a frame pointer (local base) argument and returns the
  5. ! return address from this frame.
  6. ! ___Set_PC takes a frame pointer (local base) argument plus a return
  7. ! address and sets the return address of this frame to the
  8. ! return address supplied.
  9. ___Get_PC:
  10. ld [%l0],%o0
  11. tst %o0
  12. beq 3f
  13. nop
  14. cmp %o0,%l1
  15. bne 1f
  16. nop
  17. add %i7, 8, %o0
  18. 3:
  19. retl
  20. nop
  21. 1:
  22. ta 3
  23. add %l1,%g0,%o1
  24. 2: add %o1,7,%o2
  25. andn %o2,7,%o2
  26. ld [%o2+4],%o1
  27. cmp %o0,%o1
  28. bne 2b
  29. nop
  30. ld [%o2+0x3c],%o0
  31. inc 8,%o0
  32. retl
  33. nop
  34. ___Set_PC:
  35. ld [%l0],%o0
  36. tst %o0
  37. beq 3f
  38. nop
  39. cmp %o0,%l1
  40. bne 1f
  41. nop
  42. ld [%l0+4],%i7
  43. dec 8,%i7
  44. 3:
  45. retl
  46. nop
  47. 1:
  48. ta 3
  49. add %l1,%g0,%o1
  50. 2: add %o1,7,%o2
  51. andn %o2,7,%o2
  52. ld [%o2+4],%o1
  53. cmp %o0,%o1
  54. bne 2b
  55. nop
  56. ld [%l0+4],%o0
  57. dec 8,%o0
  58. st %o0,[%o2+0x3c]
  59. retl
  60. nop