.MCALL .MODULE .MODULE PLAS,VERSION=02,COMMENT=,IDENT=NO,LIB=YES ; 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. .SBTTL Module Declarations .NLIST .ENABL LC .DSABL GBL .NLIST CND .LIST ;+ ; ; Facility: ; ; RT-11 System Subroutine Library ; ; Environment: ; ; These routines can be used from any job running in a single- or ; multiple-job mapped environment. ; ; Entry Points: ; ; CRAW, ICRAW ; CRRG, ICRRG ; ELRG, IELRG ; ELAW, IELAW ; MAP ; GMCX, IGMCX ; UNMAP, IUNMAP ; ; Include files: ; ; SYSMAC.SML: .MCALL .CRAW .ELAW .MAP ;Window control .MCALL .UNMAP .MCALL .CRRG .ELRG ;Region control .MCALL .GMCX ;Mapping context status ; ; External references: ; .GLOBL $NXADR $NXVAL ;Argument access .GLOBL $SYSLB ;Include system library work area. .GLOBL $ARGER ;Missing argument code value .GLOBL $ERRM0 ;Error conversion ; ;- .SBTTL ICRAW - Fortran-callable routine ;+ ; ; Functional description: ; ; The ICRAW (Create Window) function is used to establish a ; virtual address window and optionally map it to a physical ; memory region. ; ; Calling sequence: ; ; i = ICRAW ( iwdb ) ; or ; CALL CRAW ( iwdb [,ierr] ) ; ; Input parameters: ; ; R5 address of argument block ; 0(R5) argument count ; 2(R5) address of Window Descriptor Block (WDB) ; [4(R5) address of location to return error information] ; ; Errors: ; ; 0 Function completed successfully ; -1 Window alignment error ; -2 Attempt to define more than 7 windows ; -3 Invalid region identifier ; -5 Combination of offset into region and size of ; window to be mapped is invalid ; -16. Mode / space not available ; -257. Required argument missing ; ;- .PSECT SYS$I CRAW:: ICRAW:: CALL $$PLAS ;Perform PLAS setup BCS 10$ ;Error during SETUP .CRAW CODE=SET ;Create the window 10$: RETURN ;Errors caught by co-routine .SBTTL ICRRG - Fortran-callable routine ;+ ; ; Functional description: ; ; The ICRRG (Create Region) function allocates a dynamic region ; in physical memory for use by the requesting job. ; ; Calling sequence: ; ; i = ICRRG ( irdb ) ; or ; CALL CRRG ( irdb [,ierr] ) ; ; Input parameters: ; ; R5 address of argument block ; 0(R5) argument count ; 2(R5) address of Region Definition Block (RDB) ; [4(R5) address of location to return error information] ; ; Errors: ; ; 0 Function completed successfully ; -7 No region control blocks available ; -10 Insufficient memory to allocate region of requested size ; -11 Invalid region size was specified ; -13 Global region not found ; -14 Too many global regions ; -16 Global region privately owned ; -17 Global region already exists with different base address ; -257. Required argument missing ; ;- .PSECT SYS$I CRRG:: ICRRG:: CALL $$PLAS ;Perform PLAS setup BCS 10$ ;Error during SETUP .CRRG CODE=SET ;Create the region 10$: RETURN ;Errors will be caught by co-routine .SBTTL IELAW - Fortran-callable routine ;+ ; ; Functional description: ; ; The IELAW (Eliminate Window) function eliminates a virtual ; address window. An implied unmapping of the window occurs ; when its definition block is eliminated. ; ; Calling sequence: ; ; i = IELAW ( iwdb ) ; or ; CALL ELAW ( iwdb [,ierr] ) ; ; Input parameters: ; ; R5 address of argument block ; 0(R5) argument count ; 2(R5) address of Window Definition Block (WDB) ; [4(R5) address of location to return error information] ; ; Errors: ; ; 0 Function completed successfully ; -4 Invalid window identifier specified ; -16. Mode / space not available ; -257. Required argument missing ; ;- .PSECT SYS$I ELAW:: IELAW:: CALL $$PLAS ;Perform PLAS setup BCS 10$ ;Error during SETUP .ELAW CODE=SET ;Eliminate the window 10$: RETURN ;Errors will be caught by co-routine .SBTTL IELRG - Fortran-callable routine ;+ ; ; Functional description: ; ; The IELRG (Eliminate Region) function eliminates a dynamic ; region of physical memory and returns the memory to the free ; list where it can be used by other jobs. ; ; Calling sequence: ; ; i = IELRG ( irdb ) ; or ; CALL ELRG ( irdb [,ierr] ) ; ; Input parameters: ; ; R5 address of argument block ; 0(R5) argument count ; 2(R5) address of Region Definition Block (RDB) ; [4(R5) address of location to return error information] ; ; Errors: ; ; 0 Function completed successfully ; -3 Invalid region identifier was specified ; -12 Deallocation failure ; -15 Global region in use ; -257. Required argument missing ; ;- .PSECT SYS$I ELRG:: IELRG:: CALL $$PLAS ;Perform PLAS setup BCS 10$ ;Error during SETUP .ELRG CODE=SET ;Eliminate the region 10$: RETURN ;Errors will be caught by co-routine .SBTTL IGCMX - Fortran-callable routine ;+ ; ; Functional description: ; ; The IGMCX (Get Mapping Context) function returns the mapping ; status of an extended memory window. Status is returned in ; the window definition block. ; ; Calling sequence: ; ; i = IGMCX ( iwdb ) ; or ; CALL GMCX ( iwdb [,ierr] ) ; ; Input parameters: ; ; R5 address of argument block ; 0(R5) argument count ; 2(R5) address of Window Definition Block (WDB) ; [4(R5) address of location to return error information] ; ; Errors: ; ; 0 Function completed successfully ; -5 Invalid window identifier specified ; -16. Mode / space not available ; -257. Required argument missing ; ;- .PSECT SYS$I GMCX:: IGMCX:: CALL $$PLAS ;Perform PLAS setup BCS 10$ ;Error during SETUP .GMCX CODE=SET ;Get mapping status 10$: RETURN ;Errors will be caught by co-routine .SBTTL IUNMAP - Fortran-callable routine ;+ ; ; Functional description: ; ; The IUNMAP (Unmap Window) function unmaps a window and flags ; that portion of the program's virtual address space as ; inaccessable. ; ; Calling sequence: ; ; i = IUNMAP ( iwdb ) ; or ; CALL UNMAP ( iwdb [,ierr] ) ; ; Input parameters: ; ; R5 address of argument block ; 0(R5) argument count ; 2(R5) address of Window Definition Block (WDB) ; [4(R5) address of location to return error information] ; ; Errors: ; ; 0 Function completed successfully ; -4 Invalid window identifier specified ; -6 Specified window was not already mapped ; -16. Mode / space not available ; -257. Required argument missing ; ;- .PSECT SYS$I UNMAP:: IUNMAP:: CALL $$PLAS ;Perform PLAS setup BCS 10$ ;Error during SETUP .UNMAP CODE=SET ;Unmap the window 10$: RETURN ;Errors will be caught by co-routine .SBTTL MAP - Fortran-callable routine ;+ ; ; Functional description: ; ; The MAP (MAP Window) function maps a previously defined address ; window into a dynamic region of extended memory or into the ; static region in the lower 28kw. ; ; Calling sequence: ; ; i = MAP ( iwdb ) ; or ; CALL MAP ( iwdb [,ierr] ) ; ; Input parameters: ; ; R5 address of argument block ; 0(R5) argument count ; 2(R5) address of Window Definition Block (WDB) ; [4(R5) address of location to return error information] ; ; Errors: ; ; 0 Function completed successfully ; -3 Invalid region identifier specified ; -4 Invalid window identifier specified ; -5 Specified window not mapped because offset ; is beyond end of region, the region is larger ; than the window, or the window would extend ; beyond the bounds of the region ; -16. Mode / space not available ; -257. Required argument missing ; ;- .PSECT SYS$I MAP:: CALL $$PLAS ;Perform PLAS setup BCS 10$ ;Error during SETUP .MAP CODE=SET ;Map the window 10$: RETURN ;Errors will be caught by co-routine .SBTTL $$PLAS - Setup and handling routine for PLAS requests ;+ ; ; $$PLAS ; Obtains the window or region definition block pointer and ; prepares an EMT area on the stack. ; ; Note: ; This routine is a co-routine. After preparing the EMT area, ; it calls back the caller so that the actual PLAS request may ; be performed. The caller returns to this routine to complete ; the housekeeping (dumping the EMT area from the stack and ; returning any error information). ; ;- .PSECT SYS$I $$PLAS: MOV (R5)+,R4 ;R4 = Count of arguments CALL $NXADR ;Get address of {R|W}DB BCC 10$ ;Got it... MOV #$ARGER,R1 ;Error = Missing required argument BR 20$ 10$: MOV R0,R1 ;Save {R|W}DB address SUB #<2*2>,SP ;Make room on stack for EMT area MOV 4(SP),@SP ;Move the return address MOV SP,R0 ;R0 -> EMT area block to use ADD #2,R0 ; ... MOV R1,2(R0) ;Move address of {R|W}DB to EMT area CLC ;Setup was successful CALL @(SP)+ ;*C*Co-routine back to caller ; Post-request processing CALL $ERRM0 ;Translate the error ADD #<2*2>,SP ;Dump the EMT area we used MOV R0,R1 ;Save the error return 20$: CALL $NXADR ;Get error return address BCS 30$ ;User doesn't want it MOV R1,@R0 ;Put error code where user wants it 30$: MOV R1,R0 ;For standard function return SEC RETURN .END