d .TITLE ACPMNT - MOUNT IMAGE FOR PCACP .IDENT /V02/ , ;++ ; X; ACPMNT.MAR -- MOUNT IMAGE FOR PAPER TAPE ACP ; ; THIS PROGRAM MOUNTS THE PAPER TAPE ACP (PCACP), AFTER ; CREATING THE ACP PROCESS. IT PERFORMS ALL THE APPROPRIATE ; SYNCHRONIZING CHECKS WITH THE ACP. L; ; SIDE EFFECTS: ; x; THE PCACP PROCESS MAY BE CREATED. ; @; PROGRAMMER: ; ; VIK MUIZNIEKS JULY--1979 l; ;-- 4PC_ACP_TYPE=200 ; PAPER TAPE ACP TYPE ; ; SYMBOL AND OFFSET DEFINITIONS (SOME FROM LIB.MLB) ` ; $CCBDEF ( $IODEF $AQBDEF $SSDEF T $DYNDEF $UCBDEF  $VCBDEF $PQLDEF $PRDEF H $PSLDEF ; ; CHARACTER STRING DESCRIPTORS FOR $CREPRC t; IMAGE: .ASCID /SYS$SYSTEM:PCACP.EXE/ <PROCESS:.ASCID /PCACP/ INPUT: .ASCID /TTA0:/ ; NEVER USED BY ACP UIC: .WORD ^O01 ; ACP UIC MEMBER=001 h .WORD ^O01 ; ACP UIC GROUP=001  ; ACP UIC = [001,001] 0; ; CHAR. STRING DESCR. FOR PAPER TAPE READER/PUNCH DEVICE ; \PCAPE: .ASCID /PCA1:/ ; $; QUOTA LIST FOR PCACP PROCESS ; QLIST: .BYTE PQL$_ASTLM P .LONG 128  .BYTE PQL$_DIOLM  .LONG ^X00000FFF | .BYTE PQL$_BIOLM  .LONG ^X00000FFF D .BYTE PQL$_LISTEND ; ; STORAGE FOR RETURNED PCACP PID p; PID: .BLKL 1 8; ; 30-SECOND DELTA TIME FOR $SETIMR ; dWAIT: .LONG -10*1000*1000*30,-1 ; ,; CHANNEL FOR IO$_MOUNT QIO TO PCACP ; CHAN: .LONG 0 XSTART: .WORD 0 ; NULL ENTRY MASK  $CMKRNL_S B^BEGIN ; CHANGE MODE TO KERNEL  RET ; ALL DONE BEGIN: .WORD 0 ; SAVE NO REGISTERS ; L; GET UCB ADDRESS INTO R7 ;  $ASSIGN_S DEVNAM=PCAPE,CHAN=CHAN,-; ASSIGN CHANNEL TO PCA1 x ACMODE=#PSL$C_USER ; AT USER LEVEL--SINCE  ; THAT WAS PREVIOUS MODE @ ; (REQUIRED LATER BY  ; IOC$VERIFYCHAN)  BLBS R0,10$ ; CHECK FOR ERROR l MOVL #SS$_DEVOFFLINE,R0 ; RETURN ERROR STATUS RET 4!10$: MOVZWL W^CHAN,R0 ; OBTAIN CHANNEL NUMBER ! JSB G^IOC$VERIFYCHAN ; OKAY CHANNEL # AND PUT ! ; CCB ADDRESS IN R1 `" ; (THIS ROUTINE DESTROYS " ; R0-R3; ALSO, IT CHECKS (# ; CHANNEL ACCESSIBILITY # ; FOR THE PREVIOUS MODE- # ; IN THIS CASE, USER) T$ BLBS R0,20$ ; CHECK FOR ERROR $ RET ; AND FINISH UP %20$: MOVL CCB$L_UCB(R1),R7 ; GET UCB ADDRESS %; %; IS ACP ALREADY MOUNTED OR MARKED FOR DISMOUNT? H&; & BBS #DEV$V_MNT,UCB$L_DEVCHAR(R7),30$; ALREADY MOUNTED? ' BBC #DEV$V_DMT,UCB$L_DEVCHAR(R7),40$; MARKED FOR DISMOUNT? t'30$: MOVL #SS$_DEVMOUNT,R0 ; RETURN ERROR STATUS ' BRW EXIT ; USE COMMON EXIT <(40$: (; ); ALLOCATE THE ACP QUEUE BLOCK (AQB) h); ) MOVZBL #AQB$C_LENGTH,R1 ; LENGTH OF AQB 0* JSB G^EXE$ALONONPAGED ; ALLOCATE AQB * BLBS R0,50$ ; ALLOCATION OK? * MOVL #SS$_INSFMEM,R0 ; NO, ERROR \+ BRW EXIT ; USE COMMON EXIT +50$: $,; ,; INITIALIZE THE AQB (ADDRESS OF AQB RETURNED IN R2 BY EXEC) ,; P- MOVZBW #AQB$C_LENGTH,AQB$W_SIZE(R2) ; RECORD SIZE - MOVB #DYN$C_AQB,AQB$B_TYPE(R2) ; TYPE OF BLOCK . MOVL R2,AQB$L_ACPQFL(R2) ; SET IRP Q FORWD. LINK |. MOVL R2,AQB$L_ACPQBL(R2) ; AND BACKWARD LINK . MOVB #1,AQB$B_MNTCNT(R2) ; INITIALIZE MOUNT COUNT D/ MOVB #PC_ACP_TYPE,AQB$B_ACPTYPE(R2) ; MARK ACP AS PT ACP / BISB #AQB$M_CREATING!AQB$M_UNIQUE,- ; START SYNCHRONIZATION 0 AQB$B_STATUS(R2) ; WITH CREATING BIT p0 PUSHL R2 ; SAVE AQB ADDRESS 0; 81; ALLOCATE THE VOLUME CONTROL BLOCK (VCB) 1; 2 MOVL #SS$_INSFMEM,R6 ; ASSUME DEAL. FAILURE d2 MOVZBL #VCB$C_LENGTH,R1 ; SIZE OF VCB 2 JSB G^EXE$ALONONPAGED ; ALLOCATE VCB ,3 BLBC R0,76$ ; DEAL. AQB IF FAIL 3 MOVL R2,R8 ; SAVE VCB ADDRESS 3; X4; INITIALIZE VCB (ADDRESS RETURNED IN R2 BY THE EXECUTIVE) 4; 5 MOVB #DYN$C_VCB,VCB$B_TYPE(R2) ; RECORD TYPE 5 MOVZBW #VCB$C_LENGTH,VCB$W_SIZE(R2) ; AND SIZE 5 MOVW #1,VCB$W_TRANS(R2) ; INIT. TRANS. COUNT L6 MOVL (SP),VCB$L_AQB(R2) ; LINK TO AQB 6; 7; INITIALIZE APPROPRIATE UCB FIELDS FOR SYNCHRONIZATION x7; 7 MOVL R2,UCB$L_VCB(R7) ; LINK TO VCB @8 BISW #UCB$M_MOUNTING,UCB$W_STS(R7) ; NOTE DEVICE MOUNTING 8; 9; START THE ACP PROCESS (PCACP). NOTE THAT PCACP WILL HAVE THE l9; SAME PRIVILEGES AS THE PROCESS STARTING PCACP SINCE THE PRVADR 9; ARGUMENT IS NOT SPECIFIED IN THE $CREPRC CALL (THAT ARGUMENT IS 4:; USED TO SPECIFY THE PRIVILEGES THE CREATED PROCESS SHOULD HAVE). :; : $CREPRC_S PIDADR=PID,- `; IMAGE=IMAGE,- ; INPUT=INPUT,- (< QUOTA=QLIST,- ; GIVE LARGE QUOTAS < BASPRI=#8,- ; AS WITH MOST ACPS < PRCNAM=PROCESS,- T= STSFLG=#0,- ; DISABLE RESOURCE WAIT = UIC=UIC ; WANT DETACHED PROCESS > BLBS R0,80$ ; BR IF SUCCESSFUL > MOVL R0,R6 ; SAVE ERROR STATUS >; H?; DEALLOCATE AQB AND VCB ON FAILURE ?; @ MOVL R2,R0 ; SET ADDR. TO DEAL. VCB t@75$: JSB G^EXE$DEANONPAGED ; RETURN BLOCK @76$: POPL R0 ; SET ADDR. TO DEAL. AQB