aboutsummaryrefslogtreecommitdiff
path: root/sys/nmemio/mgtfwa.x
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 /sys/nmemio/mgtfwa.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/nmemio/mgtfwa.x')
-rw-r--r--sys/nmemio/mgtfwa.x27
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/nmemio/mgtfwa.x b/sys/nmemio/mgtfwa.x
new file mode 100644
index 00000000..8d3452fd
--- /dev/null
+++ b/sys/nmemio/mgtfwa.x
@@ -0,0 +1,27 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <syserr.h>
+include <config.h>
+include <mach.h>
+
+# MGTFWA -- Given a user buffer pointer, retrieve physical address of buffer.
+# If physical address of buffer does not seem reasonable, memory has probably
+# been overwritten, a fatal error.
+
+int procedure mgtfwa (ptr, dtype)
+
+pointer ptr, bufptr
+int dtype
+int locbuf, fwa
+int coerce()
+
+begin
+ bufptr = coerce (ptr, dtype, TY_INT)
+ fwa = Memi[bufptr-5]
+ call zlocva (Memi[bufptr-5], locbuf)
+
+ if (abs (locbuf - fwa) > (6 * SZ_VMEMALIGN))
+ call sys_panic (SYS_MCORRUPTED, "Memory fwa has been corrupted")
+
+ return (fwa)
+end