.NLIST TOC,SYM .TITLE $FNDPG .SBTTL ULBLIB 021 - Search Page Buffers for Virtual Address .IDENT \V01.00\ .PSECT .LIBC. .ENABL LC,GBL ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. ;+ ; $FNDPG ; This routine searches an internal page address list to determine whether ; a virtual page has already been transferred into an allocated memory page ; block. ; ; R1 = virtual page address ; ; CALL $FNDPG ; ; R2 = random ; ; C-bit = 0 => success ; R0 = address of memory page block in which the page is resident ; ; C-bit = 1 => failure to find page ; R0 = 0 ;- $FNDPG:: INC $TIME ;Advance time BNE 2$ ;Branch if no wrap-around INC $TIME ;Set time to 1 MOV #<$PAGHD-P$GNXT>,R0 ;Get resident page list 1$: MOV @R0,R0 ;Get address of next resident page BEQ 2$ ;Branch if done CLR P$GTIM(R0) ;Reset time BR 1$ ;Go again 2$: MOV R1,R2 ;Copy virtual address CLRB R2 ;Clear displacement in block SWAB R2 ;Position relative block to low byte MOV $PAGLS,R0 ;Get address of resident page list BEQ 3$ ;Branch if none ASL R2 ;Convert block to word offset ADD R2,R0 ;Compute list index SEC ;Assume page not resident MOV @R0,R0 ;Get page address BEQ 6$ ;Branch if page not in memory CLC ;Set success BR 5$ ;Exit 3$: MOV #<$PAGHD-P$GNXT>,R0 ;Get listhead address minus offset 4$: SEC ;Assume page not resident MOV @R0,R0 ;Get next page buffer BEQ 6$ ;Branch if no more CMPB P$GBLK(R0),R2 ;Check relative block BNE 4$ ;Branch if this isn't the requested page 5$: MOV $TIME,P$GTIM(R0) ;Time-stamp this page 6$: RETURN .END