API TITLE 'DMKAPI (CP) VM/370 - RELEASE 6' 00001000
ISEQ 73,80 VALIDATE SEQUENCING OF INPUT 00002000
* 00003000
* MODULE NAME - 00004000
* 00005000
* DMKAPI 00006000
* 00007000
* FUNCTION - 00008000
* 00009000
* READY THE ATTACHED PROCESSOR FOR SYSTEM USE. 00010000
* 00011000
* ATTRIBUTES - 00012000
* 00013000
* NON-REUSABLE, PAGEABLE, ENTERED VIA SVC FROM DMKCPI. 00014000
* 00015000
* ENTRY POINTS - 00016000
* 00017000
* DMKAPIPR - PERFORM MAIN PROCESSOR INITIALIZATION TO 00018000
* SUPPORT THE APU. 00019000
* 00020000
* DMKAPIAP - PERFORM ATTACHED PROCESSOR INITIALIZATION. 00021000
* ENTERED VIA SIGP PSW RESTART FROM DMKAPIPR. 00022000
* 00023000
* ENTRY CONDITIONS - 00024000
* 00025000
* GPR1 - POINTER TO ADDRESSES OF REAL PSA'S (VALUES TO BE 00026000
* INSERTED IN PREFIXA AND PREFIXB). 00027000
* GPR12 - DMKAPI ENTRY POINT ADDRESS. 00028000
* GPR13 - SAVEAREA ADDRESS. 00029000
* 00030000
* EXIT CONDITIONS - 00031000
* 00032000
* NORMAL - DMKAPIPR RETURNS TO DMKCPI VIA SVC. 00033000
* DMKAPIAP LOADS AN ENABLED WAIT STATE PSW. 00034000
* 00035000
* ERROR - LOAD DISABLED WAIT STATE PSW. 00036000
* 00037000
* CALLS TO OTHER ROUTINES - 00038000
* 00039000
* DMKIOGAP - INITIALIZE CR15 ON APU FOR EXTENDED LOGOUT. 00040000
* DMKLOKSP - OBTAIN SYSTEM LOCK. 00041000
* DMKLOKVM - OBTAIN VMBLOK LOCK. 00042000
* DMKPTRAN - BRING IN AND LOCK DMKIOGAP. 00043000
* DMKPTRUL - UNLOCK DMKIOGAP. 00044000
* DMKQCNWT - WRITE MESSAGES TO OPERATOR. 00045000
* 00046000
* EXTERNAL REFERENCES - 00047000
* 00048000
* DMKFREAP - PTR TO FREE STORAGE. 00049000
* DMKPRGIN - ADDRESS OF PROGAM CHECK FLIH. 00050000
* DMKPSADU - ADDRESS OF SYSTEM RESTART ROUTINES. 00051000
* DMKSVCIN - ADDRESS OF SVC FLIH. 00052000
* DMKCPEML - MAIN PROCESSOR CP ASSIST LEVEL @V5DAACD 00052100
* 00053000
* TABLES/WORK AREAS - 00054000
* 00055000
* PSA,VMBLOK 00056000
* 00057000
* MACROS - 00058000
* 00059000
* TRANS, CALL, LOCK OBTAIN 00060000
* 00061000
* REGISTER USAGE - 00062000
* 00063000
* R11 - VMBLOK ADDRESS 00064000
* R12 - BASE REGISTER 00065000
* R13 - SAVEAREA ADDRESS 00066000
* 00067000
* NOTES - 00068000
* 00069000
* NONE 00070000
* 00071000
* OPERATION - MAIN PROCESSOR (DMKAPIPR) 00072000
* 00073000
* 1. MOVE COMMON PSA FIELDS IN ABSOLUTE 0 TO STORAGE DEFINED 00074000
* BY PREFIXA AND PREFIXB. INITIALIZE AP DATA. 00075000
* 2. LOCK DMKIOG. 00076000
* 3. PSW RESTART THE APU AT DMKAPIAP AND SPIN UNTIL THE 00077000
* ROUTINE COMPLETES APU INITIALIZATION. 00078000
* 4. CHECK IF THE INTERVAL TIMER IS RUNNING ON THE APU. 00079000
* 5. SET THE PREFIX REGISTER TO PREFIXA AND INITIALIZE 00080000
* THE CONTROL REGISTERS FOR THE MAIN PROCESSOR. 00081000
* 6. OBTAIN THE SYSTEM AND VMBLOK LOCKS. 00082000
* 7. UNLOCK DMKIOG AND RETURN TO DMKCPI. 00083000
* 00084000
* OPERATION - ATTACHED PROCESSOR (DMKAPIAP) 00085000
* 00086000
* 1. RESTORE TRACSTRT AND RSTNPSW IN ABSOLUTE 0 (DESTROYED 00087000
* BY THE SIGP RESTART). 00088000
* 2. SET THE CLOCK COMPARATOR AND CPU TIMER. 00089000
* 3. LOAD CR'S FOR THE APU AND THE PREFIX REGISTER FROM OLD 00090000
* PREFIXB (NOW IS PREFIXA). 00091000
* 4. CALL DMKIOGAP TO INITIALIZE CR15 FOR EXTENDED LOGOUT. 00092000
* 4.1 TEST CP ASSIST AVAILABILITY. @V5DAACD 00092100
* 5. TEST FOR VM ASSIST AVAILABILITY ON THE APU. 00093000
* 6. RESET PSA FIELDS THAT MAY HAVE BEEN USED DURING 00094000
* INITIALIZATION BUT DO NOT REFLECT APU STATUS. 00095000
* 7. SET THE CPUID OF THE APU 00096000
* 8. LOAD AN ENABLE WAIT STATE PSW. 00097000
* 00098000
* ERROR MESSAGES - 00099000
* 00100000
* NONE. 00101000
* 00102000
* GENERAL MESSAGES - 00103000
* 00104000
* TURN ON THE ATTACHED PROCESSOR'S INTERVAL TIMER 00105000
* 00106000
* WAIT STATE CODES - 00107000
* 00108000
* 15 - SIGP RESTART FAILED. 00109000
* 00110000
EJECT 00111000
DMKAPI CSECT @V407595 00112000
COPY OPTIONS @V407595 00113000
N0 EQU 0 @V407595 00114000
DC CL8'DMKAPI' @V4M0106 00115000
N1 EQU 1 @V407595 00116000
N2 EQU 2 @V407595 00117000
N4 EQU 4 @V407595 00118000
N8 EQU 8 @V407595 00119000
L8 EQU 8 @V407595 00120000
N12 EQU 12 @V407595 00121000
N16 EQU 16 @V407595 00122000
FF EQU X'FF' @V407595 00123000
CONDCODE EQU X'08' TO STCM CC IN WAIT PSW @V407595 00124000
PROCAPU EQU X'40' TRACE TABLE ID OF THE APU @V407595 00125000
EJECT 00126000
EXTRN DMKPRGIN @V407595 00127000
EXTRN DMKPSADU @V407595 00128000
EXTRN DMKPTRUL @V407595 00129000
EXTRN DMKSVCIN @V407595 00130000
EXTRN DMKQCNWT @V407595 00131000
EXTRN DMKIOGAP @V407595 00132000
EXTRN DMKCPEML @V5DAACD 00132100
USING SAVEAREA,R13 @V407595 00133000
DMKAPIPR RELOC @V407595 00134000
USING PSA,R0 @V407595 00135000
MVC APIWORK,ZEROES CLEAR FLAG AND WORK AREA @V407595 00136000
MVC SAVEWRK2(8),0(R1) SAVE ADDRESSES OF PSA'S @VA09386 00137100
L R1,APIIOGAP OBTAIN VIRT ADDR OF DMKIOGAP @VA09386 00137200
* THIS ROUTINE MUST BE LOADED AND LOCKED 00137300
* WHEN IT IS INVOKED ON THE ATTACHED PROCESSOR. 00137400
TRANS 2,1,OPT=(BRING,DEFER,SYSTEM,LOCK) LOCK DMKIOGAP @VA09386 00137500
ST R2,REALSAVE SAVE REAL ADDRESS OF DMKIOGAP @VA09386 00137600
SR R14,R14 MVCL FROM ADDRESS IS 0 @V407595 00144000
L R15,F4096 MVCL FROM LENGTH IS PAGE SIZE @V407595 00145000
L R2,SAVEWRK3 MVCL TO ADDR - APU'S PSA @VA09386 00146100
LR R3,R15 MVCL TO LENGTH IS PAGE SIZE @V407595 00147000
MVCL R2,R14 MOVE ABSOLUTE 0 TO PREFIX AREA @V407595 00148000
* 00149000
* INITIALIZE THE ATTACHED PROCESSOR'S PSA SO THAT IPUADDR, 00150000
* LPUADDR, AND PREFIXA, CORRESPOND TO THE ATTACHED PROCESSOR 00151000
* UNIT ADDRESSES AND PSA RESPECTIVELY. IPUADDRX,LPUADDRX, 00152000
* AND PREFIXB WILL CORRESPOND TO THE MAIN PROCESSOR CPU 00153000
* ADDRESSES AND PSA RESPECTIVELY. 00156100
* 00157000
L R2,SAVEWRK3 GET ATTACHED PSA @VA09386 00158100
SR R1,R1 ZERO A REGISTER @VA07568 00159000
ST R1,ACTIVTRQ(R2) ZERO OUT ACTIVE TRQ POINTER @VA07568 00160000
MVI APSTAT4-PSA(R2),X'00' CLEAR MCHCHK BIT AND THE @VA08614 00161000
* REST OF THE BYTE 00162000
MVC IPUADDR-PSA(N2,R2),IPUADDRX SET PHYSICAL CPU @V407595 00163000
* ADDR OF APU IN ATTACHED PROCESSOR'S PSA 00164000
* (PREFIXB) 00165000
MVC IPUADDRX-PSA(N2,R2),IPUADDR SET PHYSICAL CPU @V407595 00166000
* ADDR OF MAIN PROC IN ATTACHED PROCESSOR'S 00167000
* PSA (PREFIXB) 00168000
MVC LPUADDR-PSA(N2,R2),LPUADDRX SET LOGICAL CPU @V407595 00169000
* ADDR OF APU IN ATTACHED PROCESSOR'S PSA 00170000
* (PREFIXB) 00171000
MVC LPUADDRX-PSA(N2,R2),LPUADDR SET LOGICAL CPU @V407595 00172000
* ADDR OF MAIN PROC IN ATTACHED PROCESSOR'S 00173000
* PSA (PREFIXB) 00174000
MVC PREFIXB-PSA(N4,R2),SAVEWRK2 SET ADDRESS OF MAIN @VA09386 00175100
* PROCESSOR'S PSA IN ATTACHED PROCESSOR'S 00176000
* PSA (PREFIXB). THIS PERMITS CROSS 00177000
* REFERENCING OF PSA'S 00178000
MVC PREFIXA-PSA(N4,R2),SAVEWRK3 ADDRESS OF ATTACHED @VA09386 00179100
* PSA IN ATTACHED PROCESSOR'S PSA (PREFIXB) 00180000
* THIS PERMITS REFERENCES TO ABSOLUTE 0. 00181000
STCTL C1,C14,BALR1 SAVE CR'S FOR APU TO RESTORE @V407595 00190000
* NOTE CR0 IS RESTORED FROM CR0INTAP 00191000
LM R1,R2,RESTAP LOAD PSW TO RESTART ON ATTACHED @VMH0013 00192000
* PROCESSOR 00193000
TM APSTAT4,POFFLINE IS VARY PROCESSING ACTIVE? @VMH0013 00194000
BNO STRSTNEW NO, BRANCH @VMH0013 00195000
L R15,ASYSVM GET SYSTEM VMBLOK ADDRESS @VMH0013 00196000
L R14,SAVEWRK3 ATTACHED PSA ADDRESS @VA09386 00197100
ST R15,LASTUSER-PSA(R14) SET LASTUSER TO ASYSVM @VMH0031 00198000
ST R15,RUNUSER-PSA(R14) SET RUNUSER TO ASYSVM @VMH0031 00199000
MVC TIMER-PSA(N4,R14),FFS SET ATTACHED PROCESSOR'S @VMH0031 00200000
* INTERVAL TIMER TO A HIGH NEGATIVE 00201000
* NUMBER. THIS WILL PREVENT AN INTERVAL 00202000
* TIMER INTERRUPT FROM OCCURING ON THE 00203000
* ATTACHED PROCESSOR BEFORE THE SYSTEM 00204000
* IS FULLY INITIALIZED FOR AP MODE. 00205000
LCTL C1,C1,VMSEG-VMBLOK(R15) USE SYSTEM CTRL REG 1 @VMH0013 00206000
LRA R2,0(0,R2) GET REAL ADDRESS OF ROUTINE @VMH0013 00207000
LCTL C1,C1,BALR1 RESTORE CONTROL REGISTER 1 @VMH0013 00208000
STRSTNEW DS 0H @VMH0013 00209000
STM R1,R2,RSRTNPSW SET RESTART NEW TO RESTART THE @VMH0013 00210000
* ATTACHED PROCESSOR @VMH0013 00211000
SIGPREST EQU * @V407595 00212000
ST R12,TEMPSAVE SAVE BASE REG FOR DMKAPIAP/IT @V407595 00213000
L R0,SAVEWRK3 GET ATTACHED PSA ADDRESS @VA09386 00213100
ST R0,TEMPSAVE+4 SAVE THE ADDRESS FOR DMKAPIAP @VA09386 00213200
LA R0,SIGREST SAVE SIGP ORDER IN CASE OF ERROR @V407595 00214000
SR R1,R1 CLEAR SIGP STATUS REGISTER @V407595 00215000
LH R2,IPUADDRX ADDRESS OF APU FOR SIGP RESTART @V407595 00216000
SIGP R1,R2,SIGREST PSW RESTART THE APU @V407595 00217000
BC 7,APERROR SHOULD ONLY RECEIVE CC=0, ELSE @V407595 00218000
* ERROR. 00219000
LCTL C0,C0,MFAONLY ENABLE FOR MFA ONLY DURING SIGP @V407595 00220000
* RESTART. 00221000
WAITREST EQU * @V407595 00222000
STOSM SYSMASK,EXTMASK ENABLE FOR EXTERNAL INTERRUPTS @V407595 00223000
STNSM SYSMASK,FF-EXTMASK CLOSE MFA WINDOW @V407595 00224000
TM APIFLAG1,APUSPIN WAIT UNTIL DMKAPIAP COMPLETES @V407595 00225000
BNO WAITREST WAIT FOR RESTART TO COMPLETE @V407595 00226000
* 00227000
* DETERMINE IF THE INTERVAL TIMER IS 00228000
* RUNNING ON THE APU. THE MAIN PROCESSOR'S 00229000
* HAS PREVIOUSLY BEEN TESTED. 00230000
* 00231000
L R4,SAVEWRK3 ADDRESS OF ATTACHED PSA @VA09386 00232100
L R3,TIMER(R4) OBTAIN VALUE OF APU INTERVAL TMR @V4M0106 00233000
APINTTMR EQU * @V4M0106 00234000
STIDP CPUID ISSUE A PRIVILEGED INSTRUCTION @V4M0143 00235000
* TO FORCE A TRIP THRU THE DISPATCHER 00236000
* WHEN RUNNING VM UNDER VM. 00237000
L R2,F40000 LOAD A HIGH VALUE FOR LOOP CNTRL.HRC008DK 00238490
* NOTE THAT THE INTERVAL TIMER IS UPDATED 00239000
* IN BIT POSITION 23 APPROXIMATELY 00240000
* ONCE PER 1/300 SECOND. THE SEQUENCE 00241000
* OF INSTRUCTIONS IN 'TIMELOOP' MUST BE 00242000
* EXECUTED APPROXIMATELY 7,000 TIMES 00243000
* ON A MODEL 168 TO REACH THIS INTERVAL. 00244000
* A HIGHER VALUE IS SELECTED TO ENSURE 00245000
* THE TIMER IS NOT RUNNING BEFORE ISSUING 00246000
* MESSAGE. 00247000
TIMELOOP EQU * @V4M0106 00248000
CL R3,TIMER(R4) TIMER CHANGING ON APU ? @V4M0106 00249000
BNE APNOMSG YES - TIMER IS RUNNING - CONTINUE@V4M0106 00250000
BCT R2,TIMELOOP CONTINUE UNTIL COUNTER EXHAUSTED @VM40106 00251000
* OR INTERVAL TIMER RUNNING. 00252000
LA R1,TMSG GET MESSAGE PTR. @V407595 00253000
LA R0,TMSGL GET MESSAGE LENGTH. @V407595 00254000
CALL DMKQCNWT,PARM=0 TELL OPERATOR TO READY INT TIMER @V407595 00255000
B APINTTMR RESTART THE TIMER LOOP @V4M0106 00256000
APNOMSG EQU * @V407595 00257000
LH R1,IPUADDRX ADDRESS OF THE ATTACHED PROC. @VA09386 00257010
L R8,APIDMPAA DMKDMP'S POINTER TO ATT. ADDR. @VA09386 00257020
STH R1,0(,R8) SAVE ADDRESS FOR DMKDMP @VA09386 00257030
L R8,APIDMPSA ADDRESS OF DMKDMPSA @VA09386 00257040
MVC 0(8,R8),SAVEWRK2 SAVE PSA ADDRESSES IN DMKDMPMA @VA09386 00257050
MVC PREFIXA(8),SAVEWRK2 SET PREFIXA/B IN ABSOLUTE 0 @VA09386 00257060
SR R14,R14 MVCL FROM ADDRESS IS 0 @VA09324 00257100
L R15,F4096 MVCL FROM LENGTH IS PAGE SIZE @VA09324 00257200
L R2,PREFIXA MVCL TO ADDR IS MAIN PROC'S PSA @VA09324 00257300
LR R3,R15 MVCL TO LENGTH IS PAGE SIZE @VA09324 00257400
MVCL R2,R14 MOVE ABSOLUTE 0 TO PREFIX AREA @VA09324 00257500
SPX PREFIXA ESTABLISH PREFIXING ON MAIN PROC @V407595 00258000
TM APSTAT1,CPINITD IS SYSTEM IN IPL? @VMH0026 00259000
BZ SETTDISP YES, BRANCH @VMH0026 00260000
SPACE 00261000
* THE FOLLOWING CODE GOES THROUGH THE CHAIN OF VMBLOKS AND * 00262000
* OBTAINS A DEFERRED EXECUTION BLOCK FOR EACH. ALSO, VMCPTIME * 00263000
* AND VMAPTIME ARE ADJUSTED TO THE AP MODE VALUES. * 00264000
SPACE 00265000
USING VMBLOK,R11 @VMH0026 00266000
SPACE 00267000
L R11,ASYSVM GET ADDRESS OF SYSTEM VMBLOK @VMH0026 00268000
MVC VMAPTIME,APSPTIME STORE THE AP SUP. TIME INITIAL VALUE X00269000
@VMH0026 00270000
* 00271000
*THE FOLLOWING CODE ADJUSTS VMCPTIME TO VMTTIME-X'3FFFFFFFFFFFF000' 00272000
* 00273000
LM R0,R1,VMTTIME GET VMTTIME IN EVEN-ODD REGISTERS X00274000
@VMH0026 00275000
SL R0,SUB4 SUBTRACT X'4000000000000000' @VMH0026 00276000
AL R1,ADD1 ADD BACK IN X'0000000000001000' @VMH0026 00277000
BC 12,NOCARRY BRANCH IF NO CARRY ON THE ADDITION X00278000
@VMH0026 00279000
AL R0,F1 ADD IN CARRY @VMH0026 00280000
NOCARRY STM R0,R1,VMCPTIME STORE ADJUSTED VMCPTIME VALUE @VMH0026 00281000
* 00282000
L R11,VMPNT GET FIRST VMBLOK ADDR IN CYCLIC CHAIN X00283000
@VMH0026 00284000
LR R10,R11 SAVE ENDING ADDRESS @VMH0026 00285000
VMLOOP DS 0H @VMH0026 00286000
MVC VMAPTIME,APSPTIME STORE THE AP SUP. TIME INITIAL VALUE X00287000
@VMH0026 00288000
LM R0,R1,VMTTIME GET VMTTIME IN REGISTERS @VMH0026 00289000
SL R0,SUB4 SUBTRACT X'4000000000000000' @VMH0026 00290000
AL R1,ADD1 ADD BACK IN X'0000000000001000' @VMH0026 00291000
BC 12,NOTCARRY BRANCH IF NO CARRY @VMH0026 00292000
AL R0,F1 ADD IN CARRY @VMH0026 00293000
NOTCARRY STM R0,R1,VMCPTIME STORE ADJUSTED VMCPTIME VALUE @VMH0026 00294000
LA R0,CPEXSIZE GET SIZE OF BLOCK IN DOUBLE WORDS X00295000
@VMH0026 00296000
CALL DMKFREE OBTAIN STORAGE @VMH0026 00297000
ST R1,VMDFTPNT SAVE ADDR OF DEFER EX.BLOK @VMH0026 00298000
L R11,VMPNT GET ADDR OF NEXT VMBLOK @VMH0026 00299000
CR R10,R11 END OF CHAIN @VMH0026 00300000
BNE VMLOOP NO, DO THEM ALL @VMH0026 00301000
L R11,SAVER11 RESTORE VMBLOK ADDRESS @VMH0026 00302000
SPACE 00303000
SETTDISP DS 0H @VMH0026 00304000
LA R0,VMCPTIME-VMBLOK(,R0) GET ADDR MAIN PROC TIMER@V4M0203 00305000
ST R0,TIMEDISP SAVE DISPLACEMENT IN PSA @V4M0203 00306000
CHARGE START START CHARGING OPERATOR @V4M0203 00307000
LCTL C0,C0,CR0INTMN ESTABLISH VALUE OF CR0 ON MAIN @V407595 00308000
* PROCESSOR. NOTE THAT TOD SYNC CHECKS WILL 00309000
* BE ENABLED BY DMKCLK. THIS WILL SUPPRESS 00310000
* ALL SYNC CHECKS UNTIL CLOCKS ARE SET. 00311000
STCTL C0,C0,CPCREG0 INITIALIZE CR0 FOR MAIN PROC @V407595 00312000
OI APSTAT1,APUOPER INDICATE THE APU IS NOW @V407595 00313000
* OPERATIONAL @V407595 00314000
LOCK OBTAIN,TYPE=SYS,SPIN=NO @VA07480 00315000
BNZ APNOLOK LOCK NOT AVAILABLE, TERM VM @VA07611 00316000
L R1,SAVER11 ADDRESS OF VMBLOK TO R1 @VMH0001 00317000
LOCK OBTAIN,TYPE=VMBLOK,SPIN=NO LOCK THE OPERATOR'S @V407595 00318000
* VMBLOK FOR THE DISPATCHER. 00319000
BNZ APNOLOK LOCK NOT AVAILABLE, TERM VM @VA07611 00320000
C R1,LASTUSER WAS LASTUSER JUST LOCKED? @VMH0001 00321000
BE USERSLKD YES, BRANCH @VMH0001 00322000
L R1,LASTUSER GET LASTUSER VMBLOK ADDRESS @VMH0001 00323000
C R1,ASYSVM IS LASTUSER THE SYSTEM VMBLOK? @VMH0001 00324000
BE USERSLKD YES, BRANCH @VMH0001 00325000
LOCK OBTAIN,TYPE=VMBLOK,SPIN=NO LOCK LASTUSER @VMH0001 00326000
BNZ APNOLOK LOCK NOT AVAILABLE, TERMINATE VM @VMH0001 00327000
USERSLKD DS 0H @VMH0001 00328000
L R2,REALSAVE RESTORE DMKIOGAP REAL ADDRESS @V407595 00329000
CALL DMKPTRUL UNLOCK DMKIOGAP. @V407595 00330000
EXIT @V407595 00331000
APERROR EQU * @V407595 00332000
MVC RSRTNPSW(L8),APIRSTNW RESTORE RESTART NEW PSW @V407595 00333000
BALR R15,0 SET CONDITION CODE IN WORK REG @V407595 00334000
STCM R15,CONDCODE,XWAIT4+N4 STORE CC IN WAIT PSW. @V407595 00335000
* NOTE PSW IS IN BC FORMAT. 00336000
LPSW XWAIT4 LOAD ERROR WAIT CODE =X'15' @V407595 00337000
SPACE 00338000
APNOLOK DS 0H SYTEM/VMBLOK LOCK NOT AVAILABLE @VA07611 00339000
ABEND 1 TERMINATE VM/370 @VA07611 00340000
EJECT 00341000
ENTRY DMKAPIAP APU INITIALIZATION ROUTINE @V407595 00342000
DMKAPIAP DS 0D @V407595 00343000
L R11,ASYSOP OBTAIN OPERATOR VMBLOK ADDRESS @V4M0106 00344000
* TO SATISFY SVC INTERFACE. 00345000
L R12,TEMPSAVE SET BASE TO MAINLINE DMKAPI @V407595 00346000
L R14,TEMPSAVE+4 ADDRESS ATTACHED PROCESSOR'S PSA @VA09386 00347110
L R14,TRACSTRT(R14) OBTAIN VALUE OF TRACSTRT @V407595 00348000
ST R14,TRACSTRT RESTORE TRACE TABLE START @V407595 00349000
* ADDRESS IN ABSOLUTE 0. IT WAS OVERLAID 00350000
* AS A RESULT OF THE DMKAPI PSW RESTART. 00351000
MVC RSRTNPSW(N8),APIRSTNW RESTORE RESTART NEW PSW @V407595 00352000
* IN ABSOLUTE 0 IN CASE RESET AND RESTART 00353000
* ARE PRESSED BY THE OPERATOR. 00354000
SCKC FFS INIT APU TOD CLOCK COMPARATOR @V407595 00355000
SPT PROBTIME INIT APU CPU TIMER @V407595 00356000
LCTL C1,C14,BALR1 ESTABLISH CR'S FOR THE APU @V407595 00357000
LCTL C0,C0,CR0INTAP ESTABLISH CR0 FOR THE APU - @V407595 00358000
* DISABLED FOR TOD SYNC CHECKS. 00359000
LCTL C2,C2,ZEROES INHIBIT I/O INTERRUPTS ON THE @V407595 00360000
* APU. 00361000
SPX TEMPSAVE+4 START PREFIXING ON THE ATTACHED @VA09386 00362100
STCTL C0,C0,CPCREG0 SET CR0 FOR THE APU. @V407595 00363000
XI TRACPROC,PROCAPU SET TRACE TABLE IDENTIFIER @V60B7AB 00364100
* TO OPPOSITE OF ONLINE PROC'S IDENT 00364200
NI APSTAT1,FF-PROCIO INDICATE THAT THIS PROCESSOR @V407595 00366000
* LACKS I/O CAPABILITY. 00367000
XI APSTAT1,PROCIPL THIS PROC IS THE IPL PROC ONLY @V60B7AA 00367050
* IF THE ONLINE PROC IS NOT PROCIPL 00367100
* 00367110
SPACE 00367120
* TEST FOR CP ASSIST @V5DAACD 00367130
* IF CPA AVAILABLE ON THE MAIN PROCEESOR: @V5DAACD 00367140
* 1) ISSUE STORE CPASSIST LV ID (STECPSVM) INSTRUCTION. @V5DAACD 00367150
* 2) COMPARE AP AND MAIN MICRO CODE LEVELS. @V5DAACD 00367160
* 3) IF CPA AVAILABLE AND LV. NUMBERS ARE EQUAL SET CPA @V5DAACD 00367170
* AVAILABLE AND ON. @V5DAACD 00367180
* 4) IF LV NUMBERS ARE NOT EQUAL / CPA NOT AVAILABLE ON @V5DAACD 00367190
* THE AP BUT AVAILABLE ON MAIN RESET CPA FLAGS ON @V5DAACD 00367200
* BOTH PROCESSOR'S AND NOP ALL CPA OP'S @V5DAACD 00367210
* @V5DAACD 00367220
NI CPSTAT2,X'FF'-(CPASTAVL+CPASTON) SET CPA OFF @VA09614 00367230
L R2,PREFIXA *ADDRESSABILITY TO MAIN PSA - @V5DAACD 00367240
* ADDRESS IS SET TO ABSOLUTE 0 @V5DAACD 00367250
* BECAUSE MAIN PREFIX AREA HAS NOT BEEN @V5DAACD 00367260
* MOVED/ESTABLISHED AT THIS TIME..... @V5DAACD 00367270
TM CPSTAT2-PSA(R2),CPASTAVL **CPA ON MAIN PROC.? @V5DAACD 00367280
BNO APINOCPA NO-FORGET IT BOTH CPU'S @V5DAACD 00367290
* REQUIRE CPA AND 'CPI' HAS @V5DAACD 00367300
* ALREADY NOOP'ED CPA OP'S. @V5DAACD 00367310
MVC TEMPR0(N4),ZEROES USE TEMPRO TO SET CTL REG. 6 @V5DAACD 00367320
OI TEMPR0,X'02' SET CPASSIST ENABLE MASK @V5DAACD 00367330
LCTL C6,C6,TEMPR0 ENABLE CP ASSIST FEATURE. @V5DAACD 00367340
LA R1,APIINTA SETUP FOR POSSIBLE PGM CK. @V5DAACD 00367350
ST R1,PRNPSW+4 IF CP ASSIST NOT ON AP @V5DAACD 00367360
LA R3,SVCPALV LOC. TO STORE LV. NUMBER @V5DAACD 00367370
DS 0H ISSUE 'ST CP ASSIST LEVEL' @V5DAACD 00367380
DC X'E612',S(0(R3),0) @V5DAACD 00367390
* @V5DAACD 00367400
OI CPSTAT2,CPASTAVL+CPASTON SET CPA AVAIL. AND ON @V5DAACD 00367410
L R3,=A(DMKCPEML) LOC. OF MAIN PROC. LV. NUMBER @V5DAACD 00367420
CLC SVCPALV,0(R3) LV NUMBERS EQUAL? @V5DAACD 00367430
BE APICPAOK CPA AVAIL AND LV EQ ALLSET @V5DAACD 00367440
APIINTA EQU * CPA UNAVAIL. / LV NUMBERS ARE NOT EQUAL @V5DAACD 00367450
NI CPSTAT2,X'FF'-(CPASTAVL+CPASTON) SET BOTH @V5DAACD 00367460
NI CPSTAT2-PSA(R2),X'FF'-(CPASTAVL+CPASTON) PREFIX @V5DAACD 00367470
* FLAGS TO INDICATE CPA UNAVAILABLE AND CLEAR CP @V5DAACD 00367480
NI CPCREG6-PSA(R2),X'FD' ASSIST ENABLE FLS IN CTL @V5DAACD 00367490
NI CPCREG6,X'FD' REG 6 FOR BOTH PROCESSOR'S @V5DAACD 00367500
* ALSO NOP ALL CP ASSIST INSTRUCTIONS MAIN HUNG IN LOOP @V5DAACD 00367510
* WAITING FOR AP TO COMPLETE INITILIZATION. @V5DAACD 00367520
LA R3,CPATABLE GET CP ASSIST ADDR. LIST @V5DAACD 00367530
LA R4,4 TABLE INCREMENT @V5DAACD 00367540
LA R5,CPATBLND ADDR. OF TABLE END. @V5DAACD 00367550
CLEARCPA L R6,0(R3) GET CPA INST. ADDR. @V5DAACD 00367560
MVC 0(6,R6),=X'0700,47000000' AND REMOVE IT.... @V5DAACD 00367570
BXLE R3,R4,CLEARCPA LOOP THROUGH TABLE. @V5DAACD 00367580
APICPAOK EQU * @V5DAACD 00367590
MVC PRNPSW(8),APIPGMNW RESTORE PGM NEW PSW @V5DAACD 00367600
LCTL C6,C6,ZEROES NO CPA UNTIL IPL COMPLETES. @V5DAACD 00367610
APINOCPA EQU * @V5DAACD 00367620
SPACE 00367630
CALL DMKIOGAP CALL MCH ROUTINE TO INITIALIZE @V407595 00368000
* CR15 FOR EXTENDED LOGOUT 00369000
EJECT 00370000
* 00371000
* TEST FOR VM ASSIST @V407595 00372000
* TO DO THIS, DO AN SSM INSTRUCTION IN PROBLEM STATE. IF CP RECEIVES 00373000
* THE PROGRAM INTERRUPT, VM ASSIST IS NOT PRESENT. IF VM 00374000
* ASSIST HANDLES THE SSM, DO AN SVC TO GET BACK TO SUPERVISOR STATE. 00375000
* 00376000
L R11,ASYSVM ADDRESS OF SYSTEM VMBLOK @V407595 00377000
USING VMBLOK,R11 EST ADDRESSIBILITY TO VMBLOK @V407595 00378000
LA R1,APISVC SET SVC NEW PSW TO POINT TO @V407595 00379000
ST R1,SVCNPSW+N4 APISVC @V407595 00380000
LA R1,APIPROG SET PROGRAM NEW PSW TO POINT @V407595 00381000
ST R1,PRNPSW+N4 TO APIPROG @V407595 00382000
MVC RUNCR0(4),CPCREG0 SET UP REAL CR0 @V407595 00383000
MVC RUNCR1(4),VMSEG SET UP REAL CR1 @V407595 00384000
* SET UP MICROCODE POINTER LIST 00385000
MVC TEMPR2,VMSEG SYSTEM SEGMENT TABLE IN PTR LIST @V407595 00386000
LA R1,RUNCR0 VIRT CR0 SAME AS REAL CR0 @V407595 00387000
ST R1,TEMPR3 @V407595 00388000
LA R1,SSMTEST SET UP PROPER @VA10147 00388300
ST R1,TESTPSW+4 RETURN FROM TEST @VA10147 00388600
MVC TEMPR4(4),ZEROES VIRT. PSW POINTER @V407595 00389000
LA R1,BALRSAVE WORKSPACE ADDRESS @V407595 00390000
ST R1,TEMPR5 @V407595 00391000
* SET UP C-REG 6 - USE TEMPR0 TO SET IT UP 00392000
LA R1,TEMPR2 ADDRESS OF MICROCODE PTR LIST @V407595 00393000
ST R1,TEMPR0 INTO C-REG 6 @V407595 00394000
OI TEMPR0,VMMFE+VMMSVC TURN MICROCODE ON & SVCS OFF@V407595 00395000
LCTL C6,C6,TEMPR0 LOAD CR6 @V407595 00396000
LCTL C0,C1,RUNCR0 LOAD REAL CR0 AND CR1 @V407595 00397000
LPSW TESTPSW GO INTO PROBLM STATE & ISSUE SSM @V407595 00398000
DS 0D @V407595 00399000
TESTPSW DC X'000D0000' PROB STATE PSW @VA10147 00400100
DC F'0' @VA10147 00401100
SSMTEST SSM *+1 WILL MICROCODE HANDLE THIS? @V407595 00402000
SVC 30 YES THEN MUST RETURN TO @V407595 00403000
* SUPERVISOR STATE 00404000
APIPROG EQU * IF MICROCODE DOESNT HANDLE SSM, @V407595 00405000
* PROGRAM INTERRUPT COMES HERE 00406000
NI CPSTAT2,X'FF'-CPMICAVL-CPMICON INDICATE VM @V407595 00407000
* ASSIST NOT AVAILABLE & NOT ON 00408000
B NPSWS @V407595 00409000
APISVC EQU * IF MICROCODE HANDLES SSM, SVC @V407595 00410000
* INTERRUPT COMES HERE 00411000
OI CPSTAT2,CPMICAVL+CPMICON INDICATE VM ASSIST @V407595 00412000
* AVAILABLE & ON 00413000
NPSWS MVC SVCNPSW(8),APISVCNW RESTORE SVC NEW PSW @V407595 00414000
MVC PRNPSW(8),APIPGMNW RESTORE PROGRAM NEW PSW @V407595 00415000
LCTL C6,C6,ZEROES RESTORE CR6 @V407595 00416000
L R11,ASYSOP RESTORE PTR TO OPERATOR VMBLOK @V4M0106 00417000
EJECT 00418000
XC PGREAD(CLRCNT),PGREAD CLEAR COUNTER AREA IN PSA @V407595 00419000
* ON APU THAT MAY HAVE BEEN USED WHILE IN 00420000
* ABSOLUTE 0 (I.E., BEFORE THE PSA MOVE) 00421000
XC EXOPSW(TIMER-EXOPSW),EXOPSW CLEAR LOW CORE @VA07843 00422000
* BETWEEN EXTERNAL OLD AND INTERVAL TIMER. 00423000
MVI CPSTATUS,CPWAIT+CPSUPER IND CP IN IDLE & SUP @VA11576 00424500
MVC IDLEWAIT(N8),HIGHPOS TOTAL APU IDLE STATE TIME @V407595 00425000
MVC PAGEWAIT(N8),HIGHPOS TOTAL PAGE IDLE WAIT TIME @V407595 00426000
MVC IONTWAIT(N8),HIGHPOS TOTAL SYSTEM I/O WAIT TIME @V407595 00427000
MVC PROBTIME(N8),HIGHPOS TOTAL SYSTEM PROBLEM STATE @V407595 00428000
* TIME. @V407595 00429000
STIDP CPUID STORE CPU IDENTIFIER @V407595 00430000
OI APSTAT1,APUOPER INDICATE APU NOW OPERATIONAL @V407595 00431000
LA R0,VMAPTIME-VMBLOK(,R0) GET ADDR ATTACHED TIMER @V4M0203 00432000
ST R0,TIMEDISP SAVE DISPLACEMENT IN PSA @V4M0203 00433000
OI APIFLAG1,APUSPIN LET MAIN PROCESSOR CONTINUE @V407595 00434000
LPSW ENABLEWT ENABLE FOR EXTERNAL INTERRUPTS. @V407595 00435000
* NOTE THAT CR0 WAS PREVIOUSLY ESTABLISHED. 00436000
EJECT 00437000
* START OF ATTACHED PROCESSOR DEFINITIONS 00438000
DS 0F @V407595 00439000
APIIOGAP DC V(DMKIOGAP) PTR TO DMKIOGAP @V407595 00440000
APIDMPSA DC V(DMKDMPSA) POINTER TO PSA'S IN DMKDMP @VA09386 00440100
APIDMPAA DC V(DMKDMPAA) POINTER TO ATTACHED PROC ADDR. @VA09386 00440200
DS 0D PSW'S ON DBW BOUNDARY @V407595 00441000
XWAIT4 DC X'0002000000000015' @V407595 00442000
APISVCNW DC A(MCHEKENB,DMKSVCIN) SYSTEM SVC NEW PSW @V407595 00443000
APIPGMNW DC A(MCHEKENB,DMKPRGIN) SYSTEM PGM NEW PSW @V407595 00444000
APIRSTNW DC A(MCHEKENB,DMKPSADU) SYSTEM RESTART NEW PSW @V407595 00445000
RESTAP DC A(MCHEKENB,DMKAPIAP) RESTART NEW PSW FOR APU @V407595 00446000
ENABLEWT DC AL1(EXTMASK),AL3(WAITENB),AL4(0) ENABLED WAIT @V407595 00447000
DISABLWT DC AL1(0),AL1(EXTMODE+MCHEK+WAIT),AL4(0),AL2(0) @V407595 00448000
CR0INTMN DC AL1(BLKMPX+NOSSKCK,PAGE4K) HRC004DK 00449490
DC AL1(MFAMASK+EMSMASK+XCMASK+CKCMASK+CPTMASK) @V4M0143 00450000
DC AL1(INTMASK+KEYMASK) BITMASK FOR CR0 ON MAIN P. @V407595 00451000
CR0INTAP DC AL1(BLKMPX+NOSSKCK,PAGE4K) HRC004DK 00452490
DC AL1(MFAMASK+EMSMASK+XCMASK+CKCMASK+CPTMASK) @V4M0143 00453000
DC AL1(INTMASK+KEYMASK) BITMASK FOR CR0 ON APU @V407595 00454000
MFAONLY DC AL1(BLKMPX+NOSSKCK) HRC004DK 00455003
DC AL1(PAGE4K,MFAMASK,N0) MFA ONLY FOR CR0 HRC004DK 00455006
EJECT 00455010
* @V5DAACD 00455020
* -----CP ASSIST LEVEL AND INSTRUCTION TABLE @V5DAACD 00455030
* @V5DAACD 00455040
DS 0D @V5DAACD 00455050
SVCPALV DC F'0' LEVEL OF AP PROCESSOR.... @V5DAACD 00455060
* ----------------------------------------- @V5DAACD 00455070
* NOTE: THE FOLLOWING TABLE ALSO RESIDES IN MODULE 'DMKCPI' @V5DAACD 00455080
* --------------------------------------- @V5DAACD 00455090
CPATABLE DS 0F CP ASSIST INSTRUCTION ADDRESS'S @V5DAACD 00455100
DC V(DMKFREE) E600 @V5DAACD 00455110
DC V(DMKFRET) E601 @V5DAACD 00455120
DC V(DMKPTRLK) E602 @V5DAACD 00455130
DC V(DMKPTRUL) E603 @V5DAACD 00455140
DC V(DMKCCW0) E604 @V5DAACD 00455150
DC V(DMKUNTFR) E605 @V5DAACD 00455160
DC V(DMKSCNVU) E606 @V5DAACD 00455170
DC V(DMKDSP1) E607 @V5DAACD 00455180
DC V(DMKCCWB1) E608 @V5DAACD 00455190
DC V(DMKCCWB2) E608 @V5DAACD 00455200
DC V(DMKCCWB3) E608 @V5DAACD 00455210
DC V(DMKCCWB4) E608 @V5DAACD 00455220
DC V(DMKCCWB5) E608 @V5DAACD 00455230
DC V(DMKCCWB6) E608 @V5DAACD 00455240
DC V(DMKCCWB7) E608 @V5DAACD 00455250
DC V(DMKCCWB8) E608 @V5DAACD 00455260
DC V(DMKCCWL1) E609 @V5DAACD 00455270
DC V(DMKCCWL2) E609 @V5DAACD 00455280
DC V(DMKCCWL3) E609 @V5DAACD 00455290
DC V(DMKCCWL4) E609 @V5DAACD 00455300
DC V(DMKCCWL5) E609 @V5DAACD 00455310
DC V(DMKVATZS) E60A @V5DAACD 00455320
DC V(DMKVATZP) E60B @V5DAACD 00455330
DC V(DMKCCW1) E60C @V5DAACD 00455340
DC V(DMKDSP0) E60D @V5DAACD 00455350
DC V(DMKSCNRU) E60E @V5DAACD 00455360
DC V(DMKCCWGN) E60F @V5DAACD 00455370
DC V(DMKUNTRN) E610 @V5DAACD 00455380
DC V(DMKDSP2) E611 @V5DAACD 00455390
DC V(DMKVMASH) E613 @V5DAACD 00455400
CPATBLND EQU *-4 @V5DAACD 00455410
EJECT 00455420
* 00456000
* DEFINE DMKAPI FLAGS, REGISTER SAVEAREAS AND CONSTANTS @V407595 00457000
* 00458000
SAVETIME DS F SAVE AREA FOR INTERVAL TIMER @V407595 00459000
REALSAVE DS F REAL STORAGE ADDRESS OF DMKIOGAP @V407595 00460000
RETADDR DS F RETURN TO DMKAPIAP FROM DMKAPIIT @V407595 00461000
APIPRFX DS 2F TEMPORARY SAVEAREA FOR PREFIXA/B @V407595 00462000
APIBASE DS 2F SAVEAREA FOR BASEREGS @V407595 00463000
HIGHPOS DC X'7FFFFFFFFFFFF000' HIGHEST POSITIVE VALUE IN @V4M0106 00464000
APSPTIME DC X'3FFFFFFFFFFFF000' AP SUPERVISOR TIMER VALUE @VMH0026 00465000
SUB4 DC X'40000000' @VMH0026 00466000
ADD1 DC X'00001000' @VMH0026 00467000
* DOUBLEWORD. 00468000
F8192 DC F'8192' TWO PAGES @V407595 00469000
F40000 DC F'40000' LOOP CONTROL FOR INTERVAL TIMER HRC008DK 00470490
H32 DC H'32' DECREMENT CORE TABLE PTR BELOW @V407595 00471000
* PREFIX AREA (I.E., -8K) 00472000
APIWORK DS H DMKAPI INTERNAL FLAGS AND W.A. @V407595 00473000
ORG APIWORK @V407595 00474000
APIFLAG1 DS CL1 FLAG BYTE @V407595 00475000
SYSMASK DS CL1 STOSM/STNSM WORK AREA @V407595 00476000
* DEFINE BITS FOR APIFLAG1 @V407595 00477000
APUSPIN EQU X'80' SPIN BIT @V407595 00478000
API958MG DC X'151515' @V407595 00479000
DC C'DMKAPI958I ATTACHED PROCESSOR NOW OPERATIONAL' 00480000
* @V407595 00481000
DC X'1515' @V407595 00482000
API958LN EQU *-API958MG @V407595 00483000
TMSG DC X'151515' @V407595 00484000
DC C'TURN ON THE ATTACHED PROCESSOR''S INTERVAL TIMER' 00485000
DC X'1515' @V407595 00486000
TMSGL EQU *-TMSG @V407595 00487000
EJECT 00488000
PSA @V407595 00489000
COPY EQU @V407595 00490000
COPY VMBLOK @V407595 00491000
COPY SAVE @V407595 00492000
MCHEKENB EQU (MCHEK+EXTMODE)*X'10000' @V407595 00493000
WAITENB EQU (MCHEK+EXTMODE+WAIT)*X'10000' @V407595 00494000
PREFIX EQU PREFIXA-PSA @V407595 00495000
CLRCNT EQU PSENDCLR-PGREAD @V407595 00496000
END DMKAPI @V407595 00497000