From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/memdbg/msvfwa.x | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 sys/memdbg/msvfwa.x (limited to 'sys/memdbg/msvfwa.x') diff --git a/sys/memdbg/msvfwa.x b/sys/memdbg/msvfwa.x new file mode 100644 index 00000000..d5df074d --- /dev/null +++ b/sys/memdbg/msvfwa.x @@ -0,0 +1,23 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# MSVFWA -- Determine the buffer address which satisfies the maximum alignment +# criteria, save the buffer fwa in the integer cell immediately preceding +# this, and return a pointer to the user area of the buffer. + +pointer procedure msvfwa (fwa, dtype, sz_align, fwa_align) + +int fwa, dtype, sz_align, fwa_align +pointer bufptr, mgdptr() +int coerce() + +begin + # Compute the pointer to the data area which satisfies the desired + # alignment criteria. Store the fwa of the actual OS allocated buffer + # in the integer cell preceeding the data area. + + bufptr = mgdptr (fwa, TY_INT, sz_align, fwa_align) + Memi[bufptr-1] = fwa + + # Return pointer of type dtype to the first cell of the data area. + return (coerce (bufptr, TY_INT, dtype)) +end -- cgit