IOW TITLE 'DMSIOW (CMS) VM/370 - RELEASE 6' 00001000
SPACE 2 00002000
*. 00003000
* MODULE NAME: 00004000
* 00005000
* DMSIOW P3031 00006000
* 00007000
* FUNCTION: 00008000
* 00009000
* PLACE THE VIRTUAL CPU IN THE WAIT STATE UNTIL THE COMPLETION 00010000
* OF AN I/O OPERATION ON ONE OR MORE DEVICES. 00011000
* 00012000
* ATTRIBUTES: 00013000
* 00014000
* NUCLEUS RESIDENT, REENTRANT, CALLED VIA SVC OR BALR 00015000
* IF CALLER'S SYSTEM MASK IS X'00'. 00016000
* 00017000
* ENTRY POINT 00018000
* 00019000
* 1. DMSIOW, WAIT - WAIT FOR END OF I/O OPERATION P3031 00020000
* 2. DMSIOWR, WAITRTN P3031 00021000
* 00022000
* ENTRY CONDITIONS - 00023000
* 00024000
* GPR1 = A(PLIST) 00025000
* 00026000
* PLIST DC CL8'WAIT' 00027000
* DC CL4' ' SYMBOLIC DEVICE NAME/(CON1,DSK1,PCH1,ETC.) 00028000
* DC CL4' ' SYMBOLIC DEVICE NAME/(CON1,DSK1,PCH1,ETC.) 00029000
* . 00030000
* . 00031000
* . 00032000
* DC F'0' SIGNIFIES END OF DEVICE LIST 00033000
* DS 1F SYMBOLIC NAME OF INTERRUPTING DEVICE 00034000
* IS STORED HERE (BY WAIT) AFTER IOINT 00035000
* RETURNS TO WAIT. 00036000
* 00037000
* EXIT CONDITIONS: 00038000
* 00039000
* NORMAL - 00040000
* GPR15 = 0 00041000
* SYMBOLIC NAME OF INTERRUPTING DEVICE STORED IN PLIST. 00042000
* 00043000
* ERROR - 00044000
* GPR15 = 1 - INDICATES THAT SYMBOLIC NAME IS NOT IN 00045000
* THE INTERRUPT TABLES. 00046000
* 00047000
* CALLS TO OTHER ROUTINES: 00048000
* 00049000
* NONE. 00050000
* 00051000
* EXTERNAL REFERENCES: 00052000
* 00053000
* NONE. 00054000
* 00055000
* TABLES/WORKAREAS: 00056000
* 00057000
* NONE. 00058000
* 00059000
* REGISTER USAGE: 00060000
* 00061000
* GPR0 = WORK 00062000
* GPR1 = PLIST ADDRESS 00063000
* GPR2 = SYMBOLIC NAME 00064000
* GPR3 = UNUSED 00065000
* GPR4 = WORK 00066000
* GPR5 = ADDRESS OF USER INTERRUPT TABLE. 00067000
* GPR6 = LENGTH OF USER INTERRUPT TABLE ENTRY=28 00068000
* GPR7 = ADDRESS OF LAST ENTRY IN USER INTERRUPT TABLE. 00069000
* GPR8 = ADDRESS OF NAME OF DEVICE CAUSING LAST I/O INTERRUPT 00070000
* GPR9 = ADDRESS OF REGULAR INTERRUPT TABLE. 00071000
* GPR10 = LENGTH OF REGULAR INTERRUPT TABLE ENTRY=16 00072000
* GPR11 = ADDRESS OF LAST ENTRY IN REGULAR INTERRUPT TABLE 00073000
* TABLE. 00074000
* GPR12 = UNUSED 00075000
* GPR13 = UNUSED 00076000
* GPR14 = CALLER'S RETURN ADDRESS 00077000
* GPR15 = BASE REGISTER 00078000
* 00079000
* NOTES: 00080000
* 00081000
* NONE. 00082000
* 00083000
* OPERATION: 00084000
* 00085000
* WAIT LOOKS UP THE FIRST SYMBOLIC DEVICE NAME IN THE 00086000
* USER-DEFINED INTERRUPT TABLE (IF ANY -- AS 00087000
* INITIALIZED BY THE HNDINT FUNCTION PROGRAM), OR IN 00088000
* THE DEVICE TABLE (DEVTAB) IN THE NUCLEUS. IF THE 00089000
* DEVICE IS NOT IN EITHER TABLE, WAIT RETURNS TO THE 00090000
* CALLER WITH ERROR CODE 1. 00091000
* 00092000
* IF THE DEVICE WAS FOUND, WAIT PUTS THE PSEUDO-WAIT 00093000
* BIT IN THE CORRESPONDING DEVICE TABLE ENTRY ON. WAIT 00094000
* REPEATS THIS PROCEDURE FOR EACH SYMBOLIC DEVICE NAME 00095000
* ON THE PARAMETER LIST. IT THEN LOADS A PSW WITH THE 00096000
* WAIT BIT ON. THIS CAUSES THE SYSTEM TO ENTER THE 00097000
* WAIT STATE UNTIL AN I/O OPERATION IN ONE OF THE 00098000
* SPECIFIED DEVICES IS COMPLETED. AFTER THE I/O 00099000
* OPERATION IS COMPLETED, IOINT RETURNS CONTROL TO 00100000
* WAIT, WHICH PLACES THE SYMBOLIC NAME OF THE 00101000
* INTERUPTING DEVICE (THAT IS, THE DEVICE ON WHICH THE 00102000
* I/O OPERATION WAS COMPLETED) IN THE LAST ENTRY IN THE 00103000
* PARAMETER LIST AND RETURNS CONTROL TO THE CALLER. 00104000
* 00105000
* WAIT CAN BE CALLED VIA SVC, OR CAN ALSO BE CALLED BY 00106000
* BALR IF THE CALLER'S SYSTEM MASK IS X'00'. FOR DISK 00107000
* RESIDENT PROGRAMS DOING THEIR OWN I/O OPERATIONS WAIT 00108000
* SHOULD BE CALLED VIA SVC. 00109000
* 00110000
*. 00111000
EJECT 00112000
WAIT START 0 00113000
USING NUCON,R0 00114000
ENTRY DMSIOW,WAITRTN,DMSIOWR P3031 00115000
DMSIOW EQU * P3031 00116000
EXTRN DEVTAB DEVICE TABLE IN NUCON 00117000
EXTRN TABEND END OF DEVICE TABLE IN NUCON 00118000
EXTRN IONTABL (ADDRESS OF USER-DEFINED INTERRUPT-TABLE) 00119000
STM R0,R11,WAITSAVE SAVE REGISTERS 0 TO 11 00120000
BALR R15,0 RE-ESTABLISH 00121000
USING *,R15 ADDRESSABILITY, 00122000
REGADD SR R0,R0 CLEAR R0, 00123000
LA R1,8(,R1) BUMP R1 TO POINT AT SYMBOLIC DEVICE(S) 00124000
LM R7,R11,AIONTABL SET UP SOME OF THE REG. WE NEED, 00125000
LM R5,R7,4(R7) NOW GET USER-DEFINED-TABLE (IF ANY) 00126000
LR R4,R5 SAVE R5 IN R4 FOR LATER INITIALIZING, 00127000
LR2D L R2,0(,R1) PICK UP NEXT SYMBOLIC DEVICE 00128000
LTR R5,R4 START OF USER-DEFINED-TABLE (IF ANY) 00129000
BZ TRYREG BZ IF NONE, TRY REGULAR NUCON TABLE. 00130000
SRCHU CL R2,NAME(,R5) DOES SYMBOLIC NAME MATCH ? 00131000
BE FOUNDU BE IF MATCH FOUND IN USER-DEFINED-TABLE 00132000
BXLE R5,R6,SRCHU ITERATE THRU USER-DEFINED-TABLE. 00133000
TRYREG L R9,ADEVTB GET START OF REGULAR TABLE, 00134000
SRCHR CL R2,NAME(,R9) DOES SYMBOLIC NAME MATCH REGULAR TABLE ? 00135000
BE FOUND BE IF MATCH FOUND IN REGULAR TABLE. 00136000
BXLE R9,R10,SRCHR ITERATE THRU REGULAR TABLE. 00137000
LA R0,1 SET R0 FOR ERROR NO. 1 (INTO R15 AT END) 00138000
LA R15,NEWADD SET UP R15 AS NEEDED, 00139000
USING NEWADD,R15 FOR NEXT INSTRUCTION ONLY ... 00140000
B LTR54 GO MAKE SURE ALL PSEUDO-WAIT-BITS ARE OFF 00141000
USING REGADD,R15 RESTORE NORMAL ADDRESSABILITY 00142000
FOUNDU LR R9,R5 SAVE ADDRESS IN R9, 00143000
FOUND OI STATS(R9),WAITP SET PSEUDO WAIT-BIT, 00144000
TM STATS(R9),INTR HAS AN INTERRUPT ALREADY BEEN RECEIVED ? 00145000
BO YES1 BO IF YES. OTHERWISE, ... 00146000
LA R1,4(,R1) ADVANCE TO NEXT NAME (IF ANY) 00147000
C R0,0(,R1) IS 'NEXT NAME' 0 (END OF LIST) ? 00148000
BNE LR2D BNE IF NOT, GO HANDLE NEXT NAME. 00149000
LA R1,4(,R1) BUMP R1 TO POINT AT WORD FOR DEVICE NAME 00150000
* FOR WHICH WE EXPECT AN INTERRUPT. 00151000
LPSW WAITNG LOAD PSW ENABLED WITH WAIT BIT ON 00152000
* 00153000
YES1 LA R1,4(,R1) ADVANCE TO NEXT WORD, 00154000
C R0,0(,R1) ARE WE AT THE END OF LIST YET ? 00155000
BNE YES1 IF NOT, KEEP SCANNING AHEAD 00156000
LA R1,4(,R1) NOW POINTTS TO WHERE DEVICE WILL STORE 00157000
TM STATS(R9),INTP HAS INTERRUPT ALSO BEEN PROCESSED ? 00158000
BO YES2 BO IF YES (MAKES IT EASY) 00159000
* HANDLE 'INTERRUPT RECEIVED BUT NOT YET PROCESSED' ... 00160000
MVC IOOPSW,WAITNG SET UP OUR WAIT PSW 00161000
MVC IOOPSW+2(2),SAVIOLD+2(R9) WITH DEVICE FILLED IN 00162000
MVC CSW,SAVCSW(R9) RESTORE REAL CSW 00163000
LPSW IONPSW INVEIGLE 'IOINT' INTO DOING ALL THE WORK. 00164000
* 00165000
YES2 ST R2,0(,R8) STORE DEVICE IN NUCON FOR LATER STORING 00166000
NI STATS(R9),255-INTR-INTP CLEAR INT. REC'D & PROC. BITS 00167000
DMSIOWR EQU * P3031 00168000
WAITRTN BALR R15,0 MAKE ABSOLUTELY SURE 00169000
USING *,R15 WE HAVE ADDRESSABILITY 00170000
NEWADD MVC 0(4,R1),0(R8) PUT NAME OF INT-CAUSING DEVICE IN P-LIST 00171000
LTR54 LTR R5,R4 RESTORE R5, 00172000
BZ CLRREG BZ IF NO USER-TABLE TO CONCERN WITH 00173000
TM DBGFLAGS,DBGEXINT ARE WE IN DEBUG VIA EXT INT @VA05275 00173100
BNZ CLRREG YES DON'T ERASE USER WAITS @VA05275 00173200
OFFSTATU NI STATS(R5),255-WAITP CLEAR ALL PSEUDO-WAIT BITS 00174000
BXLE R5,R6,OFFSTATU IN THE USER-DEFINED-TABLE. 00175000
CLRREG L R9,ADEVTB RESTORE R9, AND 00176000
OFFSTATR NI STATS(R9),255-WAITP CLEAR ALL PSEUDO-WAIT BITS IN 00177000
BXLE R9,R10,OFFSTATR REGULAR NUCON TABLE. 00178000
L R11,AEXTSECT @VM08901 00178100
USING EXTSECT,R11 @VM08901 00178150
CLI TIMCHAR,0 IS 'BLIP' ON? @VM08901 00178200
BE RETURN IF NOT, DON'T RESET INTERVAL@VM08901 00178250
TM EXTFLAG,REALTIMR REAL TIMER BEING USED? @VM08901 00178300
BZ RETURN IF NOT, NO NEED TO RESET @VM08901 00178350
* @VM08901 00178400
MVC TIMER(4),TIMINIT RESET 2-SEC TIMER INTERVAL @VM08901 00178450
NI EXTFLAG,255-REALTIMR AND REAL TIMR INDICATOR @VM08901 00178500
RETURN EQU * @VM08901 00178550
LR R15,R0 ERROR-CODE (USUALLY 0) INTO R15, 00179000
LM R0,R11,WAITSAVE RESTORE REGISTERS 00180000
BR R14 RETURN TO CALLER. 00181000
SPACE 3 00182000
* DISPLACEMENTS .... 00183000
DEVI EQU 0 DEVICE-ADDRESS IN TABLE 00184000
STATS EQU 2 STATUS HALF WORD IN TABLE 00185000
NAME EQU 4 LOGICAL DEVICE NAME 00186000
INTLOC EQU 8 DEVICE INTERRUPT ROUTINE 00187000
SAVIOLD EQU 12 SAVED IO-OLD-PSW 00188000
SAVCSW EQU 20 SAVED CSW 00189000
* 00190000
WAITP EQU X'80' PSEUDO-WAIT-BIT 00191000
ASAP EQU X'40' INT. TO BE HANDLED AS SOON AS POSSIBLE 00192000
INTR EQU X'20' = INTERRUPT RECEIVED 00193000
INTP EQU X'10' = INTERRUPT-PROCESSED 00194000
* 00195000
* 00196000
* CONSTANTS. . . . . 00197000
DS 0D 00198000
WAITNG DC X'FF060000',A(WAITRTN) WAIT PSW WITH RETURN @VA07921 00199000
* KEEP THE FOLLOWING SEVERAL IN ORDER (USED WITH 'LM') ... 00200000
AIONTABL DC A(IONTABL) R7 (VERY BRIEFLY) 00201000
DC V(DEVICE) R8 00202000
ADEVTB DC A(DEVTAB) R9 FIRST ENTRY IN REGULAR NUCON TABLE 00203000
DC F'16' R10 NUMBER OF BYTES PER ENTRY 00204000
DC A(TABEND-16) R11 LAST ENTRY IN REG. NUCON TABLE 00205000
EJECT 00206000
NUCON 00207000
EXTSECT @VM08901 00207100
REGEQU 00208000
END 00209000