STK TITLE 'DMKSTK (CP) VM/370 - RELEASE 6' 00001000 *. 00002000 * MODULE NAME - 00003000 * 00004000 * DMKSTK 00005000 * 00006000 * FUNCTION - 00007000 * 00008000 * TO STACK FOR PROCESSING CPEXBLOKS, IOBLOKS, AND 00009000 * DEFERRED EXECUTION BLOKS 00010000 * 00011000 * ATTRIBUTES - 00012000 * 00013000 * REENTRANT, RESIDENT, CALLED VIA BALR 00014000 * 00015000 * ENTRY POINTS - 00016000 * 00017000 * DMKSTKCP - STACK A CPEXBLOK 00018000 * DMKSTKIO - STACK AN IOBLOK 00019000 * DMKSTKDE - STACK A DEFERRED EXECUTION BLOK 00020000 * DMKSTKMP - STACK A CPEXBLOK FOR CURRENT PROCESSOR ONLY 00021000 * DMKSTKOP - STACK A CPEXBLOK FOR OTHER PROCESSOR ONLY 00022000 * DMKSTKSW - STACK A PRIORITY CPEXBLOK FOR OTHER PROCESSOR 00023000 * DMKSTKLF - STACK A CPEXBLOK LIFO FOR SPECIFIC PROCESSOR 00024000 * 00026000 * ENTRY CONDITIONS - 00027000 * 00028000 * GENERAL - 00029000 * GPR14 = RETURN ADDRESS 00030000 * GPR15 = ADDRESS OF ENTRY POINT 00031000 * 00032000 * FOR DMKSTKCP, DMKSTKMP, DMKSTKOP, DMKSTKSW, DMKSTKLF - 00033000 * GPR1 = ADDRESS OF CPEXBLOK TO BE STACKED 00034000 * 00035000 * FOR DMKSTKDE - 00036000 * GPR1 = ADDRESS OF DEFERRED EXECUTION BLOK TO BE STACKED 00037000 * 00038000 * FOR DMKSTKIO - 00039000 * GPR10 = ADDRESS OF IOBLOK TO BE STACKED 00040000 * 00041000 * FOR DMKSTKLF - 00042000 * THE CPEXBLOK WILL ALREADY CONTAIN THE 00043000 * LOGICAL PROCESSOR ADDRESS 00044000 * 00045000 * EXIT CONDITIONS - 00046000 * 00047000 * NONE 00048000 * 00049000 * CALLS TO OTHER ROUTINES - 00050000 * 00051000 * DMKLOK 00052000 * 00053000 * EXTERNAL REFERENCES - 00054000 * 00055000 * DMKDSPRQ - ANCHOR FOR REQUEST STACKS IN DMKDSPCH 00056000 * SWTHSAVE - PSA SAVEAREA FOR DMKSTK 00057000 * 00058000 * MACROS - 00059000 * 00060000 * LOCK OBTAIN,TYPE=DS,SPIN=YES 00061000 * 00062000 * LOCK RELEASE,TYPE=DS 00063000 * 00064000 * ABEND CODES - 00065000 * STK01 - COUNTER HAS OVERFLOWED 00066000 * 00067000 * TABLES / WORKAREAS - 00068000 * 00069000 * NONE 00070000 * 00071000 * REGISTER USAGE - 00072000 * 00073000 * GPR1 = LOCKWORD ADDRESS 00074000 * GPR2 = ADDRESS OF BLOK TO BE QUEUED 00075000 * GPR3 = QUEUE ANCHOR ADDRESS 00076000 * GPR4 = INTERFACE INDICATOR 00077000 * ¬0 - ADDRESS OF HALFWORD COUNTER TO BE UPDATED 00078000 * 0 - TURN ON VMDEFSTK IN VMPEND 00079000 * GPR5 = INDEX REGISTER 00080000 * GPR11 = VMBLOK ADDRESS 00081000 * GPR12 = BASE REGISTER 00082000 * 00083000 * 00084000 * NOTES - 00085000 * 00086000 * ALTHOUGH THIS IS A BALR LINKAGE ROUTINE, BALRSAVE IS NOT 00087000 * CHANGED; THERFORE, IT MAY BE CALLED BY ANOTHER BALR ROUTINE 00088000 * GENERAL REGISTERS ARE SAVED IN SPECIAL SAVEAREA IN PSA 00089000 * 00090000 * OPERATION - 00091000 * 00092000 * EACH SPECIFIC ENTRY POINT EXCEPT DMKSTKLF - 00093000 * 00094000 * 1. SAVE REGISTERS IN PREDEFINED AREA IN PSA. 00095000 * 2. ESTABLISH MODULE ADDRESSABILITY. 00096000 * 3. SAVE ADDRESS OF BLOK TO BE STACKED IN REGISTER 2 00097000 * 4. PUT ADDRESS OF STACK ANCHORS IN REGISTER 3. 00098000 * 5. SET UP ANY SPECIAL INTERFACE FOR COMMON ROUTINE. 00099000 * DMKSTKDE WILL SET INDICATOR FOR TURNING ON 00100000 * VMDEFSTK IN VMPEND. 00101000 * DMKSTKCP, DMKSTKIO, DMKSTKMP, DMKSTKOP WILL SET 00102000 * INDICATOR FOR UPDATING VMSTKCNT. 00103000 * DMKSTKSW WILL SET INDICATOR 00104000 * FOR UPDATING VMPRRCT. 00105000 * 6. SET UP INDICATORS IN CPEXBLOK FOR TYPE OF REQUEST 00106000 * DMKSTKDE - TURN ON CPEXDEFR IN CPEXTYPE 00107000 * DMKSTKSW - TURN ON CPEXPRIO IN CPEXTYPE AND 00108000 * SET CPEXPROC TO LPUADDRX 00109000 * DMKSTKMP - SET CPEXPROC TO LPUADDR 00110000 * DMKSTKOP - SET CPEXPROC TO LPUADDRX 00111000 * 7. BRANCH TO COMMON ROUTINE. 00112000 * 00113000 * COMMON ROUTINE - 00114000 * 00115000 * 1. OBTAIN LOCK FOR DISPATCHER QUEUES. 00116000 * 2. THE LAST BLOK ON THE APPROPRIATE CHAIN IS LOCATED 00117000 * 3. THE BLOK TO BE STACKED IS CHAINED TO IT 00118000 * 4. THE FORWARD AND BACKWARD CHAIN POINTERS IN THE NEW LAST 00119000 * BLOK ARE UPDATED 00120000 * 5. PERFORM SPECIAL INTERFACE FUNCTION. 00121000 * 6. RELEASE LOCK FOR DISPATCHER QUEUES. 00122000 * 7. RESTORE REGISTERS. 00123000 * 8. RETURN TO CALLER. 00124000 * 00125000 * DMKSTKLF ENTRY POINT - 00126000 * 00127000 * 1. SAVE REGISTERS IN PREDEFINED AREA IN PSA. 00128000 * 2. ESTABLISH MODULE ADDRESSABILITY. 00129000 * 3. SAVE ADDRESS OF BLOK TO BE STACKED IN REGISTER 2. 00130000 * 4. PUT ADDRESS OF LOCKWORD IN REGISTER 1. 00131000 * 5. OBTAIN LOCK FOR DISPATCHER QUEUES. 00132000 * 6. PUT BLOK LIFO ON QUEUE. 00133000 * 7. UPDATE COUNTER OF PRIORITY CPEXBLOKS STACKED FOR 00134000 * PROCESSOR DEPENDENT QUEUES - VMPRRCT. 00135000 * 8. RELEASE LOCK FOR DISPATCHER QUEUES. 00136000 * 9. RESTORE REGISTERS. 00137000 * 10. RETURN TO CALLER. 00138000 *. 00139000 EJECT 00140000 COPY OPTIONS @V407510 00141000 COPY LOCAL OPTIONS @V407510 00142000 EJECT 00143000 DMKSTK CSECT @V407510 00144000 SPACE 3 @V407510 00145000 ENTRY DMKSTKCP @V407510 00146000 ENTRY DMKSTKIO @V407510 00147000 ENTRY DMKSTKDE @V407510 00148000 ENTRY DMKSTKMP @V407510 00149000 ENTRY DMKSTKOP @V407510 00150000 ENTRY DMKSTKSW @V4M0141 00150500 ENTRY DMKSTKLF @V407510 00151000 SPACE 1 @V407510 00152000 EXTRN DMKDSPRQ @V407510 00153000 AIF (NOT &AP).NOAP1 @VA10805 00153010 EXTRN DMKLOKSY @VA09257 00153050 .NOAP1 ANOP 00153060 SPACE 3 @V407510 00154000 USING PSA,0 @V407510 00155000 USING CPEXBLOK,R2 @V407510 00156000 USING VMBLOK,R11 @V407510 00157000 EJECT 00158000 DMKSTKCP DS 0H STACK NORMAL CPEXBLOK @V407510 00159000 STM R0,R15,SWTHSAVE SAVE REGISTERS IN PSA @V407510 00160000 LR R12,R15 SET UP COMMON BASE REGISTER @V407510 00161000 USING DMKSTK,R12 SET UP COMMON ADDRESSABILITY @V407510 00162000 LR R2,R1 SAVE ADDR OF BLOK TO BE STACKED @V407510 00163000 SR R5,R5 INDEX 0 FOR CPEXBLOK QUEUE @V407510 00164000 L R11,CPEXR11 GET VMBLOK ADDRESS @V407510 00165000 LA R4,VMSTKCNT SET UP SPECIAL INTERFACE @V407510 00166000 * INDICATOR @V407510 00167000 XC CPEXMISC,CPEXMISC CLEAR CPEXMISC FELD @V407510 00168000 LA R9,EXIT2 SET EXIT ADDRESS @VA09257 00168100 B COMMON GO TO COMMON PROCESSING @V407510 00169000 DMKSTKIO DS 0H STACK NORMAL IOBLOK @V407510 00170000 USING *,R15 @V407510 00171000 STM R0,R15,SWTHSAVE SAVE REGISTERS IN PSA @V407510 00172000 L R12,STKBASE SET UP COMMON BASE REGISTER @V407510 00173000 DROP R15 DELETE TEMPORARY BASE @V407510 00174000 USING DMKSTK,R12 SET UP COMMON ADDRESSABILITY @V407510 00175000 LR R2,R10 SAVE ADDR OF BLOK TO BE STACKED @V407510 00176000 LA R5,IOBFPNT-IOBLOK INDEX 8 FOR IOBLOK QUEUE @V407510 00177000 L R11,IOBUSER-IOBLOK(R2) GET VMBLOK ADDRESS @V407510 00178000 LA R4,VMSTKCNT SET UP SPECIAL INTERFACE @V407510 00179000 * INDICATOR @V407510 00180000 LA R9,EXIO SET EXT ADR EXIO @VA09257 00180100 B COMMON GO TO COMMON PROCESSING @V407510 00181000 DMKSTKDE DS 0H STACK DEFERRED EXECUTION BLOK @V407510 00182000 USING *,R15 @V407510 00183000 STM R0,R15,SWTHSAVE SAVE REGISTERS IN PSA @V407510 00184000 L R12,STKBASE SET UP COMMON BASE REGISTER @V407510 00185000 DROP R15 DELETE TEMPORARY BASE @V407510 00186000 USING DMKSTK,R12 SET UP COMMON ADDRESSABILITY @V407510 00187000 LR R2,R1 SAVE ADDR OF BLOK TO BE STACKED @V407510 00188000 SR R5,R5 INDEX 0 FOR CPEXBLOK QUEUE @V407510 00189000 SR R4,R4 SET UP SPECIAL INTERFACE @V407510 00190000 * INDICATOR @V407510 00191000 XC CPEXMISC,CPEXMISC CLEAR CPEXMISC FELD @V407510 00192000 OI CPEXTYPE,CPEXDEFR SET UP TYPE OF CPEXBLOK @V407510 00193000 L R11,CPEXR11 GET VMBLOK ADDRESS @V407510 00194000 LA R9,EXIT2 SET EXIT ADDR @VA09257 00194100 B COMMON GO TO COMMON PROCESSING @V407510 00195000 DMKSTKMP DS 0H STACK CPEXBLOK FOR CURRENT PROCESSOR @V407510 00196000 USING *,R15 @V407510 00197000 STM R0,R15,SWTHSAVE SAVE REGISTERS IN PSA @V407510 00198000 L R12,STKBASE SET UP COMMON BASE REGISTER @V407510 00199000 DROP R15 DELETE TEMPORARY BASE @V407510 00200000 USING DMKSTK,R12 SET UP COMMON ADDRESSABILITY @V407510 00201000 LR R2,R1 SAVE ADDR OF BLOK TO BE STACKED @V407510 00202000 SR R5,R5 INDEX 0 FOR CPEXBLOK QUEUE @V407510 00203000 L R11,CPEXR11 GET VMBLOK ADDRESS @V407510 00204000 LA R4,VMSTKCNT SET UP SPECIAL INTERFACE @V4M0141 00205100 * INDICATOR @V407510 00206000 XC CPEXMISC,CPEXMISC CLEAR CPEXMISC FELD @V407510 00207000 MVC CPEXPROC,LPUADDR SET UP CURRENT PROCESSOR @V407510 00209000 * ADDRESS @V407510 00210000 LA R9,EXIT2 SET EXIT ADDR EXIT2 @VA09257 00210100 B COMMON GO TO COMMON PROCESSING @V407510 00211000 DMKSTKOP DS 0H STACK CPEXBLOK FOR OTHER PROCESSOR @V407510 00212000 USING *,R15 @V407510 00213000 STM R0,R15,SWTHSAVE SAVE REGISTERS IN PSA @V407510 00214000 L R12,STKBASE SET UP COMMON BASE REGISTER @V407510 00215000 DROP R15 DELETE TEMPORARY BASE @V407510 00216000 USING DMKSTK,R12 SET UP COMMON ADDRESSABILITY @V407510 00217000 LR R2,R1 SAVE ADDR OF BLOK TO BE STACKED @V407510 00218000 SR R5,R5 INDEX 0 FOR CPEXBLOK QUEUE @V407510 00219000 L R11,CPEXR11 GET VMBLOK ADDRESS @V407510 00220000 LA R4,VMSTKCNT SET UP SPECIAL INTERFACE @V4M0141 00221100 * INDICATOR @V407510 00222000 XC CPEXMISC,CPEXMISC CLEAR CPEXMISC FELD @V407510 00223000 MVC CPEXPROC,LPUADDRX SET UP OTHER PROCESSOR @V407510 00225000 * ADDRESS @V4M0141 00225100 LA R9,ALERTX SET EXIT ADDR @VA09257 00225150 B COMMON GO TO COMMON PROCESSING @V4M0141 00225200 DMKSTKSW DS 0H STACK CPEXBLOK FOR OTHER PROCESSOR @V4M0141 00225300 USING *,R15 @V4M0141 00225400 STM R0,R15,SWTHSAVE SAVE REGISTERS IN PSA @V4M0141 00225500 L R12,STKBASE SET UP COMMON BASE REGISTER @V4M0141 00225600 DROP R15 DELETE TEMPORARY BASE @V4M0141 00225700 USING DMKSTK,R12 SET UP COMMON ADDRESSABILITY @V4M0141 00225800 LR R2,R1 SAVE ADDR OF BLOK TO BE STACKED @V4M0141 00225900 SR R5,R5 INDEX 0 FOR CPEXBLOK QUEUE @V4M0141 00226000 L R11,CPEXR11 GET VMBLOK ADDRESS @V4M0141 00226100 LA R4,VMPRRCT SET UP SPECIAL INTERFACE @V4M0141 00226200 * INDICATOR @V4M0141 00226300 XC CPEXMISC,CPEXMISC CLEAR CPEXMISC FELD @V4M0141 00226400 OI CPEXTYPE,CPEXPRIO INDICATE PRIORITY BLOK @V4M0141 00226500 MVC CPEXPROC,LPUADDRX SET UP OTHER PROCESSOR @V4M0141 00226600 * ADDRESS @V4M0141 00226700 LA R9,EXSW SET EXT ADR EXSW OR PVALERT @VA09257 00226750 * JOIN COMMON PROCESSING @V4M0141 00226800 COMMON DS 0H COMMON PROCESSING FOR STACKING @V407510 00228000 * BLOK AT END OF STACK @V407510 00229000 LOCK OBTAIN,TYPE=DS,SPIN=YES GET LOCK FOR @V407510 00230000 L R3,=V(DMKDSPRQ) ADDRESS OF ANCHOR @V407510 00231000 ST R3,FPNT(R5,R2) FORWARD CHAIN NEW BLOK @V407510 00232000 L R6,BPNT(R5,R3) GET LAST ENTRY IN LIST @V407510 00233000 ST R6,BPNT(R5,R2) SAVE ADDRESS IN BACKCHAIN @V407510 00234000 ST R2,FPNT(R5,R6) FORWARD CHAIN FROM LAST @V407510 00235000 ST R2,BPNT(R5,R3) SAVE ADDRESS OF NEW LAST @V407510 00236000 LTR R4,R4 COUNTER TO UPDATED? @V407510 00237000 BNZ STKUPDCT YES, BRANCH- NOT DMKSTKDE @V407510 00238000 OI VMPEND,VMDEFSTK INDICATE DEFERRED EXECUTION @V407510 00239000 * BLOK STACKED @V407510 00240000 B STKEXIT JOIN COMMON EXIT CODE @V407510 00241000 DMKSTKLF DS 0H STACK CPEXBLOK LIFO FOR SPECIFIC PROCESSOR @V407510 00242000 USING *,R15 @V407510 00243000 STM R0,R15,SWTHSAVE SAVE REGISTERS IN PSA @V407510 00244000 L R12,STKBASE SET UP COMMON BASE REGISTER @V407510 00245000 DROP R15 DELETE TEMPORARY BASE @V407510 00246000 USING DMKSTK,R12 SET UP COMMON ADDRESSABILITY @V407510 00247000 LR R2,R1 SAVE ADDR OF BLOK TO BE STACKED @V407510 00248000 LA R9,EXIT2 SET EXIT ADDR @VA09257 00248010 LOCK OBTAIN,TYPE=DS,SPIN=YES GET DS LOCK @V4M0110 00248100 L R3,=V(DMKDSPRQ) ADDRESS OF LIST ANCHOR @V407510 00249000 L R6,FPNT(R3) GET @ FIRST ELEMENT @V407510 00250000 ST R6,FPNT(R2) NEW POINTS FORWARD TO OLD FIRST @V407510 00251000 ST R2,BPNT(R6) OLD FIRST POINTS BACKWARD TO NEW @V407510 00252000 ST R3,BPNT(R2) NEW FIRST POINTS BACK TO QUEUE 00253000 ST R2,FPNT(R3) QUEUE POINTS TO NEW AS FIRST @V407510 00254000 MVI CPEXTYPE,CPEXPRIO SET UP TYPE OF CPEXBLOK @V4M0141 00255100 L R11,CPEXR11 GET VMBLOK ADDRESS @V407510 00256000 LA R4,VMPRRCT UPDATE PRIORITY BLOK COUNT @V4M0141 00257100 STKUPDCT DS 0H UPDATE COUNTER @V407510 00258000 LH R6,0(R4) GET COUNTER IN WORK REG @V407510 00259000 A R6,F1 ADD ONE TO COUNT @VA07392 00260100 LTR R6,R6 TEST FOR OVERFLOW @V407510 00261000 BM STKAB1 YES, ABEND STK01 @V407510 00262000 STH R6,0(R4) STORE UPDATED COUNTER @V407510 00263000 STKEXIT DS 0H RELEASE LOCK FOR QUEUES & EXIT @V407510 00264000 LOCK RELEASE,TYPE=DS @V407510 00265000 AIF (NOT &AP).NOAP2 @VA10805 00265010 SPACE 1 00265100 TM APSTAT1,APUOPER RUNNING AS AP @VA09257 00265110 BZ EXIT2 NO @VA09257 00265120 BR R9 CONTINUE/EXIT @VA09257 00265130 .NOAP2 ANOP 00265135 SPACE 1 00265140 EXSW DS 0H AP MODE DMKSTKSW PROCESSING @VA09257 00265150 AIF (NOT &AP).NOAP3 @VA10805 00265155 L R15,PREFIXB ACCESS OTHER PSA @VA09257 00265160 B SIGDSP ISSUE DISPATCH SIGNAL @VA09257 00265170 SPACE 1 00265180 .NOAP3 ANOP 00265185 EXIO DS 0H DMKSTKIO AP MODE PROCESSING @VA09257 00265190 AIF (NOT &AP).NOAP4 @VA10805 00265195 L R15,=A(DMKLOKSY) SUPERVISOR LOCK @VA09257 00265200 SR R3,R3 CLEAR REGISTER FOR COMPARE @VA09257 00265210 C R3,0(R15) IS IT FREE @VA09257 00265220 BNE EXIT2 NO,BYPASS SIGNAL @VA09257 00265230 L R15,PREFIXB ACCESS OTHER PSA @VA09257 00265240 CLI CPSTATUS-PSA(R15),CPWAIT WAIT STATE NOW @VA09257 00265250 BNE CKR11 NO @VA09257 00265260 SIGNAL WAKEUP YES, FIRE HIM UP NOW @VA09257 00265270 B EXIT2 @VA09257 00265280 CKR11 DS 0H @VA09257 00265290 L R3,IOBUSER-IOBLOK(R2) GET R11 FOR UNSTACK @VA09257 00265300 CLC VMLOCK-VMBLOK(2,R3),LPUADDRX LOCKED BY OTHER @VA09257 00265310 BNE EXIT2 @VA09257 00265320 SIGDSP DS 0H @VA09257 00265330 TM XCPEND-PSA(R15),XCDISP DISPATCH PEND. @VA09257 00265340 BO EXIT2 YES, DON'T BOTHER @VA09257 00265350 SIGNAL DISPATCH NO, ISSUE SIGNAL @VA09257 00265360 SPACE 1 00265370 B EXIT2 AND GOODBYE @VA09257 00265380 .NOAP4 ANOP 00265385 ALERTX DS 0H @VA09257 00265390 AIF (NOT &AP).NOAP5 @VA10805 00265395 L R15,PREFIXB OTHER PROCESSOR STATUS @VA09257 00265400 CLI CPSTATUS-PSA(R15),CPWAIT @VA09257 00265410 BNE CKDISP NOT IDLE - CONT TEST @VA09257 00265420 SIGNAL WAKEUP IDLE - TELL HIM THERE'S WORK TO @VA09257 00265430 * DO 00265440 B EXIT2 AND GOODBYE @VA09257 00265450 CKDISP TM XCPEND-PSA(R15),XCDISP EXTINT DSP PEND.? @VA09257 00265460 BO EXIT2 YES - SIGP REDUNDANT @VA09257 00265470 CLI CPSTATUS-PSA(R15),CPRUN RUNNING USER? @VA09257 00265480 BNE EXIT2 YES - DON'T INT CP @VA09257 00265490 SIGNAL DISPATCH CP WORK HAS PRIORITY 1 @VA09257 00265500 B EXIT2 AND GOODBYE @VA09257 00265510 .NOAP5 ANOP 00265515 EXIT2 DS 0H @VA09257 00265520 LM R0,R15,SWTHSAVE RESTORE REGISTERS @V407510 00266000 BR R14 RETURN TO CALLER @V407510 00267000 STKAB1 DS 0H @V407510 00268000 ABEND 01 COUNTER HAS OVERFLOWED- ABEND @V407510 00269000 EJECT 00270000 * EQUATES @V407510 00271000 STKCNT EQU 0 INCREMENT VMSTKCNT @V407510 00272000 PRRCT EQU 4 INCREMENT VMPRRCT @V407510 00273000 DEFSTK EQU 8 TURN ON VMDEFSTK IN VMPEND @V407510 00274000 FPNT EQU 0 FORWARD POINTER DISPLACEMENT @V407510 00275000 BPNT EQU 4 BACKWARD POINTER DISPLACEMENT @V407510 00276000 HWMASK EQU 3 MASK TO LOAD HALFWORD @V407510 00277000 ONE EQU 1 INCREMENT VALUE FOR COUNTER @V407510 00278000 * DEFINED STORAGE @V407510 00279000 STKBASE DC A(DMKSTK) COMMON BASE REGISTER VALUE @V407510 00280000 EJECT 00281000 LTORG @V407510 00282000 EJECT 00283000 COPY SAVE @V407510 00284000 COPY IOBLOKS @V407510 00285000 PSA @V407510 00286000 COPY EQU @V407510 00287000 COPY VMBLOK @V407510 00288000 END 00289000