aboutsummaryrefslogtreecommitdiff
path: root/unix/as.ssol/zsvjmp.s.OLD
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /unix/as.ssol/zsvjmp.s.OLD
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'unix/as.ssol/zsvjmp.s.OLD')
-rw-r--r--unix/as.ssol/zsvjmp.s.OLD59
1 files changed, 59 insertions, 0 deletions
diff --git a/unix/as.ssol/zsvjmp.s.OLD b/unix/as.ssol/zsvjmp.s.OLD
new file mode 100644
index 00000000..7f6bb7eb
--- /dev/null
+++ b/unix/as.ssol/zsvjmp.s.OLD
@@ -0,0 +1,59 @@
+!# ZSVJMP, ZDOJMP -- Set up a jump (non-local goto) by saving the processor
+!# registers in the buffer jmpbuf. A subsequent call to ZDOJMP restores
+!# the registers, effecting a call in the context of the procedure which
+!# originally called ZSVJMP, but with the new status code. These are Fortran
+!# callable procedures.
+!#
+!# (SUN/UNIX sparc version)
+
+ .seg "text"
+ .global _zsvjmp_
+ .global _zdojmp_
+
+ !# The following has nothing to do with ZSVJMP, and is included here
+ !# only because this assembler module is loaded with every process.
+ !# This code sets the value of the symbol MEM (the Mem common) to zero,
+ !# setting the origin for IRAF pointers to zero rather than some
+ !# arbitrary value, and ensuring that the MEM common is aligned for
+ !# all datatypes as well as page aligned. A further advantage is that
+ !# references to NULL pointers will cause a memory violation.
+
+ .global _mem_
+ _mem_ = 0
+
+ !# The following requires a jmpbuf of length at least 6 ints.
+ .proc 0
+_zsvjmp_:
+ save %sp, -0x60, %sp
+ call _sigblock
+ clr %o0
+ st %o0, [%i0 + 0x8]
+ st %i1, [%i0 + 0x14]
+ clr %o0
+ st %o0, [%i1]
+ st %i7, [%i0]
+ st %fp, [%i0 + 0x4]
+ add %i0, 0xc, %o1
+ call _sigstack
+ clr %o0
+ ret
+ restore %g0, 0x0, %o0
+
+ .proc 0
+_zdojmp_:
+ save %sp, -0x40, %sp
+ ta 0x3
+ ld [%i0 + 0x4], %fp
+ sub %fp, 0x60, %sp
+ call _sigsetmask
+ ld [%i0 + 0x8], %o0
+ add %i0, 0xc, %o0
+ call _sigstack
+ clr %o1
+ ld [%i0 + 0x14], %o0
+ ld [%i1], %i1
+ st %i1, [%o0]
+ ld [%i0], %i7
+ ret
+ restore %i1, 0x0, %o0
+ .seg "data"