CLK TITLE 'DMKCLK (CP) VM/370 - RELEASE 6' 00001000
ISEQ 73,80 VALIDATE SEQUENCING OF INPUT 00002000
* MODULE NAME - 00003000
* 00004000
* DMKCLK 00005000
* 00006000
* FUNCTION - 00007000
* 00008000
* SYNCHRONIZE THE TOD CLOCKS IN AN ATTACHED PROCESSOR SYSTEM. 00009000
* 00010000
* ATTRIBUTES - 00011000
* 00012000
* SERIAL-REUS, PAGEABLE, ENTERED VIA SVC FROM DMKCPI DURING REAL 00013000
* MACHINE INITIALIZATION OR DMKEXT ON RECEIPT OF A TOD SYNC 00014000
* CHECK. 00015000
* 00016000
* ENTRY POINTS - 00017000
* 00018000
* DMKCLKCK - DETERMINE IF THE CLOCKS SHOULD BE SYNCHRONIZED. 00019000
* ENTERED FORM DMKCPI VIA SVC. 00020000
* DMKCLKCC - INFORMS SENDER THE STATE OF THE APU CLOCK. 00021000
* ENTERED VIA EMS SIGP ON THE APU. 00022000
* DMKCLKMP - MASTER ROUTINE FOR CLOCK SYNCHRONIZATION. 00023000
* ENTERED VIA SVC ON THE MAIN PROCESSOR. 00024000
* DMKCLKAP - ACTS AS THE SLAVE ROUTINE FOR DMKCLKMP. SETS THE 00025000
* CLOCK ON THE APU. ENTERED VIA EMS SIGP ON THE APU. 00026000
* DMKCLKSC - TOD SYNC CHECK PROCESSOR. 00027000
* ENTERED VIA SVC BY THE EXT SLIH FOLLOWING TOD SYNC 00028000
* CHECK. 00029000
* 00030000
* ENTRY CONDITIONS - DMKCLKCK, DMKCLKMP, DMKCLKSC 00031000
* 00032000
* GPR12 - DMKCLK ENTRY POINT ADDRESS. 00033000
* GPR13 - SAVEAREA ADDRESS. 00034000
* SYSTEM LOCK HELD. 00035000
* 00036000
* ENTRY CONDITIONS - DMKCLKCC, DMKCLKAP 00037000
* 00038000
* GPR12 - DMKCLK ENTRY POINT ADDRESS. 00039000
* SYSTEM LOCK HELD. 00040000
* 00041000
* EXIT CONDITIONS - DMKCLKCK, DMKCLKMP, DMKCLKSC 00042000
* 00043000
* NORMAL - RETURN TO CALLER VIA SVC. 00044000
* 00045000
* ERROR - ABEND 3 (CLOCK ERROR). 00046000
* 00047000
* EXIT CONDITIONS - DMKCLKCC, DMKCLKAP 00048000
* 00049000
* NORMAL - LOAD ENABLED WAIT STATE. 00050000
* 00051000
* ERROR - ABEND 3 (CLOCK ERROR). 00052000
* 00053000
* CALLS TO OTHER ROUTINES - 00054000
* 00055000
* DMKQCNWT - WRITE INDICATIVE CLOCK MESSAGES. 00056000
* 00057000
* EXTERNAL REFERENCES - 00058000
* 00059000
* NONE. 00060000
* 00061000
* TABLES/WORK AREAS - 00062000
* 00063000
* PSA 00064000
* TODCLK - STCK WORK AREAS USED BY DMKCLK. 00065000
* 00066000
* MACROS - 00067000
* 00068000
* RELOC, SWITCH, SIGNAL (CLKCHK), SIGNAL (SYNC), ABEND, CALL, 00069000
* EXIT, SIGNAL (QUIESCE), SIGNAL (RESUME). 00070000
* 00071000
* REGISTER USAGE - 00072000
* 00073000
* R11 - VMBLOK POINTER 00074000
* R12 - BASE REGISTER 00075000
* R13 - SAVEAREA POINTER 00076000
* 00077000
* NOTES - 00078000
* 00079000
* DMKCLKCK WILL ONLY BE INVOKED IN AN AP ENVIRONMENT. SINCE IT 00080000
* IS POSSIBLE FOR BOTH PROCESSORS TO SHARE THE SAME CLOCK, 00081000
* CODE IS INSERTED TO ENSURE NO ATTEMPT IS MADE TO SYNCHRONIZE 00082000
* IN A ONE-CLOCK SYSTEM. ATTEMPTS TO SYNCHRONIZE COULD CAUSE 00083000
* THE CLOCK IN A ONE-CLOCK SYSTEM TO ENTER THE STOPPED STATE. 00084000
* 00085000
* THE SYSTEM WILL RUN DISABLED FOR TOD SYNC CHECKS ON THE APU. 00086000
* 00087000
* ERROR MESSAGES - 00088000
* 00089000
* NONE. 00090000
* 00091000
* GENERAL MESSAGES - 00092000
* 00093000
* DMKCLK970W TOD CLOCK SYNC CHECK RECEIVED. 00094000
* CLOCK SYNCHRONIZATION - PRESS 'TOD ENABLE SET' 00095000
* 00096000
* WAIT STATE CODES - 00097000
* 00098000
* NONE - NOTE HOWEVER, THAT THE APU ROUTINES LOAD ENABLED WAIT 00099000
* PSW'S DURING THEIR PROCESSING AS THEY DO NOT EXIT TO 00100000
* THE DISPATCHER. 00101000
* 00102000
* ABENDS - 00103000
* 00104000
* CLK003 - AN ERROR HAS OCCURRED WHILE STORING OR SETTING THE TOD 00105000
* CLOCK. 00106000
* 00107000
EJECT 00108000
DMKCLK CSECT @V407595 00109000
COPY OPTIONS @V407595 00110000
DC CL8'DMKCLK' MODULE NAME @V4M0106 00111000
N0 EQU 0 @V407595 00112000
N1 EQU 1 @V407595 00113000
N2 EQU 2 @V407595 00114000
N4 EQU 4 @V407595 00115000
N8 EQU 8 @V407595 00116000
L8 EQU 8 @V407595 00117000
N16 EQU 16 @V407595 00118000
FF EQU X'FF' @V407595 00119000
EXTRN DMKPSADU @V407595 00120000
EJECT 00121000
* 00122000
* OPERATION - DMKCLKCK 00123000
* 00124000
* 1. ISSUE A SWITCH MACRO TO ENSURE RUNNING ON THE MAIN PROC. 00125000
* 2. ISSUE A CLKCHK EMS (DMKCLKCC) TO DETERMINE IF THE CLOCKS 00126000
* SHOULD BE SYNCHRONIZED. 00127000
* 3. IF DMKCLKCC INDICATES THAT THE CLOCKS SHOULD BE 00128000
* SYNCHRONIZED A MESSAGE IS WRITTEN TO THE OPERATOR 00129000
* REQUESTING ENABLEMENT OF THE 'TOD ENABLE SET' KEY. DMKCLKMP 00130000
* IS INVOKED TO SYNCHRONIZE CLOCKS. DMKCLKCK RETURNS TO 00131000
* CALLER. 00132000
* 4. IF DMKCLKCC INDICATES THAT THE CLOCK ON THE APU (OR MAIN 00133000
* PROC ON A ONE-CLOCK MULTI-PROCESSOR SYSTEM) IS RUNNING, 00134000
* MUST THEN TEST TO ENSURE THE HIGH ORDER 32 BYTES ARE IN 00135000
* SYNC. NOTE THAT A TOD SYNC CHECK WILL ONLY BE RECEIVED WHEN 00136000
* THE TOD CLOCKS ARE OUT OF LOW ORDER SYNCHRONIZATION. 00137000
* 5. IF THE CLOCKS ARE OUT OF HIGH ORDER SYNCHRONIZATION, THE 00138000
* CLOCK ARE SYNCHRONIZED AS IN STEP 3. 00139000
* 6. IF THE CLOCKS ARE IN HIGH ORDER SYNCHRONIZATION OR IF THE 00140000
* ATTACHED PROCESSOR INSTALLATION SHARES A COMMON CLOCK, 00141000
* CR0 IS ENABLED FOR TOD SYNC CHECKS AND DMKCLKCK RETURNS 00142000
* TO CALLER. NOTE THAT IF THE CLOCKS ARE OUT OF LOW ORDER 00143000
* SYNC, A TOD SYNC CHECK WILL BE RECEIVED WHEN EXT INTERRUPTS 00144000
* ARE ENABLED. THIS WILL RESULT IN AN ENTRY TO DMKCLKSC TO 00145000
* SYNCHRONIZE THE TOD CLOCKS. 00146000
* 00147000
SPACE 5 00148000
USING SAVEAREA,R13 @V407595 00149000
DMKCLKCK RELOC EXECUTES ON MAIN-SVC ENTRY @V407595 00150000
USING PSA,R0 @V407595 00151000
SWITCH ENSURE RUNNING ON MAIN PROCESSOR @V4M0143 00152000
MVI CLKFLAG1,N0 CLEAR INTERNAL FLAG BYTE @V407595 00153000
CLKSTORE EQU * @V407595 00154000
STCK TODCLKA STORE TOD CLOCK @V407595 00155000
BC 8,CLKSET1 CC=0, CLOCK IS SET @V407595 00156000
B CLKABEND CC=1,2,3 IS ERROR SINCE CLOCK @V407595 00157000
* SHOULD BE RUNNING AT THIS POINT. 00158000
CLKSET1 EQU * @V407595 00159000
* 00160000
* NOW DETERMINE IF CLOCKS SHOULD BE SYNCHRONIZED. 00161000
* 00162000
SIGNAL CLKCHK CALL DMKCLKCC @V407595 00163000
TM CLKFLAG1,CLKSYNC SHOULD CLOCKS BE SYNCHRONIZED? @V407595 00164000
BO CLKSYN YES- DMKCLKCC INDICATES CLOCKS @V407595 00165000
* SHOULD BE SYNCHRONIZED. 00166000
STCK TODCLKC STORE TOD CLOCK @V407595 00167000
BC 8,CLKSET2 CC=0, CLOCK IS SET @V407595 00168000
CLKABEND EQU * @V407595 00169000
ABEND 3 CC=1,2,3 - ERROR @V407595 00170000
CLKSET2 EQU * @V407595 00171000
L R1,TODCLKAL LOAD HIGH ORDER CLOCK WORD @V407595 00172000
AL R1,ONESEC ADD 1 SEC TO HIGH ORDER COUNT @V407595 00173000
ST R1,TODCLKAL AND SAVE. @V407595 00174000
CLC TODCLKC,TODCLKA IF > 1 SECOND TRANSPIRED THEN @V407595 00175000
* CANNOT TEST HIGH ORDER SYNCHRONIZATION 00176000
BNL CLKSTORE YES- TRY AGAIN @V407595 00177000
* NO- TEST HIGH ORDER SYNCHRONIZATION 00178000
SL R1,ONESEC DECREMENT BY 1 SEC @V407595 00179000
ST R1,TODCLKAL RESTORE ORIGINAL CLOCK VALUE @V407595 00180000
CLC TODCLKA,TODCLKB IS 1ST MAIN PROC STCK LESS THAN @V407595 00181000
* THE APU STCK 00182000
BNL CLKSYN (NO- SYNCHRONIZE CLOCKS) @V407595 00183000
CLC TODCLKB(L8),TODCLKC AND THE APU STCK IS > THE @V407595 00184000
* 2ND MAIN PROCESSOR STCK, THEN 00185000
BNL CLKSYN SYNC THE TOD CLOCKS; ELSE @V407595 00186000
* DO NOT SYNC THE TOD CLOCKS. THE @V405795 00187000
* CLOCKS ARE IN HIGH ORDER SYNCHRONIZATION. 00188000
* ATTEMPTS TO SYNCHRONIZE COULD CAUSE 00189000
* THE CLOCK IN A ONE CLOCK MULTIPROCESSING 00190000
* SYSTEM TO ENTER THE STOPPED STATE. 00191000
LCTL C0,C0,CR0INTMN ENABLE FOR TOD SYNC CHECKS @V407595 00192000
STCTL C0,C0,CPCREG0 DITTO IN PSA @V407595 00193000
B NOSYNC BYPASS CLOCK SYNCHRONIZATION @V407595 00194000
* NOTE IF CLOCKS ARE SYNCHRONIZED 00195000
* DMKCLKMP WILL ENABLE SYNC CHECKS IN CR0. 00196000
CLKSYN EQU * CLOCKS OUT OF HIGH ORDER SYNC OR @V407595 00197000
* APU CLOCK NOT SET, IN ERROR OR STOPPED. 00198000
LA R1,SETMSG MESSAGE TO ENABLE TOD ENABLE SET @V407595 00199000
* SWITCH. 00200000
LA R0,SETMSGL LENGTH OF MESSAGE @V407595 00201000
CALL DMKQCNWT,PARM=NOTIME+OPERATOR ISSUE MSG @V407595 00202000
CALL DMKCLKMP SYNCHRONIZE THE TOD CLOCKS @V407595 00203000
NOSYNC EQU * @V407595 00204000
EXIT RETURN TO CALLER @V407595 00205000
EJECT 00206000
* 00207000
* OPERATION - DMKCLKCC 00208000
* 00209000
* 1. CLEAR EMS CLKCHK PENDING FLAG IN PSA. 00210000
* 2. STORE THE TOD CLOCK TO TIMESTAMP CURRENT APU CLOCK VALUE. 00211000
* THIS WILL BE SUBSEQUENTLY USED IN TESTING HIGH ORDER CLOCK 00212000
* SYNCHRONIZATION. 00213000
* 3. IF THE CLOCK IS SET DO STEPS 4-6; ELSE GO TO STEP 7. 00214000
* 4. TURN ON CPWAIT AND CPSUPER, AND TURN OFF THE OTHER BITS. 00215500
* 5. EMS CLKCHK RECEIVED IS SET ON IN THE PSA. 00218000
* 6. DMKCLKCC LOADS AN ENABLED WAIT STATE PSW. 00219000
* 7. IF THE CC FROM THE STCK INDICATES THE CLOCK IS NOT SET, 00220000
* OR IS SET BUT IN ERROR, OR IS IN THE STOPPED STATE SET AN 00221000
* INTERNAL BIT IN DMKCLK TO INFORM THE CALLER THAT THE CLOCKS 00222000
* SHOULD BE SYNCHRONIZED. GO TO STEP 5. 00223000
* 8. IF THE CC INDICATES THAT THE CLOCK IS NOT OPERATIONAL, 00224000
* ISSUE ABEND 3. 00225000
* 00226000
SPACE 5 00227000
ENTRY DMKCLKCC @V407595 00228000
DMKCLKCC DS 0H EXECUTES ON APU - SIGP CLKCHK @V407595 00229000
USING *,R12 @V407595 00230000
SL R12,CLKCC ESTABLISH BASE FROM MOD START @V407595 00231000
USING DMKCLK,R12 @V407595 00232000
L R11,ASYSOP RUN UNDER OPERATOR VMBLOK @V4M0106 00233000
NI EMSPEND,FF-EMSPCLKC TURN OFF CLKCHK EMS PENDING @V407595 00234000
STCK TODCLKB TIMESTAMP FOR CHECKING HIGH @V407595 00235000
* ORDER SYNCHRONIZATION. 00236000
BC 8,CCEXIT CC=0, (CLOCK SET) @V407595 00237000
BC 6,SETSYNC CC=1, (NOT SET) OR CC=2 (ERROR) @V407595 00238000
* TELL SENDER CLOCKS SHOULD BE SYN'D. 00239000
* CC=3 (STOPPED OR NOT OPERATIONAL) 00240000
CLC TODCLKB,ZEROES NOT OPERATIONAL ? @V407595 00241000
BNE SETSYNC NO- (IN STOPPED STATE) @V407595 00242000
ABEND 03 YES- TERMINATE- CLOCK NOT OPER @V407595 00243000
SETSYNC EQU * @V407595 00244000
OI CLKFLAG1,CLKSYNC TELL SENDER TO SYNCHRONIZE TOD @V407595 00245000
* CLOCKS AND TERMINATE SPIN LOOP. 00246000
CCEXIT EQU * @V407595 00247000
MVI CPSTATUS,CPWAIT+CPSUPER INDICATE PROCESSOR IN @VA11576 00248500
* SUPERVISOR AND WAIT STATE, 00249500
* AND CLEAR OTHER FLAGS. 00250500
OI EMSREC,EMSRCLKC TURN ON CLKCHK RECEIVED @V407595 00256000
LPSW ENABLEWT ENABLE FOR EXTERNAL INTERRUPTS @V407595 00257000
EJECT 00258000
* 00259000
* OPERATION - DMKCLKMP, DMKCLKAP 00260000
* 00261000
* SYNCHRONIZE THE TOD CLOCKS AS FOLLOWS : 00262000
* 00263000
* 1. DMKCLKMP - STORE THE TOD CLOCK + 1 SEC. THIS VALUE WILL BE 00264000
* SET IN THE APU CLOCK BY DMKCLKAP. 00265000
* 2. DMKCLKMP - ISSUE SYNC EMS TO INVOKE DMKCLKAP TO RUN ON THE APU. 00266000
* 3. DMKCLKAP - TURN OFF SYNC EMS PENDING IN THE PSA. 00267000
* 4. DMKCLKAP - TURN ON THE TOD SYNC CONTROL BIT IN CR0. WHEN THIS 00268000
* BIT IS ON AND THE CLOCK IS IN THE STOPPED STATE 00269000
* (APU'S CLOCK ENTERS STOPPED STATE ON SCK) THE APU'S 00270000
* CLOCK WILL ENTER THE SET STATE (I.E., RUNNING) WHEN 00271000
* MAIN PROCESSOR'S CLOCK INCREMENTS TO ALL ZEROES IN 00272000
* BIT POSITIONS 32-63. THE CLOCKS WILL THEN BE IN LOW 00273000
* ORDER SYNCHRONIZATION. 00274000
* 5. DMKCLKAP - ISSUE SCK TO SET THE VALUE PASSED BY DMKCLKMP 00275000
* (TOD CLOCK VALUE + 1 SEC). 00276000
* 6. DMKCLKAP - CHECK THE CC FROM THE SCK. 00277000
* CLOCK IN 'SECURE POSITION' - REISSUE THE SCK. 00278000
* CLOCK NOT OPERATIONAL - ABEND 3. 00279000
* CLOCK IS SET - ZERO CPWAIT AND CPSUPER. 00280000
* 7. DMKCLKAP - TURN ON SYNC EMS RECEIVED AND LOAD AN ENABLED WAIT 00281000
* STATE PSW. 00282000
* 8. DMKCLKMP - OBTAIN CLOCK VALUE ON RETURN FROM DMKCLKAP. 00283000
* IF THIS VALUE IS > ORIGINAL +1 SEC VALUE AS PASSED 00284000
* TO DMKCLKAP, THEN CLOCK ARE NOT IN HIGH ORDER SYNC. 00285000
* REPEAT WITH STEP 1. 00286000
* 9. DMKCLKMP - LOOP FOR 1 SEC THEN ENABLE CR0 FOR TOD SYNC CHECKS. 00287000
* 10. DMKCLKMP - RETURN TO CALLER. 00288000
* 00289000
EJECT 00290000
DMKCLKMP RELOC EXECUTES ON MAIN - SVC ENTRY @V407595 00291000
CLKSYNMP EQU * @V407595 00292000
STCK TODCLKA STORE TOD CLOCK @V407595 00293000
BC 7,CLKERRMP ERROR - TERMINATE - CLOCK SHOULD @V407595 00294000
* BE RUNNING. 00295000
SR R1,R1 CLEAR WORK REG @V407595 00296000
ST R1,TODCLKAR CLEAR LOW ORDER 32 BITS @V407595 00297000
LA R1,N1 SET 1 TO WORK REG @V407595 00298000
AL R1,TODCLKAL ADD 1 SEC TO HIGH ORDER 32 BITS @V407595 00299000
ST R1,TODCLKAL AND SAVE @V407595 00300000
SIGNAL SYNC CALL DMKCLKAP TO RUN ON APU @V407595 00301000
STCK TODCLKB TIMESTAMP INTERVAL BETWEEN 1ST @V407595 00302000
* STCK AND NOW. 00303000
BC 7,CLKERRMP ERROR - TERMINATE - CLOCK SHOULD @V407595 00304000
* BE RUNNING. 00305000
CLC TODCLKB,TODCLKA IF 2ND STCK IS > ORIGINAL +1 @V407595 00306000
* CLOCKS ARE NOT IN SYNC- @V407595 00307000
BH CLKSYNMP TRY AGAIN. @V407595 00308000
STCK TODCLKC SET TIMESTAMP FOR LOOP CONTROL @V407595 00309000
BC 7,CLKERRMP ERROR - TERMINATE - CLOCK SHOULD @V407595 00310000
* BE RUNNING. 00311000
LA R1,2 SET WORK VALUE TO 2 SECONDS @VMV0004 00312100
AL R1,TODCLKCL ADD 2.08 SEC TO HIGH ORDER TIME @V407595 00312200
* TO ENSURE THAT A MINIMUM OF 1 00312300
* SECOND WILL HAVE ELASPED AFTER THE 00312400
* CLOCKS ARE SYNCHRONIZED. 00312500
ST R1,TODCLKCL AND SAVE @V407595 00314000
CLKCHK1S EQU * @V407595 00315000
STCK TODCLKB GET TOD CLOCK VALUE @V407595 00316000
BC 7,CLKERRMP ERROR - TERMINATE - CLOCK SHOULD @V407595 00317000
* BE RUNNING. 00318000
CLC TODCLKB,TODCLKC HAS ONE SECOND ELAPSED? @V407595 00319000
BL CLKCHK1S NO- CONTINUE LOOPING @V407595 00320000
LCTL C0,C0,CR0INTMN ENABLE FOR SYNC CHECKS. @V407595 00321000
STCTL C0,C0,CPCREG0 SAVE IN REAL 0 FOR CP @V4M0143 00322000
EXIT RETURN @V407595 00323000
CLKERRMP EQU * @V407595 00324000
ABEND 003 @V407595 00325000
EJECT 00326000
DMKCLKAP DS 0H ENTERED VIA SYNC EMS ON APU @V407595 00327000
ENTRY DMKCLKAP @V407595 00328000
BALR R12,R0 ESTABLISH BASE @V407595 00329000
USING *,R12 @V407595 00330000
L R11,ASYSOP RUN UNDER OPERATOR VMBLOK @V4M0106 00331000
NI EMSPEND,FF-EMSPSYNC TURN OFF SYNC PENDING @V407595 00332000
LCTL C0,C0,C0TODSYN SET THE TOD SYNCHRONIZATION BIT @V407595 00333000
CLKSECRE EQU * @V407595 00334000
SCK TODCLKA SET TOD AS PASSED BY MAIN PROC @V407595 00335000
BC 8,CLKSET CC=0, CLOCK SET @V407595 00336000
BC 4,CLKSECRE CC=1, CLOCK SECURE - LOOP @V407595 00337000
* CC=3, CLOCK NOT OPERATIONAL @V407595 00338000
ABEND 0003 TERMINATE @V407595 00339000
CLKSET EQU * @V407595 00340000
MVI CPSTATUS,CPWAIT+CPSUPER INDICATE PROCESSOR IN @VA11576 00341500
* SUPERVISOR AND WAIT STATE. 00342500
* ALSO CLEAR ALL OTHER FLAGS. 00343500
* THIS WILL ENSURE CLOCK SYNC SO 00344500
* THAT WORK CAN BE DISPATCHED TO 00345500
* THE APU. 00346500
OI EMSREC,EMSRSYNC LET MAIN PROCESSOR CONTINUE @V407595 00349000
LPSW ENABLEWT ENABLE FOR EMS INTERRUPTS @V407595 00350000
EJECT 00351000
* 00352000
* OPERATION - DMKCLKSC 00353000
* 00354000
* 1. ISSUE A SWITCH MACRO TO ENSURE RUNNING ON THE MAIN PROCESSSOR. 00355000
* THIS IS NECESSARY SINCE THIS ROUTINE IS PAGEABLE AND IS INVOKED 00356000
* VIA SVC FROM THE EXT SLIH. 00357000
* 2. IF THE TOD SYNC CHECK IS ALREADY BEING PROCESSED (PROCSCHK=1) 00358000
* THIS ROUNTINE EXITS TO CALLER. NOTE THAT SYNC CHECK INTERRUPTS 00359000
* WILL CONTINUE TO BE RECEIVED UNTIL THE CLOCKS ARE SYNCHRONIZED 00360000
* OR THE INTERRUPT IS DISABLED. 00361000
* 3. IF PROCSCHK=0, SET PROCSCHK=1 AND DISABLE FOR TOD SYNC CHECKS. 00362000
* 4. MESSAGE 970W IS ISSUED TO INFORM THE INSTALLATION OF THE SYNC 00363000
* CHECK. 00364000
* 5. A SECOND MESSAGE IS ISSUED REQUESTING THE SYSTEM OPERATOR TO 00365000
* PRESS THE 'TOD ENABLE SET' KEY. 00366000
* 6. THE APU IS QUIESCED. 00367000
* 7. DMKCLKMP IS INVOKED TO SYNC THE TOD CLOCKS. 00368000
* 8. PROCSCHK IS SET OFF, AND THE ATTACHED PROCESSOR IS RESUME'D. 00369000
* 9. DMKCLKSC EXITS TO CALLER. 00370000
* 00371000
SPACE 5 00372000
DMKCLKSC RELOC @V407595 00373000
SWITCH ENSURE RUNNING ON MAIN PROCESSOR @V4M0143 00374000
TM APSTAT4,PROCSCHK TOD SYNC CHECK ALREADY BEING @VA07615 00375100
* PROCESSED ? 00376000
BO SCEXIT YES - EXIT @V407595 00377000
OI APSTAT4,PROCSCHK NO- INDICATE BEING PROCESSED @VA07615 00378100
LCTL C0,C0,NOSYNCHK INHIBIT SYN CHECKS @V407595 00379000
STCTL C0,C0,CPCREG0 UNTIL CLOCKS ARE RESYNCHRONIZED @V407595 00380000
LA R1,CLK970W SYNC CHECK WARNING MSG @V407595 00381000
LA R0,CLK970WL LENGTH OF MSG @V407595 00382000
CALL DMKQCNWT,PARM=NOTIME+OPERATOR+ALARM ISSUE MSG @V407595 00383000
LA R1,SETMSG SYNC CHK- ENABLE TOD SET SWITCH @V407595 00384000
LA R0,SETMSGL LENGTH OF MESSAGE @V407595 00385000
CALL DMKQCNWT,PARM=NOTIME+OPERATOR ISSUE MSG @V407595 00386000
SIGNAL QUIESCE QUIESCE THE APU @V407595 00387000
CALL DMKCLKMP SYNCHRONIZE THE TOD CLOCKS @V407595 00388000
STCTL C0,C0,CPCREG0 ENABLE SYNC CHECKS FOR SYSTEM. @V407595 00389000
* NOTE DMKCLKMP RE-ENABLES SYNC CHECKS IN 00390000
* CR0. 00391000
NI APSTAT4,FF-PROCSCHK CLEAR SYNC BEING PROCESSED @VA07615 00392100
* INDICATOR. 00393000
SIGNAL RESUME CONTINUE PROCESSING ON APU @V407595 00394000
SCEXIT EQU * @V407595 00395000
EXIT RETURN TO CALLER @V407595 00396000
EJECT 00397000
DS 0D @V407595 00398000
CLKRSTNW DC A(MCHEKENB,DMKPSADU) SYSTEM RESTART NEW PSW @V407595 00399000
XWAIT4 DC X'0002000000000015' INDICATE SIGP ERROR @V407595 00400000
XWAIT5 DC X'0002000000000016' TOD CLOCK ERROR ON APU @V407595 00401000
ENABLEWT DC X'010E000000000000' ENABLE WAIT STATE @V407595 00402000
C0TODSYN DC AL1(BLKMPX+TODSYNC+NOSSKCK,PAGE4K) HRC004DK 00403490
DC AL1(MFAMASK+EMSMASK+XCMASK) ENABLE MFA/EMS/XC @V407595 00404000
DC AL1(0) @V407595 00405000
CR0INTMN DC AL1(BLKMPX+NOSSKCK,PAGE4K) HRC004DK 00406490
DC AL1(MFAMASK+EMSMASK+XCMASK+SYNCMASK+CKCMASK+CPTMASK) 00407000
DC AL1(INTMASK+KEYMASK) BITMASK FOR CR0 ON MAIN PR @V407595 00408000
NOSYNCHK DC AL1(BLKMPX+NOSSKCK,PAGE4K) HRC004DK 00409490
DC AL1(MFAMASK+EMSMASK+XCMASK+CKCMASK+CPTMASK) @V4M0143 00410000
DC AL1(INTMASK+KEYMASK) CR0 WITHOUT TOD SYNC CHK @V407595 00411000
SPACE 2 00412000
TODCLKA DS D STCK WORK AREA @V407595 00413000
ORG TODCLKA @V407595 00414000
TODCLKAL DS F LEFTMOST 32 BITS OF TOD CLOCK @V407595 00415000
TODCLKAR DS F RIGHTMOST 32 BITS OF TOD CLOCK @V407595 00416000
TODCLKB DS D STCK WORK AREA @V407595 00417000
ORG TODCLKB @V407595 00418000
TODCLKBL DS F LEFTMOST 32 BITS OF TOD CLOCK @V407595 00419000
TODCLKBR DS F RIGHTMOST 32 BITS OF TOD CLOCK @V407595 00420000
TODCLKC DS D STCK WORK AREA @V407595 00421000
ORG TODCLKC @V407595 00422000
TODCLKCL DS F LEFTMOST 32 BITS OF TOD CLOCK @V407595 00423000
TODCLKCR DS F RIGHTMOST 32 BITS OF TOD CLOCK @V407595 00424000
SPACE 2 00425000
ONESEC DC F'1' @V407595 00426000
CLKCC DC A(DMKCLKCC-DMKCLK) @V407595 00427000
CLKFLAGS DS 0H @V407595 00428000
ORG CLKFLAGS @V407595 00429000
CLKFLAG1 DS C @V407595 00430000
CLKSIG EQU X'80' @V407595 00431000
CLKSYNC EQU X'40' @V407595 00432000
CLKERR EQU X'20' @V407595 00433000
CLKFLAG2 DS C RESERVED @V407595 00434000
SPACE 2 00435000
CLK970W DC C'DMKCLK970W TOD CLOCK SYNC CHECK RECEIVED' @V407595 00436000
CLK970WL EQU *-CLK970W @V407595 00437000
SETMSG DC C'CLOCK SYNCHRONIZATION- PRESS ''TOD ENABLE SET''' 00438000
SETMSGL EQU *-SETMSG @V407595 00439000
COPY EQU @V407595 00440000
COPY SAVE @V407595 00441000
PSA @V407595 00442000
MCHEKENB EQU (MCHEK+EXTMODE)*X'10000' @V407595 00443000
END DMKCLK @V407595 00444000