diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/memio/mgtfwa.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/memio/mgtfwa.x')
-rw-r--r-- | sys/memio/mgtfwa.x | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/memio/mgtfwa.x b/sys/memio/mgtfwa.x new file mode 100644 index 00000000..9b39f6eb --- /dev/null +++ b/sys/memio/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-1] + call zlocva (Memi[bufptr-1], locbuf) + + if (abs (locbuf - fwa) > SZ_VMEMALIGN) + call sys_panic (SYS_MCORRUPTED, "Memory has been corrupted") + + return (fwa) +end |