CWT TITLE 'DMSCWT (CMS) VM/370 - RELEASE 6' 00001000
SPACE 2 00002000
*. 00003000
* 00007000
* DMSCWT (CONWAIT) 00008000
* 00009000
* FUNCTION: 00010000
* 00011000
* TO CAUSE THE CALLING PROGRAM TO WAIT UNTIL ALL 00012000
* TERMINAL I/O OPERATIONS HAVE BEEN COMPLETED. 00013000
* 00014000
* ATTRIBUTES: 00015000
* 00016000
* REENTRANT, NUCLEUS RESIDENT, CALLED BY SVC 00017000
* 00018000
* ENTRY POINTS 00019000
* 00020000
* DMSCWT 00021000
* 00022000
* 00023000
* ENTRY CONDITIONS: 00024000
* 00025000
* GPRI = A (PLIST) 00026000
* 00027000
* PLIST DC CL8'CONWAIT' 00028000
* 00029000
* EXIT CONDITIONS: 00030000
* 00031000
* GPR 15 = 0 00032000
* 00033000
* CALLS TO OTHER ROUTINES: 00034000
* 00035000
* DMSWAT - WAIT FOR I/O INTERRUPT 00036000
* 00037000
* EXTERNAL REFERENCES: 00038000
* 00039000
* OPSECT, DMSNUC 00040000
* 00041000
* TABLES/WORKAREAS: 00042000
* 00043000
* NONE 00044000
* 00045000
* REGISTER USAGE: 00046000
* 00047000
* R12 - BASE 00048000
* R11 - OPSECT 00049000
* R1,0,10,14,15 WORK 00050000
* 00051000
* OPERATION: 00052000
* 00053000
* DMSCWT CHECKS THE NUMBER OF PENDING READS AND PENDING 00054000
* WRITES. IF BOTH ARE NOT ZERO, DMSCWT BALR'S TO 00055000
* ROUTINE DMSWAT TO WAIT UNTIL A TERMINAL I/O OPERATION 00056000
* IS COMPLETED. UPON RETURN FROM DMSWAT, DMSCWT AGAIN 00057000
* CHECKS THE NUMBER OF PENDING READS AND PENDING 00058000
* WRITES. THIS PROCEDURE IS REPEATED UNTIL ALL TERMINAL 00059000
* I/O REQUESTS HAVE BEEN COMPLETED. AT THIS TIME, 00060000
* DMSCWT RETURNS TO THE CALLING ROUTINE. 00061000
* 00062000
*. 00063000
EJECT 00064000
DMSCWT START 00065000
EXTRN WAIT 00066000
USING DMSCWT,R12 00067000
USING OPSECT,R11 00068000
USING NUCON,R0 00069000
L R9,AFVS POINT TO FVSECT 00070000
USING FVSECT,R9 00071000
OI KXFLAG,KXWSVC HOLD KX UNTIL SVC ACTIVITY 00072000
DROP R9 00073000
LR R12,R15 LOAD BASE REGISTER 00074000
L R11,AOPSECT LOAD PLIST BASE REGISTER 00075000
LR R10,R14 SAVE RETURN ADDRESS 00076000
SR R0,R0 ZERO FOR COMPARES 00077000
WAITLOOP CH R0,NUMPNDWR ARE THERE ANY PENDING WRITES ? 00078000
BNE CALLWAIT YES, WAIT FOR I/O TO COMPLETE 00079000
C R0,PENDREAD IS THERE A READ PENDING ? 00080000
BNE CALLWAIT YES, WAIT FOR I/O TO COMPLETE 00081000
LR R14,R10 RESTORE RETURN ADDRESS 00082000
SR R15,R15 SET RETURN CODE TO ZERO 00083000
BR R14 RETURN TO THE CALLER 00084000
SPACE 00085000
CALLWAIT LA R1,WAITLST LOAD ADDRESS OF CONSOLE WAIT PLIST 00086000
L R15,=A(WAIT) LOAD ADDRESS OF WAIT ROUTINE 00087000
BALR R14,R15 WAIT FOR NEXT I/O INTERRUPT 00088000
B WAITLOOP CHECK THE LISTS AGAIN 00089000
SPACE 3 00090000
LTORG 00091000
EJECT 00092000
IO 00093000
NUCON 00094000
REGEQU 00095000
FVS 00096000
END 00097000