Added
authorceriel <none@none>
Tue, 8 Oct 1991 09:23:46 +0000 (09:23 +0000)
committerceriel <none@none>
Tue, 8 Oct 1991 09:23:46 +0000 (09:23 +0000)
mach/sparc/libdb/.distr [new file with mode: 0644]
mach/sparc/libdb/machdep.s [new file with mode: 0644]

diff --git a/mach/sparc/libdb/.distr b/mach/sparc/libdb/.distr
new file mode 100644 (file)
index 0000000..af5eda4
--- /dev/null
@@ -0,0 +1 @@
+machdep.s
diff --git a/mach/sparc/libdb/machdep.s b/mach/sparc/libdb/machdep.s
new file mode 100644 (file)
index 0000000..35c01c2
--- /dev/null
@@ -0,0 +1,64 @@
+.globl ___Get_PC, ___Set_PC
+
+! $Header$
+
+! This is the machine-dependant part of the ACK debugger support.
+! ___Get_PC takes a frame pointer (local base) argument and returns the
+!          return address from this frame.
+! ___Set_PC takes a frame pointer (local base) argument plus a return
+!          address and sets the return address of this frame to the
+!          return address supplied.
+
+___Get_PC:
+       ld      [%l0],%o0
+       tst     %o0
+       beq     3f
+       nop
+       cmp     %o0,%l1
+       bne     1f
+       nop
+       add     %i7, 8, %o0
+3:
+       retl
+       nop
+1:
+       ta      3
+       add     %l1,%g0,%o1
+2:     add     %o1,7,%o2
+       andn    %o2,7,%o2
+       ld      [%o2+4],%o1
+       cmp     %o0,%o1
+       bne     2b
+       nop
+       ld      [%o2+0x3c],%o0
+       inc     8,%o0
+       retl
+       nop
+
+___Set_PC:
+       ld      [%l0],%o0
+       tst     %o0
+       beq     3f
+       nop
+       cmp     %o0,%l1
+       bne     1f
+       nop
+       ld      [%l0+4],%i7
+       dec     8,%i7
+3:
+       retl
+       nop
+1:
+       ta      3
+       add     %l1,%g0,%o1
+2:     add     %o1,7,%o2
+       andn    %o2,7,%o2
+       ld      [%o2+4],%o1
+       cmp     %o0,%o1
+       bne     2b
+       nop
+       ld      [%l0+4],%o0
+       dec     8,%o0
+       st      %o0,[%o2+0x3c]
+       retl
+       nop