Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!mcnc!ece-csc!ncrcae!ncr-sd!crash!jeh
From: jeh@crash.CTS.COM (Jamie Hanrahan)
Newsgroups: comp.os.vms
Subject: Re: Help with a Kernal mode macro program
Message-ID: <1367@crash.CTS.COM>
Date: Sat, 11-Jul-87 08:47:39 EDT
Article-I.D.: crash.1367
Posted: Sat Jul 11 08:47:39 1987
Date-Received: Sun, 12-Jul-87 16:06:43 EDT
References: <8707110215.AA28319@ucbvax.Berkeley.EDU>
Reply-To: jeh@crash.CTS.COM (Jamie Hanrahan)
Followup-To: comp.os.vms
Distribution: world
Organization: Crash TS, El Cajon, CA
Lines: 24
Summary: LKWSET will do the job

In article <8707110215.AA28319@ucbvax.Berkeley.EDU>,
  writes:
>BTW, it's not clear to me that locking the pages involved in the working set
>is sufficient for your purposes; you have to be sure they are in memory before
>they are accessed.  I don't know for certain, but I suspect $LKWSET will
>simply start the paging going - I don't think it will necessarily wait for
>it to complete.
>
>The usual technique, if all the code fits in no more than two pages, is to
>place the IPL you are setting in memory at the end of the code.  The instruc-
>tion that sets the IPL is then itself guaranteed to be in memory, and it
>is certain to fault in the page containing the IPL.  While at elevated IPL,
>neither page will fault out.  (This can, of course, fail horribly if the
>SETIPL and the IPL itself get more than 2 pages apart, as there can then be
>a "hole" between the two.)  If you do this, the $LKWSET is redundant.
 
 $LKWSET will in fact wait to complete until all of the requested pages
 are faulted in.  The technique of referencing the IPL value, which is
 stored at the end of the code to be locked, at the beginning (via DSBINT
 or SETIPL), is a hack.  It's true that it's a _common_ hack inside VMS,
 but I still feel it should be avoided.  After all, someone who isn't
 familiar with this particular idiom might have to understand the code
 someday.  The use of the $LKWSET service makes the intent absolutely
 clear.