Table of Contents

DMKDSP Source

References

Source Listing

DMKDSP.ASSEMBLE.txt
  1. DSP TITLE 'DMKDSP (CP) VM/370 - RELEASE 6' 00001000
  2. ISEQ 73,80 00002000
  3. *. 00003000
  4. * MODULE NAME - 00004000
  5. * 00005000
  6. * DMKDSP 00006000
  7. * 00007000
  8. * FUNCTION - 00008000
  9. * 00009000
  10. * DMKDSP IS ENTERED AFTER EACH INTERRUPT HANDLER HAS FINISHED 00010000
  11. * PROCESSING, AND AFTER EACH STACKED CPEXBLOK, I/O REQUEST, 00011000
  12. * DEFERRED INTERRUPT TASK, AND EXTERNAL INTERRUPT 00012000
  13. * HAS BEEN SERVICED. IT UPDATES THE 00013000
  14. * CPU TIMES CHARGED TO THE USER THAT HAS RECEIVED SERVICE, UP- 00014000
  15. * DATES ALL VIRTUAL TIMERS, AND REFLECTS ANY PENDING INTERRUPTS 00015000
  16. * FOR WHICH THE USER IS ENABLED. AFTER THE USER'S STATUS HAS 00016000
  17. * BEEN UPDATED, EITHER THE NEXT AVAILABLE STACKED REQUEST 00017000
  18. * IS STACKED, OR THE HIGHEST PRIORITY RUNNABLE USER IS 00018000
  19. * DISPATCHED. 00019000
  20. * 00020000
  21. * ATTRIBUTES - 00021000
  22. * 00022000
  23. * REENTRANT, RESIDENT, ENTERED VIA GOTO 00023000
  24. * 00024000
  25. * ENTRY POINTS - EXECUTABLE 00025000
  26. * 00026000
  27. * DMKDSPCH - MAIN ENTRY POINT; SYSTEM LOCK HELD ON ENTRY 00027000
  28. * DMKDSPA - ENTERED FOR FAST REFLECT - ONLY STATUS UPDATE IS 00028000
  29. * FOR VIRTUAL TIMERS; SYSTEM LOCK MAY OR MAY NOT 00029000
  30. * BE HELD 00030000
  31. * DMKDSPB - ENTERED IF VIRTUAL PSW HAS BEEN ALTERED OUTSIDE OF 00031000
  32. * DMKDSP; SYSTEM LOCK HELD ON ENTRY 00032000
  33. * DMKDSPE - ENTERED FOR VIRTUAL TIMER INTERRUPT REFLECT; 00033000
  34. * SYSTEM LOCK NOT APPLICABLE 00034000
  35. * DMKDSPRU - ENTRY FOR ATTACHED PROCESSOR SUPPORT TO SELECT 00035000
  36. * ANOTHER USER TO DISPATCH; SYSTEM LOCK NOT HELD 00036000
  37. * 00037000
  38. * ENTRY POINTS - NON-EXECUTABLE 00038000
  39. * 00039000
  40. * DMKDSPQS - DISPATCHED USER'S MAXIMUM TIME SLICE 00040000
  41. * DMKDSPRQ - QUEUE ANCHOR FOR IOBLOKS AND CPEXBLOKS 00041000
  42. * DMKDSPNP - NUMBER OF DYNAMICALLY ASSIGNABLE PAGE FRAMES NOW 00042000
  43. * AVAILABLE IN THE SYSTEM 00043000
  44. * DMKDSPAC - COUNT OF DMKDSPA ENTRIES 00044000
  45. * DMKDSPBC - COUNT OF DMKDSPB ENTRIES 00045000
  46. * DMKDSPCC - COUNT OF DMKDSPCH ENTRIES 00046000
  47. * DMKDSPEC - COUNT OF DMKDSPE ENTRIES 00047000
  48. * DMKDSPRC - COUNT OF DMKDSPRU ENTRIES 00048000
  49. * DMKDSP0 - CP ASSIST INSTRUCTION ADDRESS 00049000
  50. * DMKDSP1 - CP ASSIST INSTRUCTION ADDRESS 00050000
  51. * DMKDSP2 - CP ASSIST INSTRUCTION ADDRESS 00051000
  52. * DMKDSPIT - VIRTUAL INTERVAL TIMER REFLECTION COUNTER 00052000
  53. * DMKDSPCK - VIRTUAL CLOCK COMPARATOR REFLECTION COUNTER 00053000
  54. * DMKDSPPT - VIRTUAL CPU TIMER REFLECTION COUNTER 00054000
  55. * 00055000
  56. * ENTRY CONDITIONS - 00056000
  57. * 00057000
  58. * GPR11 = ADDRESS OF VMBLOK OF USER TO CHARGE 00058000
  59. * GPR12 = ADDRESS OF ENTRY POINT 00059000
  60. * 00060000
  61. * THE SWITCH "CPSTATUS" IN PSA INDICATES THE STATE OF THE CPU 00061000
  62. * PRIOR TO THE LAST INTERRUPT OR UNSTACK OPERATION - IT WILL 00062000
  63. * INDICATE "RUNNING", "WAITING", OR "CP EXECUTION" 00063000
  64. * 00064000
  65. * EXIT CONDITIONS - 00065000
  66. * 00066000
  67. * EITHER THE NEXT AVAILABLE STACKED REQUEST IS UNSTACKED OR 00067000
  68. * THE HIGHEST PRIORITY RUNNABLE USER IS DISPATCHED; IF NO USER 00068000
  69. * IS RUNNABLE, THE CPU IS PLACED IN AN ENABLED WAIT STATE 00069000
  70. * 00070000
  71. EJECT 00071000
  72. * CALLS TO OTHER ROUTINES - 00072000
  73. * 00073000
  74. * DMKERMSG - CALLED TO WRITE ERROR MESSAGES TO USER 00074000
  75. * DMKUSOFF - CALLED TO LOG OFF A USER WHO HAS ENTERED A DISABLED 00075000
  76. * WAIT STATE WHILE DISCONNECTED 00076000
  77. * DMKSCNVU - CALLED TO LOCATE VIRTUAL UNIT BLOKS FOR INTERRUPT- 00077000
  78. * ING DEVICES 00078000
  79. * DMKCFMBK - CALLED TO PLACE USER IN CONSOLE FUNCTION MODE 00079000
  80. * DMKCVTBH - CALLED TO CONVERT BINARY TO HEX 00080000
  81. * DMKSCHDL - CALLED TO MAINTAIN SCHEDULER LISTS OF ACTIVE USERS 00081000
  82. * DMKPERIL - CALLED TO HANDLE PER TRACING PER001 00082100
  83. * DMKVATAB - CALLED TO MAINTAIN VIRTUAL RELOCATE SIMULATION 00083000
  84. * TABLES FOR VIRTUAL MACHINES WITH THE VR FEATURE 00084000
  85. * DMKVATBC - CALLED WHEN A VIRTUAL MACHINE GOES FROM EXTENDED 00085000
  86. * TO BASIC CONTROL MODE 00086000
  87. * DMKVATEX - GOTO TO RELECT PSEUDO PAGE FAULT 00087000
  88. * DMKVATMD - CALLED WHEN A VIRTUAL MACHINE IN EXTENDED CONTROL 00088000
  89. * MODE ENTERS VIRTUAL TRANSLATE MODE 00089000
  90. * DMKVMASH - CALLED TO CHECK IF LASTUSER CHANGED A SHARED PAGE 00090000
  91. * DMKVMCEX - CALLED TO REFLECT VMCF MESSAGE HEADER 00092000
  92. * DMKTRCEX - TO TRACE A VIRTUAL MACHINE EXTERNAL INTERRUPT 00093000
  93. * DMKTRCIO - TO TRACE A VIRTUAL MACHINE I/O INTERRUPT 00094000
  94. * DMKTRCIT - TO SET NEEDED "SVC B2" FOR INSTRUCTION TRACING 00095000
  95. * DMKTRCPG - CALLED TO TRACE A VIRTUAL MACHINE PROGRAM CHECK 00096000
  96. * DMKFREE - CALLED TO OBTAIN FREE STORAGE 00097000
  97. * DMKFRET - CALLED TO RELEASE STORAGE BACK INTO FREE POOL 00098000
  98. * DMKPTRAN - CALLED TO FETCH A PAGE 00099000
  99. * DMKEXTSP - CALLED TO ISSUE SIGP INSTRUCTION 00100000
  100. * DMKLOKDF - CALLED TO OBTAIN A LOCK WITHOUT SPINNING 00101000
  101. * DMKLOKVM - CALLED TO OBTAIN A VMBLOK LOCK 00102000
  102. * DMKLOKSP - CALLED TO SPIN UNTIL A LOCK IS AVAILABLE 00103000
  103. * DMKLOKPS - CALLED TO SPIN UNTIL A CONDITION IS SATISFIED 00104000
  104. * DMKSTKDE - CALLED TO STACK A DEFERRED INTERRUPT TASK 00105000
  105. * DMKSTKMP - CALLED TO STACK A CPEXBLOK FOR THE CURRENT PROC 00106000
  106. * DMKMCHSE - CALLED FOR SOFT MACHINE CHECK RECOVERY 00107000
  107. * DMKMCTPR - CALLED FOR AUTOMATIC PROCESSOR RECOVERY 00108000
  108. * DMKPRGSM - GOTO TO REFLECT INVALID PSW INTERRUPTION 00109000
  109. * DMKCCHRF - CALLED TO REFLECT CHANNEL CHECK TO VIRTUAL MACHINE 00109050
  110. * 00110000
  111. * EXTERNAL REFERENCES - 00111000
  112. * 00112000
  113. * DMKVIOMK - MASK TABLE FOR ACTIVE I/O AND PENDING INTERRUPTS 00113000
  114. * DMKSCHRL - ANCHOR FOR SCHEDULER'S LIST OF DISPATCHABLE USERS 00114000
  115. * DMKIOSER - ALLOWED EXIT DURING EXTEND 00115000
  116. * DMKIOSRC - ALLOWED EXIT DURING EXTEND 00116000
  117. * DMKPTRFD - ALLOWED EXIT DURING EXTEND 00117000
  118. * DMKPTRFE - ALLOWED EXIT DURING EXTEND 00118000
  119. * DMKPTRFP - ALLOWED EXIT DURING EXTEND 00119000
  120. * DMKPTRRC - RESERVE PAGE USAGE COUNT 00120000
  121. * DMKSCHTQ - QUEUE OF CLOCK COMPARATOR REQUESTS 00121000
  122. * DMKLOKSY - GLOBAL SYSTEM LOCK 00122000
  123. * DMKLOKDS - DISPATCHER QUEUE LOCK 00123000
  124. * DMKLOKRL - RUN LIST LOCK 00124000
  125. * DMKLOKTR - TRQ LOCK 00125000
  126. * 00126000
  127. * TABLES / WORKAREAS - 00127000
  128. * 00128000
  129. * VMBLOK - PRIMARY USER CONTROL TABLE 00129000
  130. * VDEV,VCU AND VCHBLOKS - STATUS UPDATED WHEN I/O INTERRUPTS 00130000
  131. * ARE REFLECTED TO A USER 00131000
  132. * ECBLOK - VMBLOK EXTENSION FOR EXTENDED MODE VIRTUAL MACHINES 00132000
  133. * 00133000
  134. * MACROS 00134000
  135. * 00135000
  136. * ABEND - TO TERMINATE THE SYSTEM 00136000
  137. * CALL - TO LINK TO ANOTHER SYSTEM ROUTINE 00137000
  138. * CHARGE - TO MANAGE THE CPU TIMER FACILITY 00138000
  139. * COUNT - TO INCREMENT A COUNT 00139000
  140. * GOTO - TO TRANSFER CONTROL UNCONDITIONALLY 00140000
  141. * LOCK - TO OBTAIN AND RELEASE A SYSTEM LOCK 00141000
  142. * SIGNAL - TO SIGNAL THE OTHER PROCESSOR 00142000
  143. * TRACE - TO LOCATE THE CURREN TRACE TABLE ENTRY 00143000
  144. * TRANS - TO BRING A PAGEABLE PAGE INTO REAL STORAGE 00144000
  145. * 00145000
  146. * REGISTER USAGE - 00146000
  147. * 00147000
  148. * GPR0-5 - SCRATCH 00148000
  149. * GPR6 - VCHBLOK BASE 00149000
  150. * GPR7 - VCUBLOK BASE 00150000
  151. * GPR8 - VDEVBLOK BASE; 2ND LEVEL SUBROUTINE LINKAGE 00151000
  152. * GPR9 - 1ST LEVEL SUBROUTINE LINKAGE 00152000
  153. * GPR10 - IOBLOK BASE 00153000
  154. * GPR11 - VMBLOK BASE 00154000
  155. * GPR12 - DMKDSP BASE 00155000
  156. * GPR13 - SECOND BASE REGISTER 00156000
  157. * GPR14 - EXTERNAL LINKAGE 00157000
  158. * GPR15 - EXTERNAL LINKAGE 00158000
  159. *. 00159000
  160. EJECT 00160000
  161. COPY OPTIONS 00161000
  162. COPY LOCAL OPTIONS 00162000
  163. SPACE 2 00163000
  164. DMKDSP CSECT 00164000
  165. SPACE 3 00165000
  166. ENTRY DMKDSPCH 00166000
  167. AIF (NOT &AP).UPTST0 **AIF*** 00166900
  168. ENTRY DMKDSPRU @V407508 00167000
  169. ENTRY DMKDSPRC COUNTER FOR DMKDSPRU @V407508 00168000
  170. .UPTST0 ANOP **ANOP** 00168100
  171. ENTRY DMKDSPQS 00169000
  172. ENTRY DMKDSPRQ 00170000
  173. ENTRY DMKDSPA 00171000
  174. ENTRY DMKDSPB 00172000
  175. ENTRY DMKDSPNP 00173000
  176. ENTRY DMKDSPIT,DMKDSPCK,DMKDSPPT @V2B2638 00174000
  177. ENTRY DMKDSPAC,DMKDSPBC,DMKDSPCC,DMKDSPEC - COUNTERS @V386198 00175000
  178. ENTRY DMKDSP0,DMKDSP1,DMKDSP2 - CP ASSIST INST. ADDRS @V3M4026 00176000
  179. ENTRY DMKDSPE REFLECT VIRT. TIMER INTS. @V386198 00177000
  180. SPACE 00178000
  181. EXTRN DMKERMSG @V386198 00179000
  182. EXTRN DMKTRCPG 00180000
  183. EXTRN DMKUSOFF 00181000
  184. EXTRN DMKVIOMK 00182000
  185. EXTRN DMKSCNVU 00183000
  186. EXTRN DMKCFMBK 00184000
  187. EXTRN DMKCVTBH @VA03802 00185000
  188. EXTRN DMKSCHDL 00186000
  189. EXTRN DMKSCHRL 00187000
  190. EXTRN DMKPERIL PER001 00188100
  191. EXTRN DMKPRGSM @VA05647 00189000
  192. EXTRN DMKPTRRC @VA01321 00190000
  193. EXTRN DMKPTRFD,DMKPTRFE,DMKPTRFP,DMKIOSER,DMKIOSRC @VA02760 00191000
  194. EXTRN DMKVATAB 00192000
  195. EXTRN DMKVMASH @V60BC11 00193100
  196. EXTRN DMKVATBC 00194000
  197. EXTRN DMKVATEX @V213135 00195000
  198. EXTRN DMKVATMD 00196000
  199. EXTRN DMKVMCEX @V387045 00197000
  200. EXTRN DMKCCHRF @V508690 00197100
  201. AIF (NOT &TRACE(6)).VR10A 00198000
  202. EXTRN DMKTRCEX,DMKTRCIO,DMKTRCIT 00199000
  203. .VR10A ANOP 00200000
  204. EXTRN DMKMCHSE @VA07369 00201100
  205. AIF (NOT &AP).UPTST0A **AIF*** 00201200
  206. EXTRN DMKLOKPS,DMKLOKSY @VA07369 00201300
  207. EXTRN DMKSCHTQ,DMKMCTPR @V407508 00202000
  208. EXTRN DMKSTKMP,DMKSTKDE @V407508 00203000
  209. .UPTST0A ANOP **ANOP** 00203100
  210. SPACE 2 00204000
  211. USING PSA,R0 00205000
  212. USING VMBLOK,R11 00206000
  213. USING DMKDSP,R12,R13 @V387045 00207000
  214. EJECT 00208000
  215. *. 00209000
  216. * OPERATION - 00210000
  217. * 00211000
  218. * A. PROCESSING AT ENTRY 00212000
  219. * 1. MAIN DISPATCH ENTRY POINT - IF CPSTATUS SWITCH INDICATES 00213000
  220. * A STACKED REQUEST WAS BEING PROCESSED, GO TO SECTION D. TO 00214000
  221. * START CHECKING OUT USER'S STATUS. 00215000
  222. * IF CPSTATUS INDICATES RETURN FROM WAIT OR FROM RUNNING A 00216000
  223. * USER, BAL TO THE APPROPRIATE ROUTINE TO ACCOUNT FOR THE 00217000
  224. * TIME, AND PROCEED TO SECTION D TO CHECK OUT THE USER. IF 00218000
  225. * CPSTATUS INDICATES RETURN FROM RUNNING A USER AND THERE 00219000
  226. * HAS BEEN NO CHANGE TO THAT USER'S STATUS, GO DIRECTLY TO 00220000
  227. * SECTION F, BYPASSING SECTIONS D AND E. 00221000
  228. * 2. FAST REFLECT ENTRY POINT - IF CPSTATUS INDICATES THE 00222000
  229. * SYSTEM WAS NOT RUNNING A USER, OR IF THAT USER IS NO 00223000
  230. * LONGER RUNNABLE, OR IF THE SYSTEM IS EXTENDING, THE FAST 00224000
  231. * REFLECT PATH IS NOT CONTINUED. IF THE SYSTEM LOCK IS HELD 00225000
  232. * OR CAN BE OBTAINED, CONTINUE PROCESSING IN STEP 1 ABOVE; 00226000
  233. * OTHERWISE, CONTINUE PROCESSING IN STEP 5 BELOW. IF THE 00227000
  234. * USER IS RUNNING VIRTUAL TIMERS, BAL TO THE ACCOUNTING 00228000
  235. * ROUTINE TO UPDATE AND TEST THE USER'S VIRTUAL TIMERS. IF 00229000
  236. * THE USER IS STILL DISPATCHABLE, INSERT THE PROGRAM MASK 00230000
  237. * AND CONDITION CODE FROM THE VIRTUAL PSW INTO THE 00231000
  238. * APPROPRIATE OLD PSW (EITHER I/O OR PROGRAM), STORE THE 00232000
  239. * UPDATED PSW IN RUNPSW, AND RE-DISPATCH. 00233000
  240. * 3. NEW PSW ENTRY POINT - IF THE PSW HAS BEEN ALTERED OUTSIDE 00234000
  241. * OF DMKDSP, FIRST DO ACCOUNTING AS IN STEP 1 ABOVE; THEN 00235000
  242. * GO DIRECTLY TO THE PSW VALIDATION ROUTINE (SECTION E). 00236000
  243. * 4. VIRTUAL TIMER INTERRUPT ENTRY - FIRST QUEUE AN EXTERNAL 00237000
  244. * INTERRUPT BLOCK FOR THIS INTERRUPT. THEN DO ACCOUNTING FOR 00238000
  245. * THE RUNNING USER, AND GO TO SECTION D TO CHECK OUT THE 00239000
  246. * USER'S STATUS. 00240000
  247. * 5. RUN-USER ENTRY POINT - IF CPSTATUS INDICATES RETURN FROM 00241000
  248. * WAIT OR FROM RUNNING A USER, BAL TO THE APPROPRIATE 00242000
  249. * ROUTINE TO ACCOUNT FOR THE TIME. IF THE SYSTEM WAS 00243000
  250. * RUNNING A USER AND THERE IS A TIMER INTERRUPT PENDING FOR 00244000
  251. * THAT USER, VERIFY THAT THE USER HAS A DEFERRED INTERRUPT 00245000
  252. * TASK STACKED. IF NOT, SET UP AND STACK THE DEFERRED TASK 00246000
  253. * FOR ENTRY TO DMKDSPCH. THEN UNLOCK LASTUSER IF LASTUSER 00247000
  254. * WAS NOT USING SHARED SYSTEMS. IF THERE IS NO SPECIAL 00248000
  255. * SITUATION (SUCH AS EXTEND OR A QUIESCE SIGNAL) PENDING, 00249000
  256. * GO TO SECTION H TO SELECT A USER FOR DISPATCHING. 00250000
  257. * 00251000
  258. * 00252000
  259. * 00253000
  260. * 00254000
  261. *********************************************************************** 00255000
  262. * 00256000
  263. * 00257000
  264. * CP ASSIST INSTRUCTION "DSP0" - MAIN ENTRY TO DISPATCH 00258000
  265. * (ALSO USED BY FAST DISPATCH ENTRY (DMKDSPA) 00259000
  266. * SINCE THE ASSIST IS QUICKER THAN THE "FAST" 00260000
  267. * SOFTWARE.) 00261000
  268. * 00262000
  269. * 00263000
  270. * OPERANDS: 00264000
  271. * 1 = ADDRESS OF 'DSP0LIST' (DATA LIST) 00265000
  272. * 2 = ADDRESS OF 'DSP0EXIT' (EXIT LIST) 00266000
  273. * 00267000
  274. * REGISTER INPUT: 00268000
  275. * GPR 11 = VMBLOK ADDRESS BEING CHARGED FOR CP OVERHEAD TIME 00269000
  276. * 00270000
  277. * SYSTEM DATA AREAS REFERENCED (BY MODULE WHERE APPLICABLE): 00271000
  278. * DMKPSA - 'CPSTATUS', 'IOOPSW', 'PROBSTRT', 'PROBTIME', 00272000
  279. * 'QUANTUM', 'QUANTUMR', 'RUNUSER', 'TIMER' 00272100
  280. * ECBLOK, PAGE TABLE, SEGMENT TABLE, VMBLOK, XINTBLOK 00273000
  281. * USER'S VIRTUAL PAGE ZERO (IF RESIDENT) 00274000
  282. * 00275000
  283. * 00276000
  284. * EXITS TO SPECIFIED OPERAND 2 LIST ADDRESSES: 00277000
  285. * NOTE: THE CONTENT OF ANY GPR NOT SPECIFIED IN THE FOLLOWING 00278000
  286. * LISTS, EXCEPT GPRS 12 AND 13, MAY BE UNPREDICTABLE. 00279000
  287. * 00280000
  288. * +0 'DISPATCH' (NORMAL EXIT - CAN'T UNSTACK ANY INTERRUPTS) 00281000
  289. * REGISTER OUTPUT: 00282000
  290. * GPR 11 = ADDRESS OF VMBLOK OF 'RUNUSER' 00283000
  291. * 00284000
  292. * +4 'DMKDSPC3' (EXIT IF SYSTEM COMING FROM WAIT STATE) 00285000
  293. * REGISTER OUTPUT: 00286000
  294. * GPR 11 = SAME AS ENTRY CONTENTS 00287000
  295. * 00288000
  296. * +8 'XINTQUE' (VIRTUAL LOC. 80 TIMER INTERRUPT TO BE QUEUED) 00289000
  297. * REGISTER OUTPUT: 00290000
  298. * GPR 3 = VALUE OF ZERO 00291000
  299. * GPR 4 = VALUE OF X'00800080' 00292000
  300. * GPR 9 = ADDRESS OF 'DMKDSPC4' 00293000
  301. * GPR 11 = ADDRESS OF VMBLOK OF 'RUNUSER' 00294000
  302. * 00295000
  303. * +12 'DISPATCH' ('RUNUSER' IS NOT RUNNABLE - IN CP WAIT) 00296000
  304. * REGISTER OUTPUT: SAME AS EXIT TO +0 'DISPATCH' 00297000
  305. * 00298000
  306. * +16 'CKPER' (CAN DO UNSTACK OF A PER OR PAGE FAULT INTERRUPT) 00299000
  307. * REGISTER OUTPUT: SAME AS EXIT TO +0 'DISPATCH' 00300000
  308. * 00301000
  309. * +20 'UNSTPRTY' (CAN UNSTACK EXTERNAL INTERRUPT FOR 'RUNUSER') 00302000
  310. * REGISTER OUTPUT: 00303000
  311. * GPR 4 = 'XINTMASK' BITS THAT ARE ON (IN BITS 16-31) 00304000
  312. * GPR 5 = ADDRESS OF PREVIOUS XINTBLOK (OR 'VMPXINT') 00305000
  313. * GPR 6 = ADDRESS OF CURRENT XINTBLOK (INT. TO REFLECT) 00306000
  314. * GPR 11 = ADDRESS OF VMBLOK OF 'RUNUSER' 00307000
  315. * 00308000
  316. * +24 'GETIOINT' ('RUNUSER' ENABLED FOR I/O AND I/O INT PENDING) 00309000
  317. * REGISTER OUTPUT: 00310000
  318. * GPR 7 = 'VMIOINT' ANDED WITH CHAN. MASKS (IN BITS 0-15) 00311000
  319. * GPR 11 = ADDRESS OF VMBLOK OF 'RUNUSER' 00312000
  320. * 00313000
  321. * +28 'CKWAITST' (VIRTUAL PSW OF 'RUNUSER' HAS WAIT BIT SET ON) 00314000
  322. * REGISTER OUTPUT: SAME AS EXIT TO +0 'DISPATCH' 00315000
  323. * 00316000
  324. * +32 'RUNTIME' (TIMER UPDATING WILL CAUSE AN ABEND CONDITION) 00317000
  325. * REGISTER OUTPUT: SAME AS EXIT TO +0 'DISPATCH' 00318000
  326. * 00318100
  327. * +36 'UNLOCK' (NO STATUS CHANGE HAS OCCURRED) 00318200
  328. * REGISTER OUTPUT: SAME AS EXIT TO +0 'DISPATCH' 00318300
  329. * 00319000
  330. *********************************************************************** 00320000
  331. *. 00321000
  332. SPACE 00322000
  333. DMKDSPCH EQU * MAIN ENTRY - "THE END OF THE WORLD" 00323000
  334. LR R13,R12 LOAD SECOND BASE REG. @VA05545 00324000
  335. AL R13,F4096 WITH ADDRESS @VA05545 00325000
  336. SPACE 00326000
  337. DS 0H EXECUTE CP ASSIST "DSP0" @V3M4026 00327000
  338. DMKDSP0 DC X'E60D',S(DSP0LIST,DSP0EXIT) ***@V3M4026 00328000
  339. SPACE 00329000
  340. LA R9,1 INCREMENT %V3M4038 00330000
  341. AL R9,DMKDSPCC THIS PATH COUNT %V3M4038 00331000
  342. ST R9,DMKDSPCC ... %V3M4038 00332000
  343. DSPC0 DS 0H TEST CPSTATUS SWITCH %V407508 00333000
  344. TM CPSTATUS,CPRUN RUNNING USER? %V408246 00334000
  345. BO DMKDSPC2 YES, CHECK OUT %V408246 00335000
  346. DMKDSPC1 DS 0H %V408246 00336000
  347. TM CPSTATUS,CPWAIT WAS SYSTEM IN WAIT STATE? %V408246 00337000
  348. AIF (&AP).APBR1 **AIF*** 00338000
  349. BZ UNSTACK NO, MUST BE CP REQUEST BLOCK %VA07369 00338100
  350. AGO .UPBR1 **AGO*** 00338200
  351. .APBR1 ANOP **ANOP** 00338300
  352. BZ DMKDSPC5 NO, MUST BE CP REQUEST BLOCK %VA07369 00338400
  353. .UPBR1 ANOP **ANOP** 00338500
  354. DMKDSPC3 DS 0H %V408246 00339000
  355. BAL R9,WAITIME YES -- DO WAIT TIME ACCOUNTING @V408246 00340000
  356. B UNLKLAST SEE IF LASTUSER SHOULD BE @V407508 00341000
  357. * UNLOCKED @V407508 00342000
  358. * 00343000
  359. DMKDSPC2 DS 0H VIRT. MACHINE WAS EXECUTING %V408246 00344000
  360. BAL R9,RUNTIME DO RUN TIME CLEAN UP %V408246 00345000
  361. DMKDSPC4 DS 0H %V408246 00346000
  362. TM IOOPSW,4 VIRT. PSW IN I/O OLD? %V408246 00347000
  363. BZ UNSTACK NO, CHECK FOR STATUS CHANGE %V408246 00348000
  364. TM VMDSTAT,VMDSP YES, CLEAN STATUS? %V408246 00349000
  365. BO UNLOCK YES, NO FURTHER CHECKING NEEDED %V407508 00350000
  366. B UNSTACK NO, CHECK FURTHER %V408246 00351000
  367. SPACE 00352000
  368. AIF (NOT &AP).UPTST1 **AIF*** 00352900
  369. DMKDSPC5 DS 0H STACKED BLOK WAS BEING PROCESSED %V407508 00353000
  370. TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? %V407508 00354000
  371. BZ UNSTACK NO, CONTINUE AS IN UP-MODE %V4M0136 00355000
  372. CLC LPUADDR,VMLOCK+2 IS VM LOCKED BY THIS PROC? @V407508 00356000
  373. BE UNSTACK YES, CONTINUE NORMALLY @V4M0136 00357000
  374. CHARGE STOP STOP CHARGING CURRENT VMBLOK @V4M0173 00358000
  375. L R11,ASYSVM SWITCH R11 TO SYSTEM VMBLOK @V4M0173 00359000
  376. * SYSTEM VMBLOK @V407508 00360000
  377. B UNLKLAST GO TRY TO UNLOCK LASTUSER @V407508 00361000
  378. .UPTST1 ANOP **ANOP** 00361100
  379. EJECT 00362000
  380. * THE FOLLOWING TWO DATA LISTS MUST BE KEPT CONTIGUOUS AND IN ORDER 00363000
  381. * BECAUSE THEY ARE USED BY THE CP ASSIST INSTRUCTION "DSP0". 00364000
  382. SPACE 2 00365000
  383. DSP0LIST DS 0F "DSP0" ASSIST DATA LIST @V3M4026 00366000
  384. SPACE 00367000
  385. DMKDSPCC DC F'0' +0 COUNT OF ENTRIES TO DMKDSPCH @V3M4026 00368000
  386. DC A(DMKDSPC4) +4 FOR EXIT WHEN ACCOUNTING DONE @V408246 00369000
  387. SPACE 2 00370000
  388. DSP0EXIT DS 0F "DSP0" ASSIST EXIT LIST @V3M4026 00371000
  389. SPACE 00372000
  390. DC A(DISPATCH) +0 "ALL HAS GONE WELL" @V386198 00373000
  391. DC A(DMKDSPC3) +4 SYSTEM COMING FROM WAIT STATE @V408246 00374000
  392. DC A(XINTQUE) +8 VIRTUAL TIMER WENT NEGATIVE @V386198 00375000
  393. DC A(DISPATCH) +12 'RUNUSER' IS NOT RUNNABLE @V386198 00376000
  394. DC A(CKPER) +16 PER OR PAGE FAULT PENDING @V386198 00377000
  395. DC A(UNSTPRTY) +20 EXT. INT. CAN BE UNSTACKED @V386198 00378000
  396. DC A(GETIOINT) +24 I/O INT. CAN BE UNSTACKED @V386198 00379000
  397. DC A(CKWAITST) +28 VIRT. PSW HAS 'WAIT' BIT ON @V386198 00380000
  398. DC A(RUNTIME) +32 ABEND CONDITION DETECTED @V408246 00381000
  399. DC A(UNLOCK) +36 EXIT IF CLEAN STATUS @V407508 00382000
  400. EJECT 00383000
  401. DMKDSPA DS 0H FAST REFLECT AFTER INSTR. @V213235 00384000
  402. * SIMULATION 00385000
  403. USING *,R12 @V213235 00386000
  404. LM R12,R13,DSPBASE LOAD UP BASE REGS @V387045 00387000
  405. USING DMKDSP,R12,R13 @V387045 00388000
  406. COUNT DMKDSPAC INCREMENT FAST REFLECT COUNT @V407508 00389000
  407. TM CPSTATUS,CPRUN RUNNING USER? @V408246 00390000
  408. BZ TESTSYS NO, TEST FOR SYSTEM LOCK @V4M0173 00391000
  409. TM VMRSTAT,VMNORUN VMBLOK RUNNABLE? @V408246 00392000
  410. BNZ TESTSYS NO, TEST FOR SYSTEM LOCK @V407508 00393000
  411. TM PROPSW+1,PROBMODE MONITOR CALL BUSY? @V408246 00394000
  412. BZ TESTSYS YES, TEST FOR SYSTEM LOCK @V407508 00395000
  413. L R2,PREFIXA GET PROCESSOR PREFIX ADDRESS @V407508 00396000
  414. CLI XTNDLOCK-PSA(R2),SET IS SYSTEM IN EXTEND? @V407508 00397000
  415. BE TESTSYS YES, TEST FOR SYSTEM LOCK @V407508 00398000
  416. L R2,VMSTKCNT GET COUNT OF STACKED BLOCKS @V4M0173 00399000
  417. LTR R2,R2 ARE ANY BLOCKS STACKED FOR VM? @V4M0173 00400000
  418. BNZ TESTSYS YES, GO TEST FOR SYSTEM LOCK @V4M0173 00401000
  419. TM VMPEND,VMPERPND PER PENDING? PER001 00401100
  420. BO TESTSYS YES, TEST FOR SYSTEM LOCK PER001 00401200
  421. LM R0,R2,QUANTUMR RESID., CURRENT, AND ORIG. @V408246 00402000
  422. * TIME-SLICE 00403000
  423. LTR R1,R1 ANY CURRENT LEFT? @V408246 00404000
  424. BNP TESTSYS NO, TEST FOR SYSTEM LOCK @V407508 00405000
  425. ST R1,QUANTUM CHECKPOINT TIMER @V408246 00406000
  426. TM VMMCR6,VMMFE+VMMVTMR VIRTUAL TIMER RUNNING? @V408246 00407000
  427. BO DMKDSPAA YES, NO NEED FOR UPDATE @V408246 00408000
  428. TM VMTLEVEL,VMTON+VMRON VIRTUAL TIMERS RUNNING? @V408246 00409000
  429. BZ DMKDSPAA NO @V408246 00410000
  430. SR R2,R0 VIRTUAL TIME USED @V408246 00411000
  431. LR R0,R2 PROPER REGISTER @V408246 00412000
  432. BAL R9,UPVIRT YES, UPDATE VIRT. LOCATION 80 @V408246 00413000
  433. TM VMDSTAT,VMDSP STILL DISPATCHABLE? @V408246 00414000
  434. BO DMKDSPA1 YES @V408246 00415000
  435. MVI CPSTATUS,CPEX+CPSUPER SHOW TIMER WAS UPDATED @V407508 00416000
  436. BAL R8,INCPROBT GO INCREMENT PROBLEM STATE TIME @V407508 00417000
  437. AIF (&AP).APBR2 **AIF*** 00417100
  438. B DMKDSPC4 CONTINUE AT MAIN ENTRY @VA07369 00417200
  439. AGO .UPBR2 **AGO*** 00417300
  440. .APBR2 ANOP **ANOP** 00417400
  441. * IN UP-MODE, SUBROUTINE TSTSYS IS A NO-OP. 00418000
  442. BAL R9,TSTSYS TEST FOR AND OBTAIN SYSTEM LOCK @V407508 00419000
  443. BZ DMKDSPC4 IF LOCK OBTAINED GOTO MAIN ENTRY @V407508 00420000
  444. B DSPR1 YES, MAKE ADDITIONAL TESTS @V407508 00421000
  445. .UPBR2 ANOP **ANOP** 00421100
  446. SPACE 00422000
  447. DMKDSPAA DS 0H @V408246 00423000
  448. TM VMDSTAT,VMDSP ABLE TO FAST REDSP? @V408246 00424000
  449. BO DMKDSPA1 YES, CONTINUE FAST REDISPATCH @V407508 00425000
  450. TESTSYS DS 0H TEST FOR SYSTEM LOCK @V407508 00426000
  451. AIF (&AP).APBR3 **AIF*** 00426100
  452. B DSPC0 CONTINUE AT MAIN ENTRY @VA07369 00426200
  453. AGO .UPBR3 **AGO*** 00426300
  454. .APBR3 ANOP **ANOP** 00426400
  455. * IN UP-MODE, SUBROUTINE TSTSYS IS A NO-OP. 00427000
  456. BAL R9,TSTSYS TEST FOR AND OBTAIN SYSTEM LOCK @V407508 00428000
  457. BZ DSPC0 GOTO MAIN ENTRY IF LOCK OBTAINED @V407508 00429000
  458. B DSPR0 ELSE, GOTO UNLOCKED ENTRY @V407508 00430000
  459. .UPBR3 ANOP **ANOP** 00430100
  460. SPACE 00431000
  461. DMKDSPA1 DS 0H @V408246 00432000
  462. AIF (NOT &AP).UPTST2 **AIF*** 00432900
  463. TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? @V407508 00433000
  464. BNO GETPSW NO, SKIP TEST FOR SYSTEM LOCK @V407508 00434000
  465. L R2,=A(DMKLOKSY+2) GET ADDRESS OF SYSTEM LOCK @V407508 00435000
  466. CLC LPUADDR,0(R2) IS SYSTEM LOCK HELD BY THIS PROC @V407508 00436000
  467. BNE FINDPSW DETERMINE CORRECT OLD PSW @V4M0173 00437000
  468. BAL R9,FREESYS FREE SYSTEM LOCK @V407508 00438000
  469. FINDPSW DS 0H @V4M0173 00439000
  470. TM IOOPSW,7 VIRTUAL PSW IN IOOLD? @V4M0173 00440000
  471. BNO GETPSW NO, MUST BE PROPSW @V4M0173 00441000
  472. LM R0,R1,IOOPSW GET INTERRUPT PSW @V4M0173 00442000
  473. MVI IOOPSW,0 FLAG I/O OLD PSW NOT VIRTUAL @V4M0173 00443000
  474. B DMKDSPA2 CONTINUE FAST DISPATCH @V4M0173 00444000
  475. GETPSW DS 0H @V407508 00445000
  476. .UPTST2 ANOP **ANOP** 00445100
  477. LM R0,R1,PROPSW RESTART WITH OLD PSW @V408246 00446000
  478. DMKDSPA2 DS 0H @V408246 00447000
  479. TM VMPSTAT,VMV370R EXTENDED MACHINE? @V408246 00448000
  480. BZ DMKDSPA3 NO @V408246 00449000
  481. L R2,VMECEXT PNTR. TO VMBLOK 370R EXTENSION @V408246 00450000
  482. LCTL C4,C5,EXTCR4-ECBLOK(R2) RELOAD POSSIBLE NEW CRS @V408246 00451000
  483. LCTL C7,C13,EXTCR7-ECBLOK(R2) . . @V408246 00452000
  484. TM VMTRCTL,VMTRPER IS "PER" TRACING ACTIVE ? @V408246 00453000
  485. BZ *+12 NO. @V408246 00454000
  486. L R2,VMPERCTL POINT TO PER BLOCK PER001 00455100
  487. LCTL C9,C11,PERCR9-PERBLOK(R2) PER001 00456100
  488. TM VMESTAT,VMEXTCM EXTENDED MODE PSW? @V408246 00457000
  489. BZ DMKDSPA3 NO @V408246 00458000
  490. ICM R0,B'0010',VMPSW+2 GET CURRENT C.C. @V408246 00459000
  491. B RTNADDR SET UP RETURN ADDRESS @V408246 00460000
  492. DMKDSPA3 DS 0H @V408246 00461000
  493. NI VMPSW+4,X'3F' CLEAR ILC @V408246 00462000
  494. ICM R0,B'0010',VMPSW+4 GET CURRENT C.C. @V408246 00463000
  495. RTNADDR DS 0H @V408246 00464000
  496. STM R0,R1,RUNPSW SET-UP NEW PSW @V408246 00465000
  497. TM VMESTAT,VMINVPAG+VMINVSEG+VMNEWCR0 ANY RELOC. @V408246 00466000
  498. * CHANGE? 00467000
  499. BZ LDRPSW NO, . . . GO @V408246 00468000
  500. B PERHAPS YES, HANDLE IN NORMAL WAY @V408246 00469000
  501. EJECT 00470000
  502. DMKDSPB DS 0H ENTERED AFTER VIRT. PSW CHANGE @V408246 00471000
  503. USING *,R12 TEMPORARY ADDRESSABILITY 00472000
  504. LM R12,R13,DSPBASE LOAD UP BASE REGS @V387045 00473000
  505. USING DMKDSP,R12,R13 @V387045 00474000
  506. LA R9,1 INCREMENT @V408246 00475000
  507. AL R9,DMKDSPBC DISPATCH ENTRIES AFTER PSW CHANGE@V408246 00476000
  508. ST R9,DMKDSPBC ... 00477000
  509. LA R9,CKPSW SET EXIT ADDRESS 00478000
  510. TM CPSTATUS,CPEX HERE VIA STACKED REQUEST ?? 00479000
  511. BCR 1,R9 YES -- GO CHECK OUT NEW PSW 00480000
  512. TM CPSTATUS,CPWAIT ENTERED AFTER WAIT 00481000
  513. BO WAITIME YES -- 00482000
  514. B RUNTIME GO HANDLE NORMALLY @V386198 00483000
  515. SPACE 1 00484000
  516. CKPSW BAL R9,PSWCKSUB GO CHECK OUT NEW PSW @VA05647 00485000
  517. BZ CKPEND CONTINUE IF IT LOOKS OK @VA05647 00486000
  518. SPACE 1 00487000
  519. SPECPSW EQU * TAKE PSW SPEC CHECK INTERRUPT @VA05647 00488000
  520. LA R0,X'06' SPECIFICATION EXCEPTION CODE @VA05647 00489000
  521. SLR R1,R1 ZERO ILC FOR THE INTERRUPT @VA05647 00490000
  522. STH R1,VMPRGIL ... @VA05647 00491000
  523. GOTO DMKPRGSM GO SWAP PSW'S, ETC....... @VA05647 00492000
  524. SPACE 2 00493000
  525. DMKDSPE EQU * ENTERED IF VIRTUAL TIMER INTERRUPT OCCURS @V386198 00494000
  526. USING *,R12 TEMPORARY @V386198 00495000
  527. LM R12,R13,DSPBASE LOAD BASE REGISTERS @VA05545 00496000
  528. USING DMKDSP,R12,R13 @VA05545 00497000
  529. LA R9,1 INCREMENT @V408246 00498000
  530. AL R9,DMKDSPEC COUNT ENTRIES TO TIMER REFLECT @V408246 00499000
  531. ST R9,DMKDSPEC ... @V386198 00500000
  532. NI VMDSTAT,X'FF'-VMDSP INELIGIBLE FOR FAST DSPCH @V386198 00501000
  533. SLR R3,R3 CLEAR FOR 'XINTQUE' SUBROUTINE @V386198 00502000
  534. L R4,=X'00800080' LOC. 80 TIMER INTERRUPT CODE @V3M4026 00503000
  535. BAL R9,XINTQUE GO QUEUE THE EXTERNAL INTERRUPT @V3M4026 00504000
  536. AIF (&AP).APBR4 @V5DAACD 00505010
  537. LA R9,UNSTACK @V5DAACD 00505020
  538. B RUNTIME @V5DAACD 00505030
  539. AGO .UPBT4 00505040
  540. .APBR4 ANOP @V5DAACD 00505050
  541. * IN UP-MODE, SUBROUTINE TSTSYS IS A NO-OP @V5DAACD 00505060
  542. BAL R9,RUNTIME @V5DAACD 00505070
  543. BAL R9,TSTSYS TEST FOR AND OBTAIN SYSTEM LOCK @V5DAACD 00505080
  544. BZ UNSTACK UNSTACK IF LOCK OBTAINED. @V5DAACD 00505090
  545. BAL R9,STKDEF ELSE, GO DEFER IT. @V5DAACD 00505100
  546. B SWITCH AND SWITCH TO ASYSVM @V5DAACD 00505110
  547. .UPBT4 ANOP @V5DAACD 00505120
  548. SPACE 00505130
  549. EJECT 00507000
  550. AIF (NOT &AP).UPTST3 **AIF*** 00507900
  551. DMKDSPRU DS 0H ENTRY TO RUN ANOTHER USER @V407508 00508000
  552. USING *,R12 TEMPORARY ADDRESSABILITY @V407508 00509000
  553. LM R12,R13,DSPBASE LOAD BASE REGS @V407508 00510000
  554. USING DMKDSP,R12,R13 SET UP ADDRESSABILITY @V407508 00511000
  555. COUNT DMKDSPRC INCREMENT THIS ENTRY'S COUNT @V407508 00512000
  556. TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? @V407508 00513000
  557. BO DSPR0 YES, O.K. TO CONTINUE @V407508 00514000
  558. ABEND 6 TERMINATE VM/370 @V407508 00515000
  559. DSPR0 DS 0H BEGIN PROCESSING @V407508 00516000
  560. TM CPSTATUS,CPRUN WAS SYSTEM RUNNING A USER? @V407508 00517000
  561. BZ DSPR2 NO,GO TEST FOR WAIT @V407508 00518000
  562. BAL R9,RUNTIME DO RUN TIME ACCOUNTING @V407508 00519000
  563. L R2,=A(DMKLOKSY+2) GET ADDRESS OF SYSTEM LOCK @V407508 00520000
  564. CLC LPUADDR,0(R2) IS SYSTEM LOCK HELD BY THIS PROC @V407508 00521000
  565. BE DMKDSPC4 YES, CONT AT MAIN ENTRY @V407508 00522000
  566. SPACE 00523000
  567. DSPR1 DS 0H TEST IF SYSTEM LOCK IS HELD @V407508 00524000
  568. TM VMDSTAT,VMDSP IS VM STILL DISPATCHABLE @V407508 00525000
  569. BO SWITCH YES, STILL O.K. @V407508 00526000
  570. BAL R9,STKDEF NO, INSURE A DEF TASK IS STACKED @V407508 00527000
  571. B SWITCH CONTINUE PROCESSING @V407508 00528000
  572. SPACE 00529000
  573. DSPR2 DS 0H TEST FOR SYSTEM IN WAIT @V407508 00530000
  574. TM CPSTATUS,CPWAIT WAS SYSTEM IN WAIT STATE? @V407508 00531000
  575. BZ DSPR3 NO, GO TRY TO UNLOCK LASTUSER @V407508 00532000
  576. BAL R9,WAITIME YES, DO WAIT TIME ACCOUNTING @V407508 00533000
  577. B SWITCH2 CONTINUE PROCESSING @V407508 00534000
  578. SPACE 00535000
  579. DSPR3 DS 0H TRY TO UNLOCK LASTUSER @V407508 00536000
  580. LR R1,R11 GET CURRENT R11 VMBLOK ADDR @V407508 00537000
  581. BAL R8,UNLOKVM UNLOCK THIS VMBLOK IF LOCKED @V407508 00538000
  582. ICM R1,B'1111',STACKVM GET ADDR OF UNSTACKED VMBLOK @V407508 00539000
  583. BZ SWITCH NO VMBLOK ADDRESS THERE @V407508 00540000
  584. BAL R8,UNLOKVM UNLOCK THIS VMBLOK IF LOCKED @V407508 00541000
  585. XC STACKVM(4),STACKVM CLEAR ADDR OF UNSTKED VMBLOK @V407508 00542000
  586. SWITCH DS 0H SWITCH TO ASYSVM @V407508 00543000
  587. CHARGE STOP STOP CHARGING CURRENT VMBLOK @V4M0173 00544000
  588. L R11,ASYSVM SWITCH R11 TO SYSTEM VMBLOK @V4M0173 00545000
  589. SWITCH2 DS 0H @V407508 00546000
  590. L R1,LASTUSER GET VALUE OF LASTUSER @V407508 00547000
  591. CR R1,R11 IS LASTUSER EQUAL TO ASYSVM? @V407508 00548000
  592. BE TSTXTND YES, ALREADY UNLOCKED @V407508 00549000
  593. TM VMOSTAT-VMBLOK(R1),VMSHR WAS LASTUSER USING @V407508 00550000
  594. * SHARED SYSTEMS? @V407508 00551000
  595. BO TSTXTND YES, DO NOT UNLOCK YET @V407508 00552000
  596. BAL R8,UNLOKVM2 UNLOCK LASTUSER @V407508 00553000
  597. ST R11,LASTUSER SET LASTUSER TO ASYSVM @V407508 00554000
  598. TSTXTND DS 0H @V407508 00555000
  599. * 00555050
  600. * IF A DISPATCH SIGNAL HAS BEEN RECEIVED, IT MUST BE 00555100
  601. * PROCESSED UNLESS ONE OF THE SPECIAL CONDITIONS IS PRESENT 00555150
  602. * 00555200
  603. LA R5,CKUSERS SET EXIT ADDRESS @VA08873 00555250
  604. TM XCPEND,XCDISP DISPATCH SIGNAL PENDING? @VA08873 00555300
  605. BZ TSTXTND2 NO, GO TEST FOR EXTEND @VA08873 00555350
  606. LA R5,SPIN YES, SET UP TO SPIN FOR LOCK @VA08873 00555400
  607. L R3,XCPEND PICK UP WORD OF FLAGS @VA08873 00555450
  608. DSPXC DS 0H ACKNOWLEDGE DISPATCH SIGNAL @VA08873 00555500
  609. LR R4,R3 MOVE FLAGS TO WORK REG @VA08873 00555550
  610. N R4,DISPWKUP TURN OFF DISPATCH & WAKEUP @VA08873 00555600
  611. CS R3,R4,XCPEND STORE ALTERED WORD OF FLAGS @VA08873 00555650
  612. BNE DSPXC KEEP TRYING @VA08873 00555700
  613. TSTXTND2 DS 0H TEST FOR EXTEND @VA08873 00555750
  614. L R2,PREFIXA GET PROCESSOR PREFIX ADDRESS @V407508 00556000
  615. CLI XTNDLOCK-PSA(R2),SET IS SYSTEM IN EXTEND? @V407508 00557000
  616. BNE TESTQSC NO, TEST FOR QUIESCE @V407508 00558000
  617. TM APSTAT1,PROCIO IS THIS THE MAIN PROCESSOR? @V407508 00559000
  618. BO TSTXTNDP YES, GO TEST FOR EXTEND PENDING @V407508 00560000
  619. BAL R9,XTNDAP DO AP-ONLY EXTEND PROCESSING @V407508 00561000
  620. TSTXTNDP DS 0H TEST FOR EXTEND PENDING @V407508 00562000
  621. TM EMSPEND,EMSPEXT IS EXTEND PENDING FLAG ON? @V407508 00563000
  622. BNO NOXTNDP NO, SKIP TURNING OFF XTND PNDG @V407508 00564000
  623. NI EMSPEND,X'FF'-EMSPEXT TURN OFF EXTEND PENDING @V407508 00565000
  624. OI EMSREC,EMSREXT TURN ON EXTEND RECEIVED FLAG @V407508 00566000
  625. NOXTNDP DS 0H @V407508 00567000
  626. TM APSTAT1,PROCIO IS THIS THE MAIN PROCESSOR? @V407508 00568000
  627. BO SPIN YES, GO TO SPIN ON SYSTEM LOCK @V407508 00569000
  628. SR R0,R0 CLEAR R0 INDICATE END COND @V407508 00570000
  629. LA R1,XTNDLOCK-PSA(,R2) GET ADDR OF EXTEND LOCK @V407508 00571000
  630. O R1,=A(X'80000000') TURN ON HIGH ORDER BIT @V407508 00572000
  631. CALL DMKLOKPS SPIN TILL EXTEND COMPLETES @V407508 00573000
  632. TESTQSC DS 0H @V407508 00574000
  633. TM EMSPEND,EMSPQUI+EMSINQSC TEST FOR QUIESCE @V4M0210 00575000
  634. * PENDING OR IN-QUIESCE STATUS @V4M0210 00576000
  635. BZ TESTFRLK NEITHER ON, GO TEST FRELK FLAG @V4M0210 00577000
  636. TM EMSPEND,EMSPQUI IS QUIESCE PENDING FLAG ON? @V4M0210 00578000
  637. BNO IDLEB NO, MUST BE IN-QUIESCE @V4M0210 00579000
  638. NI EMSPEND,X'FF'-EMSPQUI TURN OFF QUIESCE PENDING @V4M0210 00580000
  639. OI EMSPEND,EMSINQSC TURN ON IN-QUIESCE FLAG @V4M0210 00581000
  640. OI EMSREC,EMSRQUI TURN ON QUIESCE RECEIVED FLAG @V407508 00582000
  641. B IDLEB GO LOAD WAIT STATE @V407508 00583000
  642. TESTFRLK DS 0H @V407508 00584000
  643. CLI CPFRELK-PSA(R2),SET IS CPFRELK FLAG ON? @V407508 00585000
  644. BNE TESTMCLK NO, GO TEST MCH FLAG @V4M0006 00586000
  645. CLC FRLKPROC-PSA(1,R2),LPUADDR+1 IS THIS FRELK PROC @V407508 00587000
  646. BE SPIN YES, GO TO SPIN ON SYSTEM LOCK @V4M0006 00588000
  647. TESTMCLK DS 0H @V407508 00589000
  648. TM APSTAT4,CPMCHSE IS MCH SOFT ERROR FLAG ON? @VA07615 00590100
  649. * 00591200
  650. * AT THIS POINT, NONE OF THE SPECIAL CONDITIONS IS PRESENT 00591300
  651. * IF DISPATCH SIGNAL HAS BEEN RECEIVED, MUST SPIN FOR LOCK 00591400
  652. * 00591500
  653. BNOR R5 EITHER CKUSERS OR SPIN @VA08873 00591600
  654. SPIN DS 0H SPIN UNTIL SYSTEM LOCK IS FREE @V407508 00592000
  655. LOCK OBTAIN,TYPE=SYS,SPIN=YES GO GET SYSTEM LOCK @V407508 00593000
  656. CLI XTNDLOCK-PSA(R2),SET IS SYSTEM IN EXTEND? @V407508 00594000
  657. BNE TSTFRLK NO, GO TEST FRELK FLAG @V4M0006 00595000
  658. TM APSTAT1,PROCIO IS THIS THE MAIN PROCESSOR? @V407508 00596000
  659. BO FLAGCPEX YES, DO NORMAL EXTEND PROCESSING @VA07228 00597000
  660. TSTFRLK DS 0H @V407508 00598000
  661. CLI CPFRELK-PSA(R2),SET IS CPFRELK FLAG ON? @V407508 00599000
  662. BNE TSTMCLK NO, GO TEST MCH FLAG @V4M0006 00600000
  663. CLC FRLKPROC-PSA(1,R2),LPUADDR+1 IS THIS FRELK PROC @V407508 00601000
  664. BE FNDPBLOK YES, GO FIND PRIORITY CPEXBLOK @V4M0141 00602000
  665. TSTMCLK DS 0H @V407508 00603000
  666. TM APSTAT4,CPMCHSE IS MCH SOFT ERROR FLAG ON? @VA07615 00604100
  667. BO MCHSXT YES, GOTO DMKMCH FOR SOFT ERROR @V407508 00605000
  668. B UNLKLAST NO, CONTINUE LOCKED PROCESSING @V407508 00606000
  669. SPACE 1 00606030
  670. .UPTST3 ANOP **ANOP** 00606100
  671. EJECT 00607000
  672. *. 00608000
  673. * OPERATION 00609000
  674. * 00610000
  675. * B. RUNNING USER ACCOUNTING - 00611000
  676. * 1. UNFLAG RUNNING STATUS AND TEST IF R11 VMBLOK IS RUNUSER; 00612000
  677. * IF NOT, UNLOCK R11 VMBLOK AND SWITCH CPU TIMER AND R11 00613000
  678. * TO RUNUSER. 00614000
  679. * 2. CHECK IF USER HAS REACHED EITHER TIME-SLICE END OR QUEUE- 00615000
  680. * SLICE END; IN EITHER CASE, MARK THE USER INELIGIBLE FOR 00616000
  681. * FAST REDISPATCH. ALSO STORE THE TIME REMAINING IN THE 00617000
  682. * TIME-SLICE AND INCREMENT THE PROCESSOR PROBLEM STATE 00618000
  683. * TIME. 00619000
  684. * 3. IF THE VIRTUAL TIMER IS RUNNING, UPDATE EITHER THE USER'S 00620000
  685. * VIRTUAL TIMER, IF RESIDENT, OR THE COPY IN THE USER'S 00621000
  686. * VMBLOK. IF IT CHANGES SIGN FROM POSITIVE TO NEGATIVE, 00622000
  687. * POST A PENDING INTERRUPT AND MARK THE USER INELIGIBLE FOR 00623000
  688. * FAST REDISPATCH. 00624000
  689. *. 00625000
  690. SPACE 2 00626000
  691. RUNTIME EQU * CALCULATE TIME THAT WAS USED... %V3M4038 00627000
  692. MVI CPSTATUS,CPEX+CPSUPER SET PROCESSNG STATUS FLAG %V407508 00628000
  693. CHARGE STOP GET END OF IN-Q SLICE VMTTIME @ZA12055 00628500
  694. C R11,RUNUSER STILL POINTING TO RUNUSER ?? %V3M4038 00629000
  695. BE UNRUN IF YES, SKIP RESET OF CPU TIMER %V3M4038 00630000
  696. AIF (NOT &AP).UPTST4 **AIF*** 00630900
  697. LR R1,R11 SAVE CURRENT R11 USER %V407508 00631000
  698. * IN UP-MODE, SUBROUTINE UNLOKVM IS A NO-OP. 00632000
  699. BAL R8,UNLOKVM UNLOCK OLD R11 USER IF LOCKED %V407508 00633000
  700. .UPTST4 ANOP **ANOP** 00633100
  701. CHARGE SWITCH,RUNUSER SWITCH TIMER & R11 TO RUNUSER %V407508 00634000
  702. L R1,QUANTUMR CPU TIME REMAINING %V408246 00635000
  703. B UNRUN+4 ALREADY HAVE REMAINING VALUE %V408246 00636000
  704. SPACE 00637000
  705. UNRUN DS 0H %V408246 00638000
  706. L R1,TIMER CPU TIME REMAINING %V408246 00639000
  707. LTR R1,R1 ANY? %V3M4038 00640000
  708. BP B1 %V408246 00641000
  709. NI VMDSTAT,255-VMDSP NO, REMOVE FAST DISPATCH FLAG %V3M4038 00642000
  710. OI VMDSTAT,VMTSEND FLAG TIME-SLICE END %V3M4038 00643000
  711. B1 EQU * %V408246 00644000
  712. SPACE 00645000
  713. AIF (NOT &AP).UPTST5 **AIF*** 00645900
  714. TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? %V4M0203 00646000
  715. BZ B1A NO, CONTINUE AS IN UP-MODE %V4M0203 00647000
  716. LM R2,R5,VMCPTIME LOAD BOTH SUPERVISOR TIME VALUES @V4M0203 00648000
  717. SLDL R2,8 SHIFT OFF 1ST BYTE OF VMCPTIME @V4M0203 00649000
  718. SLDL R4,8 SHIFT OFF 1ST BYTE OF VMAPTIME @V4M0203 00650000
  719. ALR R2,R4 COMBINE SUPERVISOR TIME VALUES @V4M0203 00651000
  720. LM R4,R5,VMTMINQ LOAD QUEUE CPU LIMIT @V4M0203 00652000
  721. SLDL R4,8 SHIFT OFF 1ST BYTE OF VMTMINQ @V4M0203 00653000
  722. CLR R2,R4 SEE IF EXCEEDED QUEUE CPU LIMIT @V4M0203 00654000
  723. BH B2 NO, CHECK VIRTUAL LOC 80 TIMER @V4M0203 00655000
  724. B B1B YES, GO SET APPROPRIATE FLAGS @V4M0203 00656000
  725. B1A DS 0H %V4M0203 00657000
  726. .UPTST5 ANOP **ANOP** 00657100
  727. CLC VMTTIME(5),VMTMINQ EXCEEDED QUEUE CPU LIMIT? %V3M4038 00658000
  728. BH B2 NO, CHECK VIRTUAL LOC. 80 TIMER %V408246 00659000
  729. B1B DS 0H %V4M0203 00660000
  730. NI VMDSTAT,255-VMDSP REMOVE FAST DISPATCH FLAG %V3M4038 00661000
  731. OI VMDSTAT,VMQSEND FLAG QUEUE TIME UP %V3M4038 00662000
  732. B2 EQU * %V408246 00663000
  733. SPACE 00664000
  734. BAL R8,INCPROBT GO INCREMENT PROBLEM STATE TIME %V407508 00665000
  735. L R0,QUANTUM SAVE FOR VIRT. 80 UPDATE %V408246 00666000
  736. ST R1,QUANTUM SET TIME-SLICE REMAINING VALUE %V408246 00667000
  737. TM VMMCR6,VMMFE+VMMVTMR VIRTUAL TIMER RUNNING? %V408246 00668000
  738. BOR R9 YES, NO NEED FOR UPDATE %V408246 00669000
  739. TM VMTLEVEL,VMTON+VMRON TIMER RUNNING ?? %V408246 00670000
  740. BZR R9 NO, DONE %V408246 00671000
  741. S R0,QUANTUMR CALCULATE TIME SPENT IN PROBLEM %V408246 00672000
  742. UPVIRT DS 0H UPDATE VIRTUAL LOCATION 80 TIMER %V408246 00673000
  743. BNM DSP3A ACCEPTABLE %V408246 00674000
  744. L R0,=F'1' STOP DSP003 ABEND - JUST FIDDLE TIMER HRC006DK 00675010
  745. DSP3A DS 0H %V408246 00676000
  746. LCTL C1,C1,VMSEG INSURE CORRECT MEMORY SPACE %V408246 00677000
  747. LRA R2,TIMER-PSA VIRTUAL TIMER AVAILABLE? %V408246 00678000
  748. BZ *+8 YES %V408246 00679000
  749. LA R2,VMTIMER NO, POINT AT COPY %V408246 00680000
  750. L R5,0(,R2) GET TIMER VALUE %V408246 00681000
  751. SLR R5,R0 UPDATE VIRTUAL TIMER %V408246 00682000
  752. ST R5,0(,R2) SAVE NEW VALUE %V408246 00683000
  753. BCR 8+2+1,R9 CARRY MEANS NO INT. TO REFLECT %V3M4038 00684000
  754. SLR R3,R3 %V3M4038 00685000
  755. L R4,=X'00800080' %V3M4038 00686000
  756. NI VMDSTAT,X'FF'-VMDSP RESET RUNNING USER FLAG %V3M4038 00687000
  757. SPACE 2 00688000
  758. * QUEUE AN EXTERNAL INTERRUPT BLOCK TO USER'S VMBLOK 00689000
  759. SPACE 00690000
  760. XINTQUE LA R2,VMPXINT EXTERNAL INTERRUPT BLOCK CHAIN @V3M4026 00691000
  761. USING XINTBLOK,R2 ADDRESSABILITY TO BLOCKS... @V3M4026 00692000
  762. XINTLOOP LR R6,R2 PRESERVE POINTER TO PREVIOUS @V200198 00693000
  763. L R2,XINTNEXT-XINTBLOK(,R6) NEXT? @V200198 00694000
  764. LTR R2,R2 @V200198 00695000
  765. BZ XINTADD NOPE, ADD TO END OF CHAIN @V200198 00696000
  766. C R3,XINTSORT CHECK FOR COLLATING SEQUENCE @V200198 00697000
  767. BH XINTLOOP KEEP LOOKING... @V200198 00698000
  768. BL XINTADD "THIS IS THE PLACE..." @V200198 00699000
  769. O R4,XINTCODE THESE MAY BE PRESENTED TOGETHER @V200198 00700000
  770. ST R4,XINTCODE OR ONE AT A TIME @V200198 00701000
  771. BR R9 EXIT @V3M4026 00702000
  772. XINTADD LA R0,XINTSIZE NUMBER OF DOUBLEWORDS @V200198 00703000
  773. CALL DMKFREE GET BLOCK FORM FREE STORAGE @V200198 00704000
  774. ST R1,XINTNEXT-XINTBLOK(,R6) @V200198 00705000
  775. SLR R5,R5 PARAMETER IN MEANINGLESS HERE @V200198 00706000
  776. STM R2,R5,XINTNEXT-XINTBLOK(R1) BUILD NEW @V200198 00707000
  777. * INTERRUPT BLOCK 00708000
  778. BR R9 FINIS... @V3M4026 00709000
  779. DSPBASE DC A(DMKDSP,DMKDSP+4096) BASE REGS @V387045 00710000
  780. EJECT 00711000
  781. *. 00712000
  782. * OPERATION - 00713000
  783. * 00714000
  784. * C. WAIT TIME ACCOUNTING - 00715000
  785. * 1. WAIT TIME IS SUBDIVIDED INTO 3 MAIN CATEGORIES: 00716000
  786. * A. 'IDLEWAIT' IS ACCUMULATED WHEN THE SYSTEM IS IN A 00717000
  787. * DORMANT STATE I.E., THERE IS NO OUTSTANDING ACTIVITY 00718000
  788. * ON THE SYSTEM. 00719000
  789. * 00720000
  790. * B. 'IONTWAIT' IS ACCUMULATED WHEN THERE IS ATLEAST 1 00721000
  791. * ACTIVE CHANNEL PROGRAM IN PROGRESS (OTHER THAN PAGING) 00722000
  792. * THAT HAS NOT AS YET COMPLETED. 00723000
  793. * 00724000
  794. * C. 'PAGEWAIT' IS ACCUMULATED WHEN THE SYSTEM IS IN A 00725000
  795. * TOTAL PAGE WAIT CONDITION. A TOTAL PAGE WAIT CONDITION 00726000
  796. * IS DETECTED WHEN ALL RUNNABLE USER'S IN QUEUE 1 AND 00727000
  797. * QUEUE 2 ARE WAITING FOR PAGES. 00728000
  798. * 00729000
  799. * 2. PRIOR TO LOADING A WAIT STATE PSW THE SYSTEM IS ENABLED 00730000
  800. * FOR EXTERNAL AND I/O INTERRUPTS. IF AN INTERRUPT SHOULD 00731000
  801. * OCCUR BEFORE LOADING A WAIT STATE PSW THERE WILL BE NO 00732000
  802. * CHANGE IN SYSTEM WAIT TIME. OTHERWISE, FLAGS IN 00733000
  803. * THE PSA INDICATE WHAT THE SYSTEM STATE IS 00734000
  804. * FOR THIS WAIT STATE CONDITION. 00735000
  805. * 00736000
  806. * 3. WHEN AN EXTERNAL OR I/O INTERRUPT DOES OCCUR THE VALUE IN 00737000
  807. * THE PSA FIELD WAITEND IS MOVED INTO THE CORRESPONDING 00738000
  808. * WAIT FIELD. 00739000
  809. * 00740000
  810. * 4. A RETURN IS MADE TO THE CALLER. 00741000
  811. * 00742000
  812. *. 00743000
  813. SPACE 2 00744000
  814. WAITIME EQU * PERFORM WAIT-TIME ACCOUNTING 00745000
  815. MVI CPSTATUS,CPEX+CPSUPER SET PROCESSNG STATUS FLAG @V407508 00746000
  816. * 00747000
  817. * SUBROUTINE TO ACCOUNT FOR SYSTEM WAIT TIME 00748000
  818. * 00749000
  819. SPACE 00750000
  820. C R11,ASYSVM RUNUSER STILL THE SYSTEM 00751000
  821. BE WAITPROC YES - @V200820 00752000
  822. AIF (NOT &AP).UPTST6 **AIF*** 00752900
  823. LR R1,R11 SAVE CURRENT R11 USER @V407508 00753000
  824. * IN UP-MODE, SUBROUTINE UNLOKVM IS A NO-OP. 00754000
  825. BAL R8,UNLOKVM UNLOCK OLD R11 USER IF LOCKED @V407508 00755000
  826. .UPTST6 ANOP **ANOP** 00755100
  827. WAITPROC EQU * @V200820 00756000
  828. CHARGE STOP STOP CHARGING CURRENT VMBLOK @V4M0173 00757000
  829. L R11,ASYSVM SWITCH R11 TO SYSTEM VMBLOK @V4M0173 00758000
  830. SPACE 00759000
  831. TM CPSTAT3,CPTIDLE+CPTPAGE+CPTIONT ANY WAIT FLAGS? @V407508 00760000
  832. BCR 8,R9 BR. IF SYSTEM INT. WHILE SCANNING VMBLOKS 00761000
  833. SPACE 00762000
  834. LM R0,R1,WAITEND GET VALUE IN TIMER AT WAIT END @V407508 00763000
  835. TM CPSTAT3,CPTIDLE DID TIMER CONTAIN IDLE TIME? @V407508 00764000
  836. BZ WAITIDLE NO -- @V200820 00765000
  837. STM R0,R1,IDLEWAIT SAVE NEW IDLE WAIT TIME VALUE 00766000
  838. B WAITRETN RESET FLAG INDICATOR 00767000
  839. SPACE 00768000
  840. WAITIDLE EQU * @V200820 00769000
  841. L R4,PWTPAGES NO, OF PAGEWAIT PAGES AT ENTRY @V407508 00770000
  842. * TO WAIT 00771000
  843. LTR R4,R4 ANY? @V408246 00772000
  844. BZ WAITA NO, BYPASS ACCUMULATING PAGE @V408246 00773000
  845. * WAIT TIME 00774000
  846. LM R2,R3,WAITSTRT GET TIMER VALUE AT ENTRY TO WAIT @V407508 00775000
  847. SLR R3,R1 @V408246 00776000
  848. BC 11,*+8 @V408246 00777000
  849. SL R2,F1 @V408246 00778000
  850. SLR R2,R0 ELAPSED TIME IN WAIT (ASSUME < @V408246 00779000
  851. * 30 MINS) 00780000
  852. SRDL R2,12 VALUE IN MICROSECONDS @V408246 00781000
  853. STM R2,R3,WAITSTRT SAVE ELAPSED TIME IN WAIT @V407508 00782000
  854. MR R2,R4 WAIT * PAGEWAIT PAGES @V408246 00783000
  855. AL R3,PGWAITIM+4 @V408246 00784000
  856. BC 12,*+8 @V408246 00785000
  857. AL R2,F1 @V408246 00786000
  858. AL R2,PGWAITIM @V408246 00787000
  859. STM R2,R3,PGWAITIM @V408246 00788000
  860. WAITA DS 0H @V408246 00789000
  861. TM CPSTAT3,CPTPAGE DID TIMER HAVE PAGE WAIT TIME? @V407508 00790000
  862. BZ WAITPAGE NO -- @V200820 00791000
  863. STM R0,R1,PAGEWAIT SAVE NEW PAGE WAIT TIME VALUE 00792000
  864. B WAITRETN RESET FLAG INDICATOR 00793000
  865. SPACE 00794000
  866. WAITPAGE EQU * @V200820 00795000
  867. STM R0,R1,IONTWAIT SAVE NEW SIMPLE I/O WAIT TIME 00796000
  868. SPACE 00797000
  869. WAITRETN MVI CPSTAT3,NONE TURN OFF ANY WAIT STATE FLAG @V407508 00798000
  870. BR R9 EXIT 00799000
  871. EJECT 00800000
  872. *. 00801000
  873. * OPERATION - 00802000
  874. * 00803000
  875. * D. PENDING INTERRUPT UNSTACK - 00804000
  876. * 1. IF THE USER IS NOT RUNNABLE, GO IMMEDIATELY TO SECTION F. 00805000
  877. * TO ALTER DISPATCHING STATUS 00806000
  878. * 2. IF A DELAYED PER INTERRUPT IS PENDING, REFLECT IT TO THE 00807000
  879. * USER, SWAPPING HIS PSW'S AND STORING THE PER INTERRUPT 00808000
  880. * CODE AND ADDRESS IN LOW CORE; THEN GO TO THE NEW PSW 00809000
  881. * VALIDATION ROUTINE (SECTION E.) 00810000
  882. * 3. IF NO PER INTERRUPT IS PENDING, CHECK FOR PENDING PSEUDO 00811000
  883. * PAGE FAULTS FOR WHICH THE USER IS ENABLED. IF A PSEUDO 00812000
  884. * PAGE FAULT IS PENDING, SET THE NEGATIVE EXCEPTION 00813000
  885. * ADDRESS FROM THE PGBLOK, SET UP THE INTERRUPT CODE, AND 00814000
  886. * GO TO DMKVATEX TO SIMULATE THE PAGE AVAILABLE INTERRUPT. 00815000
  887. * IF NO PAGE FAULT IS PENDING, CHECK FOR PENDING EXTERNAL 00816000
  888. * INTERRUPTS FOR WHICH THE USER IS ENABLED. IF AN EXTERNAL 00817000
  889. * INTERRUPT SHOULD BE REFLECTED, USE THE PENDING MASK 00818000
  890. * TO INDEX THE EXTCODES TABLE TO LOCATE THE PROPER CODE TO BE 00819000
  891. * GIVEN TO THE USER. IF THE USER IS RUNNING AN EXTENDED 00820000
  892. * MACHINE, VERIFY THAT HE IS NOT IN AN ENABLED EXTERNAL 00821000
  893. * INTERRUPT LOOP; THEN REFLECT THE INTERRUPT AS IN STEP 2. 00822000
  894. * WHEN THE NEW PSW HAS BEEN ESTABLISHED, GO TO THE NEW PSW 00823000
  895. * CHECK OUT ROUTINE (SECTION E.) TO VALIDATE IT 00824000
  896. * 4. IF NO EXTERNAL INTERRUPT IS REFLECTED, CHECK FOR PENDING 00825000
  897. * I/O INTERRUPTS FOR WHICH THE USER IS ENABLED. IF THE USER 00826000
  898. * IS MASKED ON FOR A CHANNEL ON WHICH AN INTERRUPT IS PENDING 00827000
  899. * LOCATE THE UNIT ON THE CHANNEL WHICH HAS A PENDING CHANNEL 00828000
  900. * CLASS INTERRUPT. IF NO CHANNEL CLASS INTERRUPT IS PENDING 00829000
  901. * LOCATE THE FIRST UNIT WITH A CONTROL UNIT OR DEVICE CLASS 00830000
  902. * INTERRUPT, AND REFLECT IT TO THE USER BY SWAPPING PSW'S, 00831000
  903. * STORING THE ADDRESS OF THE INTERRUPTING UNIT AND STORING 00832000
  904. * THE APPROPRIATE CSW STATUS. WHEN THE NEW PSW HAS BEEN 00833000
  905. * ESTABLISHED, GO TO NEW PSW CHECK OUT ROUTINE (SECTION E.) 00834000
  906. * TO VALIDATE IT. 00835000
  907. * 5. IF NO INTERRUPTS ARE PENDING FOR WHICH THE USER IS ENABLED, 00836000
  908. * GO TO SECTION F. TO UNSTACK THE NEXT PENDING REQUEST 00837000
  909. * 00838000
  910. *. 00839000
  911. EJECT 00840000
  912. UNSTACK EQU * HERE TO UNSTACK ANY PENDING INTERRUPTS %V3M4038 00841000
  913. SPACE 00842000
  914. TM VMRSTAT,VMCPWAIT IS USER RUNNABLE ?? %V3M4038 00843000
  915. * THE FOLLOWING INSTRUCTION IS NOT PERFORMED BY ECPS 00844000
  916. BNZ CHKILL NO -- DON'T BOTHER TO UNSTACK %V408246 00845000
  917. * RATHER, ECPS PERFORMS: 00846000
  918. * BNZ DISPATCH NO -- DON'T BOTHER TO UNSTACK %V3M4038 00847000
  919. CKPEND EQU * HERE TO TEST FOR INTERRUPTS PENDING %V3M4038 00848000
  920. TM VMPEND,VMPERPND+VMPGPND PER/PAGE FAULT PENDING %V3M4038 00849000
  921. BZ CKEXT NO -- GO CHECK OUT EXTERNALS %V3M4038 00850000
  922. SPACE 00851000
  923. CKPER TM VMPEND,VMPERPND IS IT A DELAY PER INT ? @V386198 00852000
  924. BZ CKPPF NO - MUST BE PSEUDO PAGE FAULT @V213135 00853000
  925. TM VMTRCTL,VMTRPER WERE WE USING THE P.E.R? PER001 00853050
  926. BO OURPER YES. CALL DMKPERIL TO FIGURE IT OUTPER001 00853100
  927. SR R1,R1 PAGE 0 -- 00854000
  928. TRANS 2,1,OPT=(BRING,DEFER) FETCH IT -- 00855000
  929. L R1,VMPSW SWAP PSW'S 00856000
  930. ST R1,PROPSW-PSA(,R2) .. 00857000
  931. L R1,VMPSW+4 .. 00858000
  932. ST R1,PROPSW-PSA+4(,R2) .. 00859000
  933. L R1,PRNPSW-PSA(,R2) 00860000
  934. ST R1,VMPSW .. 00861000
  935. L R1,PRNPSW-PSA+4(,R2) .. 00862000
  936. ST R1,VMPSW+4 .. 00863000
  937. LA R1,X'80' SET PER INTERRUPT CODE 00864000
  938. ICM R1,12,VMPRGIL GET ILC 00865000
  939. ST R1,INTPRL-PSA(,R2) STORE FOR USER 00866000
  940. L R1,VMECEXT GET VMBLOK EXTENSION 00867000
  941. LH R0,EXTPERCD-ECBLOK(,R1) GET PER CODE 00868000
  942. STH R0,PERCODE-PSA(,R2) STORE FOR USER 00869000
  943. L R0,EXTPERAD-ECBLOK(,R1) GET PER ADDRESS 00870000
  944. ST R0,PERADD-PSA(,R2) STORE FOR USER 00871000
  945. NI VMPEND,X'FF'-VMPERPND UNFLAG PER PENDING 00872000
  946. AIF (NOT &TRACE(6)).NOPC1 AIF TRACING PROG INTERRUPTS 00875000
  947. TM VMTRCTL,VMTRPRG+VMTRBRIN TRACE ALL OR P.C. 00876000
  948. BZ CKPSW IF NOT TRACING...BRANCH 00877000
  949. LM R0,R1,PROPSW-PSA(R2) LOAD OLD PC PSW 00878000
  950. L R4,INTPRL-PSA(,R2) GET ILC + INTERRUPT CODE 00879000
  951. LM R2,R3,PRNPSW-PSA(R2) LOAD UP NEW P.C. PSW 00880000
  952. CALL DMKTRCPG CALL TRACER (PROG. CHECKS) 00881000
  953. .NOPC1 ANOP 00882000
  954. SPACE 00883000
  955. B CKPSW GO CHECK OUT NEW PSW 00884000
  956. OURPER OI VMRSTAT,VMEXWAIT TAKE MACHINE OUT OF RUNNING. PER001 00884100
  957. CALL DMKPERIL CALL INTERRUPT HANDLER. PER001 00884200
  958. NI VMPEND,255-VMPERPND KILL THE PENDING BIT. PER001 00884300
  959. NI VMRSTAT,255-VMEXWAIT REMOVE THE MACHINE FROM PER001 00884400
  960. GOTO DMKDSPCH GO TO GROUND FLOOR ZERO. PER001 00884500
  961. EJECT 00885000
  962. CKPPF EQU * HERE TO UNSTACK PSEUDO PAGE @V213135 00886000
  963. * AVAILBLE INTERRUPTS 00887000
  964. TM VMESTAT,VMEXTCM ONLY IN EC MODE, THOUGH ... @V213135 00888000
  965. BZ CKEXT NO DICE - @V213135 00889000
  966. TM VMPSW,VMIOPND AND ONLY IF ENABLED -- @V213135 00890000
  967. BZ CKEXT NOT THIS TIME -- @V213135 00891000
  968. NI VMPEND,X'FF'-VMPGPND UNFLAG PAGE FAULT PENDING @V213135 00892000
  969. L R1,VMPGPNT GET NEXT PAGE AVIALABLE BLOCK @V213135 00893000
  970. LTR R1,R1 ANY THERE ? @V213135 00894000
  971. BZ CKEXT NO -- GO TEST EXTERNALS @V213135 00895000
  972. USING PGBLOK,R1 ADDRESSABILITY FOR PGBLOK @V213135 00896000
  973. L R0,PGPNT GET NEXT ON THE STACK @V213135 00897000
  974. ST R0,VMPGPNT AND MAKE HIM FIRST @V213135 00898000
  975. LTR R0,R0 ANY MORE STACKED ?? @V213135 00899000
  976. BZ *+8 NO -- NOTHING MORE PENDING @V213135 00900000
  977. OI VMPEND,VMPGPND RE-SET PENDING FLAG @V213135 00901000
  978. SLR R8,R8 SET UP GPR8 @V213135 00902000
  979. STH R8,VMPRGIL TO CLEAR ILC SAVE AREA @V213135 00903000
  980. L R3,PGADDR AND SET FOR GOTO TO DMKVATEX @V213135 00904000
  981. LA R0,PGBSIZE RELEASE PGBLOK .. @V213135 00905000
  982. CALL DMKFRET .. @V213135 00906000
  983. LA R1,X'14' SET INTERRUPT CODE @V213135 00907000
  984. OI VMRSTAT,VMEXWAIT DO NOT RUN WHILE REFLECTING -- @V213135 00908000
  985. GOTO DMKVATEX GO DO IT @V213135 00909000
  986. EJECT 00910000
  987. CKEXT DS 0H %V408246 00911000
  988. ICM R6,B'1111',VMPXINT ANY EXTERNAL INTERRUPTS? %V408246 00912000
  989. BZ UNSTIO NO %V408246 00913000
  990. TM VMPSW,VMEXTPND ENABLED FOR EXTERNAL? %V408246 00914000
  991. BZ UNSTIO NOPE, TRY I/O %V3M4038 00915000
  992. L R3,VMVCR0 GET SELECTED MASKS %V3M4038 00916000
  993. TM VMPSTAT,VMV370R EXTENDED CONTROL BLOCK PRESENT? %V3M4038 00917000
  994. BZ *+8 NOPE, THIS'LL HAVE TO DO %V3M4038 00918000
  995. L R3,EXTCR0-ECBLOK(,R3) CONTROL REGISTER 0 %V3M4038 00919000
  996. LA R5,VMPXINT ANCHOR CHAIN FOR EXT. INTERRUPTS %V408246 00920000
  997. B UNSTLUPA JOIN CODE ALREADY IN PROGRESS %V408246 00921000
  998. USING XINTBLOK,R6 %V3M4038 00922000
  999. UNSTLOOP LR R5,R6 PRESERVE PREVIOUS BLOCK ADDRESS %V3M4038 00923000
  1000. L R6,XINTNEXT-XINTBLOK(,R5) NEXT? %V3M4038 00924000
  1001. LTR R6,R6 %V3M4038 00925000
  1002. BZ UNSTIO NOT ENABLED FOR ANY OF THESE %V3M4038 00926000
  1003. UNSTLUPA DS 0H %V408246 00927000
  1004. LH R4,XINTMASK GET MASK VALUE %V3M4038 00928000
  1005. NR R4,R3 SEE IF ENABLE FOR THIS INTERRUPT %V3M4038 00929000
  1006. BZ UNSTLOOP BETTER LUCK NEXT TIME %V3M4038 00930000
  1007. UNSTPRTY EQU * @V387045 00931000
  1008. CLC XINTCODE,=AL2(VMCXCODE) VMCF INTERRUPT ? @V387045 00932000
  1009. BNE UNSTFTCH NO..CONTINUE... @V387045 00933000
  1010. OI VMRSTAT,VMEXWAIT USER CANNOT RUN @V387045 00934000
  1011. CALL DMKSCHDL (IN CASE OF A R11 SWITCH) @V408246 00935000
  1012. CALL DMKVMCEX REFLECT MESSAGE HEADER @V387045 00936000
  1013. UNSTFTCH EQU * @V387045 00937000
  1014. SLR R1,R1 FETCH PAGE ZERO.. @V387045 00938000
  1015. TRANS 2,1,OPT=BRING+DEFER BRING IN PSA @V200198 00939000
  1016. USING PSA,R2 VIRTUAL PAGE ZERO @V200198 00940000
  1017. LM R0,R1,VMPSW CURRENT PSW @V200198 00941000
  1018. STM R0,R1,EXOPSW BECOMES EXTERNAL OLD PSW @V200198 00942000
  1019. LM R0,R1,EXNPSW AND EXTERNAL NEW PSW @V200198 00943000
  1020. STM R0,R1,VMPSW BECOMES NEW CURRENT PSW @V200198 00944000
  1021. LM R7,R9,XINTSORT SAVE BLOCK @V200198 00945000
  1022. TM XINTCODE,X'F0' IS IT CLASS 0 ? @V200198 00946000
  1023. BNZ CLASS1 NO, JUST PRESENT IT @V200198 00947000
  1024. TM XINTCODE+1,X'80' IS THIS INTERVAL TIMER? @V2B2638 00948000
  1025. BZ NOINTV NOPE, SKIP @V2B2638 00949000
  1026. LA R0,1 ADD ONE ... @V2B2638 00950000
  1027. AL R0,DMKDSPIT ... TO THE VIRTUAL INTERVAL ... @V2B2638 00951000
  1028. ST R0,DMKDSPIT ... TIMER REFLECTION COUNTER @V2B2638 00952000
  1029. NOINTV EQU * @V2B2638 00953000
  1030. XR R8,R4 RESET MASK BITS PRESENTED @V200198 00954000
  1031. STC R8,XINTMASK+1 SAVE WHAT'S LEFT OF CLASS ZERO @V200198 00955000
  1032. * INTERRUPTS 00956000
  1033. NC XINTMASK(2),XINTMASK PARTIALLY PRESENTED? @V200198 00957000
  1034. BNZ PARTIAL YES, TREAT SPECIALLY @V200198 00958000
  1035. CLASS1 CLC XINTCODE(2),=X'1005' IS IT CPU TIMER? @V200198 00959000
  1036. LA R1,DMKDSPPT ADDRESS OF THE COUNTER @V2B2638 00960000
  1037. BE UPCNT YES, GO UP THE COUNT @V2B2638 00961000
  1038. CLC XINTCODE(2),=X'1004' CLOCK COMPARATOR? @V200198 00962000
  1039. LA R1,DMKDSPCK ADDRESS OF THE COUNTER @V2B2638 00963000
  1040. BNE UNCHAINX NO, GO UNCHAIN THE XINTBLOK @V2B2638 00964000
  1041. UPCNT LA R0,1 ADD ONE TO THE PROPER COUNTER @V2B2638 00965000
  1042. AL R0,0(R1) ... @V2B2638 00966000
  1043. ST R0,0(R1) AND PUT IT BACK @V2B2638 00967000
  1044. B UNSTCONT CONTINUE @V2B2638 00968000
  1045. UNCHAINX EQU * @V2B2638 00969000
  1046. CLC XINTCODE,=X'2402' LDF interrupt? HRC065DK 00969100
  1047. BE LDFINT Yes HRC065DK 00969200
  1048. CLC XINTCODE,=AL2(VMCXCODE) VMCF INTERRUPT ? @V387045 00970000
  1049. BNE DSPFRT NO..FRET THE BLOCK @V387045 00971000
  1050. L R1,VMCPNT MASTER BLOCK... @V387045 00972000
  1051. C R6,XINTNEXT-XINTBLOK(,R5) CHECK VALIDITY OF @VA12460 00972050
  1052. * CHAIN 00972100
  1053. BE VMCDSPN CONTINUE,CHAIN APPEARS VALID @VA12460 00972150
  1054. LA R5,VMPXINT LOAD ADDRESS OF CHAIN ANCHOR @VA12460 00972200
  1055. VMCCORR DS 0H @VA12460 00972250
  1056. C R6,XINTNEXT-XINTBLOK(,R5) CHECK VALIDITY OF @VA12460 00972300
  1057. * CHAIN 00972350
  1058. BE VMCDSPN CONTINUE, CHAIN IS CORRECTED @VA12460 00972400
  1059. ICM R5,B'1111',XINTNEXT-XINTBLOK(R5) INSERT ADDR @VA12460 00972450
  1060. * OF NEXT ELEMENT 00972500
  1061. BNZ VMCCORR BRANCH IF NOT END OF CHAIN @VA12460 00972550
  1062. VMCDSPN EQU * @V387045 00973000
  1063. ICM R1,B'1111',VMCFPNT-VMCBLOK(R1) NEXT VMCBLOK @V387045 00974000
  1064. BZ DSPFRT NONE..FRET THE BLOCK @V387045 00975000
  1065. TM VMCCSTAT-VMCBLOK(R1),VMCCXINT XINT BLOK ? @V387045 00976000
  1066. BZ VMCDSPN NO..KEEP LOOKING ? @V387045 00977000
  1067. B UNSTCONT SAVE FOR NEXT INTERRUPT... @V387045 00978000
  1068. * HRC065DK 00978100
  1069. LDFINT EQU * HRC065DK 00978200
  1070. MVC PSA+128(4),XINTPARM LDF indication to loc X'80' HRC065DK 00978300
  1071. * HRC065DK 00978400
  1072. DSPFRT EQU * @V387045 00979000
  1073. L R0,XINTNEXT @V200198 00980000
  1074. ST R0,XINTNEXT-XINTBLOK(,R5) @V200198 00981000
  1075. LA R0,XINTSIZE GET COUNT OF DOUBLEWORDS @V200198 00982000
  1076. LR R1,R6 GET ADDRESS OF BLOCK @V200198 00983000
  1077. DROP R2 @V200198 00984000
  1078. USING PSA,R0 @V200198 00985000
  1079. CALL DMKFRET AND RETURN IT TO FREE STORAGE @V200198 00986000
  1080. DROP R0 @V200198 00987000
  1081. USING PSA,R2 @V200198 00988000
  1082. UNSTCONT SRL R8,16 INTERRUPTION CODE @VA01935 00989000
  1083. L R7,PRNPSW SAVE PROGRAM NEW PSW FOR CKLOOP2 @VA05647 00990000
  1084. TM EXOPSW+1,EXTMODE INTERRUPT WHILE IN EC MODE? @VA01935 00991000
  1085. BO ECXINT YES, DO YOUR THING @V200198 00992000
  1086. STH R8,EXOPSW+2 INTERRUPTION CODE @VA01935 00993000
  1087. B CHKLOOP GO CHECK FOR EXTERNAL LOOP @V200198 00994000
  1088. PARTIAL EX R4,TESTSIG SEE IF PRESENTING EXTERNAL @V200198 00995000
  1089. * SIGNALS 00996000
  1090. BZ *+8 NOPE, CAN'T COUNT THEM @V200198 00997000
  1091. O R4,=XL4'1F' NOT OVERLOOKING SIGNALS 3 @V200198 00998000
  1092. * THROUGH 7 00999000
  1093. SLL R4,16 MATCH UP WITH INTERRUPTION CODE @V200198 01000000
  1094. NR R4,R8 ONLY THESE ARE PRESENTABLE @V200198 01001000
  1095. LR R8,R4 INTERRUPTION CODE EXPECTED IN R8 @V200198 01002000
  1096. X R4,XINTCODE RESET THE ONES PRESENTED HERE @V200198 01003000
  1097. STCM R4,B'1100',XINTCODE SAVE THE REST FOR NEXT TIME @V200198 01004000
  1098. B UNSTCONT CONTINUE @V200198 01005000
  1099. ECXINT ST R8,INTEXF STASH 370 INTERRUPT CODE @VA01935 01006000
  1100. * CODE 01007000
  1101. CHKLOOP TM VMPSW,VMEXTPND ENABLED FOR EXTERNAL? @V200198 01008000
  1102. BNO NOLOOP NO, NO PROBLEM @V200198 01009000
  1103. TM VMPSTAT,VMV370R EC MODE MACHINE? @VA04307 01010000
  1104. BZ NOLOOP NO - NO CPU TIMER ETC @VA04307 01011000
  1105. LA R1,INTEX EC MODE INT LOCATION @VA04307 01012000
  1106. TM EXOPSW+1,EXTMODE IN EC MODE? @VA04307 01013000
  1107. BNZ *+8 YES - CONTINUE @VA04307 01014000
  1108. LA R1,EXOPSW+2 BC MODE INT LOCATION @VA04307 01015000
  1109. TM 0(R1),X'FF' IS INTERRUPT NOT CLASS ZERO ? @V3M4026 01016000
  1110. BZ NOLOOP IF YES, A LOOP CONDITION EXISTS @V3M4026 01017000
  1111. EXTLOOP EQU * EXTERNAL LOOP MESSAGE @VA05647 01018000
  1112. SLR R1,R1 NO DATA FOR THIS ERROR MESSAGE @V3M4026 01019000
  1113. L R2,EXTPARMS ERROR CODE: "EXTERNAL INT. LOOP" @V3M4026 01020000
  1114. B DSPERMSG GO TO CALL DMKERMSG TO SEND MSG @V3M4026 01021000
  1115. SPACE 01022000
  1116. NOLOOP EQU * @V200198 01023000
  1117. DROP R2,R6 @V200198 01024000
  1118. USING PSA,0 @V200198 01025000
  1119. AIF (NOT &TRACE(6)).VR10B 01026000
  1120. TM VMTRCTL,VMTREX+VMTRBRIN TRACING EXTERNAL INTERRUPTS ETC? 01027000
  1121. BZ CHKLOOP2 BRANCH IF NOT @VA05987 01028000
  1122. LR R4,R8 INTO R4 @V200198 01029000
  1123. LM R0,R1,EXOPSW-PSA(R2) OLD PSW INTO R0-R1, 01030000
  1124. LM R2,R3,EXNPSW-PSA(R2) NEW PSW INTO R2-R3, 01031000
  1125. CALL DMKTRCEX NOW CALL EXTERNAL INTERRUPT TRACER 01032000
  1126. .VR10B ANOP 01033000
  1127. SPACE 1 01034000
  1128. CHKLOOP2 EQU * CHECK FOR EXT/PGM CHECK LOOP @VA05647 01035000
  1129. * CHECK FOR THE AN EXTERNAL/PROGRAM CHECK LOOP DUE TO 01036000
  1130. * EXTERNAL NEW PSW INVALID, PROGRAM NEW PSW ENABLED FOR 01037000
  1131. * EXTERNAL INTERRUPTIONS, AND TAKING CPU TIMER OR 01038000
  1132. * CLOCK COMPARATOR INTERRUPTION. 01039000
  1133. BAL R9,PSWCKSUB CHECK OUT EXTERNAL NEW PSW @VA05647 01040000
  1134. BZ CKPEND EXTERNAL NEW PSW OK. CONTINUE @VA05647 01041000
  1135. * EXTERNAL NEW PSW IS INVALID. 01042000
  1136. C R8,F255 CLASS ZERO INTERRUPTION? @VA05647 01043000
  1137. BNH SPECPSW BRANCH IF CLASS 0. NO PROBLEM. @VA05647 01044000
  1138. SLL R7,7 PGM NEW PSW BIT 7 TO BIT 0 @VA05647 01045000
  1139. LTR R7,R7 IS PGM NEW PSW BIT 7 ON? @VA05647 01046000
  1140. BM EXTLOOP YES. WE ARE IN A LOOP. @VA05647 01047000
  1141. B SPECPSW NO. JUST TAKE PGM INTERRUPTION. @VA05647 01048000
  1142. EJECT 01049000
  1143. UNSTIO EQU * HERE TO UNSTACK I/O INTERRUPTS %V3M4038 01050000
  1144. SLR R6,R6 CLEAR MASK REGISTER %V3M4038 01051000
  1145. ICM R6,12,VMIOINT GET PENDING INTERRUPT MASK %V3M4038 01052000
  1146. BZ CKWAIT NOTHING PENDING -- %V3M4038 01053000
  1147. TM VMESTAT,VMEXTCM IN EXTENDED CONTROL NOW ? %V3M4038 01054000
  1148. BO UNSTIOXM YES - GO TAKE CARE OF IT. %V3M4038 01055000
  1149. L R7,VMPSW NO - GET ENABLED MASK FROM PSW %V3M4038 01056000
  1150. N R7,=X'FC000000' GET MASKS FOR CHANNELS 0-5 %V3M4038 01057000
  1151. TM VMPSTAT,VMV370R EXTENDED CHANNEL SUPPORT ? %V3M4038 01058000
  1152. BZ GETPEND NOPE - GO "AND" MASKS TOGETHER %V3M4038 01059000
  1153. TM VMPSW,VMIOPND IF YES, CHECK CHANNELS 6-15 BIT %V3M4038 01060000
  1154. BZ GETPEND NOT ON, GO "AND" MASKS TOGETHER %V3M4038 01061000
  1155. L R1,VMECEXT IF ON, GET USER'S CONTROL REG 2 %V3M4038 01062000
  1156. L R15,EXTCR2-ECBLOK(,R1) ... %V3M4038 01063000
  1157. N R15,=X'03FF0000' MASK OUT CHANNELS 6-15 ONLY %V3M4038 01064000
  1158. OR R7,R15 CONCATENATE THE TWO PIECES, %V3M4038 01065000
  1159. B GETPEND AND GO "AND" MASKS TOGETHER %V3M4038 01066000
  1160. UNSTIOXM TM VMPSW,VMIOPND CHECK I/O SUMMARY BIT %V3M4038 01067000
  1161. BZ CKWAIT NOT ENABLED, TEST FOR WAIT STATE %V3M4038 01068000
  1162. L R1,VMECEXT POINT TO EXTENDED CONTROL BLOK %V3M4038 01069000
  1163. L R7,EXTCR2-ECBLOK(,R1) CHAN MASK; 17-31 HARMLESS %V3M4038 01070000
  1164. GETPEND NR R7,R6 MASK PENDING AGAINST ENABLED %V3M4038 01071000
  1165. BZ CKWAIT NOTHING TO UNSTACK -- CHECK WAIT %V3M4038 01072000
  1166. SPACE 01073000
  1167. GETIOINT SLR R1,R1 PREFETCH PAGE ZERO @V386198 01074000
  1168. TRANS 9,1,OPT=(BRING,DEFER) @VA04484 01075000
  1169. SRL R7,1 NONZERO - PUT MASKS INTO BITS 1-16 01076000
  1170. LA R0,2 INDEX VALUE FOR UNIT TABLES 01077000
  1171. L R2,=A(DMKVIOMK) GET ADDRESS OF PENDING MASKS 01078000
  1172. SR R3,R3 CLEAR CHANNEL INDEX 01079000
  1173. SPACE 01080000
  1174. TESTVCH BXLE R7,R7,GETVCH SHIFT LEFT AND TEST FOR 1 BIT 01081000
  1175. ALR R3,R0 NO BIT - INCREMENT INDEX 01082000
  1176. B TESTVCH KEEP LOOKING 01083000
  1177. SPACE 01084000
  1178. GETVCH EQU * 01085000
  1179. LH R6,VMCHTBL(R3) GET INDEX TO VCHBLOK 01086000
  1180. A R6,VMCHSTRT POINT TO VCHBLOK 01087000
  1181. USING VCHBLOK,R6 01088000
  1182. SPACE 01089000
  1183. TM VCHTYPE,VCHSEL IS IT A SELECTOR CHANNEL ? @VA01771 01090000
  1184. BZ GETVCUI NO -- VCHCEDEV NOT VAILD 01091000
  1185. TM VCHSTAT,VCHCEPND CHANNEL CLASS INTERRUPT PENDING ?? 01092000
  1186. BZ GETVCUI NO -- 01093000
  1187. SPACE 01094000
  1188. LH R1,VCHCEDEV GET ADDRESS OF UNIT CAUSING INTERRUPT 01095000
  1189. CALL DMKSCNVU LOCATE VBLOKS 01096000
  1190. LR R4,R6 POINT TO VCHBLOK @VA04484 01097000
  1191. BZ TESTCHAN ALL BLOKS FOUND @VA04484 01098000
  1192. DSP01 ABEND 1 @VA01770 01099000
  1193. EJECT 01100000
  1194. GETVCUI SR R7,R7 CLEAR VCUINT SCANNER 01101000
  1195. ICM R7,12,VCHCUINT GET PENDING MASK 01102000
  1196. BZ CLEARVMX NOTHING PENDING 01103000
  1197. SRL R7,1 INTO BITS 1-16 01104000
  1198. SR R3,R3 CLEAR INDEX 01105000
  1199. SPACE 01106000
  1200. TESTVCU BXLE R7,R7,GETVCU SHIFT AND TEST 01107000
  1201. ALR R3,R0 NO BIT .. 01108000
  1202. B TESTVCU KEEP LOOKING 01109000
  1203. SPACE 01110000
  1204. GETVCU LH R7,VCHCUTBL(R3) GET CONTROL UNIT INDEX 01111000
  1205. A R7,VMCUSTRT POINT TO VCUBLOK 01112000
  1206. USING VCUBLOK,R7 01113000
  1207. SPACE 01114000
  1208. SR R5,R5 SAVE VCUBLOK, CLEAR NEW SHIFTER 01115000
  1209. ICM R5,12,VCUDVINT GET MASK OF INTERRUPTING DEVICES 01116000
  1210. BZ CLEARCHX NOTHING PENDING 01117000
  1211. SRL R5,1 INTO BITS 1-16 01118000
  1212. SR R3,R3 CLEAR INDEX 01119000
  1213. SPACE 01120000
  1214. TESTVDEV BXLE R5,R5,GETVDEV SHIFT AND TEST 01121000
  1215. ALR R3,R0 INDEX 01122000
  1216. B TESTVDEV KEEP LOOKING 01123000
  1217. SPACE 01124000
  1218. GETVDEV LH R8,VCUDVTBL(R3) GET DEVICE INDEX 01125000
  1219. A R8,VMDVSTRT AND DEVELOP ADDRESS OF VDEVBLOK 01126000
  1220. USING VDEVBLOK,R8 01127000
  1221. SPACE 01128000
  1222. TM VDEVSTAT,VDEVPEND+VDEVCHAN+VDEVCUE ANYTHING PENDING ? 01129000
  1223. BZ CLEARCUX NO -- 01130000
  1224. TM VCUINTS,CUE IS CUE PENDING ? 01131000
  1225. BZ TESTCUE NO - USE THIS AS INTERRUPTING DEVICE 01132000
  1226. ALR R3,R0 INCREMENT DEVICE INDEX FOR RE-SCAN 01133000
  1227. TM VDEVSTAT,VDEVCUE IS THIS DEVICE CAUSING CUE ?? 01134000
  1228. BZ TESTVDEV NO -- GO LOOK FOR ANOTHER 01135000
  1229. SPACE 01136000
  1230. TESTCUE EQU * CONTROL-UNIT-END PENDING 01137000
  1231. LR R4,R6 POINT TO VCHBLOK 01138000
  1232. TM VCHTYPE,VCHSEL IS IT A SELECTOR CHANNEL ? @VA01771 01139000
  1233. BNZ TESTCHAN YES -- 01140000
  1234. LR R4,R7 POINT TO VCUBLOK 01141000
  1235. TM VCUTYPE,VCUSHRD+VCUCTCA ON SHARED SUBCHANNEL ?? 01142000
  1236. BNZ TESTCHAN YES -- 01143000
  1237. LR R4,R8 POINT TO VDEVBLOK 01144000
  1238. SPACE 2 01145000
  1239. TESTCHAN EQU * HERE TO TEST STATUS OF SUBCHANNEL 01146000
  1240. LR R2,R9 ADDRESS PAGE 0 IN R2 @VA09137 01146200
  1241. TM VDEVFLG2,VDEVPST THIS INTERRUPT TO BE POSTED? @VA09137 01146500
  1242. BO POST YES @VA09137 01146800
  1243. TM VCHSTAT-VCHBLOK(R4),VCHBUSY IS THE SUBCHANNEL BUSY ?? 01147000
  1244. BZ TESTCE NO -- GO PREPARE TO REFLECT 01148000
  1245. CLC VDEVCSW+4(2),=AL1(0,PCI) IS IT PCI ALONE 01149000
  1246. BNE CKWAIT NO -- SAVE INTERRUPT FOR LATER 01150000
  1247. EJECT 01151000
  1248. TESTCE EQU * 01152000
  1249. TM VCHSTAT-VCHBLOK(R4),VCHCEPND IS A CHANNEL INT. PENDING? 01154000
  1250. BZ TESTCU NO -- GO LOOK FOR CU OR DEVICE INTERRUPTS 01155000
  1251. ALR R3,R0 INCREMENT DEVICE INDEX FOR RESCAN 01156000
  1252. TM VDEVSTAT,VDEVCHAN CHANNEL INT. PENDING? 01157000
  1253. BZ TESTVDEV NO- GO FIND THE NEXT DEVICE 01158000
  1254. POST EQU * @VA09137 01159100
  1255. NI VDEVFLG2,255-VDEVPST TURN OFF POST @VA09137 01159200
  1256. LR R3,R4 SET R3 FOR NEXT TEST 01160000
  1257. LM R4,R5,VDEVCSW GET CSW TO BE STORED 01161000
  1258. NI VDEVCSW+5,X'FF'-PCI REMOVE PCI 01162000
  1259. NI VCHSTAT-VCHBLOK(R3),X'FF'-VCHCEPND REMOVE CE PENDING 01163000
  1260. NI VDEVSTAT,X'FF'-VDEVCHAN REMOVE CE STATUS FROM DEVICE 01164000
  1261. NI VCUSTAT,X'FF'-VCUCEPND AND FROM CU 01165000
  1262. B STORECSW GO FINISH REFLECTING 01166000
  1263. SPACE 3 01167000
  1264. TESTCU EQU * HERE IF INTERRUPT IS NOT CE 01168000
  1265. SR R4,R4 CLEAR OUT 01169000
  1266. SR R5,R5 CSW SAVE REGISTERS 01170000
  1267. TM VCUINTS,CUE IS A CUE PENDING ? 01171000
  1268. BZ TESTDVIC NO -- GO LOOK FOR INTERRUPTS IN DEVICE 01172000
  1269. ICM R5,12,VCUINTS GET CSW STATUS 01173000
  1270. NI VCUINTS,X'FF'-CUE REMOVE CUE FROM CONTROL UNIT 01174000
  1271. NI VDEVSTAT,X'FF'-VDEVCUE AND FORM DEVICE 01175000
  1272. B STORECSW AND GO STORE CSW 01176000
  1273. SPACE 3 01177000
  1274. TESTDVIC EQU * HERE IF INTERRUPT IN IN DEVICE ONLY 01178000
  1275. TM VDEVINTS,ATTN ATTENTION PENDING ?? 01179000
  1276. BZ NOATTN NO -- 01180000
  1277. TM VDEVFLAG,VDEVPOST SINGLE INTERRUPT ? @VA08933 01181000
  1278. BO POSTOFF YES - ATTN + ALL OTHERS @VA04343 01182000
  1279. TM VDEVINTS,X'FF'-(ATTN+UC) ANYTHING ELSE ?? 01183000
  1280. BNZ ATTNPLUS YES -- REFLECT SEPARATE INTERRUPTS 01184000
  1281. B NOATTN REFLECT SINGLE INTERRUPT @VA04343 01185000
  1282. SPACE 01186000
  1283. * HERE TO REFLECT A SINGLE INTERRUPT ALSO WITH ATTENTION 01187000
  1284. POSTOFF NI VDEVFLAG,X'FF'-VDEVPOST TURN OFF VDEVPOST @VA04343 01188000
  1285. NOATTN ICM R5,12,VDEVINTS GET CSW STATUS @VA08933 01189000
  1286. STH R4,VDEVINTS CLEAR PENDING INTERRUPTS @VA09069 01190100
  1287. NI VDEVSTAT,X'FF'-VDEVPEND CLEAR PENDING STATUS 01191000
  1288. B STORECSW AND GO FINISH REFLECTING 01192000
  1289. SPACE 3 01193000
  1290. ATTNPLUS EQU * HERE IF ATTN PLUS OTHER STATUS IS PENDING 01194000
  1291. ICM R5,12,VDEVINTS GET STATUS 01195000
  1292. N R5,=XL4'7DFF0000' CLEAR ATTN AND UC FROM CSW 01196000
  1293. NI VDEVINTS,ATTN+UC LEAVE ONLY ATTN AND UC IN DEVICE 01197000
  1294. EJECT 01198000
  1295. STORECSW EQU * HERE TO FINISH REFLECTIN ALL INTERRUPTS 01199000
  1296. L R1,VMPSW SWAP 01200000
  1297. ST R1,IOOPSW-PSA(,R2) PSW'S 01201000
  1298. L R3,VMPSW+4 ... 01202000
  1299. ST R3,IOOPSW-PSA+4(,R2) ... 01203000
  1300. LH R0,VDEVADD GET UNIT ADDRESS 01204000
  1301. AH R0,VCUADD ... 01205000
  1302. AH R0,VCHADD ... 01206000
  1303. TM VMESTAT,VMEXTCM EXTENDED MACHINE .. 01207000
  1304. BZ *+12 NO -- 01208000
  1305. STCM R0,7,INTTIO-PSA-1(R2) SAVE ADDR IN LOW CORE @VA02716 01209000
  1306. B *+8 01210000
  1307. STH R0,IOOPSW-PSA+2(,R2) SAVE ADDRESS IN LOW CORE 01211000
  1308. L R1,IONPSW-PSA(,R2) GET NEW PSW 01212000
  1309. ST R1,VMPSW AND STORE AS CURRENT 01213000
  1310. L R1,IONPSW-PSA+4(,R2) .. 01214000
  1311. ST R1,VMPSW+4 .. 01215000
  1312. ST R4,CSW-PSA(,R2) STORE 01216000
  1313. ST R5,CSW-PSA+4(,R2) CSW 01217000
  1314. TM CSW-PSA+5(R2),CDC+CCC+IFCC ANY CHANNEL ERRORS @V508690 01217200
  1315. BZ NOCHAN NO, CONTINUE NORMAL PROCESSING @V508690 01217250
  1316. ICM R1,15,VDEVIOER GET IOERBLOK FOR CHANNEL ERROR @V508690 01217300
  1317. BZ NOCHAN NO IOERBLOK, FORGET IT @V508690 01217350
  1318. CALL DMKCCHRF REFLECT CHAN ERROR TO VIRT MACH @V508690 01217400
  1319. NOCHAN EQU * @V508690 01217450
  1320. AIF (NOT &TRACE(9)).TR2 01218000
  1321. TM TRACFLG2,TRAC0C TRACING ACTIVE? 01219000
  1322. BZ NOTRAC2 BRANCH IF NOT 01220000
  1323. * 01221000
  1324. * TRACE UNSTACK OF VIRTUAL I/O INTERRUPT 01222000
  1325. * 01223000
  1326. LA R14,TRCUNSTK SET CODE FOR UNSTAK OF INTERRUPT @V407508 01224000
  1327. BAL R1,GETRACE GET CURRENT TRACE TABLE ENTRY @V4M0017 01225000
  1328. STCM R0,B'0111',ONE(R15) SAVE VIRTUAL DEVICE ADDRESS @V407508 01226000
  1329. ST R11,4(,R15) SAVE VMBLOK PTR 01227000
  1330. ST R4,8(,R15) SAVE VIRTUAL CSW 01228000
  1331. ST R5,12(,R15) ... 01229000
  1332. NOTRAC2 EQU * 01230000
  1333. .TR2 ANOP 01231000
  1334. EJECT 01232000
  1335. * REMOVE PENDING BITS FROM MASKS 01233000
  1336. CLI VDEVINTS,0 ANY STATUS STILL PENDING IN DEVICE ? 01234000
  1337. BNE CHKTRAC CHECK OUT TRACING STATUS @VA04484 01235000
  1338. CLEARCU L R2,=A(DMKVIOMK) GET ADDRESS OF INTERRUPT MASK TABLE 01236000
  1339. LH R3,VDEVADD GET DEVICE ADDRESS (0-F) 01237000
  1340. ALR R3,R3 TIMES 2 01238000
  1341. ALR R3,R2 POINT TO PROPER INTERRUPT MASK 01239000
  1342. XC VCUDVINT,0(R3) CLEAR DEVICE PENDING FLAG FROM CU 01240000
  1343. BNZ CHKTRAC CHECK TRACING STATUS @VA04484 01241000
  1344. SPACE 01242000
  1345. CLEARCH LH R3,VCUADD GET CONTROL UNIT ADDRESS (00-F0) 01243000
  1346. SRL R3,3 TIMES 2 01244000
  1347. ALR R3,R2 POINT TO PROPER MASK 01245000
  1348. XC VCHCUINT,0(R3) CLEAR CU PENDING FLAG FROM CHANNEL 01246000
  1349. BNZ CHKTRAC CHECK TRACING STATUS @VA04484 01247000
  1350. SPACE 01248000
  1351. CLEARVM LH R3,VCHADD GET CHANNEL ADDRESS (000-F00) 01249000
  1352. SRL R3,7 GET ADDRESS TIMES 2 01250000
  1353. ALR R3,R2 POINT TO PENDING MASK 01251000
  1354. XC VMIOINT,0(R3) CLEAR PENDING INTERRUPT 01252000
  1355. BNZ CHKTRAC CHECK TRACING STATUS @VA04484 01253000
  1356. SPACE 01254000
  1357. NI VMPEND,X'FF'-VMIOPND CLEAR SUMMARY BIT 01255000
  1358. CHKTRAC EQU * CHECK TRACING STATUS @VA04484 01256000
  1359. AIF (NOT &TRACE(6)).TR2A @VA04484 01257000
  1360. TM VMTRCTL,VMTRIO+VMTRBRIN TRACING I/O OR SUCH ? @VA04484 01258000
  1361. BZ CKPSW NO..CHECK OUT PSW @VA04484 01259000
  1362. LR R4,R0 DEVICE ADDRESS IN R0 @VA04484 01260000
  1363. LH R5,CSW-PSA+4(,R9) CSW TO R5 @VA04484 01261000
  1364. LM R0,R1,IOOPSW-PSA(R9) OLD PSW IN R0-R1 @VA04484 01262000
  1365. LM R2,R3,IONPSW-PSA(R9) NEW PSW IN R2-R3 @VA04484 01263000
  1366. * VDEVBLOK ADDRESS STILL IN R8 01264000
  1367. CALL DMKTRCIO TRACE THE INTERRUPT @VA04484 01265000
  1368. LR R1,R4 DEVICE ADDRESS TO R1 @VA04484 01266000
  1369. CALL DMKSCNVU RESCAN FOR DEVICE BLOKS @VA04484 01267000
  1370. BZ CKPSW STILL THERE...GOOD @VA04484 01268000
  1371. ABEND 4 SHOULD NOT OCCUR @VA04484 01269000
  1372. .TR2A ANOP 01270000
  1373. B CKPSW BRANCH EVEN IF NO TRACE OPTION @VA05145 01271000
  1374. SPACE 01272000
  1375. CLEARCUX EQU * @VA05145 01273000
  1376. L R2,=A(DMKVIOMK) GET ADDRESS OF INT MASK TABLE @VA12932 01273500
  1377. ALR R3,R2 POINT TO PROPER INTERRUPT MASK @VA05145 01274000
  1378. XC VCUDVINT,0(R3) CLEAR DEVICE PENDING FLAG FROM CU@VA05145 01275000
  1379. BNZ CKPSW GO CHECK PSW @VA05145 01276000
  1380. SPACE 01277000
  1381. LH R3,VCUADD GET CONTROL UNIT ADDRESS (00-F0) @VA05145 01278000
  1382. SRL R3,3 TIMES 2 @VA05145 01279000
  1383. CLEARCHX EQU * @VA05145 01280000
  1384. ALR R3,R2 POINT TO PROPER MASK @VA05145 01281000
  1385. XC VCHCUINT,0(R3) CLEAR CU PENDING FLAG FROM CHAN @VA05145 01282000
  1386. BNZ CKPSW GO CHECK PSW @VA05145 01283000
  1387. SPACE 01284000
  1388. LH R3,VCHADD GET CHANNEL ADDRESS (000-F00) @VA05145 01285000
  1389. SRL R3,7 GET ADDRESS TIMES 2 @VA05145 01286000
  1390. CLEARVMX EQU * @VA05145 01287000
  1391. ALR R3,R2 POINT TO PENDING MASK @VA05145 01288000
  1392. XC VMIOINT,0(R3) CLEAR PENDING INTERRUPT @VA05145 01289000
  1393. BNZ CKPSW GO CHECK PSW @VA05145 01290000
  1394. SPACE 01291000
  1395. NI VMPEND,X'FF'-VMIOPND CLEAR SUMMARY BIT @VA05145 01292000
  1396. B CKPSW GO CHECK PSW @VA05647 01293000
  1397. EJECT 01294000
  1398. *. 01295000
  1399. * OPERATION - 01296000
  1400. * 01297000
  1401. * E. NEW PSW VALIDATION - 01298000
  1402. * 1. IF THE USER IS NOT RUNNING AN EXTENDED MACHINE,VERIFY THAT 01299000
  1403. * HE HAS NOT LOADED AN EXTENDED PSW. 01300000
  1404. * 2. IF THE USER IS RUNNING AN EXTENDED MACHINE AND IS GOING 01301000
  1405. * FROM EXTENDED TO BASIC CONTROL MODE, CALL DMKVATBC TO CLEAN 01302000
  1406. * UP ANY SHADOW TRANSLATION TABLES 01303000
  1407. * 3. IF THE USER HAS LOADED AN EXTENDED PSW, FLAG HIS MACHINE 01304000
  1408. * IN EXTENDED MODE AND CHECK TO SEE IF HE IS ENTERING 01305000
  1409. * VIRTUAL TRANSLATE MODE ALSO. IF HE IS, CALL DMKVATMD TO 01306000
  1410. * INITIALIZE SHADOW TABLES 01307000
  1411. * 4. CONDITION CODE ZERO IS RETURNED IF THE PSW IS 01308000
  1412. * VALID. OTHERWISE CONDITION CODE THREE IS RETURNED. 01309000
  1413. * 01310000
  1414. *. 01311000
  1415. SPACE 2 01312000
  1416. PSWCKSUB EQU * SUBROUTINE TO CHECK ANY NEW PSW @VA05647 01313000
  1417. NI VMDSTAT,255-VMDSP NOT RUN USER @VA08989 01314100
  1418. TM VMPSTAT,VMV370R ALLOWED TO ENTER EXTENDED MODE ?? 01315000
  1419. BZ CKBCPSW NO - PSW MUST BE VANILLA 01316000
  1420. TM VMPSW+1,EXTMODE EXTENDED PSW ?? 01317000
  1421. BO CKEXTPSW YES -- GO CHECK IT OUT 01318000
  1422. TM VMESTAT,VMEXTCM LEAVING EXTENDED MODE ?? 01319000
  1423. BZ CKTRACE NO, WAS & IS BC, GO CHK TRACE @VA04140 01320000
  1424. CALL DMKVATBC YES -- CLEAN UP TABLES 01321000
  1425. NI VMESTAT,X'FF'-VMEXTCM-VMPERCM UNFLAG PER & @V408246 01322000
  1426. * EXTENDED 01323000
  1427. B CKTRACE GO CHECK OUT TRACE @VA04140 01324000
  1428. EJECT 01325000
  1429. CKEXTPSW EQU * CHECK OUT EXTENDED MODE PSW 01326000
  1430. OI VMESTAT,VMEXTCM FLAG EXTENDED 01327000
  1431. TM VMPSW,TRANMODE ADDRESS TRANSATE MODE ALSO ?? 01328000
  1432. BZ GETMASK NO PER001 01329050
  1433. TM VMOSTAT,VMSHR IS USER EC,TRANSLATE AND SHARED? @VA09151 01329100
  1434. BNO NOTSHR NO NOT SHARED....... @VA09151 01329300
  1435. CALL DMKVATBC YES MUST THROW AWAY SHADOW TABLES@VA09151 01329500
  1436. NOTSHR DS 0H @VA09151 01329700
  1437. CALL DMKVATMD ENTER ADDRESS TRANSLATE MODE 01330000
  1438. GETMASK L R0,EXTZBIT GET MASK OF "MUST BE ZERO" BITS 01339000
  1439. N R0,VMPSW TEST 1ST WORD OF PSW 01340000
  1440. BNZ BADPSW ILLEGAL PSW FORMAT 01341000
  1441. TM VMPSW+4,X'FF' ILLEGAL BITS IN 2ND WORD 01342000
  1442. BNZ BADPSW ILLEGAL PSW IF BIT SET - GO GIVE MESSAGE 01343000
  1443. CKTRACE EQU * HERE TO CHECK OUT TRACING @VA04140 01344000
  1444. AIF (NOT &TRACE(6)).TR4 **AIF** 01345000
  1445. NI VMTRCTL,255-VMTRPER ... PER001 01345050
  1446. NI VMESTAT,255-VMPERCM ... PER001 01345100
  1447. TM VMPSW+1,EXTMODE IN EXT MODE? PER001 01345150
  1448. BNO OUROWN THEN USER CAN'T HAVE OWN PER PER001 01345200
  1449. TM VMPSW,PERMODE IS USER PER ON? PER001 01345250
  1450. BNO OUROWN NO, GO CHECK FOR CP PER PER001 01345300
  1451. OI VMESTAT,VMPERCM AND USER PER FLAG PER001 01345350
  1452. B CKTRACE2 AND CONTINUE PER001 01345400
  1453. OUROWN TM VMPERFLG,VMPERUSE IS PER TRACE ACTIVE? PER001 01345450
  1454. BNO CKTRACE2 NO, SKIP THIS NONSENSE PER001 01345500
  1455. L R1,VMPERCTL LOAD POINTER TO TRACE CTL BLOCK PER001 01345550
  1456. CLI PERCR9-PERBLOK(R1),00 ANY STOPS ACTIVE? PER001 01345600
  1457. BE CKTRACE2 NO, SKIP OI PER001 01345650
  1458. OI VMESTAT,VMPERCM TURN ON ANY BIT PER001 01345700
  1459. OI VMTRCTL,VMTRPER ... PER001 01345750
  1460. CKTRACE2 EQU * HERE TO CHECK TRACE PER001 01345800
  1461. TM VMTRCTL,VMTRBRIN INSTRUCTION TRACING SET ? 01346000
  1462. BZ CKPSWOK NOPE - OK TO GET OUT NOW @VA05647 01347000
  1463. L R1,VMTREXT YES - REFERENCE TRACE CNTRL BLOCK@VA04140 01348000
  1464. USING TREXT,R1 ... 01349000
  1465. CLI TREXIN2,X'FF' ADDRESS "NULL" OR ALREADY FILLED IN ? 01350000
  1466. BNE CKPSWOK NOT X'FF' - MUST BE ALREADY @VA05647 01351000
  1467. * FILLED IN 01352000
  1468. CLI TREXIN1,X'FF' CHECK THE "NEXT INSTRUCTION" ADDRESS 01353000
  1469. BNE CKPSWOK NOT X'FF' - MUST BE ALREADY @VA05647 01354000
  1470. * FILLED IN 01355000
  1471. TM VMPSW+1,WAIT IS USER PERCHANCE IN WAIT STATE ? 01356000
  1472. BO CKPSWOK IF YES, DON'T SET ANYTHING YET @VA05647 01357000
  1473. TM TREXFLAG,TREXNDSP SKIP THE TRCIT CALL? @VA04044 01358000
  1474. BO CKPSWOK YES - TRC WILL TURN OFF LATER @VA05647 01359000
  1475. L R1,VMPSW+4 OK - WHERE-TO-GO INTO R1, AND 01360000
  1476. CALL DMKTRCIT SET NEW "SVC B2" INSTRUCTION 01361000
  1477. DROP R1 @VA04044 01362000
  1478. .TR4 ANOP 01363000
  1479. CKPSWOK EQU * THE PSW IS VALID @VA05647 01364000
  1480. SR R0,R0 SET CONDITION CODE ZERO @VA05647 01365000
  1481. BR R9 GO BACK FROM WHENCE WE CAME @VA05647 01366000
  1482. BADPSW EQU * PSW IS BAD. TELL CALLER ABOUT IT.@VA05647 01367000
  1483. TM FFS,X'FF' SET CONDITION CODE THREE @VA05647 01368000
  1484. BR R9 AND GO BACK. HE WILL HANDLE @VA05647 01369000
  1485. SPACE 01370000
  1486. CKBCPSW EQU * HERE TO CHECK OUT BC MODE PSW 01371000
  1487. TM VMPSW+1,EXTMODE ILLEGAL BIT FOR BC MODE MACHINE 01372000
  1488. BZ CKTRACE OK, GO CHECK OUT TRACING @VA04140 01373000
  1489. B BADPSW OTHERWISE, GO GIVE MESSAGE 01374000
  1490. EJECT 01375000
  1491. CKWAIT EQU * CHECK HERE FOR DISABLED OR IDLE WAIT STATES: %V3M4038 01376000
  1492. SPACE 01377000
  1493. NI VMRSTAT,X'FF'-(VMPSWAIT+VMIDLE) UNFLAG WAIT %V3M4038 01378000
  1494. TM VMPSW+1,WAIT STILL IN WAIT ?? %V3M4038 01379000
  1495. BZ DISPATCH NO -- GO DISPATCH %V3M4038 01380000
  1496. OI VMRSTAT,VMPSWAIT FLAG IN WAIT %V3M4038 01381000
  1497. SPACE 01382000
  1498. CKWAITST SLR R1,R1 CLEAR R1 EC MODE @V386198 01383000
  1499. L R3,XRIGHT16 AND GET MASK FOR ALL EXT CHANNELS@VA02145 01384000
  1500. L R2,VMVCR0 CR0 OR ECBLOK @VA02145 01385000
  1501. TM VMESTAT,VMEXTCM RUNNING IN EC MODE ? @VA02145 01386000
  1502. BNZ CKENBL YES..CHECK I/O SUMMARY @VA02145 01387000
  1503. N R3,=A(X'3FF') IF NOT..DISABLE 0-5 @VA02145 01388000
  1504. LH R1,VMPSW PICK UP CHANNEL MASK BITS + @VA02145 01389000
  1505. N R1,=A(X'FC00') ALL BUT CHANNEL 0 - 5 @VA02145 01390000
  1506. TM VMPSTAT,VMV370R EC MODE MACHINE ? @VA02145 01391000
  1507. BZ TSTMASK NO..CHECK OUT ENABLED @VA02145 01392000
  1508. CKENBL EQU * HERE TO TEST FOR ENABLED I/O @VA02145 01393000
  1509. TM VMPSW,VMIOPND SUMMARY ENABLED? @VA02145 01394000
  1510. BZ TSTMASK NO..SEE IF ANY ENABLED @VA02145 01395000
  1511. LH R0,EXTCR2-ECBLOK(,R2) EXTENDED CHANNEL MASK @VA02145 01396000
  1512. NR R0,R3 LESS CH 0-5 ..MAYBE @VA02145 01397000
  1513. OR R1,R0 COMBINE WITH PSW MASK @VA02145 01398000
  1514. TSTMASK EQU * @VA02145 01399000
  1515. ICM R0,B'0011',VMIOACTV ACTIVE I/O MASK @V408246 01400000
  1516. BNZ DISPATCH SOMETHING GOING ON @V408246 01401000
  1517. LTR R1,R1 ENABLED ON ANY CHANNELS? @VA02145 01402000
  1518. BZ CKENEXT NO..CHECK OUT TIMERS, ECT.. @VA02145 01403000
  1519. CH R0,VMNDCNT ANY NON-DEFERED PAGE ON THE WAY @V213135 01406000
  1520. BE SETIDLE NO -- SET IDLE WAIT STATE @V213135 01407000
  1521. TM VMESTAT,VMEXTCM WILL USER BE ABLE TO TAKE IT @V213135 01408000
  1522. BO DISPATCH YES -- LEAVE HIM IN QUEUE @V213135 01409000
  1523. SETIDLE OI VMRSTAT,VMIDLE FLAG IDLE MACHINE FOR QUEUE DROP @V213135 01410000
  1524. B DISPATCH AND LEAVE @V213135 01411000
  1525. CKENEXT EQU * @VA02145 01412000
  1526. OI VMRSTAT,VMIDLE FLAG FOR Q DROP @VA02145 01413000
  1527. TM VMPSW,VMEXTPND ENABLED FOR EXT INTERRUPTS? @VA02145 01414000
  1528. BZ DISABLED NO..DISABLED WAIT STATE @VA02145 01415000
  1529. TM VMPSTAT,VMV370R EC MODE MACHINE? @VA02145 01416000
  1530. BZ EXTBCM NO..NO CLOCK COMP..CPU TIMER @VA02145 01417000
  1531. L R2,EXTCR0-ECBLOK(,R2) PICK UP CR0 @VA02145 01418000
  1532. LR R1,R2 AND SWITCH TO R1 @VA02145 01419000
  1533. N R1,=A(X'0C00') ENABLED FOR EXTENDED TIMERS, ECT.@VA02145 01420000
  1534. BNZ DISPATCH YES..INTERRUPT WILL COME.. @VA02145 01421000
  1535. EXTBCM EQU * @VA02145 01422000
  1536. LR R1,R2 CR0 TO R1 @VA02145 01423000
  1537. N R1,=A(X'41') EXT KEY + VMCF @V387045 01424000
  1538. BNZ DISPATCH YES¬¬LET HIM GO @VA02145 01425000
  1539. TM VMTLEVEL,VMRON REAL TIMER RUNNING? @VA02145 01426000
  1540. BZ DISABLED NO..DISABLED WAIT STATE @VA02145 01427000
  1541. N R2,=A(X'80') ENABLED FOR INTERVAL TIMER? @VA02145 01428000
  1542. BNZ DISPATCH YES..IT'LL COME LATER.. @VA02145 01429000
  1543. EJECT 01430000
  1544. DISABLED TM VMOSTAT,VMSYSOP IS USER ALLOWED TO DISABLE ? @V3M4026 01431000
  1545. BO DISPATCH O.K. IF SYSTEM OPERATOR @V3M4026 01432000
  1546. LA R2,450 ERROR CODE: "DISABLED WAIT PSW" @V3M4026 01433000
  1547. SPACE 01434000
  1548. LA R0,3 SIZE OF MESSAGE BUFFER @V3M4026 01435000
  1549. CALL DMKFREE GO GET THE SPACE FOR IT... @V3M4026 01436000
  1550. LR R3,R1 SAVE ADDR IN R3 (FOR ERMSG FRET) @V3M4026 01437000
  1551. MVI 0(R3),C'''' ADD BEG. DELIMITER TO MSG DATA @V3M4026 01438000
  1552. L R1,VMPSW GET FIRST HALF OF PSW IN ERROR @V3M4026 01439000
  1553. CALL DMKCVTBH CONVERT FOR OUTPUT @V3M4026 01440000
  1554. STM R0,R1,1(R3) SAVE IT @V3M4026 01441000
  1555. MVI 9(R3),C' ' CLEAN UP MESSAGE OUTPUT... @V3M4026 01442000
  1556. L R1,VMPSW+4 GET SECOND HALF @V3M4026 01443000
  1557. CALL DMKCVTBH CONVERT IT @V3M4026 01444000
  1558. STM R0,R1,10(R3) AND SAVE @V3M4026 01445000
  1559. MVI 18(R3),C'''' ADD ENDING DELIMITER TO MSG DATA @V3M4026 01446000
  1560. LA R0,19 SIZE OF MESSAGE IN BYTES @V3M4026 01447000
  1561. LR R1,R3 ADDRESS OF THE MESSAGE @V3M4026 01448000
  1562. ICM R2,B'1100',PSWPARMS LOAD OPTION REGISTER @V3M4026 01449000
  1563. ICM R3,B'1000',F3+3 LOAD SIZE OF BUFFER TO FRET @V3M4026 01450000
  1564. SPACE 01451000
  1565. DSPERMSG EQU * HERE TO SEND MSG @V3M4026 01452000
  1566. NI VMOSTAT,X'FF'-VMCFRUN STOP RUNNING IN CF MODE @V3M4026 01453000
  1567. OI VMRSTAT,VMCFWAIT AND PUT IN CF WAIT RIGHT NOW @V3M4026 01454000
  1568. ICM R0,B'1110',=C'DSP' MODULE ID FOR CALL TO ERM @V3M4026 01455000
  1569. CALL DMKERMSG INVOKE ERROR MESSAGE WRITER @V3M4026 01456000
  1570. CALL DMKCFMBK PLACE USER IN CONSOLE FUNC. MODE @V3M4026 01457000
  1571. * B DISPATCH CONTINUE... @V407508 01458000
  1572. EJECT 01459000
  1573. *. 01460000
  1574. * 01461000
  1575. * OPERATION - 01462000
  1576. * 01463000
  1577. * F. COMPLETE PROCESSING FOR CURRENT USER - 01464000
  1578. * 1. CALL DMKSCHDL IF NECESSARY TO ALTER DISPATCHING PRIORITY OF 01465000
  1579. * THE USER FOR WHICH DISPATCH WAS ENTERED. 01466000
  1580. * 2. UNLOCK THE CURRENT USER IF THAT USER IS NOT LASTUSER OR 01467000
  1581. * THE SYSTEM VMBLOK (WHICH IS NOT LOCKED). IF THE CURRENT 01468000
  1582. * USER IS RUNNABLE AND THE OTHER PROCESSOR IS IDLE, SIGNAL 01469000
  1583. * THE OTHER PROCESSOR. 01470000
  1584. * 3. UNLOCK LASTUSER IMMEDIATELY IF THAT USER IS NOT USING 01471000
  1585. * SHARED SYSTEMS. OTHERWISE, WAIT UNTIL ANOTHER USER IS 01472000
  1586. * SELECTED TO RUN, OR UNTIL A WAIT STATE IS LOADED. 01473000
  1587. * 4. IF THE SYSTEM IS IN EXTEND AND THE CURRENT PROCESSOR IS 01474000
  1588. * THE ATTACHED PROCESSOR RELEASE THE SYSTEM LOCK AND SPIN 01475000
  1589. * UNTIL EXTEND COMPLETES. 01476000
  1590. * 5. IF AUTOMATIC PROCESSOR RECOVERY IS PENDING, CALL DMKMCTPR. 01477000
  1591. * 6. IF THE OTHER PROCESSOR NEEDS THE SYSTEM LOCK, RELEASE IT 01478000
  1592. * AND GO TO SECTION H TO SELECT A USER FOR DISPATCHING. 01479000
  1593. * 01480000
  1594. * 01481000
  1595. *********************************************************************** 01482000
  1596. * 01483000
  1597. * 01484000
  1598. * CP ASSIST INSTRUCTIONS "DSP1" AND "DSP2" - DISPATCH A BLOK 01485000
  1599. * 01486000
  1600. * 01487000
  1601. * OPERANDS: 01488000
  1602. * 1 = ADDRESS OF 'DSP1LIST' (DATA LIST) 01489000
  1603. * 2 = ADDRESS OF 'DSP1EXIT' (EXIT LIST) 01490000
  1604. * 01491000
  1605. * REGISTER INPUT: 01492000
  1606. * GPR 11 = ADDRESS OF THE VMBLOK OF USER BEING PROCESSED 01493000
  1607. * 01494000
  1608. * SYSTEM DATA AREAS REFERENCED (BY MODULE WHERE APPLICABLE): 01495000
  1609. * DMKPSA - 'APSTAT2', 'ASYSVM', 'PROBSTRT', 'STACKVM', 01496000
  1610. * RUN AND STATUS FIELDS, TRACING INFORMATION 01496100
  1611. * CPEXBLOK, ECBLOK, IOBLOK, MICBLOK, PAGE AND SEGMENT TABLES, 01497000
  1612. * SHRTABLE, TREXT, TRQBLOK, VMABLOK, VMBLOK, XINTBLOK 01498000
  1613. * 01499000
  1614. * 01500000
  1615. * NOTE: ONLY CR, FPR, AND GPR 12-13 CONTENTS WILL NOT BE CHANGED 01501000
  1616. * IF NOT MENTIONED IN THE FOLLOWING EXIT LISTS. ALL OTHER GPR 01502000
  1617. * VALUES AT EXIT POINTS SHOULD BE CONSIDERED UNPREDICTABLE. 01503000
  1618. * 01504000
  1619. * "DSP1" EXITS TO SPECIFIED OPERAND 2 LIST ADDRESSES: 01505000
  1620. * 01506000
  1621. * +0 'OFFCALL' (THIS USER IS TO BE LOGGED OFF THE SYSTEM) 01507000
  1622. * REGISTER OUTPUT: 01508000
  1623. * GPR 11 = ENTRY CONTENT - VMBLOK ADDRESS BEING PROCESSED 01509000
  1624. * 01510000
  1625. * +4 'SCHDL' (MUST CALL SCHEDULER TO CHECK DISPATCHING QUEUE) 01511000
  1626. * REGISTER OUTPUT: SAME AS EXIT TO +0 'OFFCALL' 01512000
  1627. * 01513000
  1628. * "DSP1" AND "DSP2" EXITS TO SPECIFIED OPERAND 2 LIST ADDRESSES: 01514000
  1629. * 01515000
  1630. * +8 'UNLOCK1' (THE SYSTEM EXTEND LOCK IS SET TO X'FF') 01516000
  1631. * REGISTER OUTPUT: SAME AS EXIT TO +0 'OFFCALL' 01517000
  1632. * 01518000
  1633. * +12 'FRETCPEX' (CP ASSIST "FRET" COULDN'T FRET CPEXBLOK) 01519000
  1634. * REGISTER OUTPUT: 01520000
  1635. * GPR 0 = VALUE OF X'0000000A' 01521000
  1636. * GPR 1 = ADDRESS OF CPEXBLOK 01522000
  1637. * GPR 2-11 = CPEXBLOK VALUES ('CPEXR2' TO 'CPEXR11') 01523000
  1638. * 01524000
  1639. * +16 'CKSHRSYS' (CAN'T COMPLETE CHECKS FOR SHARED SYSTEM USER) 01525000
  1640. * REGISTER OUTPUT: 01526000
  1641. * GPR 10 = ADDRESS OF VMBLOK TO BE DISPATCHED 01526100
  1642. * GPR 11 = ADDRESS OF VMBLOK OF 'LASTUSER' 01527000
  1643. * 01528000
  1644. * +20 'FREELOCK' DSP2 EXIT IF VMNOECPS IS NON-ZERO @VMD0134 01529100
  1645. * REGISTER OUTPUT: @VMD0134 01529200
  1646. * GPR 1 = ADDRESS OF VMBLOK TO BE DISPATCHED @VMD0134 01529300
  1647. * GPR 11 = ASYSVM VALUE @VMD0134 01529400
  1648. * 01533000
  1649. * +24 'IDLEECPS' (THE RUN LIST, 'DMKSCHRL', IS EMPTY) 01534000
  1650. * REGISTER OUTPUT: REGISTERS ARE UNPREDICTABLE 01535000
  1651. * 01536000
  1652. * +28 'DSP2' (A BAD EC-MODE ENVIRONMENT HAS BEEN DETECTED) 01537000
  1653. * REGISTER OUTPUT: 01538000
  1654. * GPR 11 = ADDRESS OF VMBLOK TO BE DISPATCHED 01539000
  1655. * 01540000
  1656. * "DSP1" AND "DSP2" EXITS UPON DISPATCH OF A BLOK: 01541000
  1657. * 01542000
  1658. * EXIT BY IOBLOK OR TRQBLOK DISPATCH: (EXIT TO NEW GPR 12 VALUE) 01543000
  1659. * REGISTER OUTPUT: 01544000
  1660. * GPR 10 = ADDRESS OF THE IOBLOK/TRQBLOK 01545000
  1661. * GPR 11 = ADDRESS OF THE VMBLOK OF 'IOBUSER'/'TRQBUSER' 01546000
  1662. * GPR 12 = EXIT ADDRESS ('IOBIRA'/'TRQBIRA') 01547000
  1663. * 01548000
  1664. * EXIT BY CPEXBLOK DISPATCH: (EXIT TO NEW ADDRESS IN GPR 15) 01549000
  1665. * REGISTER OUTPUT: 01550000
  1666. * GPR 0-14 = CPEXBLOK VALUES ('CPEXR0' TO 'CPEXR14') 01551000
  1667. * GPR 15 = CPEXBLOK VALUE ('CPEXADD') 01552000
  1668. * 01553000
  1669. * EXIT BY VMBLOK DISPATCH: (EXIT TO ADDRESS IN 'VMPSW'+4) 01554000
  1670. * REGISTER OUTPUT: 01555000
  1671. * CR 0 = VALUE FROM EITHER 'CPCREG0' OR 'EXTSHCR0' 01556000
  1672. * CR 1 = VALUE FROM EITHER 'VMSEG' OR 'EXTSHCR1' 01557000
  1673. * CR 4-8 = VALUES FROM ECBLOK ('EXTCR4' - 'EXTCR8') OR 01558000
  1674. * ENTRY CONTENTS 01558100
  1675. * CR 9-11 = VALUES FROM ECBLOK ('EXTCR9' - 'EXTCR11') OR 01559000
  1676. * VALUES FROM TREXT ('TREXCR9' - 'TREXCR11') OR 01560000
  1677. * ENTRY CONTENTS 01561000
  1678. * CR 12-13 = VALUES FROM ECBLOK ('EXTCR12' - 'EXTCR13') OR 01562000
  1679. * ENTRY CONTENTS 01562100
  1680. * FPR 0-6 = VALUES FROM VMBLOK ('VMFPRS') 01563000
  1681. * GPR 0-15 = VALUES FROM VMBLOK ('VMGPRS') 01564000
  1682. * 01565000
  1683. *********************************************************************** 01566000
  1684. *. 01567000
  1685. EJECT 01568000
  1686. DISPATCH EQU * ALTER USER STATUS AND DISPATCH... 01569000
  1687. SPACE 01570000
  1688. DS 0H EXECUTE CP ASSIST "DSP1" @V3M4026 01571000
  1689. DMKDSP1 DC X'E607',S(DSP1LIST,DSP1EXIT) ***@V3M4026 01572000
  1690. SPACE 01573000
  1691. L R1,VMRSTAT SCH BITS %V408246 01574000
  1692. N R1,SCHMASK JUST 'IMPORTANT' BITS %V408246 01575000
  1693. SL R1,SCHMON REMOVE 'ON' BITS, SHOULD LEAVE %V408246 01576000
  1694. * 'ZERO' 01577000
  1695. BC 2,UNLOCK YES, NO FURTHER CHECKING %V407508 01578000
  1696. * NECESSARY 01579000
  1697. CHKILL DS 0H %V408246 01580000
  1698. C R11,ASYSVM IS VMBLOK = SYSTEM? %V408246 01581000
  1699. BE UNLOCK YES, NOTHING FURTHER TO CHECK %V4M0173 01582000
  1700. TM VMOSTAT,VMKILL SHOULD USER BE LOGGED OFF ? %V3M4038 01583000
  1701. BZ SCHDL NO, CHECK FOR RUNNABLE STATUS %V407508 01584000
  1702. TM VMQSTAT,VMCFREAD IS READ PENDING? %V3M4038 01585000
  1703. BO OFF IF SO, EXIT %V3M4038 01586000
  1704. TM VMOSTAT,VMCF EXECUTING A CONSOLE FUNCTION NOW %V3M4038 01587000
  1705. BO SCHDL YES, WAIT UNTIL IT'S ALL DONE %V407508 01588000
  1706. OFF NI VMQSTAT,255-VMCFREAD TURN OFF FLAG AND EXIT %V3M4038 01589000
  1707. NI VMOSTAT,255-VMKILL DO NOT CALL TWICE %V3M4038 01590000
  1708. TM VMRSTAT,VMLOGOFF IN LOGOFF? %V3M4038 01591000
  1709. BO UNLOCK DON'T CALL USO AGAIN %V407508 01592000
  1710. OI VMRSTAT,VMLOGOFF DO NOT RUN THIS VM %V3M4038 01593000
  1711. OFFCALL DS 0H LOG USER OFF SYSTEM @VA13025 01594000
  1712. TM VMRSTAT,VMEXWAIT IS USER IN EXECUTION WAIT @VA13025 01594200
  1713. BO DELAYOFF YES, WAIT UNTIL FINISHED @VA13025 01594400
  1714. CALL DMKUSOFF LOG USER OFF SYSTEM @VA08667 01594600
  1715. B UNLOCK GO UNLOCK USER @V407508 01595000
  1716. SPACE 1 @VA13025 01595100
  1717. DELAYOFF OI VMOSTAT,VMKILL RESET THE VMKILL BIT @VA13025 01595200
  1718. NI VMRSTAT,255-VMLOGOFF RESET LOGOFF BIT IN VMBLOK @VA13025 01595300
  1719. TM VMSPMFLG,VMCFRD1 IS BACK-UP BIT ON ? @VA13025 01595400
  1720. BZ SCHDL NO, THEN JUST GO TO SCHEDULER @VA13025 01595500
  1721. OI VMQSTAT,VMCFREAD YES, THEN SET CFREAD FLAG @VA13025 01595600
  1722. B SCHDL AND GO TO SCHEDULER @VA13025 01595700
  1723. SPACE 1 @VA13025 01595800
  1724. * 01596000
  1725. * THE FOLLOWING TWO DATA LISTS MUST BE KEPT CONTIGUOUS AND IN ORDER 01597000
  1726. * BECAUSE THEY ARE USED BY CP ASSIST INSTRUCTIONS "DSP1" AND "DSP2". 01598000
  1727. SPACE 01599000
  1728. DSP1LIST DS 0F "DSP1" & "DSP2" ASSIST DATA LIST @V3M4026 01600000
  1729. SPACE 01601000
  1730. * NOTE: THE WORD AT DISPLACEMENT 28 WILL BE INCREMENTED 01601200
  1731. * BY 4 DURING IPL IF THIS CPU HAS CP ASSIST LEVEL 18 01601400
  1732. * OR 19. THIS ALLOWS USE OF THE "OLD" LEVEL OF FRET ASSIST. 01601600
  1733. SPACE , 01601800
  1734. DMKDSPRQ DC 4A(DMKDSPRQ) +0 IO, TRQ, CPEX BLOK ANCHORS @V3M4026 01602000
  1735. DMKDSPQS DC A(X'F00') +16 50 MILLISEC. DSP. TIME SLICE @V3M4026 01603000
  1736. PTRRTLOC DC A(0) +20 RESERVED @V408246 01604000
  1737. SCHRLOC DC A(DMKSCHRL) +24 LIST OF RUNNABLE USERS @V386198 01605000
  1738. DC V(DMKFREMX) +28 ADDRESS OF 'MAXSIZE' @VA14280 01606100
  1739. DC V(DMKFRETL) +32 ADDR OF CP ASSIST DATA LIST @V386198 01607000
  1740. DC V(DMKVATAT) +36 ADDR OF TABLE 'ARCHTECT' @V386198 01608000
  1741. DSPSAVE DC 6F'0' +40 SAVE AREA FOR CPEX REGS 12-1 @V386198 01609000
  1742. SCHMASK DS 0F +60 BITS REQUIRING CHECK 01610000
  1743. DC AL1(VMNORUN) VMRSTAT @V408246 01611000
  1744. DC AL1(VMRUN+VMINQ+VMTSEND+VMQSEND) VMDSTAT @V408246 01612000
  1745. DC AL1(VMKILL) VMOSTAT @V408246 01613000
  1746. DC AL1(VMPRIDSP) VMQSTAT @V408246 01614000
  1747. SCHMON DS 0F +64 THE ONLY ALLOWABLE VALUE 01615000
  1748. DC AL1(0) VMRSTAT @V408246 01616000
  1749. DC AL1(VMRUN+VMINQ) VMDSTAT @V408246 01617000
  1750. DC AL2(0) VMOSTAT, VMQSTAT @V408246 01618000
  1751. SPACE 2 01619000
  1752. DSP1EXIT DS 0F "DSP1" & "DSP2" ASSIST EXIT LIST @V3M4026 01620000
  1753. SPACE 01621000
  1754. DC A(OFFCALL) +0 USER GOING TO BE LOGGED OFF @V386198 01622000
  1755. DC A(SCHDL) +4 NEED TO GO THRU SCHEDULER @V386198 01623000
  1756. DC A(UNLOCK1) +8 THE SYSTEM IS EXTENDING @V407508 01624000
  1757. DC A(FRETCPEX) +12 CAN'T RELEASE A CPEXBLOK @V386198 01625000
  1758. DC A(CKSHRSYS) +16 CAN'T DO SHARED SYS. CHECKS @V386198 01626000
  1759. DC A(FREELOCK) +20 VMNOECPS BIT IS NON-ZERO @VMD0134 01627100
  1760. DC A(IDLEECPS) +24 CAN'T DISPATCH A USER @V407508 01628000
  1761. DC A(DSP2) +28 ABEND CONDITION DETECTED @V386198 01629000
  1762. EJECT 01630000
  1763. SCHDL CALL DMKSCHDL CALL THE SCHEDULER 01631000
  1764. UNLOCK DS 0H UNLOCK THE CURRENT USER %V407508 01632000
  1765. SPACE 01633000
  1766. DS 0H EXECUTE CP ASSIST DSP2 %V407508 01634000
  1767. DMKDSP2 DC X'E611',S(DSP1LIST,DSP1EXIT) ***%V407508 01635000
  1768. UNLOCK1 DS 0H %V407508 01636000
  1769. SPACE 01637000
  1770. LR R1,R11 SAVE CURRENT R11 USER %V407508 01638000
  1771. CHARGE STOP STOP CHARGING CURRENT VMBLOK %V4M0173 01639000
  1772. L R11,ASYSVM SWITCH R11 TO SYSTEM VMBLOK %V4M0173 01640000
  1773. AIF (NOT &AP).UPBR4 **AIF*** 01640900
  1774. * IN UP-MODE, SUBROUTINE UNLOKVM1 IS A NO-OP. 01641000
  1775. BAL R8,UNLOKVM1 UNLOCK OLD R11 USER %V407508 01642000
  1776. L R15,PREFIXB ACCESS PSA OF OTHER PROCESSOR %V4M0173 01643000
  1777. CLI CPSTATUS-PSA(R15),CPWAIT IS IT IDLE %V4M0173 01644000
  1778. BNE UNLKLAST NO - PROCESS STACKVM %V4M0173 01645000
  1779. TM VMDSTAT-VMBLOK(R1),VMRUN IS OLD R11 VM RUNNABLE @V4M0173 01646000
  1780. BZ UNLKLAST NO- BYPASS WAKE-UP SIGNAL @V4M0173 01647000
  1781. BAL R9,WAKSIG ALERT OTH PROC @VA09257 01648000
  1782. .UPBR4 ANOP **ANOP** 01648100
  1783. UNLKLAST DS 0H SEE IF LASTUSER IS TO BE UNLOCKD %V407508 01649000
  1784. AIF (&AP).APBR5 **AIF*** 01649100
  1785. CLI XTNDLOCK,SET IS SYSTEM IN EXTEND? %VA07369 01649200
  1786. BE FLAGCPEX YES, DO EXTEND PROCESSING %VA07369 01649300
  1787. AGO .UPBR5 **AGO*** 01649400
  1788. .APBR5 ANOP **ANOP** 01649500
  1789. TM APSTAT1,APUOPER IS THE AP OPERATIONAL? %V407508 01650000
  1790. BNO EXTNDTST NO, LEAVE EVERYTHING AS IS %V407508 01651000
  1791. L R1,STACKVM GET ADDR OF UNSTACKED VMBLOK @V407508 01652000
  1792. LTR R1,R1 IS ANY ADDRESS THERE? @V407508 01653000
  1793. BZ NOSTKVM NO, SKIP TRYING TO UNLOCK VM @V407508 01654000
  1794. BAL R8,UNLOKVM UNLOCK VMBLOK IF LOCKED @V407508 01655000
  1795. SLR R1,R1 CLEAR R1 @V407508 01656000
  1796. ST R1,STACKVM CLEAR ADDR OF UNSTACKED VMBLOK @V407508 01657000
  1797. NOSTKVM DS 0H @V407508 01658000
  1798. L R1,LASTUSER GET VALUE OF LASTUSER @V407508 01659000
  1799. CR R1,R11 IS LASTUSER EQUAL TO ASYSVM? @V407508 01660000
  1800. BE EXTNDTST YES, ALREADY UNLOCKED @V407508 01661000
  1801. TM VMOSTAT-VMBLOK(R1),VMSHR WAS LASTUSER USING @V407508 01662000
  1802. * SHARED SYSTEMS @V407508 01663000
  1803. BO EXTNDTST YES, LEAVE LOCKED @V4M0173 01664000
  1804. BAL R8,UNLOKVM2 UNLOCK LASTUSER @V407508 01665000
  1805. ST R11,LASTUSER SET LASTUSER = ASYSVM @V407508 01666000
  1806. EJECT 01667000
  1807. EXTNDTST DS 0H TEST FOR EXTEND %V407508 01668000
  1808. L R2,PREFIXA GET PROCESSOR PREFIX ADDRESS %V407508 01669000
  1809. CLI XTNDLOCK-PSA(R2),SET IS SYSTEM IN EXTEND? %V407508 01670000
  1810. BNE MCHTEST NO, TEST FOR SOFT ERROR PENDING %V407508 01671000
  1811. TM APSTAT1,PROCIO IS THIS THE MAIN PROCESSOR? @V407508 01672000
  1812. BO FLAGCPEX YES, DO EXTEND PROCESSING @V4M0173 01673000
  1813. BAL R9,XTNDAP DO AP-ONLY EXTEND PROCESSING @V407508 01674000
  1814. BAL R9,FREESYS NO, AP RELEASES THE SYSTEM LOCK @V407508 01675000
  1815. SR R0,R0 CLEAR R0 TO INDICATE END COND @V407508 01676000
  1816. LA R1,XTNDLOCK-PSA(,R2) GET ADDR OF EXTEND LOCK @V407508 01677000
  1817. O R1,=A(X'80000000') TURN ON HIGH ORDER BIT @V407508 01678000
  1818. CALL DMKLOKPS SPIN TILL EXTEND COMPLETES @V407508 01679000
  1819. CLI CPFRESW-PSA(R2),SET IS FRESW FLAG ON FOR AP? @V407508 01680000
  1820. BNE CKUSERS2 NO, SELECT A USER TO DISPATCH @V407508 01681000
  1821. LOCK OBTAIN,TYPE=SYS,SPIN=YES GO SPIN ON SYSTEM LOCK @V407508 01682000
  1822. MVI CPFRESW-PSA(R2),NONE TURN OFF FRESW FLAG @V407508 01683000
  1823. B FNDPBLOK FIND 1ST PRIORITY BLOK FOR PROC @V4M0141 01684000
  1824. .UPBR5 ANOP **ANOP** 01684100
  1825. SPACE 01685000
  1826. MCHTEST DS 0H TEST FOR NEEDED RECOVERY %V407508 01686000
  1827. * IN UP-MODE, FLAG CPAPRPND IS ALWAYS 0. 01687100
  1828. * ECPS CHECKS CPMCHLK IN APSTAT2 INSTEAD OF CPMCHSE; 01687600
  1829. * ECPS EXITS TO UNLOCK1 IF THIS FLAG IS ON. 01688100
  1830. TM APSTAT4,CPMCHSE+CPAPRPND TEST MCH RECOVRY FLAGS %VA07615 01688600
  1831. AIF (&AP).APBR6 **AIF*** 01689100
  1832. BZ CKCPSTAK NONE SET, CONTINUE NORMALLY %VA07615 01689600
  1833. CHARGE START START CHARGING SYSTEM VMBLOK @VA07615 01690100
  1834. AGO .UPBR6 **AGO*** 01690600
  1835. .APBR6 ANOP **ANOP** 01691100
  1836. BZ SYSLKTST NONE SET, CHECK SYS LOCK FLAG %VA07615 01691600
  1837. CHARGE START START CHARGING SYSTEM VMBLOK @V4M0173 01693000
  1838. TM APSTAT4,CPAPRPND IS AUTO PROC RECOVERY PENDING? @VA07615 01694100
  1839. BNO MCHSXT NO, GOTO DMKMCH FOR SOFT ERROR @V407508 01695000
  1840. GOTO DMKMCTPR DO AUTOMATIC PROCESSOR RECOVERY @V407508 01696000
  1841. SPACE 01697000
  1842. MCHSXT DS 0H EXIT TO DMKMCHSE @V407508 01698000
  1843. .UPBR6 ANOP **ANOP** 01698100
  1844. GOTO DMKMCHSE DO SOFT ERROR RECOVERY @V407508 01699000
  1845. AIF (NOT &AP).UPTST7 **AIF*** 01699900
  1846. SPACE 01700000
  1847. SYSLKTST DS 0H CHECK SYSTEM LOCK FLAG %VA07615 01701100
  1848. * IN UP-MODE, FLAG CPSYSLK IS ALWAYS 0. 01701200
  1849. TM APSTAT3,CPSYSLK DOES OTHER PROC NEED SYS LOCK? %VA07615 01701300
  1850. BZ CKCPSTAK NO, CONTINUE NORMALLY %VA07615 01701400
  1851. BAL R9,FREESYS RELEASE SYSTEM LOCK @V407508 01702000
  1852. B CKUSERS GO SELECT A USER TO DISPATCH @V407508 01703000
  1853. .UPTST7 ANOP **ANOP** 01703100
  1854. EJECT 01704000
  1855. *. 01705000
  1856. * 01706000
  1857. * OPERATION - 01707000
  1858. * 01708000
  1859. * G. UNSTACK DEFERRED BLOCKS 01709000
  1860. * 1. TO UNSTACK ANY BLOK, FIRST LOCK THE ASSOCIATED VMBLOK. IF 01710000
  1861. * THE LOCK IS NOT AVAILABLE, SKIP THIS BLOK AND SCAN FOR 01711000
  1862. * ANOTHER BLOK FOR A DIFFERENT VM. FOR A GIVEN VM, BLOKS ARE 01712000
  1863. * UNSTACKED IN THE FOLLOWING ORDER: DEFERRED INTERRUPT TASK; 01713000
  1864. * PRIORITY CPEXBLOKS; IO/TRQ BLOKS; NORMAL CPEXBLOKS. 01714000
  1865. * 2. EXAMINE FIRST THE STACK OF IO/TRQ BLOKS. IF SYSTEM IS NOT 01715000
  1866. * EXTENDING, UNSTACK NORMALLY; OTHERWISE, ONLY UNSTACK PAGING 01716000
  1867. * OR PCI IOBLOKS. 01717000
  1868. * 3. BEFORE EXAMINING THE STACK OF CPEXBLOKS, OPEN A WINDOW FOR 01718000
  1869. * INTERRUPTS IF THE SYSTEM IS NOT EXTENDING. 01719000
  1870. * 4. EXAMINE THE STACK OF CPEXBLOKS. IF SYSTEM IS NOT EXTENDING 01720000
  1871. * UNSTACK NORMALLY; OTHERWISE ONLY UNSTACK THOSE THAT WILL 01721000
  1872. * ALLOW THE SYSTEM TO EXTEND. IF A 01722000
  1873. * CPEXBLOK FOR THE OTHER PROCESSOR IS ENCOUNTERED, GIVE UP 01723000
  1874. * THE SYSTEM LOCK, SIGNAL THE OTHER PROCESSOR, AND GO TO 01724000
  1875. * SECTION H TO SELECT A USER TO DISPATCH. 01725000
  1876. * 01726000
  1877. *. 01727000
  1878. SPACE 2 01728000
  1879. EJECT 01729000
  1880. CKCPSTAK EQU * FIRST, TEST FOR STACKED REQUESTS %V3M4038 01730000
  1881. LA R15,DMKDSPRQ GET ADDRESS OF DSP REQUEST STACK %V4M0173 01731000
  1882. C R15,IOBFPNT-IOBLOK(,R15) IS THE LIST EMPTY? %V4M0173 01732000
  1883. BE WINDOW YES, GO OPEN INTERRUPT WINDOW %V4M0173 01733000
  1884. SPACE 01734000
  1885. FLAGCPEX DS 0H %V408246 01735000
  1886. BAL R9,LOCKOBDS GET LOCK FOR DSP STACKS @VA09257 01736000
  1887. SPACE 01737000
  1888. LA R15,DMKDSPRQ POINT TO REQUEST STACK %V3M4038 01738000
  1889. LR R10,R15 INTIALIZE R10 %V407508 01739000
  1890. AIF (&AP).APBR7 **AIF*** 01739100
  1891. CLI XTNDLOCK,SET IS SYSTEM IN EXTEND? %VA07369 01739200
  1892. AGO .UPBR7 **AGO*** 01739300
  1893. .APBR7 ANOP **ANOP** 01739400
  1894. L R3,PREFIXA GET PROCESSOR PREFIX ADDRESS %V407508 01740000
  1895. CLI XTNDLOCK-PSA(R3),SET IS SYSTEM IN EXTEND? %V407508 01741000
  1896. .UPBR7 ANOP **ANOP** 01741100
  1897. BNE NOEXTND NO, CONTINUE NORMALLY %V407508 01742000
  1898. USING IOBLOK,R10 SET UP ADDRESSABILITY TO IOBLOK @V407508 01743000
  1899. NXTIOB DS 0H @V407508 01744000
  1900. L R10,IOBFPNT GET FIRST/NEXT IO OR TRQ BLOK @V407508 01745000
  1901. CLR R10,R15 ANY REQUESTS LEFT? @V407508 01746000
  1902. BE EXTDISP NO, GO LOOK FOR XTND CPEXBLOKS @V407508 01747000
  1903. TM 0(R10),X'80' IS THIS A TRQ @VA07831 01747100
  1904. BO NXTIOB YES, DO NOT UNSTACK @VA07831 01747150
  1905. * BIT IS ON FOR ALL TRQ'S & 01747200
  1906. * OFF FOR ALL PAGING IOB'S 01747250
  1907. TM IOBFLAG,IOBPAG IS IOB A PAGING TASK @V407508 01748000
  1908. BO GETVM YES, GO TO LOCK ASSOCIATED VM @V407508 01749000
  1909. TM IOBCSW+5,PCI IS IOB A PCI INERRUPT? @V407508 01750000
  1910. BNO NXTIOB NO, GO GET NEXT IOBLOK @V407508 01751000
  1911. GETVM DS 0H @V407508 01752000
  1912. AIF (NOT &AP).UPTST8 **AIF*** 01752900
  1913. L R1,IOBUSER GET ADDRESS OF ASSOCIATED VM @V407508 01753000
  1914. * IN UP-MODE, SUBROUTINE LOCKVM IS A NO-OP. 01754000
  1915. BAL R9,LOCKVM GO TO LOCK THIS VM @V407508 01755000
  1916. BNZ DOWN LOCK NOT OBTAINED, TERM VM/370 @V407508 01756000
  1917. .UPTST8 ANOP **ANOP** 01756100
  1918. B PROCIOB LOCK HELD, PROCESS THIS IOB @V407508 01757000
  1919. SPACE 01758000
  1920. NOEXTND DS 0H NORMAL PROCESSING %V407508 01759000
  1921. L R10,IOBFPNT GET FIRST/NEXT IO OR TRQ BLOK %V407508 01760000
  1922. AIF (NOT &AP).UPTST9 **AIF*** 01760900
  1923. CLR R10,R15 ANY REQUESTS LEFT? %V407508 01761000
  1924. BE CKCPREQ NO, GO LOOK FOR CPEXBLOKS %V407508 01762000
  1925. TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? %V4M0173 01763000
  1926. BZ PROCIOB NO, GO PROCESS THIS IOB %V4M0173 01764000
  1927. L R1,IOBUSER GET ADDRESS OF ASSOCIATED VM @V407508 01765000
  1928. BAL R9,LOCKVM GO TO LOCK THIS VM @V407508 01766000
  1929. BZ TESTDEF LOCK OBTAINED @VA09257 01767100
  1930. L R2,PREFIXB ACCESS OTHER PSA @VA09257 01767120
  1931. CLI CPSTATUS-PSA(R2),CPRUN IS OTHER PROCR ENABLED @VA09257 01767140
  1932. BNE NOEXTND NO, BYPASS IOB @VA09257 01767160
  1933. B SIGPDSP YES, SIGNAL DISPATCH @VA09257 01767180
  1934. DSPSIG SIGNAL DISPATCH @VA09257 01767200
  1935. BR R9 @VA09257 01767220
  1936. WAKSIG SIGNAL WAKEUP @VA09257 01767240
  1937. BR R9 @VA09257 01767260
  1938. TESTDEF DS 0H @VA09257 01767280
  1939. DROP R11 STOP USING R11 FOR VMBLOK @V407508 01768000
  1940. USING VMBLOK,R1 SET UP ADDRESSABILITY TO VMBLOK @V407508 01769000
  1941. TM VMPEND,VMDEFSTK IS A DEFERRED INTERRUPT PENDING @V407508 01770000
  1942. BNO TESTP NO, TEST FOR PRIORITY CPEXBLOKS @V4M0141 01771000
  1943. L R2,VMDFTPNT GET ADDRESS OF DEFERRED INT TASK @V407508 01772000
  1944. CLC LPUADDRX,CPEXPROC-CPEXBLOK(R2) IS THIS DEFERRED @V407508 01773000
  1945. * TASK FOR THE OTHER PROCESSOR? @V407508 01774000
  1946. BNE PROCCP GO TO UNSTACK THIS TASK @V407508 01775000
  1947. B SIGNLDSP GO ISSUE DISPATCH SIGNAL @V407508 01776000
  1948. SPACE 01777000
  1949. TESTP DS 0H @V407508 01778000
  1950. LH R2,VMPRRCT GET CNT OF PRIORITY CPEXBLOKS @V4M0141 01779000
  1951. LTR R2,R2 ARE THERE PRIORITY CPEXBLOKS? @VA07581 01779100
  1952. BNZ FINDPTSK FIND PRIORITY CPEXBLOK @V4M0136 01780000
  1953. TESTIO DS 0H @V407508 01781000
  1954. C R10,IOBFPNT-IOBLOK(,R15) IS THIS THE 1ST IOB? @V407508 01782000
  1955. BE PROCIOB YES, NO PRIOR IOB EXIST @V407508 01783000
  1956. LH R2,VMSTKCNT GET IOB/CPEX COUNT @V407508 01784000
  1957. C R2,F1 IS THIS COUNT > 1? @V407508 01785000
  1958. BNH PROCIOB NO, GO PROCESS THIS IOB @V407508 01786000
  1959. BAL R9,FINDIOB LOOK FOR A PRIOR IOB @V407508 01787000
  1960. DROP R1 STOP USING R1 AS VMBLOK BASE @VA07369 01787100
  1961. .UPTST9 ANOP **ANOP** 01787200
  1962. PROCIOB DS 0H PROCESSING FOR IO OR TRQ BLOKS %V407508 01788000
  1963. LM R2,R3,IOBFPNT GET FORWARD & BACKWARD POINTERS %V407508 01789000
  1964. ST R2,IOBFPNT-IOBLOK(,R3) REPLACE FORWARD POINTER %V407508 01790000
  1965. * OF PREVIOUS ELEMENT %V407508 01791000
  1966. ST R3,IOBBPNT-IOBLOK(,R2) REPLACE BACKWARD POINTER %V407508 01792000
  1967. * OF NEXT ELEMENT %V407508 01793000
  1968. USING VMBLOK,R11 START USING R11 AS VMBLOK BASE %V4M0173 01795000
  1969. L R11,IOBUSER SWITCH R11 TO NE VMBLOK %V4M0173 01796000
  1970. LH R2,VMSTKCNT GET IOB/CPEX COUNT FOR THIS VM %V407508 01797000
  1971. BCTR R2,0 DECREMENT THIS COUNT BY 1 %V407508 01798000
  1972. STH R2,VMSTKCNT REPLACE WITH UPDATED COUNT %V407508 01799000
  1973. BAL R9,LOCKRLDS RELEASE LOCK ON DSP STACKS @VA09257 01800100
  1974. AIF (NOT &TRACE(9)).TR10 ** AIF ** %V3M4038 01801000
  1975. TM TRACFLG2,TRAC10 TRACING ACTIVE? %V3M4038 01802000
  1976. BZ NOTRAC3 BRANCH IF NOT %V3M4038 01803000
  1977. * 01804000
  1978. * TRACE UNSTACK OF IOBLOK OR TRQBLOK 01805000
  1979. * 01806000
  1980. LA R14,TRCUNBLK SET CODE FOR UNSTACK OF BLOK %V407508 01807000
  1981. BAL R1,GETRACE GET CURRENT TRACE TABLE ENTRY %V4M0017 01808000
  1982. STCM R11,B'0111',ONE(R15) STORE VMBLOK ADDRESS %V4M0173 01809000
  1983. MVC 4(4,R15),VMRSTAT SAVE STATUS OF NEW VMBLOK %V4M0173 01810000
  1984. ST R10,8(,R15) POINT TO IOBLOK OR TRQBLOK %V3M4038 01811000
  1985. L R1,IOBIRA GET INTERRUPT RETURN ADDRESS %VA07237 01812000
  1986. ST R1,12(,R15) SAVE THE RETURN ADDRESS %VA07237 01813000
  1987. NOTRAC3 EQU * %V3M4038 01814000
  1988. .TR10 ANOP 01815000
  1989. CHARGE START START CHARGING NEW VMBLOK %V4M0173 01816000
  1990. L R12,IOBIRA GET INTERRUPT RETURN ADDRESS %VA07237 01816100
  1991. ST R11,STACKVM REMEMBER UNSTACKED VMBLOK %V407508 01817000
  1992. BR R12 AND GO .. %V3M4038 01818000
  1993. EJECT 01819000
  1994. CKCPREQ EQU * CHECK FOR STACKED CPEXBLOKS %V3M4038 01820000
  1995. * 01826000
  1996. * OPEN WINDOW FOR INTERRUPTS 01827000
  1997. * 01828000
  1998. BAL R9,LOCKRLDS RELEASE LOCK ON DSP STACKS @VA09257 01829100
  1999. WINDOW DS 0H %V4M0173 01830000
  2000. AIF (NOT &AP).UPTST10 **AIF*** 01830900
  2001. TM APSTAT1,PROCIO IS THIS THE MAIN PROCESSOR? %V4M0173 01831000
  2002. BO ENABLE YES, OPEN WINDOW ON MAIN PROC %V4M0173 01832000
  2003. LA R15,DMKDSPRQ GET ADDRESS OF DSP REQUEST STACK @V4M0173 01833000
  2004. C R15,CPEXFPNT-CPEXBLOK(,R15) IS THE LIST EMPTY? @V4M0173 01834000
  2005. BE DONE2 YES, GO FREE THE SYSTEM LOCK AND @V4M0173 01835000
  2006. * SELECT A USER TO DISPATCH @V4M0173 01836000
  2007. B GETDSLOK NO, GO GET LOCK ON DSP STACKS @V4M0173 01837000
  2008. .UPTST10 ANOP **ANOP** 01837100
  2009. SPACE 01838000
  2010. ENABLE DS 0H %V4M0173 01839000
  2011. * THE FOLLOWING 'SSM ENABLE/SSM DISABLE' INSTRUCTIONS ARE 01840000
  2012. * ARE NOT PERFORMED BY ECPS. 01841000
  2013. SSM IOWINDOW OPEN WINDOW FOR IO INTERRUPTS %V4M0173 01842000
  2014. SSM *+1 AND CLOSE AGAIN %V408246 01843000
  2015. * 01844000
  2016. LA R15,DMKDSPRQ GET ADDRESS OF DSP REQUEST STACK %V4M0173 01845000
  2017. C R15,CPEXFPNT-CPEXBLOK(,R15) IS THE LIST EMPTY? %V4M0173 01846000
  2018. BE DONE2 YES, GO GET A USER TO DISPATCH %V4M0173 01847000
  2019. GETDSLOK DS 0H %V4M0173 01848000
  2020. BAL R9,LOCKOBDS GET LOCK ON DSP STACKS @VA09257 01849000
  2021. LA R15,DMKDSPRQ RESTORE ADDRESS OF REQUEST STACK %V407508 01850000
  2022. LR R2,R15 INITIALIZE R2 %V407508 01851000
  2023. USING CPEXBLOK,R2 GET ADDRESSABILITY TO CPEXBLOK %V407508 01852000
  2024. NXTCP DS 0H %V407508 01853000
  2025. L R2,CPEXFPNT GET NEXT CPEXBLOK POINTER %V407508 01854000
  2026. AIF (NOT &AP).UPTST11 **AIF*** 01854900
  2027. CR R2,R15 ANY CPEXBLOKS LEFT? %V407508 01855000
  2028. BE DONE NO, GO GET A USER TO RUN %V407508 01856000
  2029. TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? %V4M0173 01857000
  2030. BZ PROCCP NO, UNSTACK THIS CPEXBLOK %V4M0173 01858000
  2031. L R1,CPEXR11 GET ADDRESS OF ASSOCIATED VM @V407508 01859000
  2032. BAL R9,LOCKVM TRY TO LOCK THIS VM @V407508 01860000
  2033. * UNSTK CPEXBLOK HAS PRIORITY OVER RUNNING USER 01861100
  2034. BZ UNSTK GOT THE LOCK-GO UNSTK CPEXBLOK @VA09257 01861110
  2035. L R15,PREFIXB ACCESS OTH PROC PSA @VA09257 01861120
  2036. TM XCPEND-PSA(R15),XCDISP EXTINT PEND? @VA09257 01861130
  2037. BO NOSIGNAL YES-SIGP REDUNDANT @VA09257 01861140
  2038. CLI CPSTATUS-PSA(R15),CPRUN RUNNING USER? @VA09257 01861150
  2039. BZ NOSIGNAL NO - DON'T BOTHER @VA09257 01861160
  2040. B SIGPDSP @VA09257 01861170
  2041. NOSIGNAL LA R15,DMKDSPRQ RESTORE R15 @VA09257 01861180
  2042. B NXTCP SEE IF MORE ON Q @VA09257 01861190
  2043. UNSTK DS 0H @VA09257 01861200
  2044. DROP R11 STOP USING R11 AS VMBLOK BASE @V407508 01862000
  2045. USING VMBLOK,R1 USE R1 AS BASE FOR VMBLOK @V407508 01863000
  2046. TM VMPEND,VMDEFSTK IS A DEFERRED INTERRUPT PENDING @V407508 01864000
  2047. BNO TSTP NO, TEST FOR PRIORITY CPEXBLOKS @V4M0141 01865000
  2048. L R2,VMDFTPNT GET ADDRESS OF DEFERRED INT TASK @V407508 01866000
  2049. CLC LPUADDRX,CPEXPROC IS THIS DEFERRED TASK FOR THE @V407508 01867000
  2050. * OTHER PROCESSOR @V407508 01868000
  2051. BNE PROCCP GO TO UNSTACK THIS TASK @V407508 01869000
  2052. B SIGNLDSP GO ISSUE DISPATCH SIGNAL @V407508 01870000
  2053. SPACE 01871000
  2054. TSTP DS 0H @V407508 01872000
  2055. LH R3,VMPRRCT GET CNT OF PRIORITY CPEXBLOKS @V4M0141 01873000
  2056. LTR R3,R3 ARE THERE ANY PRIORITY CPEXBLOKS @VA07381 01873100
  2057. BNZ FINDPTSK FIND PRIORITY CPEXBLOK @V4M0136 01874000
  2058. TSTIO DS 0H @V407508 01875000
  2059. LH R3,VMSTKCNT GET IOB/CPEX COUNT @V407508 01876000
  2060. C R3,F1 IS THIS COUNT > 1? @V407508 01877000
  2061. BNH TSTCP NO, TEST CPEXBLOK FOR AFFINITY @V4M0141 01878000
  2062. BAL R9,FINDIOB LOOK FOR A PRIOR IOB @V407508 01879000
  2063. BAL R9,FINDCP LOOK FOR A PRIOR CPEXBLOK @V407508 01880000
  2064. TSTCP DS 0H TEST CPEXBLOK FOR PROC AFFINITY @V4M0141 01881000
  2065. CLC CPEXPROC,LPUADDRX IS THIS CPEXBLOK STACKED FOR @V4M0141 01882000
  2066. * THE OTHER PROCESSOR? @V4M0141 01883000
  2067. BNE PROCCP NO, GO PROCESS THIS CPEXBLOK @V4M0141 01884000
  2068. SIGNLDSP DS 0H SIGNAL OTHER PROCESSOR @V4M0141 01885000
  2069. BAL R8,UNLOKVM1 UNLOCK THIS VM @V4M0141 01886000
  2070. SIGPDSP DS 0H @VA09257 01886500
  2071. BAL R9,LOCKRLDS RELEASE LOCK ON DSP STACKS @VA09257 01887100
  2072. BAL R9,FREESYS RELEASE THE SYSTEM LOCK @V4M0141 01888000
  2073. L R15,PREFIXB ACCESS OTHER PSA @VA08311 01888400
  2074. TM XCPEND-PSA(R15),XCDISP IS DISPATCH XC PENDING ? @VA08311 01888500
  2075. BO CKUSERS YES- SKIP REDUNDANT SIGNAL @VA08311 01888600
  2076. BAL R9,DSPSIG TELL OTH PROC ABOUT CPEXBLOK @VA09257 01889000
  2077. B CKUSERS GO SELECT A USER TO DISPATCH @V4M0141 01890000
  2078. DROP R1 STOP USING R1 AS VMBLOK BASE @VA07369 01890100
  2079. .UPTST11 ANOP **ANOP** 01890200
  2080. SPACE 01891000
  2081. PROCCP DS 0H %V407508 01892000
  2082. L R3,CPEXFPNT GET ADDRESS OF NEXT ELEMENT %V407508 01893000
  2083. L R4,CPEXBPNT GET ADDRESS OF PREVIOUS ELEMENT %V407508 01894000
  2084. ST R3,CPEXFPNT-CPEXBLOK(,R4) REPLACE FORWARD PTR %V407508 01895000
  2085. * OF PREVIOUS ELEMENT %V407508 01896000
  2086. ST R4,CPEXBPNT-CPEXBLOK(,R3) REPLACE BACKWARD PTR %V407508 01897000
  2087. * OF NEXT ELEMENT %V407508 01898000
  2088. USING VMBLOK,R11 USE R11 AS BASE FOR VMBLOK %V4M0173 01900000
  2089. L R11,CPEXR11 SWITCH R11 TO NEW VMBLOK %V4M0173 01901000
  2090. AIF (NOT &AP).UPTST12 **AIF*** 01901900
  2091. * IN UP-MODE, FLAG CPEXPRIO IS NEVER ON. 01902000
  2092. TM CPEXTYPE,CPEXPRIO IS THIS A PRIORITY CPEXBLOK? %V4M0141 01903000
  2093. BZ CHKNORM NO, CHECK FOR NORMAL CPEXBLOK %V407508 01904000
  2094. LH R3,VMPRRCT GET CNT OF PRIORITY CPEXBLOKS @V4M0141 01905000
  2095. BCTR R3,0 DECREMENT THIS COUNT BY 1 @V407508 01906000
  2096. STH R3,VMPRRCT REPLACE WITH UPDATED COUNT @V407508 01907000
  2097. B NEXT CONTINUE PROCESSING BLOK @V407508 01908000
  2098. SPACE 01909000
  2099. CHKNORM DS 0H %V407508 01910000
  2100. * IN UP-MODE, FLAG CPEXDEFR IS NEVER ON. 01911000
  2101. TM CPEXTYPE,CPEXDEFR IS THIS A DEFERRED INT TASK? %V407508 01912000
  2102. BZ NORMCP NO, MUST BE A NORMAL CPEXBLOK %V407508 01913000
  2103. NI VMPEND,X'FF'-VMDEFSTK TURN OFF DEFERRED FLAG @V407508 01914000
  2104. B NEXT CONTINUE PROCESSING BLOK @V407508 01915000
  2105. SPACE 01916000
  2106. NORMCP DS 0H %V407508 01917000
  2107. .UPTST12 ANOP **ANOP** 01917100
  2108. LH R3,VMSTKCNT GET IOB/CPEX COUNT FOR THIS VM %V407508 01918000
  2109. BCTR R3,0 DECREMENT THIS COUNT BY 1 %V407508 01919000
  2110. STH R3,VMSTKCNT REPLACE WITH UPDATED COUNT %V407508 01920000
  2111. NEXT DS 0H %V407508 01921000
  2112. BAL R9,LOCKRLDS RELEASE LOCK ON DSP STACKS @VA09257 01922100
  2113. CHARGE START START CHARGING NEW VMBLOK %V4M0173 01923000
  2114. ST R11,STACKVM REMEMBER UNSTACKED VMBLOK %V407508 01924000
  2115. DROP R2 STOP USING R2 AS BASE FOR CPEXBK %V407508 01925000
  2116. USING CPEXBLOK,R1 USE R1 AS BASE FOR CPEXBLOK %V407508 01926000
  2117. LR R1,R2 GET CPEXBLOK ADDRESS IN R1 %V407508 01927000
  2118. LM R5,R7,CPEXADD GET EXECUTION ADDRESS, GPR0,1 %V3M4038 01928000
  2119. LM R2,R4,CPEXREGS+12*4 GET GPRS 12-14 %V3M4038 01929000
  2120. STM R2,R7,DSPSAVE SAVE REGS ACROSS CALL TO FRET %V3M4038 01930000
  2121. LM R2,R11,CPEXREGS+2*4 GET NEW USER'S GPR2-11 %V3M4038 01931000
  2122. LA R0,CPEXSIZE GET SIZE OF CPEXBLOK %VA07369 01931100
  2123. AIF (NOT &AP).UPTST13 **AIF*** 01931200
  2124. * IN UP-MODE, FLAG CPEXDEFR IS NEVER ON. 01932000
  2125. TM CPEXTYPE,CPEXDEFR IS THIS A DEFERRED INT TASK %V407508 01933000
  2126. BO NOFRET YES, DO NOT FRET STORAGE %V407508 01934000
  2127. * IN UP-MODE, FLAG CPEXLPSW IS NEVER ON. 01936000
  2128. TM CPEXTYPE,CPEXLPSW IS THIS A 'SWITCH' CPEXBLOK? %V407508 01937000
  2129. BO CPLPSW YES, SAVE CPEXR15 BEFORE FRET %V407508 01938000
  2130. .UPTST13 ANOP **ANOP** 01938100
  2131. FRETCPEX CALL DMKFRET TO FREE STORAGE %V3M4038 01939000
  2132. NOFRET DS 0H %V407508 01940000
  2133. LM R12,R1,DSPSAVE RESTORE KEY REGS AFTER CALL %V3M4038 01941000
  2134. LTR R15,R15 SET CONDITION CODE %V3M4038 01942000
  2135. BR R15 AND GO ... %V3M4038 01943000
  2136. SPACE 01944000
  2137. AIF (NOT &AP).UPTST14 **AIF*** 01944900
  2138. CPLPSW DS 0H @V407508 01945000
  2139. L R14,CPEXR15 GET CPEXR15 VALUE @V407508 01946000
  2140. ST R14,DSPSAVE+OFFR15 SAVE ACROSS CALL TO FRET @V407508 01947000
  2141. MVC PSWADDR,CPEXADD SAVE CPEXADD ACROSS FRET CALL @V407508 01948000
  2142. CALL DMKFRET RETURN CPEXBLOK TO FREE STORAGE @V407508 01949000
  2143. MVC TEMPSAVE(LNPSW),CPPSW SET UP PSW IN TEMPSAVE @V407508 01950000
  2144. LM R12,R1,DSPSAVE RESTORE REGS AFTER CALL TO FRET @V407508 01951000
  2145. LPSW TEMPSAVE LOAD PSW TO GO TO EXECUTION ADDR @V407508 01952000
  2146. .UPTST14 ANOP **ANOP** 01952100
  2147. SPACE 2 01953000
  2148. EXTDISP EQU * HERE IF THE SYSTEM IS EXTENDING -- 01954000
  2149. LM R3,R7,EXTADDRS GET VALUES OF ALLOWED EXITS @V407508 01955000
  2150. LR R2,R15 INITIALIZE R2 @V407508 01956000
  2151. DROP R1 STOP USING R1 AS CPEXBLOK BASE @V407508 01957000
  2152. USING CPEXBLOK,R2 USE R2 AS CPEXBLOK BASE @V407508 01958000
  2153. EXTCP DS 0H @V407508 01959000
  2154. L R2,CPEXFPNT GET ADDRESS OF NEXT CPEXBLOK @V407508 01960000
  2155. CR R2,R15 ANY CPEXBOLKS LEFT? @V407508 01961000
  2156. BE DONE NO, GO RELEASE LOCKS AND WAIT @V407508 01962000
  2157. L R14,CPEXADD GET VALUE OF EXIT ADDRESS @V407508 01963000
  2158. LA R14,0(,R14) CLEAR HIGH-ORDER BYTE @V407508 01964000
  2159. CR R3,R14 IS THIS AN ALLOWED EXIT? @V407508 01965000
  2160. BE EXTVM YES, GO LOCK VM @V407508 01966000
  2161. CR R4,R14 ANOTHER ALLOWED EXIT? @V407508 01967000
  2162. BE EXTVM YES, GO LOCK VM @V407508 01968000
  2163. CR R5,R14 ANOTHER ALLOWED EXIT? @V407508 01969000
  2164. BE EXTVM YES, GO LOCK VM @V407508 01970000
  2165. CR R6,R14 IS EXIT FOR AN I/O ERROR? @V407508 01971000
  2166. BE PAGCHK YES, CHECK IF IT IS PAGING @V407508 01972000
  2167. CR R7,R14 ANOTHER I/O ERROR EXIT? @V407508 01973000
  2168. BNE EXTCP NO, GET NEXT CPEXBLOK @V407508 01974000
  2169. PAGCHK DS 0H @V407508 01975000
  2170. L R10,CPEXR10 GET IOBLOK ADDR FROM CPEXBLOK @V407508 01976000
  2171. TM IOBFLAG,IOBPAG IS IOBLOK FOR PAGING? @V407508 01977000
  2172. BO EXTVM YES, GO LOCK VM @V407508 01978000
  2173. L R8,CPEXR8 GET RDEVBLOK ADDRESS @V407508 01979000
  2174. L R10,RDEVFIOB-RDEVBLOK(,R8) GET QUEUED IOBLOK @V407508 01980000
  2175. CKLIST DS 0H TEST ALL IOBLOKS QUEUED @V407508 01981000
  2176. CR R8,R10 ANY MORE IOBLOKS? @V407508 01982000
  2177. BE EXTCP NO, GO GET NEXT CPEXBLOK @V407508 01983000
  2178. TM IOBFLAG,IOBPAG IS IOBLOK FOR PAGING? @V407508 01984000
  2179. BO EXTVM YES, GO LOCK VM @V407508 01985000
  2180. L R10,IOBFPNT GET NEXT IOBLOK ON QUEUE @V407508 01986000
  2181. B CKLIST GO CHECK THIS IOBLOK @V407508 01987000
  2182. EXTVM DS 0H @V407508 01988000
  2183. AIF (NOT &AP).UPTST15 **AIF*** 01988900
  2184. L R1,CPEXR11 GET ADDRESS OF ASSOCIATED VM @V407508 01989000
  2185. * IN UP-MODE, SUBROUTINE LOCKVM IS A NO-OP. 01990000
  2186. BAL R9,LOCKVM TRY TO LOCK THIS VM @V407508 01991000
  2187. BNZ DOWN LOCK NOT OBTAINED, TERM VM/370 @V407508 01992000
  2188. .UPTST15 ANOP **ANOP** 01992100
  2189. B PROCCP LOCK OBTAINED, PROCESS CPEXBLOK @V407508 01993000
  2190. DROP R2 STOP USING R2 AS CPEXBLOK BASE @V407508 01994000
  2191. EJECT 01995000
  2192. * 01996000
  2193. * INTERNAL SUBROUTINES 01997000
  2194. * 01998000
  2195. AIF (NOT &AP).UPTST16 **AIF*** 01998900
  2196. LOCKVM DS 0H @V407508 01999000
  2197. * R1=ADDR OF VM TO BE LOCKED @V407508 02000000
  2198. TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? @V4M0136 02001000
  2199. BZR R9 NO, RETURN TO CALLER @V4M0136 02002000
  2200. C R1,LASTUSER IS VM = LASTUSER? @V407508 02003000
  2201. BER R9 YES, RETURN-ALREADY LOCKED @V407508 02004000
  2202. C R1,ASYSVM IS VM = ASYSVM? @V407508 02005000
  2203. BER R9 YES, RETURN-NO LOCK NEEDED @V407508 02006000
  2204. LOCK OBTAIN,TYPE=VMBLOK,SPIN=NO,SAVE TRY TO LOCK VM @V407508 02007000
  2205. BR R9 RETURN TO CALLER @V407508 02008000
  2206. * 02009000
  2207. UNLOKVM DS 0H UNLOCK A VM @V407508 02010000
  2208. * R1=ADDR OF VM TO BE UNLOCKED @V407508 02011000
  2209. LH R0,LPUADDR GET LOGICAL CPU ADDRESS @V407508 02012000
  2210. CH R0,VMLOCK+2-VMBLOK(,R1) IS VMBLOK LOCKED? @V407508 02013000
  2211. BNER R8 NO, RETURN TO CALLER @V407508 02014000
  2212. UNLOKVM1 DS 0H SKIP LASTUSER CHECK @V407508 02015000
  2213. C R1,LASTUSER IS VM = LASTUSER? @V407508 02016000
  2214. BER R8 YES, RETURN-DO NOT UNLOCK @V407508 02017000
  2215. C R1,ASYSVM IS VM = ASYSVM? @V407508 02018000
  2216. BER R8 YES, RETURN-ASYSVM NOT LOCKED @V407508 02019000
  2217. UNLOKVM2 DS 0H SKIP ASYSVM CHECK @V407508 02020000
  2218. LOCK RELEASE,TYPE=VMBLOK,SAVE GO UNLOCK THIS VM @V407508 02021000
  2219. BR R8 RETURN TO CALLER @V407508 02022000
  2220. EJECT 02023000
  2221. * 02024000
  2222. TSTSYS DS 0H @V407508 02025000
  2223. TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? @V407508 02026000
  2224. BZR R9 NO, RETURN TO CALLER @V407508 02027000
  2225. L R2,=A(DMKLOKSY+2) GET ADDRESS OF SYSTEM LOCK @V407508 02028000
  2226. CLC LPUADDR,0(R2) IS SYSTEM LOCK HELD BY THIS PROC?@V407508 02029000
  2227. BER R9 YES, RETURN TO CALLER @V407508 02030000
  2228. GETSYS DS 0H TRY TO GET SYSTEM LOCK @V407508 02031000
  2229. LOCK OBTAIN,TYPE=SYS,SPIN=NO TRY TO GET SYSTEM LOCK @V407508 02032000
  2230. BR R9 RETURN TO CALLER @V407508 02033000
  2231. * 02034000
  2232. FREESYS DS 0H RELEASE SYSTEM LOCK @V407508 02035000
  2233. LOCK RELEASE,TYPE=SYS RELEASE SYSTEM LOCK @V407508 02036000
  2234. BR R9 RETURN TO CALLER @V407508 02037000
  2235. .UPTST16 ANOP **ANOP** 02037100
  2236. * 02038000
  2237. GETRACE DS 0H GET CURRENT TRACE TABLE ENTRY %V407508 02039000
  2238. TRACE CODE=(R14),R15,R2,R3 GET CURRENT TRACE ENTRY %V407508 02040000
  2239. BR R1 RETURN TO CALLER %V4M0017 02041000
  2240. EJECT 02042000
  2241. AIF (NOT &AP).UPTST17 **AIF*** 02042900
  2242. * 02043000
  2243. STKDEF DS 0H 02044000
  2244. TM VMPEND,VMDEFSTK IS A DEFERRED TASK PENDING @V407508 02045000
  2245. BOR R9 YES, RETURN TO CALLER @V407508 02046000
  2246. L R1,VMDFTPNT GET ADDR OF DEFERRED TASK BLOK @V407508 02047000
  2247. USING CPEXBLOK,R1 GET ADDRESSABILITY TO DEF TASK @V407508 02048000
  2248. STM R0,R15,CPEXREGS SAVE CURRENT REGS @V407508 02049000
  2249. L R2,ADSPCH GET ADDR OF DSP MAIN ENTRY @V407508 02050000
  2250. ST R2,CPEXADD SET UP RETURN ADDR FOR DEF TASK @V407508 02051000
  2251. CALL DMKSTKDE STACK DEFERRED TASK @V407508 02052000
  2252. DROP R1 @V407508 02053000
  2253. BR R9 RETURN TO CALLER @V407508 02054000
  2254. EJECT 02071000
  2255. * 02072000
  2256. XTNDAP DS 0H AP-ONLY EXTEND PROCESSING @V407508 02073000
  2257. C R11,LASTUSER IS LASTUSER EQUAL TO ASYSVM? @V407508 02074000
  2258. BER R9 YES, RETURN TO CALLER @V407508 02075000
  2259. L R11,LASTUSER SWITCH R11TO LASTUSER @V4M0173 02076000
  2260. CHARGE START START CHARGING LASTUSER @V4M0173 02077000
  2261. CALL DMKVMASH CHECK FOR CHANGED PAGES @V407508 02078000
  2262. NOUNSHR DS 0H @V4M0136 02082000
  2263. CHARGE STOP STOP CHARGING LASTUSER @V4M0173 02083000
  2264. L R11,ASYSVM SWITCH R11 TO SYSTEM VMBLOK @V4M0173 02084000
  2265. L R1,LASTUSER GET VALUE OF LASTUSER @V407508 02085000
  2266. BAL R8,UNLOKVM2 UNLOCK LASTUSER @V407508 02086000
  2267. ST R11,LASTUSER SET LASTUSER TO ASYSVM @V407508 02087000
  2268. BR R9 RETURN TO CALLER @V407508 02088000
  2269. .UPTST17 ANOP **ANOP** 02088100
  2270. * 02089000
  2271. INCPROBT DS 0H INCREMENT PROBLEM STATE TIME %V407508 02090000
  2272. CLC VMTMOUTQ,PROBSTRT HAS CALCULATION BEEN DONE? %VA07582 02090100
  2273. BER R8 YES, RETURN TO CALLER %VA07582 02090200
  2274. LM R2,R3,VMTMOUTQ GET TIMER AT PROBLEM STATE END %V407508 02091000
  2275. LM R4,R5,PROBSTRT GET TIMER AT PROBLEM STATE START %V407508 02092000
  2276. SLR R5,R3 CALC 2ND HALF OF ELAPSED TIME %V407508 02093000
  2277. BNM *+6 WAS THERE A CARRY? %V407508 02094000
  2278. BCTR R4,0 NO CARRY, SIGNIFICANT DIFFERENCE %V407508 02095000
  2279. SLR R4,R2 CALC 1ST HALF OF ELAPSED TIME %V407508 02096000
  2280. LM R2,R3,PROBTIME GET TOTAL PROBLEM TIME %V4M0142 02097000
  2281. SLR R3,R5 SUBTRCT 2ND HALF OF ELAPSED TIME %V4M0142 02098000
  2282. BNM *+6 WAS THERE A CARRY? %V4M0142 02099000
  2283. BCTR R2,0 NO CARRY, SIGNIFICANT DIFFERENCE %V4M0142 02100000
  2284. SLR R2,R4 SUBTRCT 1ST HALF OF ELAPSED TIME %V4M0142 02101000
  2285. STM R2,R3,PROBTIME STORE NEW TOTAL PROBLEM TIME %V4M0142 02102000
  2286. BR R8 RETURN TO CALLER %V407508 02103000
  2287. EJECT 02104000
  2288. AIF (NOT &AP).UPTST18 **AIF*** 02104900
  2289. * 02105000
  2290. FINDPTSK DS 0H FIND PRIORITY CPEXBLOK FOR VM @V4M0141 02106000
  2291. * R1=VM ADDR; R15=DSP STACK ADDR @V407508 02107000
  2292. USING CPEXBLOK,R14 USE R14 AS BASE FOR CPEXBLOK @V407508 02108000
  2293. LR R14,R15 LOAD POINTER TO START SEARCH @V407508 02109000
  2294. FNDNXTP DS 0H @V407508 02110000
  2295. L R14,CPEXFPNT GET FIRST/NEXT CPEXBLOK @V407508 02111000
  2296. CR R14,R15 ANY CPEXBLOKS LEFT? @V407508 02112000
  2297. BE DOWN NO, TERMINATE VM/370 @V4M0136 02113000
  2298. C R1,CPEXR11 IS CPEXBLOK FOR THIS VM? @V407508 02114000
  2299. BNE FNDNXTP NO, GO GET NEXT CPEXBLOK @V407508 02115000
  2300. TM CPEXTYPE,CPEXPRIO IS THIS A PRIORITY CPEXBLOK? @V4M0141 02116000
  2301. BNO FNDNXTP NO, GO GET NEXT CPEXBLOK @V407508 02117000
  2302. LH R8,CPEXPROC GET ADDR OF RELATED PROCESSOR @V407508 02118000
  2303. LTR R8,R8 IS THERE A RELATED PROCESSOR @VA07402 02118100
  2304. BZ PICKCPEX NO, TAKE THIS CPEXBLOK @VA07402 02118300
  2305. CH R8,LPUADDR IS THIS THE RELATED PROCESSOR @V407508 02119000
  2306. BNE SIGNLDSP NO, GO ISSUE DISPATCH SIGNAL @V4M0136 02120000
  2307. LR R2,R14 GET ADDRESS OF THIS CPEXBLOK @V407508 02121000
  2308. B PROCCP GO PROCESS THIS CPEXBLOK @V407508 02122000
  2309. * 02123000
  2310. FINDIOB DS 0H FIND IO OR TRQ REQUEST @V407508 02124000
  2311. * R1=VM ADDR; R15=DSP STACK ADDR @V407508 02125000
  2312. USING IOBLOK,R14 USE R14 AS BASE FOR IOBLOK @V407508 02126000
  2313. LR R14,R15 LOAD POINTER TO START SEARCH @V407508 02127000
  2314. FNDNXTI DS 0H @V407508 02128000
  2315. L R14,IOBFPNT GET FIRST/NEXT IOBLOK @V407508 02129000
  2316. CR R14,R15 ANY IOBLOKS LEFT? @V407508 02130000
  2317. BER R9 NO, RETURN TO CALLER @V407508 02131000
  2318. C R1,IOBUSER IS IOBLOK FOR THIS VM? @V407508 02132000
  2319. BNE FNDNXTI NO, GO GET NEXT IOBLOK @V407508 02133000
  2320. LR R10,R14 GET ADDRESS OF THIS IOBLOK @V407508 02134000
  2321. B PROCIOB GO PROCESS THIS IOBLOK @V407508 02135000
  2322. * 02136000
  2323. FINDCP DS 0H FIND CPEXBLOK @V407508 02137000
  2324. * R1=VM ADDR; R15=DSP STACK ADDR @V407508 02138000
  2325. USING CPEXBLOK,R14 USE R14 AS BASE FOR CPEXBLOK @V407508 02139000
  2326. LR R14,R15 LOAD POINTER TO START SEARCH @V407508 02140000
  2327. FNDNXTC DS 0H @V407508 02141000
  2328. L R14,CPEXFPNT GET FIRST/NEXT CPEXBLOK @V407508 02142000
  2329. CR R14,R2 ANY PRIOR CPEXBLOKS LEFT? @V4M0141 02143000
  2330. BER R9 NO, RETURN TO CALLER @V407508 02144000
  2331. C R1,CPEXR11 IS CPEXBLOK FOR THIS VM? @V407508 02145000
  2332. BNE FNDNXTC NO, GO GET NEXT CPEXBLOK @V407508 02146000
  2333. TM CPEXTYPE,CPEXDEFR+CPEXPRIO IS IT A NORMAL BLOK? @V4M0141 02147000
  2334. BNZ FNDNXTC NO, GO GET NEXT CPEXBLOK @V407508 02148000
  2335. LH R8,CPEXPROC GET ADDR OF RELATED PROC, IF ANY @V4M0141 02149000
  2336. LTR R8,R8 IS THERE A RELATED PROC? @V4M0141 02150000
  2337. BZ PICKCPEX NO, TAKE THIS CPEXBLOK @V4M0141 02151000
  2338. CH R8,LPUADDRX IS IT STACKED FOR OTHER PROC? @V4M0141 02152000
  2339. BE FNDNXTC YES, GO GET NEXT CPEXBLOK @V4M0141 02153000
  2340. PICKCPEX DS 0H @V4M0141 02154000
  2341. LR R2,R14 GET ADDRESS OF THIS CPEXBLOK @V407508 02155000
  2342. B PROCCP GO PROCESS THIS CPEXBLOK @V407508 02156000
  2343. DROP R14 STOP USING R14 AS BASE @V407508 02157000
  2344. * 02158000
  2345. FNDPBLOK DS 0H FIND 1ST PRIORITY BLOK FOR PROC @V4M0141 02159000
  2346. BAL R9,LOCKOBDS GET LOCK ON DISPATCH STACKS @VA09257 02160000
  2347. LA R15,DMKDSPRQ GET ADDRESS OF DSP STACKS @V407508 02161000
  2348. LR R2,R15 LOAD POINTER TO START SEARCH @V407508 02162000
  2349. USING CPEXBLOK,R2 USE R2 AS BASE FOR CPEXBLOK @V407508 02163000
  2350. NXTP DS 0H @V407508 02164000
  2351. L R2,CPEXFPNT GET FIRST/NEXT CPEXBLOK @V407508 02165000
  2352. CR R2,R15 ANY CPEXBLOKS LEFT? @V407508 02166000
  2353. BE DOWN NO, TERMINATE VM/370 @V407508 02167000
  2354. TM CPEXTYPE,CPEXPRIO IS THIS A PRIORITY CPEXBLOK @V4M0141 02168000
  2355. BNO NXTP NO, GO GET NEXT CPEXBLOK @V407508 02169000
  2356. CLC LPUADDR,CPEXPROC IS THIS THE RELATED PROCESSOR? @V407508 02170000
  2357. BNE NXTP NO, GO GET NEXT CPEXBLOK @V407508 02171000
  2358. L R1,CPEXR11 GET ADDRESS OF ASSOCIATED VM @V407508 02172000
  2359. BAL R9,LOCKVM TRY TO LOCK THIS VM @V407508 02173000
  2360. BZ PROCCP GO PROCESS THIS CPEXBLOK @V407508 02174000
  2361. DROP R2 STOP USING R2 AS CPEXBLOK BASE @V407508 02175000
  2362. DOWN DS 0H TERMINATE VM/370 @V407508 02176000
  2363. ABEND 5 EXPECTED BLOK NOT FOUND @V407508 02177000
  2364. .UPTST18 ANOP **ANOP** 02177100
  2365. EJECT 02178000
  2366. *. 02179000
  2367. * 02180000
  2368. * OPERATION - 02181000
  2369. * 02182000
  2370. * H. SELECT A USER FOR DISPATCHING 02183000
  2371. * 1. IF THE SYSTEM IS LOCKED FOR RUNNING USERS DUE TO EXTEND, 02184000
  2372. * CPFRELK BEING SET, OR CPSHRLK BEING SET, GO TO STEP 4 TO 02185000
  2373. * LOAD A WAIT STATE. 02186000
  2374. * 2. SCAN THE RUN LIST FOR A DISPATCHABLE CANDIDATE - THAT IS, A 02187000
  2375. * RUNNABLE VM THAT EITHER HAS NO AFFINITY OR AFFINITY TO THE 02188000
  2376. * CURRENT PROCESSOR. TRY TO LOCK THIS VM, IF THE LOCK IS NOT 02189000
  2377. * AVAILABLE, LOOK FOR ANOTHER CANDIDATE. IF THE RUN LIST IS 02190000
  2378. * EXHAUSTED BEFORE A CANDIDATE IS FOUND, GO TO STEP 4 TO LOAD 02191000
  2379. * A WAIT STATE. 02192000
  2380. * 3. ONCE A VM IS LOCKED, CALL DMKVMASH IF NECESSARY TO CHECK 02193000
  2381. * FOR SHARED SYSTEM VIOLATION; SET UP DISPATCH TIME SLICE; 02194000
  2382. * LOAD FLOATING POINT REGS; BUILD RUNPSW, RUNCR0, AND RUNCR1; 02195000
  2383. * CALL DMKVATAB IF SHADOW TABLES ARE BAD; SET UP FOR PER (IF 02196000
  2384. * PER TRACING IS ACTIVE); AND SET UP FOR ASSIST. BEFORE THE 02197000
  2385. * ACTUAL DISPATCH OF THIS VM, PERFORM THE FOLLOWING ADDITIONAL 02198000
  2386. * TASKS: WAKE-UP THE OTHER PROCESSOR, IF IT IS IDLE; ISSUE A 02199000
  2387. * PTLB IF REQUIRED; AND SET THE CLOCK COMPARATOR IF NECESSARY. 02200000
  2388. * THEN DISPATCH THE VM BY LOADING THE TIMERS, CONTROL 02201000
  2389. * REGISTERS, GENERAL REGISTERS, AND PSW. 02202000
  2390. * 4. IF THE SYSTEM IS EXTENDING OR IF CPSHRLK IS SET, OR IF 02203000
  2391. * THERE IS NO DISPATCHABLE USER ON THE RUN LIST, LOAD A WAIT 02204000
  2392. * STAT ENABLED FOR EXTERNAL AND I/O INTERRUPTS. IF THIS 02205000
  2393. * PROCESSOR IS BEING QUIESCED OF IF CPFRELK IS SET, LOAD A 02206000
  2394. * WAIT ENABLED ONLY FOR EXTERNAL INTERRUPTS. 02207000
  2395. * 02208000
  2396. *. 02209000
  2397. SPACE 2 02210000
  2398. DONE DS 0H PREPARE TO SEARCH RUN LIST @V407508 02211000
  2399. BAL R9,LOCKRLDS RELEASE LOCK ON DSP STACKS @VA09257 02212100
  2400. DONE2 DS 0H %V4M0173 02213000
  2401. AIF (NOT &AP).UPTST19 **AIF*** 02213900
  2402. * IN UP-MODE, SUBROUTINE FREESYS IS A NO-OP. 02214000
  2403. BAL R9,FREESYS RELEASE THE SYSTEM LOCK %V407508 02215000
  2404. .UPTST19 ANOP **ANOP** 02215100
  2405. SPACE 2 02216000
  2406. CKUSERS DS 0H %V407508 02217000
  2407. AIF (&AP).APBR8 **AIF*** 02217100
  2408. CLI XTNDLOCK,SET IS SYSTEM IN EXTEND? %VA07369 02217200
  2409. AGO .UPBR8 **AGO*** 02217300
  2410. .APBR8 ANOP **ANOP** 02217400
  2411. L R2,PREFIXA GET PROCESSOR PREFIX ADDRESS %V407508 02218000
  2412. CLI XTNDLOCK-PSA(R2),SET IS SYSTEM IN EXTEND? %V407508 02219000
  2413. .UPBR8 ANOP **ANOP** 02219100
  2414. BE LOADIDLE YES, GO LOAD A WAIT %V4M0006 02220000
  2415. CKUSERS2 DS 0H %V407508 02221000
  2416. AIF (NOT &AP).UPTST20 **AIF*** 02221900
  2417. * IN UP-MODE, FLAG CPFRELK IS NEVER ON. 02222000
  2418. CLI CPFRELK-PSA(R2),SET IS CPFRELK FLAG ON? %V407508 02223000
  2419. BE IDLEB YES, GO LOAD A WAIT %V4M0006 02224000
  2420. .UPTST20 ANOP **ANOP** 02224100
  2421. TM CPSTAT2,CPSHRLK LOCKED FOR RUNUSERS? %V408246 02225000
  2422. * THE FOLLOWING INSTRUCTION IS NOT PERFORMED BY ECPS. 02226000
  2423. BO LOADIDLE YES %V408246 02227000
  2424. * RATHER ECPS DOES THE FOLLOWING: 02228000
  2425. * BO IDLEECPS YES %V407508 02229000
  2426. AIF (NOT &AP).UPTST21 **AIF*** 02229900
  2427. LOCKRL DS 0H %V407508 02250000
  2428. LOCK OBTAIN,TYPE=RL GET LOCK ON RUNLIST %V407508 02251000
  2429. .UPTST21 ANOP **ANOP** 02251100
  2430. L R10,SCHRLOC GET IN-Q VMBLOK LIST ANCHOR %V407508 02252000
  2431. LR R1,R10 LOAD POINTER TO START SEARCH %V407508 02253000
  2432. DROP R11 STOP USING R11 AS VMBLOK BASE %V407508 02254000
  2433. USING VMBLOK,R1 USE R1 AS BASE FOR VMBLOK %V407508 02255000
  2434. AIF (NOT &AP).UPTST22 **AIF*** 02255900
  2435. * THE FLAG IN TEMPSAVE IS NOT MAINTAINED BY ECPS. 02256000
  2436. MVI TEMPSAVE,NONE INIT FLAG TO WAKE-UP OTHER PROC %V4M0001 02257000
  2437. .UPTST22 ANOP **ANOP** 02257100
  2438. FNDUSRA DS 0H %V407508 02258000
  2439. L R1,VMQFPNT GET FIRST/NEXT VMBLOK ON RUNLIST %V407508 02259000
  2440. CR R1,R10 ANY VMBLOKS LEFT? %V407508 02260000
  2441. * THE FOLLOWING INSTRUCTION IS NOT PERFORMED BY ECPS. 02261000
  2442. BE IDLEA NO, GO LOAD A WAIT %V407508 02262000
  2443. * RATHER ECPS DOES THE FOLLOWING: 02263000
  2444. * BE IDLEECPS NO, GO LOAD A WAIT %V407508 02264000
  2445. TM VMDSTAT,VMRUN IS THIS VM RUNNABLE? %V407508 02265000
  2446. BZ FNDUSRA NO, GO GET NEXT VMBLOK %V407508 02266000
  2447. TM VMRSTAT,VMCPWAIT ARE ANY RSTAT FLAGS STILL ON? %V407508 02267000
  2448. BNZ FNDUSRA YES, GO GET NEXT VMBLOK %V407508 02268000
  2449. AIF (NOT &AP).UPTST23 **AIF*** 02268900
  2450. TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? %V4M0173 02269000
  2451. BZ FREELOCK NO, SELECT THIS USER TO RUN %V4M0173 02270000
  2452. TM VMPEND,VMDEFSTK IS A DEFERRED TASK PENDING? @V4M0173 02271000
  2453. BO FNDUSRA YES, SKIP THIS VM @V4M0173 02272000
  2454. TM VMAFF,VMAFFON DOES VM HAVE AFFINITY? @V407508 02273000
  2455. BNO GETLOCK NO, TRY TO LOCK THIS VMBLOK @V4M0155 02274000
  2456. CLC VMAFF,LPUADDR+1 IS AFF FOR THIS PROC? @V407508 02275000
  2457. BE GETLOCK YES, TRY TO LOCK THIS VMBLOK @V4M0155 02276000
  2458. MVI TEMPSAVE,SET SET FLAG TO WAKE-UP OTHER PROC @V4M0155 02277000
  2459. B FNDUSRA GO GET NEXT VMBLOK @V4M0155 02278000
  2460. SPACE 02279000
  2461. GETLOCK DS 0H @V407508 02280000
  2462. L R2,VMSTKCNT GET COUNT OF STACKED BLOCKS @V4M0173 02281000
  2463. LTR R2,R2 ARE ANY BLOCKS STACKED FOR VM? @V4M0173 02282000
  2464. BNZ FNDUSRA SKIP VM IF THERE ARE BLOCKS @V4M0136 02283000
  2465. BAL R9,LOCKVM TRY TO LOCK THIS VM @V407508 02284000
  2466. BNZ FNDUSRA LOCK NOT OBTAINED, GET NEXT VM @V407508 02285000
  2467. TM VMDSTAT,VMRUN IS VM REALLY RUNNABLE? @V407508 02286000
  2468. BNO FREEVM NO, UNLOCK THIS VM & GET ANOTHER @V407508 02287000
  2469. TM VMRSTAT,VMCPWAIT ARE ANY RSTAT FLAGS STILL ON? @V407508 02288000
  2470. BNZ FREEVM YES, GO UNLOCK THIS VM @V407508 02289000
  2471. TM VMPEND,VMDEFSTK IS A DEFERRD TASK PENDING? @V407508 02290000
  2472. BO FREEVM YES, UNLOCK THIS VM @V407508 02291000
  2473. L R2,VMSTKCNT GET COUNT OF STACKED BLOCKS? @V4M0173 02292000
  2474. LTR R2,R2 ARE ANY BLOCKS STACKED FOR VM? @V4M0173 02293000
  2475. BZ FREELOCK NO, SELECT THIS VM @V407508 02294000
  2476. FREEVM DS 0H @V407508 02295000
  2477. BAL R8,UNLOKVM1 UNLOCK VM FROM RUNLIST @V4M0136 02296000
  2478. B FNDUSRA GO GET NEXT VMBLOK ON LIST @V407508 02297000
  2479. .UPTST23 ANOP **ANOP** 02297100
  2480. SPACE 02298000
  2481. * ECPS:VM/370 DSP2 EXIT IF VMNOECPS BYTE IS NON-ZERO @VMD0134 02298100
  2482. FREELOCK DS 0H %V407508 02299000
  2483. LR R10,R1 SAVE VMBLOK JUST SELECTED %V407508 02300000
  2484. DROP R1 STOP USING R1 AS BASE FOR VMBLOK %V407508 02301000
  2485. LOCK RELEASE,TYPE=RL RELEASE RUNLIST LOCK %V407508 02302000
  2486. C R10,RUNUSER IS NEW VM SAME AS RUNUSER? %V407508 02303000
  2487. BNE FNDUSRD NO, NO CHANCE FOR FAST DISPATCH %V407508 02304000
  2488. USING VMBLOK,R10 USE R10 AS BASE FOR VMBLOK %V407508 02305000
  2489. L R0,QUANTUM RESIDUAL SLICE %V408246 02306000
  2490. LTR R0,R0 ANY? %V408246 02307000
  2491. BM GETQS NO %V408246 02308000
  2492. * THE FOLLOWING FAST RE-DISPATCH INSTRUCTIONS ARE NOT 02309000
  2493. * IMPLEMENTED BY ECPS. IF THERE IS TIME REMAINING IN THE 02310000
  2494. * TIMESLICE, ECPS BRANCHES TO SETQUANT. 02311000
  2495. AIF (NOT &AP).UPTST24 **AIF*** 02311900
  2496. C R10,LASTUSER IS RUNUSER = LASTUSER @V407508 02312000
  2497. BE TSTFAST YES, SEE IF O.K. FOR FAST DISP @V407508 02313000
  2498. CLC VMLSTPRC,LPUADDR+1 WAS VM LAST RUN ON THIS PROC @V407508 02314000
  2499. BNE SETQUANT NO, TAKE NORMAL PATH @V407508 02315000
  2500. ST R10,LASTUSER RESET LASTUSER FOR REDISPATCH @V407508 02316000
  2501. TSTFAST DS 0H TEST FOR FAST DISPATCH @V407508 02317000
  2502. .UPTST24 ANOP **ANOP** 02317100
  2503. TM VMDSTAT,VMDSP+VMRUN+VMINQ EVERYTHING IN ORDER? @V408246 02318000
  2504. BNO SETQUANT NO, TAKE NORMAL PATH @V408246 02319000
  2505. TM IOOPSW,4 VIRT. PSW IN I/O OLD? @V408246 02320000
  2506. BNO SETQUANT NO @V408246 02321000
  2507. ST R0,TIMER SET REMAINING TIME SLICE @V408246 02322000
  2508. LM R0,R1,IOOPSW INTERRUPTED PSW @V408246 02323000
  2509. MVI IOOPSW,0 FLAG I/O OLD PSW NOT VIRTUAL @V408246 02324000
  2510. DROP R10 STOP USING R10 AS VMBLOK BASE @V407508 02325000
  2511. USING VMBLOK,R11 USE R11 AS VMBLOK BASE @V407508 02326000
  2512. LR R11,R10 SWITCH R11 TO NEW VM @V4M0173 02327000
  2513. CHARGE START START CHARGING THIS VMBLOK @V4M0173 02328000
  2514. L R15,VMMICRO SET UP TO GET MICBLOK ADDRESS @VA06300 02328100
  2515. LA R15,0(R15) GET MICBLOK ADDRESS, IF ANY @VA06300 02328200
  2516. LTR R15,R15 SEE IF MICBLOK EXISTS @VA06300 02328300
  2517. BZ NOVMA NO, SKIP PENDING INTERRUPT CHECK @VA06300 02328400
  2518. BAL R9,CHKPENDG GO SEE IF MICPEND SHOULD BE SET @VA06300 02328500
  2519. NOVMA DS 0H @VA06300 02328600
  2520. MVI CPSTATUS,CPRUN+CPSUPER SET FLAG FOR RUNNING VM @V407508 02329000
  2521. MVC PROBSTRT,VMTMOUTQ SAVE TIMER AT PROB STATE STRT @V4M0136 02330000
  2522. B DMKDSPA2 SET C.C. AND CONTROL REGS @V408246 02331000
  2523. SPACE 02332000
  2524. FNDUSRD DS 0H %V408246 02333000
  2525. L R2,RUNUSER GET ADDRESS OF LAST RUNNING VM %V407508 02334000
  2526. AIF (NOT &AP).UPTST25 **AIF*** 02334900
  2527. C R2,LASTUSER IS RUNUSER STILL LOCKED? %V407508 02335000
  2528. BNE *+8 NO, LEAVE FLAG ALONE %V407508 02336000
  2529. .UPTST25 ANOP **ANOP** 02336100
  2530. NI VMDSTAT-VMBLOK(R2),X'FF'-VMDSP RESET FLAG %V407508 02337000
  2531. L R2,LASTUSER GET LASTUSER %V407508 02338000
  2532. CR R2,R11 IS LASTUSER = ASYSVM? %V407508 02339000
  2533. BE GETQS YES, LASTUSER ALREADY UNLOCKED %V407508 02340000
  2534. CR R2,R10 IS THIS A SWITCH FROM LASTUSER? %V4M0136 02341000
  2535. BE GETQS NO, NO NEED TO CHECK LASTUSER %V4M0136 02342000
  2536. TM VMOSTAT-VMBLOK(R2),VMSHR WAS LASTUSER SHARED? %V407508 02343000
  2537. BNO FRELAST NO, GO UNLOCK LASTUSER %V407508 02344000
  2538. LR R11,R2 SWITCH R11 TO LASTUSER %V4M0173 02345000
  2539. CHARGE START START CHARGING LASTUSER %V4M0173 02346000
  2540. CKSHRSYS CALL DMKVMASH CHECK FOR CHANGED PAGE %V408246 02347000
  2541. CHARGE STOP STOP CHARGING LASTUSER %V4M0173 02360000
  2542. FRELAST DS 0H %V407508 02361000
  2543. AIF (NOT &AP).UPTST28 **AIF*** 02361900
  2544. L R1,LASTUSER GET ADDRESS OF LASTUSER %V407508 02362000
  2545. * IN UP-MODE, SUBROUTINE UNLOKVM2 IS A NO-OP. 02363000
  2546. BAL R8,UNLOKVM2 UNLOCK LASTUSER %V407508 02364000
  2547. .UPTST28 ANOP **ANOP** 02364100
  2548. GETQS DS 0H %V408246 02365000
  2549. L R0,DMKDSPQS GET FULL TIMESLICE %V408246 02366000
  2550. TM VMQLEVEL-VMBLOK(R10),VMCOMP COMPUTE BOUND? %V407508 02367000
  2551. BZ *+8 NO -- %V408246 02368000
  2552. SLL R0,2 YES - QUADRUPLE SLIICEI %V408246 02369000
  2553. SETQUANT DS 0H %V408246 02370000
  2554. ST R0,TIMER SET QUANTUM %V408246 02371000
  2555. LR R11,R10 SWITCH R11 TO NEW VM %V4M0173 02372000
  2556. CHARGE START START CHARGING THIS VMBLOK %V4M0173 02373000
  2557. ST R11,LASTUSER SET LASTUSER %V407508 02374000
  2558. AIF (NOT &AP).UPTST29 **AIF*** 02374900
  2559. * VMLSTPRC IS ALWAYS 0 WHEN THE SYSTEM IS RUNNING ON A 02375000
  2560. * PROCESSOR WITHOUT THE MULTI-PROCESSING FEATURE. 02376000
  2561. MVC VMLSTPRC,LPUADDR+1 INDICATE VM RUN ON THIS PROC %V407508 02377000
  2562. .UPTST29 ANOP **ANOP** 02377100
  2563. ST R11,RUNUSER SET RUNUSER %V4M0173 02380000
  2564. AIF (NOT &FLOATPT).FPR1 %V407508 02381000
  2565. LD Y0,VMFPRS LOAD FLOAT REGS FROM NEW VM %V407508 02382000
  2566. LD Y2,VMFPRS+8 .. %V407508 02383000
  2567. LD Y4,VMFPRS+16 .. %V407508 02384000
  2568. LD Y6,VMFPRS+24 .. %V407508 02385000
  2569. .FPR1 ANOP %V407508 02386000
  2570. NOFPRS DS 0H %V4M0173 02387000
  2571. EJECT 02388000
  2572. *---------------------------------------------------------------------* 02389000
  2573. * NOW THE ACTUAL DISPATCHING PSW IS BUILT FROM DATA IN * 02390000
  2574. * THE "VMPSW" AND STATUS SWITCHES INDICATING THE PSW * 02391000
  2575. * FORMAT, REQUESTED EXTENDED FEATURES, ETC. IF DISPATCH * 02392000
  2576. * TRACING IS ENABLED, THE RUNNING PSW AND VMBLOK ADDRESS * 02393000
  2577. * WILL BE TRACED BEFORE THE CONTROL REGISTERS ARE LOADED * 02394000
  2578. * FOR THE USER'S DISPATCH. IF VM ASSIST IS ON, SETUP IS DONE * 02395000
  2579. * FOR CONTROL REGISTER 6 AND THE MICBLOK. * 02396000
  2580. *---------------------------------------------------------------------* 02397000
  2581. L R1,VMPSW+4 GET NEW PSW ADDRESS %V3M4038 02398000
  2582. ST R1,RUNPSW+4 START BUILDING PSW FOR DISPATCH %V3M4038 02399000
  2583. SLR R0,R0 %V3M4038 02400000
  2584. ICM R0,B'0100',VMPSW+1 GET USER KEY AND EMWP BITS %V3M4038 02401000
  2585. O R0,=X'070D0000' ADD TRAN+IO+EXT+ECMODE+PROB+MC %V3M4038 02402000
  2586. TM VMESTAT,VMEXTCM VIRTUAL MACHINE IN EC-MODE ? %V3M4038 02403000
  2587. BO LOADEXT YES - FINISH HIS PSW %V3M4038 02404000
  2588. MVI RUNPSW+4,X'00' STRIP OFF ILC, CC, PGM MASK %V3M4038 02405000
  2589. NI VMPSW+4,X'3F' THROW AWAY HIS ILC BITS %V3M4038 02406000
  2590. ICM R0,B'0010',VMPSW+4 ...ADD CC, PGM MASK TO PSW %V3M4038 02407000
  2591. B HALFPSW SAVE FIRST HALF OF PSW %V3M4038 02408000
  2592. SPACE 02409000
  2593. LOADEXT EQU * LOAD EXTENDED-MODE PSW %V3M4038 02410000
  2594. O R0,VMPSW ADD HIS CC, PGM MASK %V3M4038 02411000
  2595. HALFPSW ST R0,RUNPSW SET FIRST WORD OF PSW %V3M4038 02412000
  2596. SPACE 02413000
  2597. PERHAPS DS 0H %V408246 02414000
  2598. NI VMMCR6,255-(VMMSHADT+VMMPROB+VMMNOSK+VMMFE) %V408246 02415000
  2599. L R0,CPCREG0 ASSUME VM/370 ARCHITECTURE %V3M4038 02416000
  2600. L R1,VMSEG AND 2'ND LEVEL MEMORY %V3M4038 02417000
  2601. TM VMPSTAT,VMV370R ARE EC-REGS. PRESENT %V3M4038 02418000
  2602. BZ SETCREGS NO - STANDARD VM/370 CREGS %V3M4038 02419000
  2603. L R2,VMECEXT EC-REGS. ARE IN THE ECBLOK %V3M4038 02420000
  2604. USING ECBLOK,R2 %V3M4038 02421000
  2605. LCTL C4,C13,EXTCR4 LOAD USER'S VALUES IN REAL CREGS %V3M4038 02422000
  2606. TM VMESTAT,VMEXTCM ALSO IN EC-MODE NOW ? %V3M4038 02423000
  2607. BZ CHKRUNE NO - STANDARD VM/370 CREGS 0-1 %V3M4038 02424000
  2608. TM VMESTAT,VMINVSEG+VMNEWCR0 UNHEALTHY SITUATION %V3M4038 02425000
  2609. BZ CHKTRAN BUT WE REALLY CAN'T HAVE IT %V3M4038 02426000
  2610. ABEND 2 HOW DID WE GET HERE, ANYWAY ??? 02427000
  2611. CHKTRAN TM VMPSW,TRANMODE IN VIRTUAL TRANSLATE MODE ? %V3M4038 02428000
  2612. BZ CHKRUNE NO, USE STAN. VM/370 ARCHITECTURE%V3M4038 02429000
  2613. L R0,EXTSHCR0 ELSE GET USER'S ARCHITECTURE %V3M4038 02430000
  2614. L R1,EXTSHCR1 AND HIS 3'RD LEVEL MEMORY. %V3M4038 02431000
  2615. OI VMMCR6,VMMSHADT TURN ON VMA SHADOW TABLE FLAG %V408246 02432000
  2616. EJECT 02433000
  2617. DROP R2 %V3M4038 02434000
  2618. CHKRUNE TM VMESTAT,VMINVPAG+VMSHADT SHADOW TABLES BAD ?? %V3M4038 02435000
  2619. BNO SETCREGS IF NOT - READY TO DISPATCH HIM %V3M4038 02436000
  2620. CALL DMKVATAB INVALIDATE SHADOW PAGE TABLES %V3M4038 02437000
  2621. SPACE 02438000
  2622. SETCREGS ST R0,RUNCR0 SET UP FOR CONTROL REGISTER 0. %V3M4038 02439000
  2623. ST R1,RUNCR1 SET UP FOR CONTROL REGISTER 1. %V3M4038 02440000
  2624. NI VMESTAT,X'FF'-VMINVPAG RESET INVALID PAGE FLAG %V3M4038 02441000
  2625. TAKEOFF EQU * ALMOST READY TO DISPATCH HIM %V3M4038 02442000
  2626. TM VMTRCTL,VMTRPER IS "PER" TRACING ACTIVE ? %V3M4038 02443000
  2627. BZ RELPSW NO. %V3M4038 02444000
  2628. RELPER DS 0H %V3M4038 02445000
  2629. L R2,VMPERCTL TRACE EXTENSION % PER001 02446000
  2630. LCTL C9,C11,PERCR9-PERBLOK(R2) LOAD TRACE C-REGS % PER001 02447000
  2631. OI RUNPSW,PERMODE ENABLE PER IN RUNPSW %V3M4038 02448000
  2632. SPACE 02449000
  2633. RELPSW EQU * FINAL STRETCH BEFORE WE GO... %V3M4038 02450000
  2634. LA R9,TSTTRQ1 PREPARE FALL THROUGH ADDRESS %VA06300 02450100
  2635. OI VMDSTAT,VMDSP FLAG DISPATCHED RUNUSER %V3M4038 02451000
  2636. LA R6,CPCREG6 %V408246 02452000
  2637. TM CPSTAT2,CPMICON IS VMA ON FOR SYSTEM ? %V3M4038 02453000
  2638. BZ TSTTRQ NO - LEAVE CREG6 ZERO %V407508 02454000
  2639. ICM R15,B'0111',VMMADDR IS USER ASSIST ON ? %V3M4038 02455000
  2640. BZ TSTTRQ NO - LEAVE CREG6 ZERO %V407508 02456000
  2641. TM VMTRCTL,VMTRSVC+VMTRPRV+VMTRBRIN TRACING THESE? %V3M4038 02457000
  2642. BNZ TSTTRQ YES - LEAVE VM ASSIST OFF %V407508 02458000
  2643. OI VMMCR6,VMMFE TURN ON VMA ASSIST FOR USER %V3M4038 02459000
  2644. TM VMOSTAT,VMSHR RUNNING WITH SHARED SYSTEMS %V3M4038 02460000
  2645. BZ *+8 IF NOT, ALLOW ISK/SSK BY VMA %V3M4038 02461000
  2646. OI VMMCR6,VMMNOSK VMA NOT TO HANDLE ISK/SSK %V3M4038 02462000
  2647. TM VMPSW+1,PROBMODE USER IN PROBLEM STATE? %V3M4038 02463000
  2648. BZ *+8 NO..PROB BIT IS OK.. %V3M4038 02464000
  2649. OI VMMCR6,VMMPROB TURN ON PROBLEM BIT.. %V3M4038 02465000
  2650. LA R6,VMMICRO %V408246 02466000
  2651. USING MICBLOK,R15 R15 SET UP ABOVE (BY 'ICM') %V3M4038 02467000
  2652. CHKPENDG EQU * ENTRY FROM FAST DISPATCH %VA06300 02467100
  2653. SLR R4,R4 CLEAR MASK REG %V3M4038 02468000
  2654. * HERE TO CHECK FOR PENDING INTERRUPTS 02469000
  2655. NI MICVIP,255-MICPEND RESET PENDING INTERRUPT BIT %V3M4038 02470000
  2656. L R3,VMVCR0 ECBLOK POINTER %V3M4038 02471000
  2657. ICM R4,B'1100',VMIOINT PENDING INTERRUPT MASK %V3M4038 02472000
  2658. BZ PGPEND CHECK FOR PSEUDO PAGE FAULTS %V407508 02473000
  2659. TM VMESTAT,VMEXTCM USER IN EC MODE ? %V3M4038 02474000
  2660. BZ INTPEND NO..CAN'T CONTROL SYSTEM MASK %V3M4038 02475000
  2661. L R5,EXTCR2-ECBLOK(,R3) PICK UP I/O MASK BITS %V3M4038 02476000
  2662. NR R5,R4 LESS INTERRUPTS NOT PENDING %V3M4038 02477000
  2663. BNZ INTPEND MUST TURN ON INT PENDING BIT %V3M4038 02478000
  2664. PGPEND DS 0H CHECK FOR PSEUDO PAGE FAULTS %V407508 02479000
  2665. TM VMESTAT,VMEXTCM FIRST SEE IF EC-MODE %V407508 02480000
  2666. BZ EXPEND NO, CHECK FOR EXTERNL INTERRUPTS %V407508 02481000
  2667. TM VMPEND,VMPGPND IS A PSEUDO PAGE FAULT PENDING? %V407508 02482000
  2668. BO INTPEND TURN ON INTERRUPT PENDING BIT %V407508 02483000
  2669. EXPEND DS 0H CHECK FOR EXTERNAL INTERRUPTS %V407508 02484000
  2670. L R4,VMPXINT %V408246 02485000
  2671. LTR R4,R4 ANY EXT INT PENDING? %V408246 02486000
  2672. BZ TSTTRQ %V407508 02487000
  2673. TM VMPSTAT,VMV370R EC MODE MACHINE ? %V3M4038 02488000
  2674. BZ *+8 NO..CR0 ALREADY INTACT %V3M4038 02489000
  2675. L R3,EXTCR0-ECBLOK(,R3) PICK UP CR0 %V3M4038 02490000
  2676. B XPNMSK %V408246 02491000
  2677. USING XINTBLOK,R4 %V3M4038 02492000
  2678. XPNEXT EQU * %V3M4038 02493000
  2679. L R4,XINTNEXT POINTER TO NEXT BLOK %V3M4038 02494000
  2680. LTR R4,R4 PENDING EXT INTERRUPT? %V3M4038 02495000
  2681. BZ TSTTRQ ALL SET IF NO %V407508 02496000
  2682. XPNMSK DS 0H %V408246 02497000
  2683. LH R5,XINTMASK PENDING INTERRUPT MASK %V3M4038 02498000
  2684. NR R5,R3 LESS INTERRUPTS NOT PENDING %V3M4038 02499000
  2685. BZ XPNEXT LOOP THROUGH EXT BLOKS %V3M4038 02500000
  2686. INTPEND EQU * %V3M4038 02501000
  2687. OI MICVIP,MICPEND SET INTERRUPT PENDING.. %V3M4038 02502000
  2688. DROP R15,R4 %V3M4038 02503000
  2689. TSTTRQ DS 0H TEST FOR TRQ AND IDLE %V407508 02504000
  2690. BR R9 POSSIBLE EXIT TO FAST DISPATCH %VA06300 02504100
  2691. TSTTRQ1 EQU * %VA06300 02504200
  2692. AIF (NOT &AP).UPTST30 **AIF*** 02504900
  2693. TM APSTAT1,APUOPER IS THE AP OPERATIONAL? %V407508 02505000
  2694. BNO DSPTRC NO, SKIP TESTS FOR TRQ AND IDLE %V407508 02506000
  2695. TM VMPSTAT,VMV370R IS VM AN EC MODE MACHINE @V407508 02507000
  2696. BNO TSTIDLE @V407508 02508000
  2697. LOCK OBTAIN,TYPE=TR GET THE LOCK ON THE TRQ CHAIN @V407508 02509000
  2698. L R10,=A(DMKSCHTQ) GET ADDRESS OF TRQ CHAIN @V407508 02510000
  2699. USING TRQBLOK,R10 USE R10 AS BASE FOR TRQBLOK @V407508 02511000
  2700. L R10,TRQBFPNT GET FIRST TRQ ON CHAIN @V407508 02512000
  2701. C R11,TRQBUSER IS TRQ FOR THIS VM? @V407508 02513000
  2702. BNE FRETRQL NO, GO FREE THE TRQ LOCK @V407508 02514000
  2703. C R10,ACTIVTRQ IS THIS TRQ ACTIVE ON THIS PROC? @V407508 02515000
  2704. BE FRETRQL YES, GO FREE THE TRQ LOCK @V407508 02516000
  2705. SCKC TRQBVAL ELSE SET NEW CLK COMPARATOR REQ @V407508 02517000
  2706. ST R10,ACTIVTRQ INDICATE THIS TRQ IS ACTIVE @V407508 02518000
  2707. DROP R10 STOP USING R10 AS TRQBLOK BASE @V407508 02519000
  2708. FRETRQL DS 0H @V407508 02520000
  2709. LOCK RELEASE,TYPE=TR RELEASE THE TRQ LOCK @V407508 02521000
  2710. TSTIDLE DS 0H @V407508 02522000
  2711. MVI TEMPSAVE,NONE TURN OFF WAKE-UP FLAG @V4M0001 02523000
  2712. L R2,PREFIXB GET PREFIX VALUE OF OTHER PROC @V407508 02524000
  2713. CLI CPSTATUS-PSA(R2),CPWAIT IS OTHER PROC IN WAIT? @V4M0136 02525000
  2714. BNE DSPTRC NO, GO TRACE DISPATCH @V4M0136 02526000
  2715. BAL R9,WAKSIG WAKE UP IDLE PROC @VA09257 02527000
  2716. DSPTRC DS 0H %V407508 02528000
  2717. .UPTST30 ANOP **ANOP** 02528100
  2718. AIF (NOT &TRACE(9)).TR1 %V3M4038 02529000
  2719. TM TRACFLG2,TRAC0A TRACING ACTIVE? %V3M4038 02530000
  2720. BZ NOTRAC1 BRANCH IF NOT %V3M4038 02531000
  2721. * 02532000
  2722. * TRACE DISPATCH OF NEW USER 02533000
  2723. * 02534000
  2724. LA R14,TRCRUN SET CODE FOR DISPATCH OF USER %V407508 02535000
  2725. BAL R1,GETRACE GET CURRENT TRACE TABLE ENTRY %V4M0017 02536000
  2726. MVC ONE(THREE,R15),ZEROES CLEAR REST OF FIRST WORD %V4M0173 02537000
  2727. ST R11,4(0,R15) TRACE RUNUSER VMBLOK POINTER %V3M4038 02538000
  2728. MVC 8(8,R15),RUNPSW AND HIS PSW %V3M4038 02539000
  2729. NOTRAC1 EQU * %V407508 02540000
  2730. .TR1 ANOP 02541000
  2731. LCTL C6,C6,0(R6) LOAD APPROPRIATE VMA VALUE %V407508 02542000
  2732. SPACE 02543000
  2733. TM APSTAT2,CPPTLBR IS PTLB REQUIRED? %V407508 02544000
  2734. BNO MORE NO, CONTINUE WITH DISPATCH %V407508 02545000
  2735. NI APSTAT2,X'FF'-CPPTLBR RESET PTLB REQUIRED FLAG %VA07615 02546100
  2736. PTLB ISSUE PTLB %VA07615 02547100
  2737. MORE DS 0H %V407508 02548000
  2738. SLR R15,R15 CLEAR WORK REGISTER %V407508 02549000
  2739. ST R15,STACKVM INITIALIZE ADDR FOR DSP REENTRY %V407508 02550000
  2740. MVC PROBSTRT,VMTMOUTQ SAVE TIMER AT PROB STATE STRT %V407508 02551000
  2741. MVI IOOPSW,0 FLAG I/O PSW NOT VIRTUAL %V408246 02552000
  2742. MVC QUANTUM,TIMER CHECKPOINT TIMER AT ENTRY TO %V408246 02553000
  2743. * PROBLEM STATE 02554000
  2744. LDRPSW DS 0H %V408246 02555000
  2745. LCTL C0,C1,RUNCR0 SET-UP VIRT. MEMORY CREGS %V408246 02556000
  2746. MVI CPSTATUS,CPRUN SET RUNNING USER FLAG %V407508 02557000
  2747. CHARGE STOP STORE SUPERVISOR TIME FOR USER %V407508 02558000
  2748. SPT VMTMOUTQ GIVE USER REMAINING TIME LEFT %V3M4038 02559000
  2749. LM R0,R15,VMGPRS RESTORE USER REGISTERS %V3M4038 02560000
  2750. LPSW RUNPSW -------> %V3M4038 02561000
  2751. EJECT 02562000
  2752. AIF (NOT &AP).UPTST31 **AIF*** 02562900
  2753. * 02563000
  2754. * LOAD A WAIT ENABLED ONLY FOR EXTERNAL INTERRUPTS 02564000
  2755. * 02565000
  2756. IDLEB DS 0H @V407508 02566000
  2757. MVI CPSTAT3,CPTIDLE TURN ON IDLE WAIT FLAG @V407508 02567000
  2758. LM R0,R1,IDLEPSW GET WAIT STATE PSW @V407508 02568000
  2759. STM R0,R1,RUNPSW SAVE FOR WHEN LOADED @V407508 02569000
  2760. NI RUNPSW,X'FF'-IOMASK TURN OFF I/O MASK @V407508 02570000
  2761. MVC TIMER,FFS AVOID UNNECESSARY TIMER INTS @V407508 02571000
  2762. LA R1,IDLEWAIT GET ADDRESS OF TIMER FIELD @V407508 02572000
  2763. COUNT APWAITS INCREMENT COUNT OF AP-TYPE WAITS @V407508 02573000
  2764. ST R11,RUNUSER SET RUNUSER TO ASYSVM @V407508 02574000
  2765. MVC TEMPR0,CPCREG0 MOVE CR0 INTO WORKAREA @V4M0210 02575000
  2766. NC TEMPSAVE+2(2),NOCLK TURN OFF EXTRANEOUS BITS @V4M0136 02576000
  2767. OI TEMPSAVE+2,MFAMASK+EMSMASK+XCMASK INSURE MFA, @V4M0136 02577000
  2768. * EMS, AND XC BITS ARE ON @V4M0136 02578000
  2769. LCTL C0,C0,TEMPSAVE LOAD ALTERED CONTROL REG 0 @V4M0136 02579000
  2770. B SETWAIT GO TO LOAD WAIT @V407508 02580000
  2771. .UPTST31 ANOP **ANOP** 02580100
  2772. * 02581000
  2773. * LOAD A WAIT ENABLED FOR EXTERNAL & I/O INTERRUPTS 02582000
  2774. * 02583000
  2775. IDLEECPS DS 0H ECPS EXIT TO LOAD A WAIT STATE @V407508 02584000
  2776. L R11,ASYSVM SET R11 TO ASYSVM @V407508 02585000
  2777. B LOADIDLE CONTINUE WITH LOADING A WAIT @V407508 02586000
  2778. SPACE 02587000
  2779. IDLEA DS 0H COME HERE WHEN RUNLIST IS EMPTY @V407508 02588000
  2780. AIF (NOT &AP).UPTST32 **AIF*** 02588900
  2781. LOCK RELEASE,TYPE=RL RELEASE RUNLIST LOCK @V407508 02589000
  2782. CLI TEMPSAVE,SET SHOULD OTHER PROC BE AWOKEN? @V4M0001 02590000
  2783. BNE LOADIDLE NO, GO LOAD AN ENABLED WAIT @VA07840 02591000
  2784. MVI TEMPSAVE,NONE TURN OFF WAKE-UP FLAG @V4M0001 02592000
  2785. L R14,PREFIXB GET PREFIX VALUE OF OTHER PROC @V4M0001 02593000
  2786. BAL R9,WAKSIG SIGNAL THE OTH PROC @VA09257 02596000
  2787. .UPTST32 ANOP **ANOP** 02596950
  2788. LOADIDLE DS 0H NO TASKS CURRENTLY EXECUTABLE @V213235 02597000
  2789. L R2,RUNUSER GET ADDRESS OF RUNUSER @V407508 02598000
  2790. C R2,LASTUSER IS RUNUSER STILL LOCKED? @V407508 02599000
  2791. BNE *+8 NO, SKIP RESETTING OF FLAG @V407508 02600000
  2792. NI VMDSTAT-VMBLOK(R2),X'FF'-VMDSP RESET FLAG @V407508 02601000
  2793. ST R11,RUNUSER SET RUNUSER TO ASYSVM @V407508 02602000
  2794. AIF (NOT &AP).UPTST33 **AIF*** 02602900
  2795. TM APSTAT1,APUOPER IS THE AP OPERATIONAL? @V407508 02603000
  2796. BNO SETUP NO, GO SET UP PSW FOR WAIT @V407508 02604000
  2797. L R2,PREFIXA GET PROCESSOR PREFIX ADDRESS @V407508 02607000
  2798. CLI XTNDLOCK-PSA(R2),SET IS SYSTEM IN EXTEND? @V4M0006 02608000
  2799. BNE UNDOLAST NO, GO CHECK LASTUSER @V4M0136 02609000
  2800. C R11,LASTUSER IS LASTUSER STILL LOCKED? @VA07840 02609100
  2801. BE SETUP NO, GO SET UP PSW FOR WAIT @VA07840 02609200
  2802. TM APSTAT1,PROCIO IS THIS THE MAIN PROCESSOR? @V4M0136 02610000
  2803. BO SETUP YES, GO SET UP PSW FOR WAIT @V4M0136 02611000
  2804. BAL R9,XTNDAP DO AP-ONLY EXTEND PROCESSING @V4M0136 02612000
  2805. B SETUP GO SET UP PSW FOR WAIT @V4M0136 02613000
  2806. UNDOLAST DS 0H @V4M0136 02614000
  2807. C R11,LASTUSER IS LASTUSER STILL LOCKED? @VA07840 02614100
  2808. BE TSTSTAK NO, GO TEST FOR BLKS TO UNSTACK @VA07840 02614200
  2809. L R2,LASTUSER GET ADDRESS OF LASTUSER @V407508 02615000
  2810. TM VMOSTAT-VMBLOK(R2),VMSHR IS LASTUSER SHARED @V407508 02616000
  2811. BNO UNLLST NO, GO UNLOCK LASTUSER @V407508 02617000
  2812. LR R11,R2 SWITCH R11 TO LASTUSER @V4M0173 02618000
  2813. CHARGE START START CHARGING LASTUSER @V4M0173 02619000
  2814. CALL DMKVMASH CHECK FOR CHANGED PAGES @V407508 02620000
  2815. RESET DS 0H @V407508 02625000
  2816. CHARGE STOP STOP CHARGING LASTUSER @V4M0173 02626000
  2817. L R11,ASYSVM SWITCH R11 TO SYSTEM VMBLOK @V4M0173 02627000
  2818. UNLLST DS 0H @V407508 02628000
  2819. L R1,LASTUSER GET ADDRESS OF LASTUSER @V407508 02629000
  2820. BAL R8,UNLOKVM2 UNLOCK LASTUSER @V407508 02630000
  2821. ST R11,LASTUSER SET LASTUSER TO ASYSVM @V407508 02631000
  2822. TSTSTAK DS 0H TEST FOR STACKED BLOCKS @VA07840 02631010
  2823. L R15,PREFIXB ACCESS OTHER PSA @VA08311 02631014
  2824. TM XCPEND-PSA(R15),XCDISP IS DISPATCH XC PENDING ? @VA08311 02631015
  2825. BO SETUP YES- SKIP REDUNDANT SIGNAL @VA08311 02631016
  2826. LA R15,DMKDSPRQ GET ADDR OF DSP REQUEST STACK @VA07840 02631020
  2827. C R15,IOBFPNT-IOBLOK(,R15) IS THE LIST EMPTY? @VA07840 02631030
  2828. BNE TSTLOCK NO, GO SEE IF SYSTEM LOCK IS FREE@VA07840 02631040
  2829. C R15,CPEXFPNT-CPEXBLOK(,R15) OTHER LIST EMPTY TOO@VA07840 02631050
  2830. BE SETUP YES, GO SET UP PSW FOR WAIT @VA07840 02631060
  2831. TSTLOCK DS 0H SEE IF SYSTEM LOCK IS FREE @VA07840 02631070
  2832. BAL R9,GETSYS GO TRY FOR SYSTEM LOCK @VA07840 02631080
  2833. BZ CKCPSTAK SYSTEM LOCK FREE, GO UNSTACK BLKS@VA07840 02631090
  2834. .UPTST33 ANOP **ANOP** 02631100
  2835. SETUP DS 0H SET UP PSW FOR WAIT @V407508 02632000
  2836. LM R0,R1,IDLEPSW WAIT STATE PSW ENABLED FOR EXT. AND I/O 02633000
  2837. STM R0,R1,RUNPSW SAVE FOR WHEN LOADED 02634000
  2838. MVC TIMER,FFS AVOID UNNECESSARY TIMER INTERRUPTS 02635000
  2839. SSM RUNPSW ENABLE FOR INTERRUPTS @V407508 02636000
  2840. SSM *+1 DISABLE BEFORE GETTING LOCK @V407508 02637000
  2841. LOCK OBTAIN,TYPE=RL GET LOCK ON RUNLIST @V407508 02638000
  2842. AIF (NOT &AP).UPTST34 **AIF*** 02638900
  2843. L R4,PREFIXB GET PREFIX ADDRESS OF OTHER PROC @V4M0136 02639000
  2844. L R4,RUNUSER(R4) GET RUNUSER OF OTHER PROC @V4M0136 02640000
  2845. .UPTST34 ANOP **ANOP** 02640100
  2846. L R3,=A(DMKSCHRL) ANCHOR FOR LIST OF RUN-Q USERS @V408246 02641000
  2847. C R3,VMQFPNT-VMBLOK(,R3) ANY USERS IN RUN-Q? @V408246 02642000
  2848. AIF (NOT &AP).UPTST35 **AIF*** 02642900
  2849. BE STIDLEWT NO, GO SET IDLE WAIT @V4M0136 02643000
  2850. C R4,VMQFPNT-VMBLOK(,R3) IS 1ST USER IN RUN LIST @V4M0136 02644000
  2851. * RUNUSER ON THE OTHER PROC? @V4M0136 02645000
  2852. BNE CKPAGEWT NO, GO CALC PAGE WAIT STATUS @V4M0136 02646000
  2853. C R4,VMQBPNT-VMBLOK(,R3) IS LAST USER IN RUN LIST @V4M0136 02647000
  2854. * RUNUSER ON THE OTHER PROC? @V4M0136 02648000
  2855. .UPTST35 ANOP **ANOP** 02648100
  2856. BNE CKPAGEWT NO, GO CALC PAGE WAIT STATUS @V4M0136 02649000
  2857. STIDLEWT DS 0H ONLY ONE USER ON RUN LIST @V4M0136 02650000
  2858. LOCK RELEASE,TYPE=RL RELEASE LOCK ON RUN LIST @VA07394 02650100
  2859. LDIDLEWT DS 0H SET UP FOR IDLE WAIT @VA07394 02650200
  2860. LA R1,IDLEWAIT TIMER FIELD @V408246 02651000
  2861. OI CPSTAT3,CPTIDLE TURN ON IDLE WAIT FLAG @V407508 02652000
  2862. B SETWAIT ... @V408246 02654000
  2863. SPACE 3 02655000
  2864. CKPAGEWT DS 0H @V408246 02656000
  2865. * CHECK 02657000
  2866. LR R1,R3 @V408246 02658000
  2867. DROP R11 DROP REAL VMBLOK POINTER @V408246 02659000
  2868. USING VMBLOK,R1 TEMPORARY USE R1 AS VMBLOK @V408246 02660000
  2869. * POINTER 02661000
  2870. SR R0,R0 CLEAR FOR COUNT OF PAGEWAIT PAGES@V408246 02662000
  2871. SR R2,R2 CLEAR FOR COUNT OF I/O TASKS @V408246 02663000
  2872. NEXTVMBK DS 0H @V408246 02664000
  2873. L R1,VMQFPNT NEXT USER ON CHAIN @V408246 02665000
  2874. CR R1,R3 AT END OF CHAIN? @V408246 02666000
  2875. BE PAGEING YES, CHECK STATUS @V408246 02667000
  2876. AIF (NOT &AP).UPTST36 **AIF*** 02667900
  2877. CR R1,R4 IS THIS RUNUSER OF OTHER PROC? @V4M0136 02668000
  2878. BE NEXTVMBK YES, SKIP THIS VMBLOK @V4M0136 02669000
  2879. .UPTST36 ANOP **ANOP** 02669100
  2880. TM VMRSTAT,VMPGWAIT IS THIS USER IN PAGE WAIT? @V408246 02670000
  2881. BZ IOCYLCES NO @V408246 02671000
  2882. LH R5,VMPAGES NO. RESIDENT PAGES @V408246 02672000
  2883. CH R5,VMWSPROJ MAXIMUM VALUE? @V408246 02673000
  2884. BNL *+8 YES @V408246 02674000
  2885. LH R5,VMWSPROJ NO, RESET TO MAX @V408246 02675000
  2886. AR R0,R5 ACCUMULATE VALUE @V408246 02676000
  2887. B NEXTVMBK @V408246 02677000
  2888. IOCYLCES DS 0H @V408246 02678000
  2889. AIF (NOT &AP).UPTST38 **AIF*** 02678100
  2890. TM VMRSTAT,VMIOWAIT IS THIS USER IN I/O WAIT? @VA07394 02678200
  2891. BZ NEXTVMBK NO, GO GET NEXT USER ON CHAIN @VA07394 02678300
  2892. .UPTST38 ANOP **ANOP** 02678400
  2893. LA R2,1(,R2) INCREMENT COUNT OF I/O WAIT TASKS@V408246 02679000
  2894. B NEXTVMBK @V408246 02680000
  2895. * 02681000
  2896. DROP R1 @V408246 02682000
  2897. USING VMBLOK,R11 @V408246 02683000
  2898. * 02684000
  2899. PAGEING DS 0H @V408246 02685000
  2900. LOCK RELEASE,TYPE=RL,SAVE RELEASE LOCK ON RUNLIST @V407508 02686000
  2901. L R4,=A(DMKPTRRC) POINTER TO RESERVED PAGE COUNT @V408246 02687000
  2902. L R4,0(,R4) RESERVED PAGE COUNT @V408246 02688000
  2903. AL R4,DMKDSPNP + PAGEABLE PAGES -> TOTAL @V408246 02689000
  2904. * PAGEABLE PAGES 02690000
  2905. CR R0,R4 UPPER LIMIT? @V408246 02691000
  2906. BNH *+6 NO @V408246 02692000
  2907. LR R0,R4 YES, RESET @V408246 02693000
  2908. ST R0,PWTPAGES SAVE FOR EXIT FROM WAIT @V407508 02694000
  2909. ALR R0,R0 2 * PAGES WAITING @V408246 02695000
  2910. CR R0,R4 2 * PAGE-WAIT PAGES > PAGEABLE @V408246 02696000
  2911. * PAGES ?? 02697000
  2912. BH PIOCYCL YES @V408246 02698000
  2913. LTR R2,R2 ANY I/O TASKS? @V408246 02699000
  2914. BNZ LOADIO YES @V408246 02700000
  2915. AIF (NOT &AP).UPTST39 **AIF*** 02700100
  2916. LTR R0,R0 ARE THERE ANY PAGE WAIT PAGES? @VA07394 02700200
  2917. BZ LDIDLEWT NO, GO LOAD AN IDLE WAIT @VA07394 02700300
  2918. .UPTST39 ANOP **ANOP** 02700400
  2919. PIOCYCL DS 0H @V408246 02701000
  2920. LA R1,PAGEWAIT SET PAGE WAIT TIMER @V408246 02702000
  2921. OI CPSTAT3,CPTPAGE TURN ON PAGE WAIT FLAG @V407508 02703000
  2922. B SETWAIT @V408246 02704000
  2923. LOADIO DS 0H @V408246 02705000
  2924. LA R1,IONTWAIT SET I/O WAIT TIMER @V408246 02706000
  2925. OI CPSTAT3,CPTIONT TURN ON I/O WAIT FLAG @V407508 02707000
  2926. SETWAIT DS 0H @V408246 02708000
  2927. SLR R15,R15 CLEAR WORK REGISTER @V407508 02709000
  2928. ST R15,STACKVM INITIALIZE ADDR FOR DSP REENTRY @V407508 02710000
  2929. MVI CPSTATUS,CPWAIT FLAG SYSTEM AS IN WAIT @V407508 02711000
  2930. SPT 0(R1) SET TIMER POINTED TO BY REG. 1 @V408246 02712000
  2931. LM R2,R3,0(R1) SAVE INITIAL TIMER VALUE @V408246 02713000
  2932. STM R2,R3,WAITSTRT FOR WAIT EXIT @V407508 02714000
  2933. LPSW RUNPSW --ZZZZZZ--ZZZZZ-- 02715000
  2934. SPACE 2 02715010
  2935. LOCKRLDS DS 0H @VA09257 02715015
  2936. LOCK RELEASE,TYPE=DS RELEASE LOCK ON DSP STKS @VA09257 02715020
  2937. BR R9 @VA09257 02715025
  2938. SPACE 2 02715030
  2939. LOCKOBDS DS 0H SPACE SAVER CODE @VA09257 02715035
  2940. LOCK OBTAIN,TYPE=DS OBTAIN LOCK ON DSP STKS @VA09257 02715040
  2941. BR R9 @VA09257 02715045
  2942. EJECT 02716000
  2943. * CONSTANTS AND EXECUTED INSTRUCTIONS 02717000
  2944. SPACE 02718000
  2945. DS 0D 02719000
  2946. IDLEPSW DC X'030E0000',X'00000000' WAIT-STATE IDLE PSW 02720000
  2947. SPACE 02721000
  2948. EXTZBIT DC X'B800C0FF' MUST-BE-ZERO BITS FOR EC-MODE PSW 02722000
  2949. SPACE 02723000
  2950. TESTSIG TM =AL1(SIGMASK),*-* EXECUTED TO TEST EXT SIGNAL ENABLED 02724000
  2951. SPACE 02725000
  2952. EXTPARMS DC X'80',C'W',AL2(452) RETURN; WNG; ERROR CODE. @V3M4026 02726000
  2953. SPACE 02727000
  2954. PSWPARMS DC X'C0',C'W' RETURN, FRET R3 SPACE; WNG MSG. @V3M4026 02728000
  2955. * THESE ADDRESSES MUST REMAIN TOGETHER AND IN THIS ORDER 02729000
  2956. EXTADDRS DC A(DMKPTRFD) EXIT ALLOWED DURING EXTEND @V407508 02730000
  2957. DC A(DMKPTRFE) .. @V407508 02731000
  2958. DC A(DMKPTRFP) .. @V407508 02732000
  2959. DC A(DMKIOSER) .. @V407508 02733000
  2960. DC A(DMKIOSRC) .. @V407508 02734000
  2961. SPACE 3 02735000
  2962. * MEASUREMENT COUNTERS @V386198 02736000
  2963. SPACE 02737000
  2964. DMKDSPNP DC F'0' COUNT OF ASSIGNABLE PAGE FRAMES @V386198 02738000
  2965. DMKDSPAC DC F'0' ENTRIES TO DMKDSPA 02739000
  2966. DMKDSPBC DC F'0' ENTRIES TO DMKDSPB 02740000
  2967. DMKDSPEC DC F'0' ENTRIES TO DMKDSPE @V386198 02741000
  2968. AIF (NOT &AP).UPTST37 **AIF*** 02741900
  2969. DMKDSPRC DC F'0' ENTRIES TO DMKDSPRU @V407508 02742000
  2970. DISPWKUP DC X'CFFFFFFF' TURN OFF WAKEUP & DISPATCH @VA08873 02742060
  2971. .UPTST37 ANOP **ANOP** 02742100
  2972. DMKDSPIT DC F'0' VIRT INTV TIMER INT REF, X'0080' @V2B2638 02743000
  2973. DMKDSPCK DC F'0' VIRT CLOCK COMP INT REF, X'1004' @V2B2638 02744000
  2974. DMKDSPPT DC F'0' VIRT CPU TIMER INT REF, X'1005' @V2B2638 02745000
  2975. SPACE 02747000
  2976. APWAITS DC F'0' AP INDUCED WAITS @V407508 02748000
  2977. CPPSW DC A(X'000C0000') FIRST HALF OF PSW TO UNSTACK @V407508 02749000
  2978. * SWITCH CPEXBLOK @V407508 02750000
  2979. PSWADDR DC F'0' SECOND HALF OF PSW @V407508 02751000
  2980. NOCLK DC X'E31F' ALL BITS BUT MFA, EMS, AND XC @V4M0136 02752000
  2981. IOWINDOW DC X'02' MASK ENABLING FOR I/O INTERRUPTS @V4M0173 02753000
  2982. SPACE 02754000
  2983. FORCE EQU X'02' PARAMETER FOR CALL TO DMKUSOFF @V200820 02755000
  2984. SET EQU X'FF' USED TO TEST IF FLAG IS SET @V407508 02756000
  2985. NONE EQU X'00' USED TO TEST IF FLAG IS OFF @V407508 02757000
  2986. ONE EQU 1 CONSTANT ONE @V407508 02758000
  2987. THREE EQU 3 CONSTANT THREE @V407508 02759000
  2988. LNPSW EQU 8 LENGTH OF PSW @V407508 02760000
  2989. OFFR15 EQU 12 OFFSET OF R15 IN DSPSAVE @V407508 02761000
  2990. EJECT 02762000
  2991. LTORG 02763000
  2992. EJECT 02764000
  2993. COPY VMBLOK 02765000
  2994. COPY XINTBLOK @V200198 02766000
  2995. COPY PGBLOK @V213135 02767000
  2996. EJECT 02768000
  2997. COPY TREXT 02769000
  2998. COPY PERBLOKS PER001 02769500
  2999. COPY VBLOKS 02770000
  3000. PSA 02771000
  3001. COPY SAVE 02772000
  3002. COPY TIMER INCLUDE DSECT FOR TRQBLOK @V407508 02773000
  3003. COPY IOBLOKS 02774000
  3004. COPY EQU 02775000
  3005. COPY RBLOKS @VA04189 02776000
  3006. COPY MICBLOK 02777000
  3007. COPY VMCBLOKS @V387045 02778000
  3008. END DMKDSP @V200820 02779000