EXT TITLE 'DMTEXT (RSCS) VM/370 - RELEASE 6' 00001000
*. 00002000
* MODULE NAME - 00003000
* 00004000
* DMTEXT 00005000
* 00006000
* FUNCTION - 00007000
* 00008000
* THE DMTEXT MODULE IS THE MSUP EXTERNAL INTERRUPT 00009000
* HANDLER. DMTEXT RECEIVES CONTROL DIRECTLY ON AN 00010000
* EXTERNAL INTERRUPT AND SAVES THE STATUS OF THE 00011000
* EXECUTING TASK IF ONE WAS INTERRUPTED. 00012000
* 00013000
* ATTRIBUTES - 00014000
* 00015000
* REUSABLE, EXECUTABLE DISABLED ONLY 00016000
* 00017000
* ENTRY POINTS - 00018000
* 00019000
* DMTEXT - DIRECTLY ON EXTERNAL INTERRUPT 00020000
* 00021000
* 00022000
* ENTRY CONDITIONS - 00023000
* 00024000
* MAY BE ENTERED AT ANY TIME THE EXTERNAL INTERRUPT 00025000
* MASK IS ON. THE EXTERNAL INTERRUPT CODE IS STORED 00026000
* IN THE EXTERNAL OLD PSW ON ENTRY. 00027000
* 00028000
* 00029000
* EXIT CONDITIONS - 00030000
* 00031000
* NORMAL - 00032000
* 00033000
* ON EXIT TO AN ASYNCHRONOUS EXIT ROUTINE, 00034000
* GPR13 = ADDR OF TASK ELEMENT FOR ASYN EXIT'S TASK 00035000
* GPR14 = RETURN ADDR TO DMTEXT 00036000
* GPR15 = ADDR OF ENTRY TO ASYN EXIT ROUTINE 00037000
* 00038000
* ERROR - 00039000
* 00040000
* NONE (NO ERROR CONDITIONS POSSIBLE) 00041000
EJECT 00042000
* 00043000
* CALLS TO OTHER ROUTINES - 00044000
* 00045000
* DMTDSP - TO RESUME DISPATCHED PROCESSING 00046000
* 00047000
* 00048000
* EXTERNAL REFERENCES - 00049000
* 00050000
* NONE 00051000
* 00052000
* 00053000
* TABLES / WORKAREAS - 00054000
* 00055000
* TAREA - INTERRUPTED TASK'S SAVE AREA, TO SAVE STATUS 00056000
* TASKE - TASK ELEMENT, TO LOCATE TAREA 00057000
* ASYNE - EXTERNAL ASYNCH EXIT ELEMENT, TO LOCATE EXITS 00058000
* 00059000
* 00060000
* 00061000
* REGISTER USAGE - 00062000
* 00063000
* R1 - ASYNCHRONOUS EXIT ELEMENT 00063500
* R2 - PREVIOUS ASYNCHRONOUS EXIT ELEMENT IN CHAIN 00064000
* R4 - NEXT ASYNCHRONOUS EXIT ELEMENT IN CHAIN 00064500
* R5 - LINK REG 00065000
* R9 - LINKTABL FOR TASK TAKING ASYNCH INTERRUPT 00065500
* GPR15 = DMTEXT BASE REGISTER 00067000
* 00068000
* NOTES - 00069000
* 00070000
* NONE 00071000
* 00072000
* OPERATION - 00073000
* 00074000
* 00075000
* IF A TASK WAS EXECUTING AT THE TIME OF THE INTERRUPT, IT IS 00075200
* SUSPENDED. IF THERE HAVE BEEN NO REQUESTS FOR 00075400
* EXTERNAL INTERRUPT ASYNCHRONOUS EXITS, EXIT IS MADE TO 00075600
* THE DISPATCHER. IF THERE HAVE BEEN REQUESTS MADE, THE 00075800
* EXTERNAL INTERRUPT CODE IS EXAMINED. ONLY THE FOLLOWING 00076000
* INTERRUPT CODES ARE SERVICED, ALL OTHERS RESULT IN AN 00076200
* IMMEDIATE EXIT TO THE DISPATCHER: 00076400
* 00076600
* X'1004' - CLOCK COMPARATOR 00076800
* 00077000
* THE QUEUE IS SCANNED TO FIND THE ASYNCHRONOUS QUEUE 00077200
* ELEMENT WHICH CORRESPONDS TO THIS INTERRUPT. 00077400
* 00077600
* FOR CLOCK COMPARATOR INTERRUPTS, THE FIRST ELEMENT SHOULD 00077800
* SATISFY THE SEARCH, SINCE THEY ARE QUEUED IN ASSENDING ORDER 00078000
* WITH THE FIRST ELEMENT BEING THE ACTIVE ONE. 00078200
* THE QUEUE ELEMENT IS DEQUEUED AND RETURNED TO THE POOL. 00078400
* IF THERE IS ANOTHER CLOCK COMPARATOR QUEUE ELEMENT BEHIND 00078600
* IT, IT IS MADE THE ACTIVE ELEMENT AND THE CLOCK COMPARATOR 00078800
* IS SET FOR ITS VALUE; IF THERE ARE NO MORE CLOCK COMPARATOR 00079000
* REQUESTS BEHIND IT, THE CLOCK COMPARATOR IS SET FOR ALL 00079200
* HEX F'S. IN EITHER CASE, THEREAFTER THE USER TASK EXIT 00079400
* IS TAKEN 00079600
* 00079800
* AFTER THE EXIT HAS BEEN TAKEN, RETURN IS MADE TO 00080000
* THE DISPATCHER 00080200
* 00084000
*. 00085000
EJECT 00086000
DMTEXT CSECT 00087000
SPACE 00088000
* EXTERNAL INTERRUPT ENTRY POINT 00089000
SPACE 00090000
USING SVECTORS,0 GET SVECTORS ADDRESSABILITY 00091000
STM R14,R15,SSAVE SAVE WORK REGS TEMPORARILY 00092000
L R15,NEWEXT+4 GET ADDRESS OF ENTRY POINT 00093000
USING DMTEXT,R15 DEFINE ADDRESSING FOR EXTERNAL HANDL 00094000
USING TASKE,R14 GET TASK ELEMENT ADDRESSABILITY 00095000
CLI ACTIVE,X'00' WAS THE DISPATCHER WAITING? 00096000
BE EXTNOSAV DON'T BOTHER TO SAVE REGISTERS IF IT WAS 00097000
SPACE 00098000
L R14,ACTIVE REG 14 = ADDR OF ELEMENT FOR INTERRUPTED TASK 00099000
L R14,TASKSAVE REG.14 = ADDR OF THAT TASK'S SAVE AREA 00100000
DROP R14 00101000
USING TAREA,R14 DEFINE TASK SAVE AREA DSECT ADDRESSA 00102000
SPACE 00103000
MVC TPSW(8),OLDEXT MOVE RESUME PSW TO TASK'S SAVE AREA 00104000
STM R0,R13,TGREG0 SAVE THE INTERRUPTED TASK'S REGISTERS 00105000
MVC TGREG14(8),SSAVE AND MOVE IN SAVED REGS 14 & 15 00106000
MVI ACTIVE,X'00' INDICATE NOT RUNNING DISPATCHED 00107000
SPACE 00108000
DROP R14 00109000
EJECT 00110000
EXTNOSAV EQU * 00111000
USING ASYNE,R1 @VA03349 00112000
LH R0,OLDEXT+2 GET INTERRUPT CODE @VA03349 00112400
CH R0,=X'1004' IS THIS A CLOCK COMPARATOR @VA03349 00112800
BE SRCHQ YES, GO SEARCH THE QUEUE @VA03349 00113200
B EXTGO NOT CC OR RSI, FORGET IT @VA03349 00113600
SRCHQ LA R1,EXTQ-(ASYNNEXT-ASYNE) INITIALIZE ELEM PTR @VA03349 00114000
LOOKNEXT LR R2,R1 SAVE PREV ELEM PTR @VA03349 00114400
ICM R1,B'1111',ASYNNEXT GET ADDR OF NEXT ELEM @VA03349 00114800
BZ CHKTYPE NO MORE ELEMS, DONE @VA03349 00115200
CH R0,ASYNCODE IS THIS ELEM FOR SAME CODE @VA03349 00115600
BNE LOOKNEXT NOPE, GO LOOK AT THE NEXT ONE @VA03349 00116000
BAL R5,SCANLINK GO FIND THE LINKTABL @VA03349 00116400
USING LINKTABL,R9 @VA03349 00116800
MVC LNKCLOCK(8),FFS UNSTAMP LINKTAB @VA03349 00117200
L R13,ASYNTASK PASS TASKE IN R13 @VA03349 00117600
L R3,ASYNEXIT SAVE EXIT ADDRESS @VA03349 00118000
L R4,ASYNNEXT GET PTR TO NEXT (OR ZERO) @VA03349 00118400
ST R4,ASYNNEXT-ASYNE(R2) AND PLACE IN PREV ELEM @VA03349 00118800
L R15,QREQ ELEM UNCHAINED, NOW RETURN IT @VA03349 00119200
BALR R14,R15 ... @VA03349 00119600
L R15,NEWEXT+4 RESTORE BASE REG QUICK LIKE @VA03349 00120000
LTR R1,R4 WAS THERE A NEXT? @VA03349 00120400
BZ SETHI NO, QUEUE EMPTY, GO SET HI VALUE @VA03349 00120800
CLC ASYNCODE(2),=X'1004' IS NEXT A CLOCK COMPARATOR @VA03349 00121200
BNE SETHI NOPE, USE HI VALUE @VA03349 00121600
BAL R5,SCANLINK GO GET THE LINKTABLE @VA03349 00122000
SCKC LNKCLOCK SET THE CLOCK @VA03349 00122400
TAKEXIT LR R15,R3 EXIT ADDR IN R15 @VA03349 00122800
EXITNOW BALR R14,R15 TAKE THE EXIT @VA03349 00123200
L R15,DISPATCH NOW RETURN TO DISPATCHER @VA03349 00123600
BALR R14,R15 ... @VA03349 00124000
SPACE 00124400
SETHI SCKC FFS SET CLOCK COMPARATOR TO FFS @VA03349 00124800
B TAKEXIT AND TAKE THE EXIT @VA03349 00125200
SPACE 00125600
SCANLINK L R8,ASYNTASK GET TASK ELEMENT ADDRESS @VA03349 00126000
L R8,TASKNAME-TASKE(R8) GET TASK NAME @VA03349 00126400
L R9,TLINKS GET LINKTABLE ANCHOR @VA03349 00126800
L R10,0(R9) GET NUMBER OF ENTRIES @VA03349 00127200
LA R9,8(R9) BUMP TO FIRST ENTRY @VA03349 00127600
CHKNEXT TM LFLAG,LACTIVE IS THIS AN ACTIVE LINK? @VA03349 00128000
BZ BUMPNEXT NOPE, THEN SKIP IT, BR. @VA03349 00128400
CL R8,LACTTNME SAME TASK NAME? @VA03349 00128800
BER R5 YES, LINKTABL ENTRY FOUND, RETURN@VA03349 00129200
BUMPNEXT LA R9,LINKLEN(R9) BUMP TO NEXT ENTRY @VA03349 00129600
BCT R10,CHKNEXT AND KEEP LOOKING @VA03349 00130000
DC H'0' THATS THE END OF THE ROAD. @VA03349 00130400
SPACE 00130800
CHKTYPE CH R0,=X'1004' IS THIS A CLOCK COMPARATOR? @VA03349 00131200
BNE EXTGO NOPE, ALL SET @VA03349 00131600
SCKC FFS YES, THEN PREVENT RECURRANCE @VA03349 00132000
SPACE 00139000
EXTGO EQU * 00140000
L R15,DISPATCH REG.15 = ADDRESS OF DISPATCHER ENTRY POINT 00141000
BALR R14,R15 GO TRY TO RUN SOME TASK 00142000
DS 0D @VA03349 00142100
FFS DC 8X'FF' @VA03349 00142200
SPACE 00143000
EJECT 00145000
COPY RSSEQU 00146000
COPY SVECTORS 00148000
COPY TAREA 00150000
COPY TASKE 00152000
COPY ASYNE 00154000
COPY LINKTABL @VA03349 00154500
END 00155000