.TITLE INI$VM - INITIALIZE VM POOL .SBTTL INI$VM - TITLE PAGE .PSECT VMX$$$,RO,I .IDENT /V01.01/ .ENABL LC ; ; ************************************************************************ ; * ; THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS ONLY. DIGITAL EQUIPMENT * ; COMPUTER USER'S SOCIETY, DIGITAL EQUIPMENT CORPORATION, MONSANTO, AND * ; THE AUTHOR DISCLAIM ALL WARRANTIES ON THE PROGRAM, INCLUDING WITHOUT * ; LIMITATION, ALL IMPLIED WARRANTIES OF MERCHANTABLITY AND FITNESS. * ; * ; FULL PERMISSION AND CONSENT IS HEREBY GIVEN TO DECUS AND TO THE DECUS * ; SPECIAL INTEREST GROUPS TO REPRODUCE, DISTRIBUTE, AND PUBLISH AND * ; PERMIT OTHERS TO REPRODUCE IN WHOLE OR IN PART, IN ANY FORM AND * ; WITHOUT RESTRICTION, THIS PROGRAM AND ANY INFORMATION RELATING TO IT. * ; * ; ************************************************************************ ; ; INITIALIZE VM POOL ; ; VERSION: V01.01 ; ; AUTHOR: R.W. STAMERJOHN MAPC 02-NOV-81 ; ; MODIFICATION HISTORY: ; ; V01.01 RWS 02-NOV-81 INITIAL VERSION ; .SBTTL INI$VM - DECLARATIONS .DSABL GBL .DSABL CRF ; ; MACRO LIBRARY CALLS: ; .MCALL CALLR ;Call subroutine and return ; ; GLOBAL DECLARATIONS: ; .GLOBL INI$VM ;Module entry ; ; GLOBAL REFERENCES: ; ; VM subroutines. ; .GLOBL INI$VI ;Create initial pool space .GLOBL MAP$VI ;Map VM_address .GLOBL MRK$VI ;Mark VM_address as written .GLOBL RGD$VI ;Process region descriptor .GLOBL SWD$VI ;Process swapping descriptor .ENABL CRF .SBTTL INI$VM * INITIALIZE VM POOL ; ;+ ; This routine initializes the VM pool. The actual pool allocation ; depends of the version of the pool being used. Currently, four ; choices are available: ; ; 1. Task space extension, non-swapped. ; 2. Task space extension, swapped to working file. ; 3. Region area, non-swapped. ; 4. Region area, swapped to working file. ; ; INPUT: ; ; Call by: JSR PC,INI$VM ; ; R0,R1 = Maximum pool size (bytes) ; R2 = Pool increment (bytes) ; R3 = Region descriptor address (see INIVMF) ; R4 = Swapping descriptor address (see INIVMF) ; ; OUTPUT: ; ; The VM is initialized for allocation and access. ; ; REGISTERS: ; ; Uses: R0-R5 Saves: None Stack: 3 words ;- INI$VM:: ;Ref. label ; ; Process region and swapping information as needed by pool type. ; CALL RGD$VI ;Process region information as needed CALL SWD$VI ;Process swapping information as needed ; ; Create initial pool space as needed by pool type. Return with R4,R5 set to ; top of allocated pool space and R3 to pool cell allocation increment. ; CALL INI$VI ;Create initial region MOV R5,-(SP) ;Save size of pool MOV R4,-(SP) ; ... on the stack for later use ; ; Create pool header cell and link to cell with rest of allocated pool. ; CLR R0 ;Get starting pool cell CLR R1 ; ... at VM_address = 0 CALL MAP$VI ;Map pool header CALL MRK$VI ;Mark buffer as written ADD R3,R1 ;Get address of first free cell MOV R0,(R5)+ ;Store link in header cell MOV R1,(R5)+ ; ... as a double word pointer CLR (R5)+ ;Mark header cell of size 0 CLR (R5)+ ; ... in double precsision CALL MAP$VI ;Map free cell header CALL MRK$VI ;Mark buffer as written CLR (R5)+ ;Set end of free list CLR (R5)+ ; ... as a double word pointer MOV (SP)+,(R5)+ ;Set size of free buffer MOV (SP)+,(R5)+ ; ... to size of pool SUB R3,-(R5) ;Get size of pool remaining SBC -(R5) ; ... in double precsision RETURN ;Return to caller .END