blob: 8d3452fd08676b0cf85a43d3424fbf7446a54666 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
|