Table of Contents

DMKCLK Source

References

Source Listing

DMKCLK.ASSEMBLE.txt
  1. CLK TITLE 'DMKCLK (CP) VM/370 - RELEASE 6' 00001000
  2. ISEQ 73,80 VALIDATE SEQUENCING OF INPUT 00002000
  3. * MODULE NAME - 00003000
  4. * 00004000
  5. * DMKCLK 00005000
  6. * 00006000
  7. * FUNCTION - 00007000
  8. * 00008000
  9. * SYNCHRONIZE THE TOD CLOCKS IN AN ATTACHED PROCESSOR SYSTEM. 00009000
  10. * 00010000
  11. * ATTRIBUTES - 00011000
  12. * 00012000
  13. * SERIAL-REUS, PAGEABLE, ENTERED VIA SVC FROM DMKCPI DURING REAL 00013000
  14. * MACHINE INITIALIZATION OR DMKEXT ON RECEIPT OF A TOD SYNC 00014000
  15. * CHECK. 00015000
  16. * 00016000
  17. * ENTRY POINTS - 00017000
  18. * 00018000
  19. * DMKCLKCK - DETERMINE IF THE CLOCKS SHOULD BE SYNCHRONIZED. 00019000
  20. * ENTERED FORM DMKCPI VIA SVC. 00020000
  21. * DMKCLKCC - INFORMS SENDER THE STATE OF THE APU CLOCK. 00021000
  22. * ENTERED VIA EMS SIGP ON THE APU. 00022000
  23. * DMKCLKMP - MASTER ROUTINE FOR CLOCK SYNCHRONIZATION. 00023000
  24. * ENTERED VIA SVC ON THE MAIN PROCESSOR. 00024000
  25. * DMKCLKAP - ACTS AS THE SLAVE ROUTINE FOR DMKCLKMP. SETS THE 00025000
  26. * CLOCK ON THE APU. ENTERED VIA EMS SIGP ON THE APU. 00026000
  27. * DMKCLKSC - TOD SYNC CHECK PROCESSOR. 00027000
  28. * ENTERED VIA SVC BY THE EXT SLIH FOLLOWING TOD SYNC 00028000
  29. * CHECK. 00029000
  30. * 00030000
  31. * ENTRY CONDITIONS - DMKCLKCK, DMKCLKMP, DMKCLKSC 00031000
  32. * 00032000
  33. * GPR12 - DMKCLK ENTRY POINT ADDRESS. 00033000
  34. * GPR13 - SAVEAREA ADDRESS. 00034000
  35. * SYSTEM LOCK HELD. 00035000
  36. * 00036000
  37. * ENTRY CONDITIONS - DMKCLKCC, DMKCLKAP 00037000
  38. * 00038000
  39. * GPR12 - DMKCLK ENTRY POINT ADDRESS. 00039000
  40. * SYSTEM LOCK HELD. 00040000
  41. * 00041000
  42. * EXIT CONDITIONS - DMKCLKCK, DMKCLKMP, DMKCLKSC 00042000
  43. * 00043000
  44. * NORMAL - RETURN TO CALLER VIA SVC. 00044000
  45. * 00045000
  46. * ERROR - ABEND 3 (CLOCK ERROR). 00046000
  47. * 00047000
  48. * EXIT CONDITIONS - DMKCLKCC, DMKCLKAP 00048000
  49. * 00049000
  50. * NORMAL - LOAD ENABLED WAIT STATE. 00050000
  51. * 00051000
  52. * ERROR - ABEND 3 (CLOCK ERROR). 00052000
  53. * 00053000
  54. * CALLS TO OTHER ROUTINES - 00054000
  55. * 00055000
  56. * DMKQCNWT - WRITE INDICATIVE CLOCK MESSAGES. 00056000
  57. * 00057000
  58. * EXTERNAL REFERENCES - 00058000
  59. * 00059000
  60. * NONE. 00060000
  61. * 00061000
  62. * TABLES/WORK AREAS - 00062000
  63. * 00063000
  64. * PSA 00064000
  65. * TODCLK - STCK WORK AREAS USED BY DMKCLK. 00065000
  66. * 00066000
  67. * MACROS - 00067000
  68. * 00068000
  69. * RELOC, SWITCH, SIGNAL (CLKCHK), SIGNAL (SYNC), ABEND, CALL, 00069000
  70. * EXIT, SIGNAL (QUIESCE), SIGNAL (RESUME). 00070000
  71. * 00071000
  72. * REGISTER USAGE - 00072000
  73. * 00073000
  74. * R11 - VMBLOK POINTER 00074000
  75. * R12 - BASE REGISTER 00075000
  76. * R13 - SAVEAREA POINTER 00076000
  77. * 00077000
  78. * NOTES - 00078000
  79. * 00079000
  80. * DMKCLKCK WILL ONLY BE INVOKED IN AN AP ENVIRONMENT. SINCE IT 00080000
  81. * IS POSSIBLE FOR BOTH PROCESSORS TO SHARE THE SAME CLOCK, 00081000
  82. * CODE IS INSERTED TO ENSURE NO ATTEMPT IS MADE TO SYNCHRONIZE 00082000
  83. * IN A ONE-CLOCK SYSTEM. ATTEMPTS TO SYNCHRONIZE COULD CAUSE 00083000
  84. * THE CLOCK IN A ONE-CLOCK SYSTEM TO ENTER THE STOPPED STATE. 00084000
  85. * 00085000
  86. * THE SYSTEM WILL RUN DISABLED FOR TOD SYNC CHECKS ON THE APU. 00086000
  87. * 00087000
  88. * ERROR MESSAGES - 00088000
  89. * 00089000
  90. * NONE. 00090000
  91. * 00091000
  92. * GENERAL MESSAGES - 00092000
  93. * 00093000
  94. * DMKCLK970W TOD CLOCK SYNC CHECK RECEIVED. 00094000
  95. * CLOCK SYNCHRONIZATION - PRESS 'TOD ENABLE SET' 00095000
  96. * 00096000
  97. * WAIT STATE CODES - 00097000
  98. * 00098000
  99. * NONE - NOTE HOWEVER, THAT THE APU ROUTINES LOAD ENABLED WAIT 00099000
  100. * PSW'S DURING THEIR PROCESSING AS THEY DO NOT EXIT TO 00100000
  101. * THE DISPATCHER. 00101000
  102. * 00102000
  103. * ABENDS - 00103000
  104. * 00104000
  105. * CLK003 - AN ERROR HAS OCCURRED WHILE STORING OR SETTING THE TOD 00105000
  106. * CLOCK. 00106000
  107. * 00107000
  108. EJECT 00108000
  109. DMKCLK CSECT @V407595 00109000
  110. COPY OPTIONS @V407595 00110000
  111. DC CL8'DMKCLK' MODULE NAME @V4M0106 00111000
  112. N0 EQU 0 @V407595 00112000
  113. N1 EQU 1 @V407595 00113000
  114. N2 EQU 2 @V407595 00114000
  115. N4 EQU 4 @V407595 00115000
  116. N8 EQU 8 @V407595 00116000
  117. L8 EQU 8 @V407595 00117000
  118. N16 EQU 16 @V407595 00118000
  119. FF EQU X'FF' @V407595 00119000
  120. EXTRN DMKPSADU @V407595 00120000
  121. EJECT 00121000
  122. * 00122000
  123. * OPERATION - DMKCLKCK 00123000
  124. * 00124000
  125. * 1. ISSUE A SWITCH MACRO TO ENSURE RUNNING ON THE MAIN PROC. 00125000
  126. * 2. ISSUE A CLKCHK EMS (DMKCLKCC) TO DETERMINE IF THE CLOCKS 00126000
  127. * SHOULD BE SYNCHRONIZED. 00127000
  128. * 3. IF DMKCLKCC INDICATES THAT THE CLOCKS SHOULD BE 00128000
  129. * SYNCHRONIZED A MESSAGE IS WRITTEN TO THE OPERATOR 00129000
  130. * REQUESTING ENABLEMENT OF THE 'TOD ENABLE SET' KEY. DMKCLKMP 00130000
  131. * IS INVOKED TO SYNCHRONIZE CLOCKS. DMKCLKCK RETURNS TO 00131000
  132. * CALLER. 00132000
  133. * 4. IF DMKCLKCC INDICATES THAT THE CLOCK ON THE APU (OR MAIN 00133000
  134. * PROC ON A ONE-CLOCK MULTI-PROCESSOR SYSTEM) IS RUNNING, 00134000
  135. * MUST THEN TEST TO ENSURE THE HIGH ORDER 32 BYTES ARE IN 00135000
  136. * SYNC. NOTE THAT A TOD SYNC CHECK WILL ONLY BE RECEIVED WHEN 00136000
  137. * THE TOD CLOCKS ARE OUT OF LOW ORDER SYNCHRONIZATION. 00137000
  138. * 5. IF THE CLOCKS ARE OUT OF HIGH ORDER SYNCHRONIZATION, THE 00138000
  139. * CLOCK ARE SYNCHRONIZED AS IN STEP 3. 00139000
  140. * 6. IF THE CLOCKS ARE IN HIGH ORDER SYNCHRONIZATION OR IF THE 00140000
  141. * ATTACHED PROCESSOR INSTALLATION SHARES A COMMON CLOCK, 00141000
  142. * CR0 IS ENABLED FOR TOD SYNC CHECKS AND DMKCLKCK RETURNS 00142000
  143. * TO CALLER. NOTE THAT IF THE CLOCKS ARE OUT OF LOW ORDER 00143000
  144. * SYNC, A TOD SYNC CHECK WILL BE RECEIVED WHEN EXT INTERRUPTS 00144000
  145. * ARE ENABLED. THIS WILL RESULT IN AN ENTRY TO DMKCLKSC TO 00145000
  146. * SYNCHRONIZE THE TOD CLOCKS. 00146000
  147. * 00147000
  148. SPACE 5 00148000
  149. USING SAVEAREA,R13 @V407595 00149000
  150. DMKCLKCK RELOC EXECUTES ON MAIN-SVC ENTRY @V407595 00150000
  151. USING PSA,R0 @V407595 00151000
  152. SWITCH ENSURE RUNNING ON MAIN PROCESSOR @V4M0143 00152000
  153. MVI CLKFLAG1,N0 CLEAR INTERNAL FLAG BYTE @V407595 00153000
  154. CLKSTORE EQU * @V407595 00154000
  155. STCK TODCLKA STORE TOD CLOCK @V407595 00155000
  156. BC 8,CLKSET1 CC=0, CLOCK IS SET @V407595 00156000
  157. B CLKABEND CC=1,2,3 IS ERROR SINCE CLOCK @V407595 00157000
  158. * SHOULD BE RUNNING AT THIS POINT. 00158000
  159. CLKSET1 EQU * @V407595 00159000
  160. * 00160000
  161. * NOW DETERMINE IF CLOCKS SHOULD BE SYNCHRONIZED. 00161000
  162. * 00162000
  163. SIGNAL CLKCHK CALL DMKCLKCC @V407595 00163000
  164. TM CLKFLAG1,CLKSYNC SHOULD CLOCKS BE SYNCHRONIZED? @V407595 00164000
  165. BO CLKSYN YES- DMKCLKCC INDICATES CLOCKS @V407595 00165000
  166. * SHOULD BE SYNCHRONIZED. 00166000
  167. STCK TODCLKC STORE TOD CLOCK @V407595 00167000
  168. BC 8,CLKSET2 CC=0, CLOCK IS SET @V407595 00168000
  169. CLKABEND EQU * @V407595 00169000
  170. ABEND 3 CC=1,2,3 - ERROR @V407595 00170000
  171. CLKSET2 EQU * @V407595 00171000
  172. L R1,TODCLKAL LOAD HIGH ORDER CLOCK WORD @V407595 00172000
  173. AL R1,ONESEC ADD 1 SEC TO HIGH ORDER COUNT @V407595 00173000
  174. ST R1,TODCLKAL AND SAVE. @V407595 00174000
  175. CLC TODCLKC,TODCLKA IF > 1 SECOND TRANSPIRED THEN @V407595 00175000
  176. * CANNOT TEST HIGH ORDER SYNCHRONIZATION 00176000
  177. BNL CLKSTORE YES- TRY AGAIN @V407595 00177000
  178. * NO- TEST HIGH ORDER SYNCHRONIZATION 00178000
  179. SL R1,ONESEC DECREMENT BY 1 SEC @V407595 00179000
  180. ST R1,TODCLKAL RESTORE ORIGINAL CLOCK VALUE @V407595 00180000
  181. CLC TODCLKA,TODCLKB IS 1ST MAIN PROC STCK LESS THAN @V407595 00181000
  182. * THE APU STCK 00182000
  183. BNL CLKSYN (NO- SYNCHRONIZE CLOCKS) @V407595 00183000
  184. CLC TODCLKB(L8),TODCLKC AND THE APU STCK IS > THE @V407595 00184000
  185. * 2ND MAIN PROCESSOR STCK, THEN 00185000
  186. BNL CLKSYN SYNC THE TOD CLOCKS; ELSE @V407595 00186000
  187. * DO NOT SYNC THE TOD CLOCKS. THE @V405795 00187000
  188. * CLOCKS ARE IN HIGH ORDER SYNCHRONIZATION. 00188000
  189. * ATTEMPTS TO SYNCHRONIZE COULD CAUSE 00189000
  190. * THE CLOCK IN A ONE CLOCK MULTIPROCESSING 00190000
  191. * SYSTEM TO ENTER THE STOPPED STATE. 00191000
  192. LCTL C0,C0,CR0INTMN ENABLE FOR TOD SYNC CHECKS @V407595 00192000
  193. STCTL C0,C0,CPCREG0 DITTO IN PSA @V407595 00193000
  194. B NOSYNC BYPASS CLOCK SYNCHRONIZATION @V407595 00194000
  195. * NOTE IF CLOCKS ARE SYNCHRONIZED 00195000
  196. * DMKCLKMP WILL ENABLE SYNC CHECKS IN CR0. 00196000
  197. CLKSYN EQU * CLOCKS OUT OF HIGH ORDER SYNC OR @V407595 00197000
  198. * APU CLOCK NOT SET, IN ERROR OR STOPPED. 00198000
  199. LA R1,SETMSG MESSAGE TO ENABLE TOD ENABLE SET @V407595 00199000
  200. * SWITCH. 00200000
  201. LA R0,SETMSGL LENGTH OF MESSAGE @V407595 00201000
  202. CALL DMKQCNWT,PARM=NOTIME+OPERATOR ISSUE MSG @V407595 00202000
  203. CALL DMKCLKMP SYNCHRONIZE THE TOD CLOCKS @V407595 00203000
  204. NOSYNC EQU * @V407595 00204000
  205. EXIT RETURN TO CALLER @V407595 00205000
  206. EJECT 00206000
  207. * 00207000
  208. * OPERATION - DMKCLKCC 00208000
  209. * 00209000
  210. * 1. CLEAR EMS CLKCHK PENDING FLAG IN PSA. 00210000
  211. * 2. STORE THE TOD CLOCK TO TIMESTAMP CURRENT APU CLOCK VALUE. 00211000
  212. * THIS WILL BE SUBSEQUENTLY USED IN TESTING HIGH ORDER CLOCK 00212000
  213. * SYNCHRONIZATION. 00213000
  214. * 3. IF THE CLOCK IS SET DO STEPS 4-6; ELSE GO TO STEP 7. 00214000
  215. * 4. TURN ON CPWAIT AND CPSUPER, AND TURN OFF THE OTHER BITS. 00215500
  216. * 5. EMS CLKCHK RECEIVED IS SET ON IN THE PSA. 00218000
  217. * 6. DMKCLKCC LOADS AN ENABLED WAIT STATE PSW. 00219000
  218. * 7. IF THE CC FROM THE STCK INDICATES THE CLOCK IS NOT SET, 00220000
  219. * OR IS SET BUT IN ERROR, OR IS IN THE STOPPED STATE SET AN 00221000
  220. * INTERNAL BIT IN DMKCLK TO INFORM THE CALLER THAT THE CLOCKS 00222000
  221. * SHOULD BE SYNCHRONIZED. GO TO STEP 5. 00223000
  222. * 8. IF THE CC INDICATES THAT THE CLOCK IS NOT OPERATIONAL, 00224000
  223. * ISSUE ABEND 3. 00225000
  224. * 00226000
  225. SPACE 5 00227000
  226. ENTRY DMKCLKCC @V407595 00228000
  227. DMKCLKCC DS 0H EXECUTES ON APU - SIGP CLKCHK @V407595 00229000
  228. USING *,R12 @V407595 00230000
  229. SL R12,CLKCC ESTABLISH BASE FROM MOD START @V407595 00231000
  230. USING DMKCLK,R12 @V407595 00232000
  231. L R11,ASYSOP RUN UNDER OPERATOR VMBLOK @V4M0106 00233000
  232. NI EMSPEND,FF-EMSPCLKC TURN OFF CLKCHK EMS PENDING @V407595 00234000
  233. STCK TODCLKB TIMESTAMP FOR CHECKING HIGH @V407595 00235000
  234. * ORDER SYNCHRONIZATION. 00236000
  235. BC 8,CCEXIT CC=0, (CLOCK SET) @V407595 00237000
  236. BC 6,SETSYNC CC=1, (NOT SET) OR CC=2 (ERROR) @V407595 00238000
  237. * TELL SENDER CLOCKS SHOULD BE SYN'D. 00239000
  238. * CC=3 (STOPPED OR NOT OPERATIONAL) 00240000
  239. CLC TODCLKB,ZEROES NOT OPERATIONAL ? @V407595 00241000
  240. BNE SETSYNC NO- (IN STOPPED STATE) @V407595 00242000
  241. ABEND 03 YES- TERMINATE- CLOCK NOT OPER @V407595 00243000
  242. SETSYNC EQU * @V407595 00244000
  243. OI CLKFLAG1,CLKSYNC TELL SENDER TO SYNCHRONIZE TOD @V407595 00245000
  244. * CLOCKS AND TERMINATE SPIN LOOP. 00246000
  245. CCEXIT EQU * @V407595 00247000
  246. MVI CPSTATUS,CPWAIT+CPSUPER INDICATE PROCESSOR IN @VA11576 00248500
  247. * SUPERVISOR AND WAIT STATE, 00249500
  248. * AND CLEAR OTHER FLAGS. 00250500
  249. OI EMSREC,EMSRCLKC TURN ON CLKCHK RECEIVED @V407595 00256000
  250. LPSW ENABLEWT ENABLE FOR EXTERNAL INTERRUPTS @V407595 00257000
  251. EJECT 00258000
  252. * 00259000
  253. * OPERATION - DMKCLKMP, DMKCLKAP 00260000
  254. * 00261000
  255. * SYNCHRONIZE THE TOD CLOCKS AS FOLLOWS : 00262000
  256. * 00263000
  257. * 1. DMKCLKMP - STORE THE TOD CLOCK + 1 SEC. THIS VALUE WILL BE 00264000
  258. * SET IN THE APU CLOCK BY DMKCLKAP. 00265000
  259. * 2. DMKCLKMP - ISSUE SYNC EMS TO INVOKE DMKCLKAP TO RUN ON THE APU. 00266000
  260. * 3. DMKCLKAP - TURN OFF SYNC EMS PENDING IN THE PSA. 00267000
  261. * 4. DMKCLKAP - TURN ON THE TOD SYNC CONTROL BIT IN CR0. WHEN THIS 00268000
  262. * BIT IS ON AND THE CLOCK IS IN THE STOPPED STATE 00269000
  263. * (APU'S CLOCK ENTERS STOPPED STATE ON SCK) THE APU'S 00270000
  264. * CLOCK WILL ENTER THE SET STATE (I.E., RUNNING) WHEN 00271000
  265. * MAIN PROCESSOR'S CLOCK INCREMENTS TO ALL ZEROES IN 00272000
  266. * BIT POSITIONS 32-63. THE CLOCKS WILL THEN BE IN LOW 00273000
  267. * ORDER SYNCHRONIZATION. 00274000
  268. * 5. DMKCLKAP - ISSUE SCK TO SET THE VALUE PASSED BY DMKCLKMP 00275000
  269. * (TOD CLOCK VALUE + 1 SEC). 00276000
  270. * 6. DMKCLKAP - CHECK THE CC FROM THE SCK. 00277000
  271. * CLOCK IN 'SECURE POSITION' - REISSUE THE SCK. 00278000
  272. * CLOCK NOT OPERATIONAL - ABEND 3. 00279000
  273. * CLOCK IS SET - ZERO CPWAIT AND CPSUPER. 00280000
  274. * 7. DMKCLKAP - TURN ON SYNC EMS RECEIVED AND LOAD AN ENABLED WAIT 00281000
  275. * STATE PSW. 00282000
  276. * 8. DMKCLKMP - OBTAIN CLOCK VALUE ON RETURN FROM DMKCLKAP. 00283000
  277. * IF THIS VALUE IS > ORIGINAL +1 SEC VALUE AS PASSED 00284000
  278. * TO DMKCLKAP, THEN CLOCK ARE NOT IN HIGH ORDER SYNC. 00285000
  279. * REPEAT WITH STEP 1. 00286000
  280. * 9. DMKCLKMP - LOOP FOR 1 SEC THEN ENABLE CR0 FOR TOD SYNC CHECKS. 00287000
  281. * 10. DMKCLKMP - RETURN TO CALLER. 00288000
  282. * 00289000
  283. EJECT 00290000
  284. DMKCLKMP RELOC EXECUTES ON MAIN - SVC ENTRY @V407595 00291000
  285. CLKSYNMP EQU * @V407595 00292000
  286. STCK TODCLKA STORE TOD CLOCK @V407595 00293000
  287. BC 7,CLKERRMP ERROR - TERMINATE - CLOCK SHOULD @V407595 00294000
  288. * BE RUNNING. 00295000
  289. SR R1,R1 CLEAR WORK REG @V407595 00296000
  290. ST R1,TODCLKAR CLEAR LOW ORDER 32 BITS @V407595 00297000
  291. LA R1,N1 SET 1 TO WORK REG @V407595 00298000
  292. AL R1,TODCLKAL ADD 1 SEC TO HIGH ORDER 32 BITS @V407595 00299000
  293. ST R1,TODCLKAL AND SAVE @V407595 00300000
  294. SIGNAL SYNC CALL DMKCLKAP TO RUN ON APU @V407595 00301000
  295. STCK TODCLKB TIMESTAMP INTERVAL BETWEEN 1ST @V407595 00302000
  296. * STCK AND NOW. 00303000
  297. BC 7,CLKERRMP ERROR - TERMINATE - CLOCK SHOULD @V407595 00304000
  298. * BE RUNNING. 00305000
  299. CLC TODCLKB,TODCLKA IF 2ND STCK IS > ORIGINAL +1 @V407595 00306000
  300. * CLOCKS ARE NOT IN SYNC- @V407595 00307000
  301. BH CLKSYNMP TRY AGAIN. @V407595 00308000
  302. STCK TODCLKC SET TIMESTAMP FOR LOOP CONTROL @V407595 00309000
  303. BC 7,CLKERRMP ERROR - TERMINATE - CLOCK SHOULD @V407595 00310000
  304. * BE RUNNING. 00311000
  305. LA R1,2 SET WORK VALUE TO 2 SECONDS @VMV0004 00312100
  306. AL R1,TODCLKCL ADD 2.08 SEC TO HIGH ORDER TIME @V407595 00312200
  307. * TO ENSURE THAT A MINIMUM OF 1 00312300
  308. * SECOND WILL HAVE ELASPED AFTER THE 00312400
  309. * CLOCKS ARE SYNCHRONIZED. 00312500
  310. ST R1,TODCLKCL AND SAVE @V407595 00314000
  311. CLKCHK1S EQU * @V407595 00315000
  312. STCK TODCLKB GET TOD CLOCK VALUE @V407595 00316000
  313. BC 7,CLKERRMP ERROR - TERMINATE - CLOCK SHOULD @V407595 00317000
  314. * BE RUNNING. 00318000
  315. CLC TODCLKB,TODCLKC HAS ONE SECOND ELAPSED? @V407595 00319000
  316. BL CLKCHK1S NO- CONTINUE LOOPING @V407595 00320000
  317. LCTL C0,C0,CR0INTMN ENABLE FOR SYNC CHECKS. @V407595 00321000
  318. STCTL C0,C0,CPCREG0 SAVE IN REAL 0 FOR CP @V4M0143 00322000
  319. EXIT RETURN @V407595 00323000
  320. CLKERRMP EQU * @V407595 00324000
  321. ABEND 003 @V407595 00325000
  322. EJECT 00326000
  323. DMKCLKAP DS 0H ENTERED VIA SYNC EMS ON APU @V407595 00327000
  324. ENTRY DMKCLKAP @V407595 00328000
  325. BALR R12,R0 ESTABLISH BASE @V407595 00329000
  326. USING *,R12 @V407595 00330000
  327. L R11,ASYSOP RUN UNDER OPERATOR VMBLOK @V4M0106 00331000
  328. NI EMSPEND,FF-EMSPSYNC TURN OFF SYNC PENDING @V407595 00332000
  329. LCTL C0,C0,C0TODSYN SET THE TOD SYNCHRONIZATION BIT @V407595 00333000
  330. CLKSECRE EQU * @V407595 00334000
  331. SCK TODCLKA SET TOD AS PASSED BY MAIN PROC @V407595 00335000
  332. BC 8,CLKSET CC=0, CLOCK SET @V407595 00336000
  333. BC 4,CLKSECRE CC=1, CLOCK SECURE - LOOP @V407595 00337000
  334. * CC=3, CLOCK NOT OPERATIONAL @V407595 00338000
  335. ABEND 0003 TERMINATE @V407595 00339000
  336. CLKSET EQU * @V407595 00340000
  337. MVI CPSTATUS,CPWAIT+CPSUPER INDICATE PROCESSOR IN @VA11576 00341500
  338. * SUPERVISOR AND WAIT STATE. 00342500
  339. * ALSO CLEAR ALL OTHER FLAGS. 00343500
  340. * THIS WILL ENSURE CLOCK SYNC SO 00344500
  341. * THAT WORK CAN BE DISPATCHED TO 00345500
  342. * THE APU. 00346500
  343. OI EMSREC,EMSRSYNC LET MAIN PROCESSOR CONTINUE @V407595 00349000
  344. LPSW ENABLEWT ENABLE FOR EMS INTERRUPTS @V407595 00350000
  345. EJECT 00351000
  346. * 00352000
  347. * OPERATION - DMKCLKSC 00353000
  348. * 00354000
  349. * 1. ISSUE A SWITCH MACRO TO ENSURE RUNNING ON THE MAIN PROCESSSOR. 00355000
  350. * THIS IS NECESSARY SINCE THIS ROUTINE IS PAGEABLE AND IS INVOKED 00356000
  351. * VIA SVC FROM THE EXT SLIH. 00357000
  352. * 2. IF THE TOD SYNC CHECK IS ALREADY BEING PROCESSED (PROCSCHK=1) 00358000
  353. * THIS ROUNTINE EXITS TO CALLER. NOTE THAT SYNC CHECK INTERRUPTS 00359000
  354. * WILL CONTINUE TO BE RECEIVED UNTIL THE CLOCKS ARE SYNCHRONIZED 00360000
  355. * OR THE INTERRUPT IS DISABLED. 00361000
  356. * 3. IF PROCSCHK=0, SET PROCSCHK=1 AND DISABLE FOR TOD SYNC CHECKS. 00362000
  357. * 4. MESSAGE 970W IS ISSUED TO INFORM THE INSTALLATION OF THE SYNC 00363000
  358. * CHECK. 00364000
  359. * 5. A SECOND MESSAGE IS ISSUED REQUESTING THE SYSTEM OPERATOR TO 00365000
  360. * PRESS THE 'TOD ENABLE SET' KEY. 00366000
  361. * 6. THE APU IS QUIESCED. 00367000
  362. * 7. DMKCLKMP IS INVOKED TO SYNC THE TOD CLOCKS. 00368000
  363. * 8. PROCSCHK IS SET OFF, AND THE ATTACHED PROCESSOR IS RESUME'D. 00369000
  364. * 9. DMKCLKSC EXITS TO CALLER. 00370000
  365. * 00371000
  366. SPACE 5 00372000
  367. DMKCLKSC RELOC @V407595 00373000
  368. SWITCH ENSURE RUNNING ON MAIN PROCESSOR @V4M0143 00374000
  369. TM APSTAT4,PROCSCHK TOD SYNC CHECK ALREADY BEING @VA07615 00375100
  370. * PROCESSED ? 00376000
  371. BO SCEXIT YES - EXIT @V407595 00377000
  372. OI APSTAT4,PROCSCHK NO- INDICATE BEING PROCESSED @VA07615 00378100
  373. LCTL C0,C0,NOSYNCHK INHIBIT SYN CHECKS @V407595 00379000
  374. STCTL C0,C0,CPCREG0 UNTIL CLOCKS ARE RESYNCHRONIZED @V407595 00380000
  375. LA R1,CLK970W SYNC CHECK WARNING MSG @V407595 00381000
  376. LA R0,CLK970WL LENGTH OF MSG @V407595 00382000
  377. CALL DMKQCNWT,PARM=NOTIME+OPERATOR+ALARM ISSUE MSG @V407595 00383000
  378. LA R1,SETMSG SYNC CHK- ENABLE TOD SET SWITCH @V407595 00384000
  379. LA R0,SETMSGL LENGTH OF MESSAGE @V407595 00385000
  380. CALL DMKQCNWT,PARM=NOTIME+OPERATOR ISSUE MSG @V407595 00386000
  381. SIGNAL QUIESCE QUIESCE THE APU @V407595 00387000
  382. CALL DMKCLKMP SYNCHRONIZE THE TOD CLOCKS @V407595 00388000
  383. STCTL C0,C0,CPCREG0 ENABLE SYNC CHECKS FOR SYSTEM. @V407595 00389000
  384. * NOTE DMKCLKMP RE-ENABLES SYNC CHECKS IN 00390000
  385. * CR0. 00391000
  386. NI APSTAT4,FF-PROCSCHK CLEAR SYNC BEING PROCESSED @VA07615 00392100
  387. * INDICATOR. 00393000
  388. SIGNAL RESUME CONTINUE PROCESSING ON APU @V407595 00394000
  389. SCEXIT EQU * @V407595 00395000
  390. EXIT RETURN TO CALLER @V407595 00396000
  391. EJECT 00397000
  392. DS 0D @V407595 00398000
  393. CLKRSTNW DC A(MCHEKENB,DMKPSADU) SYSTEM RESTART NEW PSW @V407595 00399000
  394. XWAIT4 DC X'0002000000000015' INDICATE SIGP ERROR @V407595 00400000
  395. XWAIT5 DC X'0002000000000016' TOD CLOCK ERROR ON APU @V407595 00401000
  396. ENABLEWT DC X'010E000000000000' ENABLE WAIT STATE @V407595 00402000
  397. C0TODSYN DC AL1(BLKMPX+TODSYNC+NOSSKCK,PAGE4K) HRC004DK 00403490
  398. DC AL1(MFAMASK+EMSMASK+XCMASK) ENABLE MFA/EMS/XC @V407595 00404000
  399. DC AL1(0) @V407595 00405000
  400. CR0INTMN DC AL1(BLKMPX+NOSSKCK,PAGE4K) HRC004DK 00406490
  401. DC AL1(MFAMASK+EMSMASK+XCMASK+SYNCMASK+CKCMASK+CPTMASK) 00407000
  402. DC AL1(INTMASK+KEYMASK) BITMASK FOR CR0 ON MAIN PR @V407595 00408000
  403. NOSYNCHK DC AL1(BLKMPX+NOSSKCK,PAGE4K) HRC004DK 00409490
  404. DC AL1(MFAMASK+EMSMASK+XCMASK+CKCMASK+CPTMASK) @V4M0143 00410000
  405. DC AL1(INTMASK+KEYMASK) CR0 WITHOUT TOD SYNC CHK @V407595 00411000
  406. SPACE 2 00412000
  407. TODCLKA DS D STCK WORK AREA @V407595 00413000
  408. ORG TODCLKA @V407595 00414000
  409. TODCLKAL DS F LEFTMOST 32 BITS OF TOD CLOCK @V407595 00415000
  410. TODCLKAR DS F RIGHTMOST 32 BITS OF TOD CLOCK @V407595 00416000
  411. TODCLKB DS D STCK WORK AREA @V407595 00417000
  412. ORG TODCLKB @V407595 00418000
  413. TODCLKBL DS F LEFTMOST 32 BITS OF TOD CLOCK @V407595 00419000
  414. TODCLKBR DS F RIGHTMOST 32 BITS OF TOD CLOCK @V407595 00420000
  415. TODCLKC DS D STCK WORK AREA @V407595 00421000
  416. ORG TODCLKC @V407595 00422000
  417. TODCLKCL DS F LEFTMOST 32 BITS OF TOD CLOCK @V407595 00423000
  418. TODCLKCR DS F RIGHTMOST 32 BITS OF TOD CLOCK @V407595 00424000
  419. SPACE 2 00425000
  420. ONESEC DC F'1' @V407595 00426000
  421. CLKCC DC A(DMKCLKCC-DMKCLK) @V407595 00427000
  422. CLKFLAGS DS 0H @V407595 00428000
  423. ORG CLKFLAGS @V407595 00429000
  424. CLKFLAG1 DS C @V407595 00430000
  425. CLKSIG EQU X'80' @V407595 00431000
  426. CLKSYNC EQU X'40' @V407595 00432000
  427. CLKERR EQU X'20' @V407595 00433000
  428. CLKFLAG2 DS C RESERVED @V407595 00434000
  429. SPACE 2 00435000
  430. CLK970W DC C'DMKCLK970W TOD CLOCK SYNC CHECK RECEIVED' @V407595 00436000
  431. CLK970WL EQU *-CLK970W @V407595 00437000
  432. SETMSG DC C'CLOCK SYNCHRONIZATION- PRESS ''TOD ENABLE SET''' 00438000
  433. SETMSGL EQU *-SETMSG @V407595 00439000
  434. COPY EQU @V407595 00440000
  435. COPY SAVE @V407595 00441000
  436. PSA @V407595 00442000
  437. MCHEKENB EQU (MCHEK+EXTMODE)*X'10000' @V407595 00443000
  438. END DMKCLK @V407595 00444000