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