ITE TITLE 'DMSITE (CMS) VM/370 - RELEASE 6' 00001000 SPACE 2 00002000 *. 00003000 * MODULE NAME: 00004000 * 00005000 * DMSITE 00006000 * 00007000 * FUNCTION: 00008000 * 00009000 * TO HANDLE EXTERNAL INTERRUPTS. 00010000 * 00011000 * ATTRIBUTES: 00012000 * 00013000 * NUCLEUS, REENTRANT 00014000 * 00015000 * ENTRY POINT: 00016000 * 00017000 * 1. DMSITE, EXTINT - HANDLE EXTERNAL INTERRUPTS 00018000 * 2. DMSITET, TRAP 00019000 * 00020000 * ENTRY CONDITIONS: 00021000 * 00022000 * THE NEW EXTERNAL PSW CONTAINS THE ADDRESS OF DMSITE 00023000 * 00024000 * EXIT CONDITIONS: 00025000 * 00026000 * RESTORES ALL REGISTERS AND LOADS EXTERNAL OLD PSW 00027000 * 00028000 * CALLS TO OTHER ROUTINES: 00029000 * 00030000 * FREE, FRET, CONWRITE 00031000 * 00032000 * EXTERNAL REFERENCES: 00033000 * 00034000 * IOINT,TYPE, FUS, FREE, FRET, CONWRITE 00035000 * 00036000 * TABLE / WORKAREA: 00037000 * 00038000 * EXISECT 00039000 * 00040000 * REGISTER USAGE: 00041000 * 00042000 * 10-12, 14-1 SCRATCH 00043000 * 2-9 UNUSED 00044000 * 00045000 * OPERATION: 00046000 * 00047000 * DMSITE USES THE WORKAREA EXISECT IN THE NUCLEUS IN 00048000 * ORDER TO MAINTAIN REENTRANCY. 00049000 * 00050000 * AN EXTERNAL INTERRUPTION CAUSES CONTROL TO BE PASSED 00051000 * TO THE EXTERNAL INTERRUPT HANDLER DMSITE. IF THE 00052000 * INTERRUPT WAS CAUSED BY THE TIMER, BLIP IS ON, AND 00053000 * THE CONSOLE IS QUIET, DMSITE RESETS THE TIMER TO A 00054000 * VALUE OF TWO SECONDS, AND TYPES THE BLIP CHARACTER AT 00055000 * THE TERMINAL. THE STANDARD BLIP CHARACTER IS UPPER 00056000 * CASE, FOLLOWED BY LOWER CASE (IT MOVES THE TYPEBALL 00057000 * WITHOUT PRINTING). 00058000 * 00059000 * IF THE INTERRUPT WAS NOT A TIMER INTERRUPT AND 00060000 * EXTERNAL INTERRUPT HANDLING IS NOT WANTED, CONTROL 00061000 * RETURNS TO THE CALLER. IF EXTERNAL INTERRUPT 00062000 * HANDLING IS WANTED, FREE STORAGE IS OBTAINED TO SAVE 00063000 * REGISTERS, THE NEW EXTERNAL PSW IS LOADED. ON 00064000 * RETURN, THE REGISTERS ARE RESTORED AND THE STORAGE 00065000 * AREA RETURNED. IF THE OLD PSW WAS NOT IN WAIT, THE 00066000 * OLD EXTERNAL PSW IS LOADED AND CONTROL RETURNED. IF 00067000 * IT WAS IN WAIT AND THE INTERRUPT CODE WAS NOT AN I/O 00068000 * INTERRUPT, THE RETURN ADDRESS IS SET AS ADDRESS IN 00069000 * EXTERNAL OLD PSW AND CONTROL IS RETURNED TO CALLER. 00070000 * 00071000 *. 00072000 EJECT 00073000 EXTINT START 0 00074000 USING NUCON,R0 00075000 EXTRN IOINT 00076000 ENTRY DMSITE,TRAP,DMSITET P3031 00077000 DMSITE EQU * P3031 00078000 STM R14,R15,0 SAVE R14-R15 IN LOWER CORE, 00079000 BALR R15,0 GET ADDRESSABILITY, 00080000 USING *,R15 00081000 TIMBAS L R14,AEXTSECT REFERENCE EXTSECT 00082000 USING EXTSECT,R14 00083000 CLI EXTOPSW+3,X'80' INTERRUPT-CODE = TIMER ? 00084000 BNE OPINT 00085000 STM R0,R13,EXSAVE SAVE R0 THRU R13, 00086000 MVC EXSAVE+R14*4(8),0 AND R14-R15 ALSO, 00087000 DROP R14 00088000 LR R11,R14 USE R11 FOR SAVE-AREA 00089000 USING EXTSECT,R11 00090000 LR R12,R15 ADDRESSABILITY INTO R12 00091000 DROP R15 ... 00092000 USING TIMBAS,R12 ... 00093000 L R7,TIMER GET TIMER UNITS @VA03368 00094000 LTR R7,R7 IF TIMER NEG? @VA03368 00095000 BM TIMXET YES, THEN CHECK TIMER ADDRESS @VA03368 00096000 MVC TIMINIT(4),TIMER @VA03368 00097000 B HNDLBLIP @VA03368 00098000 TIMXET L R7,STIMEXIT GET ADDR OF STIMER EXIT @VA03368 00099000 LA R7,0(,R7) CLEAR HIGH ORDER BYTE V0206 00100000 LTR R7,R7 IS STIMER EXIT SPECIFIED 00101000 BZ HNDLBLIP NO, GO HANDLE BLIP 00102000 L R8,ASVCSECT @VA06273 00103000 USING SVCSECT,R8 @VA06273 00104000 ICM R8,HIORBYT,OVSTAT SAVE SVCTRACE FLAGS @VA06273 00105000 XC OVSTAT,OVSTAT TURN OFF SVCTRACE IF ON @VA06273 00106000 SR R0,R0 ABSOLUTE ZERO @VA01445 00107000 ST R0,STIMEXIT ZERO OUT STIMER EXIT ADDR @VA01445 00108000 IC R13,DOSFLAGS PRESERVE DOSFLAGS SETTING @V305101 00109000 NI DOSFLAGS,255-DOSSVC RESET DOSSVC FLAG IF 'ON' @V305101 00110000 MVC EXTRET(8),EXTOPSW SAVE EXT OLD PSW @VA07921 00111000 DMSFREE DWORDS=23,TYPCALL=BALR GET USER AREA @VA12917 00111500 STC R13,DOSFLAGS RESTORE DOSFLAGS SETTING @V305101 00112000 USING EXTUAREA,R1 ADDRESS USER AREA @VA07921 00112200 L R15,JR1 PREV USER AREA POINTER @VA07921 00112400 ST R15,PREVUSER STORED IN NEW USER AREA @VA07921 00112600 ST R1,JR1 SAVE NEW USER AREA PTR @VA07921 00112800 LA R13,USERAREA USER SAVEAREA POINTER @VA07921 00113000 MVC GRS(64),EXSAVE SAVE GP REGS @VA09133 00113200 STD F0,4*F0+FRS SAVE FLOATING @VA07921 00113400 STD F2,4*F2+FRS POINT @VA07921 00113600 STD F4,4*F4+FRS REGISTERS @VA07921 00113800 STD F6,4*F6+FRS ALSO @VA07921 00114000 MVC UEXTPSWO(8),EXTRET SAVE EXT OLD PSW @VA07921 00114200 DMSKEY LASTUSER RESTORE USER PSW PROTECT KEY P8118 00115000 LR R15,R7 GET ADDRESS OF USER EXIT ROUTINE P8118 00116000 BALR R14,R15 GO TO STIMER EXIT RTN 00117000 DMSKEY RESET 00118000 SR R13,R13 PREPARE TEST FOR STIMER... @VA09485 00118100 L R13,STIMEXIT WITHIN STIMER @VA09485 00118200 LTR R13,R13 IS THERE ONE? @VA09485 00118300 BNP ST10 NO - SO CONTINUE @VA09485 00118400 MVC TIMINIT,TIMER BETTER PREPARE IN CASE OF WAIT @VA09485 00118500 ST10 EQU * @VA09485 00118600 SLR R13,R13 ZERO REGISTER @VA07921 00119000 IC R13,DOSFLAGS PRESERVE DOSFLAGS SETTING @V305101 00120000 NI DOSFLAGS,255-DOSSVC RESET DOSSVC FLAG IF 'ON' @V305101 00121000 L R1,JR1 USER AREA POINTER @VA07921 00121150 L R15,PREVUSER PREVIOUS USER AREA PTR @VA07921 00121300 ST R15,JR1 RESTORE ANCHOR PTR @VA07921 00121450 MVC EXTRET(8),UEXTPSWO RESTORE EXT OLD PSW @VA07921 00121600 MVC EXSAVE(64),GRS RESTORE GP REGS @VA09133 00121750 LD F0,4*F0+FRS RESTORE @VA07921 00121900 LD F2,4*F2+FRS FLOATING @VA07921 00122050 LD F4,4*F4+FRS POINT @VA07921 00122200 LD F6,4*F6+FRS REGISTERS @VA07921 00122350 DMSFRET DWORDS=23,LOC=(1),TYPCALL=BALR @VA12917 00122500 MVC EXTOPSW(8),EXTRET RESTORE EXT OLD PSW @VA07921 00122650 STC R13,DOSFLAGS RESTORE DOSFLAGS SETTING @V305101 00123000 STCM R8,HIORBYT,OVSTAT RESTORE SVCTRACE FLAG @VA06273 00124000 HNDLBLIP LA R14,NEWAD14 SET R14 AS IF RETURNED FROM 'TYPE' 00125000 TM TIMER,X'80' TIMER GREATER THAN ZERO? @VA09485 00125100 BZ LM010 YES, DO NOT SET TIMER @VA09485 00125200 MVC TIMER,=X'7FFFFF00' SET TIMER TO LARGE NUMBER @VM03203 00126000 LM010 EQU * @VA09485 00126100 TM EXTOPSW+1,X'02' CMS IN 'WAIT' STATE? @VM03203 00127000 BZ NOWAIT NORMAL... @VM03203 00128000 OI EXTFLAG,REALTIMR EXT.INT + WAIT = REAL TIMR @VM03203 00129000 TM OSSFLAGS,OSWAIT SLEEPINT OF OS ECB? @VM03203 00130000 BNO NOWAIT @VA05156 00131000 NI EXTOPSW+1,HEXFD YES, SEE IF POSTED @VM03203 00132000 B LM015 SO DON'T RESET 2-SEC INTERVL@VM03203 00133000 NOWAIT EQU * @VA08246 00133050 USING CMSTAXE,R1 @VA08246 00133100 L R1,TAXEADDR LOAD STAX QUE PTR @VA08246 00133150 LOOP LA R1,0(0,R1) CLEAR HIGH ORDER BYTE @VA08246 00133200 LTR R1,R1 TEST FOR ADDR @VA08246 00133250 BNP GOON IF NOT CONTINUE @VA08246 00133300 TM TAXESTAT,TAXEFREQ HAS THIS EXT BEEN TAKEN @VA08246 00133350 BO RET IF YES THEN IGNORE BLIP @VA08246 00133400 L R1,TAXELNK GET NEXT QUE ELMNT @VA08246 00133450 B LOOP GO SEE IF EXIT WAS TAKEN @VA08246 00133500 DROP R1 @VA08246 00133550 GOON EQU * @VA08246 00133600 NI EXTFLAG,255-REALTIMR TURN OFF REALTIMER FLAG @VM03203 00138000 TM BATFLAGS,BATRUN+BATLOAD IF BATCH IS NOT RUNNING @VM03203 00139000 BZ NOTBAT NOT BATCH MACHINE @VA05121 00140000 BO RET LOADING BATCH, DO NOT TIME @VA05121 00141000 TM BATFLAGS,BATUSEX USER JOB RUNNING @VA08492 00141300 BNO RET YES, GO TO BATCH @VA08492 00141600 L R3,ABATLIMT FIND BATCH LIMIT TABLE V0742 00142000 USING BATLSECT,R3 V0742 00143000 LH R2,BATCPUC GET CURRENT CPU SECS. V0742 00144000 LA R2,2(,R2) 1 BLIP = 2 CPU SECS. V0742 00145000 CH R2,BATCPUL COMPARE IT TO JOB LIMIT V0742 00146000 BL BATOK O.K. IF LOW V0742 00147000 OI BATFLAG2,BATXLIM+BATXCPU OTHERWISE IT'S ALL OVER...V0742 00148000 MVC EXTOPSW+5(3),ABATABND+1 MAKE SURE WE TELL BATCH.. V0742 00149000 NI EXTOPSW+1,X'0F' CLEAR THE KEY FOR BATCH @VA07101 00150000 B RET GO TO BATCH V0742 00151000 BATOK STH R2,BATCPUC UP THE COUNT V0742 00152000 DROP R3 V0742 00153000 B RET RESTORE TWO SECOND INTERVAL @VA04734 00154000 NOTBAT EQU * @VA04734 00155000 CLI TIMCHAR,00 BLIP CHAR(S) = BINARY 00 ? 00156000 BE LM015 IF YES, NO BLIP(S) WANTED FROM NOW ON. 00157000 CLI TIMCHAR,X'FF' BLIP-CHARACTER(S) = X'FF' ? 00158000 BNE LR3 BNE IF NOT. 00159000 MVI TIMCCW+7,2 IF YES, SUBSTITUTE CHARACTERS 00160000 MVC TIMCHAR(2),=X'3606' TO 'JIGGLE' THE PRINT-BALL. 00161000 LR3 CLI NUMPNDWR+1,X'00' ANY PENDING WRITES ? 00162000 BNE RET BNE IF YES, FORGET THE BLIP. 00163000 CLC PENDREAD,=F'0' IS THERE A PENDING READ ? 00164000 BNE RET BR IF YES, FORGET THE BLIP. 00165000 TM TSOFLAGS,TSOATCNL IS CANCELLED READ IN EFFECT 00166000 BO RET YES, DON'T GIVE BLIP 00167000 CLC IONPSW+5(3),=AL3(IOINT) IS USER HANDLING I/O INTERRUPTS 00168000 BNE RET TRF IF YES - DON'T CALL OUR 'TYPE' RTN 00169000 MVC SCAW(12),CSW SAVE OLD CSW AND CAW, 00170000 L R15,=V(DMSCWR) TYPE THE BLIP CHARS 00171000 LA R1,TYPLIST R1 POINTS TO P-LIST 00172000 DROP R12 00173000 BALR R14,R15 CALL 'TYPE' NOW ... 00174000 USING NEWAD14,R14 ... 00175000 NEWAD14 L R11,AEXTSECT RESTORE R11 00176000 MVC CSW(12),SCAW RESTORE CSW AND CAW, 00177000 RET MVC TIMER(4),TIMINIT NOW RESET TIMER FOR 2 SECONDS 00178000 L R7,STIMEXIT GET STIMER ADDR @VA13219 00178200 LA R7,0(R7) @VA13219 00178400 LTR R7,R7 IS THERE ONE? @VA13219 00178600 BNZ LM015 YES - GET OUT CLEAN @VA13219 00178800 MVC TIMINIT(4),=X'000258F6' RESTORE 2 SEC VALUE @VA03368 00179000 LM015 LM R0,R15,EXSAVE 00180000 LPSW EXTOPSW 00181000 DROP R11,R14 00182000 EJECT 00183000 USING TIMBAS,R15 00184000 USING EXTSECT,R14 00185000 OPINT STM R0,R13,EXSAVE1 SAVE R0-R13, 00186000 MVC EXSAVE1+R14*4(8),0 AND R14-R15. 00187000 LR R11,R14 USE R11 FOR SAVE-AREA @VA06196 00188000 DROP R14 00189000 USING EXTSECT,R11 ... 00192000 LR R12,R15 00193000 USING TIMBAS,R12 00194000 DROP R15 00195000 SR R15,R15 CLEAR AN AVAILABLE REGISTER, @VA03313 00196000 TM BATFLAGS,BATRUN IS BATCH RUNNING? @VA10987 00196050 BNO EXINTCK NO, BRANCH @VA10987 00196100 CLC EXTOPSW+2(2),=X'4001' VMCF EXTERNAL INTERRUPT? @VA10987 00196150 BNE NOTWAIT IF NOT BATCH IGNORES IT @VA10987 00196200 CLM R15,14,EXTPSW+5 EXTERNAL INT HANDLING? @VA10987 00196250 BE NOTWAIT NOT ALLOWED, RETURN @VA10987 00196300 EXINTCK EQU * @VA10987 00196350 CLM R15,14,EXTPSW+5 EXT. INT. HANDLING REQUESTED ? @VA03313 00197000 BE OPRET NO - BRANCH. @VA03313 00198000 STH R15,IOOPSW+2 CLEAR INT. CODE IN IO OLD PSW, @VA03313 00199000 MVC EXTRET,EXTOPSW AND SAVE EXTERNAL OLD PSW @VA03313 00200000 LA R0,23 USER AREA LENGTH (DWDS) @VA07921 00201000 DMSFREE DWORDS=(0),TYPE=NUCLEUS,TYPCALL=BALR 00202000 USING EXTUAREA,R1 USER AREA ADDRESSABILITY @VA07921 00202600 L R15,JR1 PREVIOUS USER AREA PTR @VA07921 00203200 ST R15,PREVUSER SAVE IN CURRENT AREA @VA07921 00203800 ST R1,JR1 SAVE CURRENT AREA PTR @VA07921 00204400 MVC GRS(64),EXSAVE1 SAVE GEN REGS P3048 00205000 STD F0,4*F0+FRS AND FLOAT REGS P3048 00206000 STD F2,4*F2+FRS * P3048 00207000 STD F4,4*F4+FRS * P3048 00208000 STD F6,4*F6+FRS * P3048 00209000 MVC UEXTPSWO(8),EXTOPSW SAVE EXTERNAL OLD PSW P3048 00210000 LA R13,USERAREA P3048 00211000 LA R14,RETAD 00212000 L R15,EXTPSW+4 00213000 LPSW EXTPSW 00214000 DROP R12 00215000 USING RETAD,R14 00216000 RETAD EQU * @VA07921 00216300 SSM *+1 DISABLE @VA07921 00216600 L R11,AEXTSECT RESTORE ADDRESSABILITY @VA07921 00216900 LA R0,23 USER AREA LENGTH (DWDS) @VA07921 00217200 L R1,JR1 USER AREA POINTER @VA07921 00217500 L R15,PREVUSER PREVIOUS USER AREA PTR @VA07921 00217800 ST R15,JR1 RESTORE ANCHOR PTR @VA07921 00218100 MVC EXSAVE1(64),GRS RESTORE SAVEAREA @VA07921 00218400 MVC EXTRET(8),UEXTPSWO RESTORE EXT OLD PSW @VA07921 00218700 LD F0,4*F0+FRS RESTORE @VA04317 00219000 LD F2,4*F2+FRS USER'S @VA04317 00220000 LD F4,4*F4+FRS FLOATING-POINT @VA04317 00221000 LD F6,4*F6+FRS REGISTERS @VA04317 00222000 * RETURN THE FREE STORAGE WE USED 00223000 DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR 00224000 BALR R14,R0 00225000 USING *,R14 NEW ADDRESSABILITY AGAIN 00226000 MVC EXTOPSW(8),EXTRET 00227000 TM EXTOPSW+1,X'02' WAS OLD PSW IN WAITSTATE 00228000 BZ NOTWAIT 00229000 SR R15,R15 WAS THERE AN I/O INTERRUPT @VA03313 00230000 CH R15,IOOPSW+2 WHILE WE WERE OCCUPIED ? @VA03313 00231000 BNE KEEPGOIN YES; SKIP @VA04569 00232000 TM OSSFLAGS,OSWAIT WAITING FOR OS ECB? @VA04569 00233000 BZ NOTWAIT NO; SKIP @VA04569 00234000 NI EXTOPSW+1,255-WAIT YES; TURN OFF THE WAIT BIT @VA04569 00235000 NOTWAIT LM R0,R15,EXSAVE1 RESTORE ORIGINAL REGISTERS @VA04569 00236000 LPSW EXTOPSW RETURN WHENCE WE CAME @VA04569 00237000 KEEPGOIN LM R0,R14,EXSAVE1 RESTORE ORIGINAL REGISTERS @VA04569 00238000 L R15,EXTOPSW+4 (GET R15 FROM THE PSW) @VA04569 00239000 BR R15 @VA04569 00240000 SPACE 1 @VA04569 00241000 DROP R14 00242000 USING TIMBAS,R12 00243000 OPRET MVC 0(8,0),SAVEXT 00244000 TM DBGFLAGS,DBGEXEC ARE WE ALREADY IN DEBUG? V0367 00245000 BZ CALLDBG NO, GO CALL DEBUG @VA01159 00246000 MVC 0(8,0),EXTOPSW DO NOT CALL DEBUG AGAIN @VA01159 00247000 B RETURN JUST RETURN VIA EXTOLD PSW @VA01159 00248000 CALLDBG EQU * @VA01159 00249000 L R10,=V(FVS) LOAD FILE SYSTEM WORK AREA ADDRESS 00250000 USING FVSECT,R10 00251000 CLI UFDBUSY,X'02' IS ABNBIT ON? @VA04318 00252000 BNE CHECKAG NO THEN SEE IF IT'S ZERO @VA04318 00253000 MVI UFDBUSY,X'00' @VA04318 00254000 CHECKAG CLI UFDBUSY,X'00' ARE WE UPDATING UFD ? @VA04318 00255000 BNE LM015 YES, LET'S GET BACK... @VM08901 00256000 L R10,=V(DBGSECT) LOAD DEBUG WORK AREA ADDRESS 00257000 USING DBGSECT,R10 00258000 MVC XPSW,EXTOPSW SAVE THE PSW FOR DEBUG 00259000 OI DBGFLAGS,DBGEXINT INDICATE ENTRY FROM EXTERNAL INT. 00260000 RETURN EQU * @VA01159 00261000 LM R0,R15,EXSAVE1 00262000 LPSW 0 00263000 SPACE 00264000 DROP R10,R11,R12 00265000 DS 0F @VA03313 00266000 TRAP EQU * @VA03313 00267000 DMSITET EQU * @VA03313 00268000 USING TRAP,R15 @VA03313 00269000 USING NUCON,R0 ACCESS NUCLEUS AREA CONSTANTS @VA03313 00270000 L R3,AEXTSECT A(EXTERNAL INTERRUPT AREA) @VA03313 00271000 USING EXTSECT,R3 ESTABLISH ACCESS @VA03313 00272000 SR R15,R15 CLEAR REG @VA03313 00273000 DROP R15 (NOT NEEDED ANY MORE ) @VA03313 00274000 MVC EXTPSW+5(3),9(R1) SET UP NEW EXTINT ADDRESS @VA03313 00275000 BR R14 RETURN @VA03313 00276000 HEXFD EQU X'FD' USED FOR POSTING ECB @V305066 00277000 HIORBYT EQU 8 @VA06273 00278000 EJECT 00279000 LTORG 00280000 EJECT 00281000 EXTSECT 00282000 SPACE 2 00283000 BATLIMIT V0742 00284000 EXTUAREA DSECT P3048 00285000 DS 0D P3048 00286000 GRS DS 16F REGS AT TIME OF INTERRUPT P3048 00287000 FRS DS 4D FLOAT REGS AT INTERRUPT P3048 00288000 UEXTPSWO DS 1D EXTERNAL OLD PSW AT INT. P3048 00289000 USERAREA DS 18F USER SAVE AREA P3048 00290000 PREVUSER DS A PTR TO PREVIOUS USER AREA @VA07921 00291250 DS A UNUSED @VA07921 00291500 USAREAND DS 0D END USER AREA @VA07921 00291750 DBGSECT 00292000 TSOBLKS @VA08246 00292100 FVS 00293000 SVCSECT @VA06273 00294000 NUCON 00295000 REGEQU 00296000 EQUATES 00297000 END 00298000