Table of Contents

DMKPRG Source

References

Source Listing

DMKPRG.ASSEMBLE.txt
  1. PRG TITLE 'DMKPRG (CP) VM/370 - RELEASE 6' 00001000
  2. ISEQ 73,80 VALIDATE SEQUENCING OF SYSIN 00002000
  3. *. 00003000
  4. * MODULE NAME - 00004000
  5. * 00005000
  6. * DMKPRG 00006000
  7. * 00007000
  8. * CONTENTS - 00008000
  9. * 00009000
  10. * DMKPRGIN - TO HANDLE A HARDWARE PROGRAM INTERRUPT 00010000
  11. * DMKPRGRF - TO REFLECT AN SVC INTERRUPT TO A VIRTUAL MACHINE 00011000
  12. * DMKPRGSM - TO SIMULATE A VIRTUAL PROGRAM INTERRUPT 00012000
  13. * 00013000
  14. * FUNCTION - 00014000
  15. * 00015000
  16. * TO PROVIDE THE PROPER HANDLING FOR VARIOUS TYPES OF 00016000
  17. * PROGRAM INTERRUPTS WHICH MAY OCCUR. 00017000
  18. * 00018000
  19. * ATTRIBUTES - 00019000
  20. * 00020000
  21. * REUSEABLE, RESIDENT, FIRST-LEVEL INTERRUPT HANDLER 00021000
  22. * 00022000
  23. * ENTRY POINTS - 00023000
  24. * 00024000
  25. * DMKPRGIN - 00025000
  26. * DMKPRGRF - 00026000
  27. * DMKPRGSM - 00027000
  28. * 00028000
  29. * ENTRY POINTS - NON-EXECUTABLE 00029000
  30. * 00030000
  31. * DMKPRGCT - COUNT OF PROGRAM INTTERUPTS REFLECTED TO USERS 00031000
  32. * DMKPRGC8 - CP 'MONITOR' STORAGE, USED BY "MONITOR START" 00032000
  33. * DMKPRGMI - CP 'MONITOR' ENTRY POINTER, FILLED IN BY "START" 00033000
  34. * DMKPRGMC - CP 'MONITOR' COMM. POINTER, FILLED IN BY "START" 00034000
  35. * DMKPRGTI - CP 'MONITOR' TIMER INTERVAL, USED BY DMKMON 00035000
  36. * 00036000
  37. * ENTRY CONDITIONS - 00037000
  38. * 00038000
  39. * DMKPRGIN - NO ENTRY CONDITIONS OTHER THAN THE PROGRAM OLD PSW 00039000
  40. * AND THE INTERRUPT CODES. 00040000
  41. * 00041000
  42. * DMKPRGRF - THE SYSTEM LOCK IS HELD, REFLECTABLE DATA IN REGS: 00042000
  43. * GPR 1 = ADDRESS OF OLD PSW TO BE REFLECTED 00043000
  44. * GPR 3 = ADDRESS OF ILC/INT. CODE WORD IN PAGE 0 00044000
  45. * GPR 4 = SVC OLD PSW (FIRST HALF) 00045000
  46. * GPR 5 = SVC OLD PSW (LAST HALF) 00046000
  47. * GPR 6 = EXTENDED SVC INTERRUPT ILC/CODE 00047000
  48. * GPR 11 = ADDRESS OF VIRTUAL MACHINE'S VMBLOK 00048000
  49. * GPR 12 = ADDRESS OF DMKPRGRF 00049000
  50. * 00050000
  51. * DMKPRGSM - GPR 0 = PROGRAM INTERRUPT CODE 00051000
  52. * GPR 11 = ADDRESS OF VMBLOK 00052000
  53. * GPR 12 = ADDRESS OF DMKPRGSM 00053000
  54. * 00054000
  55. * EXIT CONDITIONS - 00055000
  56. * 00056000
  57. * PAGING REQUESTS HAVE BEEN PROCESSED VIA CALL TO DMKPTRAN. 00057000
  58. * 00058000
  59. * SVC OR PROGRAM INTERRUPTS HAVE BEEN REFLECTED TO THE 00059000
  60. * VIRTUAL MACHINE IF NECESSARY. 00060000
  61. * 00061000
  62. * CONTROL TRANSFERS TO DMKPRVLG, DMKVATSX, DMKVATPX, DMKVATPF, 00062000
  63. * DMKDSPCH, DMKDSPB, OR DMKDMPDK. 00063000
  64. * 00064000
  65. EJECT 00065000
  66. * CALLS TO OTHER ROUTINES - 00066000
  67. * 00067000
  68. * DMKPTRAN - TO HANDLE PAGING EXCEPTION 00068000
  69. * DMKPRVLG - TO HANDLE PRIVILEGED INSTRUCTIONS 00069000
  70. * DMKDSPCH - TO DISPATCH A USER 00070000
  71. * DMKCFMBK - TO PLACE A VIRTUAL MACHINE IN CP CONSOLE MODE 00071000
  72. * DMKQCNWT - TO TYPE WARNING MESSAGE AT USER TERMINAL 00072000
  73. * DMKDMPDK - TO DUMP CORE IF PROGRAM INTERRUPT FROM CP 00073000
  74. * DMKVATPX - TO PROCESS PAGING EXCEPTION FOR V370R 00074000
  75. * DMKVATSX - TO PROCESS SEGMENT EXCEPTION FOR V370R 00075000
  76. * DMKVATPF - TO SIMULATE PSEUDO PAGE FAULT FOR V370R 00076000
  77. * DMKDSPB - TO NEW PSW ENTRY IN DISPATCHER 00077000
  78. * DMKDSPA - TO (POTENTIALLY) FAST RE-DISPATCH CURRENT USER 00078000
  79. * DMKPERIL - 00079000
  80. * 00080000
  81. * EXTERNAL REFERENCES - 00081000
  82. * 00082000
  83. * NONE. 00083000
  84. * 00084000
  85. * TABLES / WORK AREAS - 00085000
  86. * 00086000
  87. * TEMPSAVE AREA USED TO SAVE GPR 14-15 UPON ENTRY. 00087000
  88. * DUMPSAVE - REGISTERS SAVED ON SUPERVISOR STATE PROGRAM CHECK 00088000
  89. * MONREGS - REGISTERS PASSED TO MONITOR ON MONITOR CALL INT. 00089000
  90. * 00090000
  91. * REGISTER USAGE - 00091000
  92. * 00092000
  93. * GPR 11 = ADDRESS OF VIRTUAL MACHINE'S VMBLOK 00093000
  94. * GPR 12 = BASE REGISTER 00094000
  95. * 00095000
  96. * GPRS 0-10 AND 13-15 ARE WORK REGISTERS. 00096000
  97. * 00097000
  98. * NOTES - 00098000
  99. * 00099000
  100. * NONE 00100000
  101. * 00101000
  102. * OPERATION - 00102000
  103. * 00103000
  104. * DMKPRGIN DETERMINES THE MODE OF THE MACHINE (PROBLEM OR 00104000
  105. * SUPERVISOR STATE), AND THE CAUSE OF THE PROGRAM INTERRUPTION 00105000
  106. * 00106000
  107. * IF A PROGRAM INTERRUPT OCCURRED WITH THE MACHINE IN THE 00107000
  108. * SUPERVISOR STATE, REGISTERS ARE STORED IN THE DMKDMPGR AREA, 00108000
  109. * AND CONTROL IS TRANSFERRED TO DMKDMPDK TO DUMP THE 00109000
  110. * MACHINE. 00110000
  111. * 00111000
  112. * IF THE INTERRUPT WAS CAUSED BY A PRIVILEGED OR INVALID 00112000
  113. * OPERATION, DMKPRGIN TRANSFERS TO DMKPRVLG FOR SIMULATION. 00113000
  114. * 00114000
  115. * ANY PROGRAM INTERRUPT RECEIVED WHILE THE VIRTUAL MACHINE 00115000
  116. * IS IN PROBLEM STATE IS REFLECTED TO THE VIRTUAL MACHINE. 00116000
  117. * 00117000
  118. * IF ANY PROGRAM INTERRUPT OCCURRS SUCH THAT THE OLD PSW 00118000
  119. * ADDRESS, MINUS THE INSTRUCTION LENGTH CODE, EQUALS THE 00119000
  120. * ADDRESS IN THE PROGRAM NEW PSW, A WARNING MESSAGE: 00120000
  121. * 00121000
  122. * DMKPRG453W CP ENTERED; PROGRAM INTERRUPT LOOP 00122000
  123. * 00123000
  124. * IS ISSUED, THE PSW'S ARE EXCHANGED AS IF THE INTERRUPT 00124000
  125. * WERE TO BE REFLECTED, AND THE VIRTUAL MACHINE IS PLACED 00125000
  126. * IN CP CONSOLE FUNCTION MODE VIA A CALL TO DMKCFMBK. 00126000
  127. * 00127000
  128. * A PAGE EXCEPTION INTERRUPT IS HANDLED VIA A CALL TO 00128000
  129. * DMKPTRAN TO BRING IN THE REQUIRED VIRTUAL STORAGE PAGE. 00129000
  130. * AN ADDRESSING EXCEPTION IS GENERATED IF THE REFERENCED 00130000
  131. * ADDRESS IS OUTSIDE OF VIRTUAL STORAGE. IF THE INTERRUPT 00131000
  132. * WAS FOR AN EC-MODE VIRTUAL MACHINE RUNNING IN VIRTUAL 00132000
  133. * TRANSLATE MODE, DMKVATPX IS INVOKED VIA GOTO. 00133000
  134. * IF A VIRTUAL ECMODE MACHINE HAS REQUESTED PSEUDO PAGE FAULT 00134000
  135. * HANDLING AND IS ENABLED, A PSEUDO PAGE FAULT MAY BE GENER- 00135000
  136. * ATED IF THE 2ND LEVEL MEMORY PAGE IS NOT AVAILABLE. THE PAGE 00136000
  137. * FAULT IS HANDLED VIA A GOTO TO DMKVATPF. 00137000
  138. * 00138000
  139. * OR AN ECMODE MACHINE RUNNING NON-TRANSLATE IS 00139000
  140. * TREATED IN THE SAME MANNER AS A PAGE EXCEPTION 00140000
  141. * INDICATES A VIRTUAL ADDRESSING ERROR HAS BEEN MADE, AND 00141000
  142. * AN ADDRESSING EXCEPTION IS GENERATED FOR THE VIRTUAL 00142000
  143. * IF THE VIRTUAL MACHINE IS RUNNING IN VIRTUAL 00143000
  144. * TRANSLATE MODE, DMKVATSX IS INVOKED VIA GOTO TO FIELD THE 00144000
  145. * INTERRUPT. 00145000
  146. * 00146000
  147. * THE DMKPRGRF ENTRY POINT (INVOKED FROM DMKPSASV) PERFORMS 00147000
  148. * THE NECESSARY FUNCTIONS TO REFLECT AN SVC-INTERRUPT TO 00148000
  149. * THE VIRTUAL MACHINE (SEE LATER SECTION FOR DETAILS). 00149000
  150. * 00150000
  151. * THE DMKPRGSM ENTRY POINT IS INVOKED VIA GOTO WHENEVER 00151000
  152. * A PROGRAM INTERRUPT MUST BE GENERATED FOR A VIRTUAL 00152000
  153. * MACHINE. THE VIRTUAL OLD PSW AND ILC DATA IS CONTAINED 00153000
  154. * IN THE VMBLOK - VMPSW AND VMPRGIL FIELDS. EXIT IS VIA 00154000
  155. * GOTO DMKDSPB. 00155000
  156. *. 00156000
  157. EJECT 00157000
  158. COPY OPTIONS 00158000
  159. SPACE 2 00159000
  160. COPY LOCAL 00160000
  161. SPACE 3 00161000
  162. DMKPRG CSECT PROGRAM NAME. 00162000
  163. * 00163000
  164. ENTRY DMKPRGIN ENTRY POINT - HARDWARE PROGRAM INTERRUPT 00164000
  165. ENTRY DMKPRGRF "REFLECT" ENTRY POINT 00165000
  166. ENTRY DMKPRGSM "SIMULATE" ENTRY POINT 00166000
  167. ENTRY DMKPRGC8 CR8 VALUE ENABLED, BEFORE START @V2B2638 00167000
  168. ENTRY DMKPRGMI ADDR OF DMKMON PROG INT HANDLER @V2B2638 00168000
  169. ENTRY DMKPRGMC ADDR OF MONCOM @V2B2638 00169000
  170. ENTRY DMKPRGTI VALUE SET BY 'MONITOR' INT CMD @V2B2638 00170000
  171. SPACE 00171000
  172. EXTRN DMKPRVLG 00172000
  173. EXTRN DMKDSPB,DMKPERIL 00173000
  174. EXTRN DMKDSPA @V408246 00174000
  175. EXTRN DMKCFMBK 00175000
  176. EXTRN DMKSTKDE @V407579 00176000
  177. AIF (NOT &AP).LOKSY4 00177000
  178. EXTRN DMKLOKSY,DMKDSPRU @V407579 00178000
  179. .LOKSY4 ANOP 00179000
  180. EXTRN DMKDMPDK @V407579 00180000
  181. EXTRN DMKVATPX,DMKVATSX,DMKVATPF @V407579 00181000
  182. AIF (NOT &TRACE(6)).NTR1 **AIF** 00182000
  183. EXTRN DMKTRCPG 00183000
  184. .NTR1 ANOP 00184000
  185. SPACE 2 00185000
  186. USING PSA,R0 FOR ALL ENTRY POINTS 00186000
  187. * 00187000
  188. EQUAL EQU B'1000' CONDITION CODE MASK @V407579 00188000
  189. EJECT 00189000
  190. *********************************************************************** 00190000
  191. * * 00191000
  192. * HERE ON A HARDWARE PROGRAM INTERRUPT * 00192000
  193. * * 00193000
  194. *********************************************************************** 00194000
  195. SPACE 00195000
  196. *. 00196000
  197. *********************************************************************** 00197000
  198. * 00198000
  199. * 00199000
  200. * EXPANDED VMA PARTIAL INSTRUCTION EMULATION FUNCTION: 00200000
  201. * 00201000
  202. * INVOKED BY THESE INSTRUCTIONS WHEN EXECUTED IN PROBLEM STATE 00202000
  203. * WITH CONTROL REGISTER 6 BYTE 0 SET TO THE SPECIFIED VALUE: 00203000
  204. * LPSW, SIO, SIOF, SSM - B'10XXXX1X' (X = 0 OR 1) 00204000
  205. * SCKC, SPT, STNSM, STOSM - B'10X0XX1X' (X = 0 OR 1) 00205000
  206. * AND THE APPROPRIATE INDIVIDUAL CONTROLS IN THE ASSIST 00206000
  207. * CONTROL WORD (OFFSET X'14' INTO MICBLOK) SET TO 1: 00207000
  208. * BIT 0 LPSW BIT 2 SCKC/SPT 00208000
  209. * BIT 3 SIO/SIOF BIT 4 SSM/STNSM/STOSM 00209000
  210. * 00210000
  211. * REGISTER INPUT: 00211000
  212. * CR 6 = BITS 0-7 ARE THE ASSIST FLAGS; BITS 8-28 ADDRESS 00212000
  213. * THE MICBLOK (THE VIRTUAL MACHINE POINTER LIST) 00213000
  214. * 00214000
  215. * SYSTEM DATA AREAS REFERENCED (BY MODULE WHERE APPLICABLE): 00215000
  216. * DMKPRV - 'DMKPRVMA' (EQUALS 'VMALIST') 00216000
  217. * DMKPSA - 'AVMALIST', 'PRNPSW', CPCREGS, TIMER FIELDS, 00217000
  218. * TRACING INFORMATION, 'CPSTATUS', 'PROPSW' 00218000
  219. * MICBLOK, VCHBLOK, VCUBLOK, VDEVBLOK, VMBLOK 00219000
  220. * 00220000
  221. * 00221000
  222. * SEE DMKPRV, DMKTMR, OR DMKVSI FOR MORE INFORMATION ON 00222000
  223. * INSTRUCTION EMULATION DONE BY THE EXPANDED ASSIST... 00223000
  224. * 00224000
  225. *********************************************************************** 00225000
  226. *. 00226000
  227. SPACE 00227000
  228. DMKPRGIN DS 0H PROGRAM FLIH %V4M0144 00228000
  229. OI CPSTATUS,CPSUPER INDICATE SUPERVISOR STATE %V4M0144 00229000
  230. ST R14,TEMPR14 SAVE R14 & R15... %V4M0144 00230000
  231. ST R15,TEMPR15 ... %V3M4038 00231000
  232. L R15,PRNPSW+4 OBTAIN BASE REGISTER %V407579 00232000
  233. USING DMKPRGIN,R15 %V407579 00233000
  234. PRG00 EQU * %V3M4038 00234000
  235. L R14,RUNUSER GET CURRENT RUNUSER %V3M4038 00235000
  236. USING VMBLOK,R14 TEMPORARY ADDRESSABILITY %V3M4038 00236000
  237. TM PROPSW+1,PROBMODE TEST FOR PROBLEM MODE %V408246 00237000
  238. BZ CKMON NO, CHECK FOR MONITOR CALL %V408246 00238000
  239. PRGVRT DS 0H %V408246 00239000
  240. MVC QUANTUMR,TIMER SAVE INTERVAL TIMER %V408246 00240000
  241. STPT VMTMOUTQ STOP CHARGING PROBLEM TIME %V408246 00241000
  242. CHARGE START START CHARGING SUPERVISOR TIME %V407579 00242000
  243. DROP R15 %V4M0203 00243000
  244. STM R0,R13,VMGPRS SAVE REGISTERS 0-13 %V408246 00244000
  245. L R12,PRNPSW+4 PROPER BASE REGISTER %V4M0203 00245000
  246. USING DMKPRGIN,R12 %V408246 00246000
  247. DROP R14 %V408246 00247000
  248. LR R11,R14 AND ACCESS VMBLOK IN R11 AS USUAL%V408246 00248000
  249. USING VMBLOK,R11 %V408246 00249000
  250. L R14,TEMPR14 GET R14 AND R15 %V408246 00250000
  251. L R15,TEMPR15 ... %V408246 00251000
  252. ST R14,VMGPRS+R14*4 STORE IN VMBLOK %V408246 00252000
  253. ST R15,VMGPRS+R15*4 ... %V408246 00253000
  254. COUNT DMKPRGCT COUNT PROBLEM STATE PROGRAM INTS.%V407579 00254000
  255. EJECT 00255000
  256. * 00256000
  257. * 'NORMAL' VIRTUAL PROGRAM INTERRUPT HANDLING 00257000
  258. * 00258000
  259. PRGSPSW DS 0H %V408246 00259000
  260. LCTL C8,C8,CPCREG8 HOST SYSTEM'S MC %V408246 00260000
  261. LCTL C0,C0,CPCREG0 LOAD STANDARD C-REG 0 %V408246 00261000
  262. OI VMRSTAT,VMEXWAIT FLAG INSTRUCTION WAIT %V408246 00262000
  263. AIF (NOT &FLOATPT).NOFP1 %V408246 00263000
  264. STD Y0,VMFPRS SAVE FLOATING POINT REGISTERS %V408246 00264000
  265. STD Y2,VMFPRS+8 %V408246 00265000
  266. STD Y4,VMFPRS+16 %V408246 00266000
  267. STD Y6,VMFPRS+24 %V408246 00267000
  268. .NOFP1 ANOP 00268000
  269. AIF (NOT &TRACE(9)).TR2 %V408246 00269000
  270. TM TRACFLG1,TRAC03 TRACING ACTIVE? %V408246 00270000
  271. BZ NOTRAC2 BRANCH IF NOT %V408246 00271000
  272. TRACE CODE=TRCPGM,R14,R1,R2 %V407579 00272000
  273. USING TRACETBL,R14 %V407579 00273000
  274. MVC TRACEADR,VMPSW TRACE FIRST 3 BYTES OF VIRT. PSW %V407579 00274000
  275. L R1,INTPRL SAVE INTERRUPT ILC AND CODE %V408246 00275000
  276. ST R1,TRACECOD %V407579 00276000
  277. MVC TRACEPSW,PROPSW ACTUAL PROGRAM OLD PSW %V407579 00277000
  278. DROP R14 %V407579 00278000
  279. NOTRAC2 EQU * %V408246 00279000
  280. .TR2 ANOP 00280000
  281. L R1,PROPSW+4 GET INTERRUPTING ADDRESS %V408246 00281000
  282. LH R2,INTPRL ...AND ILC HALF-WORD %V408246 00282000
  283. STH R2,VMPRGIL SAVE ILC IN VMBLOK %V408246 00283000
  284. LA R7,PRG01 BRANCH ADDRESS FOR INTERRUPT %V408246 00284000
  285. * ANALYSIS 00285000
  286. TM PROPSW+1,PROBMODE 1-2 PUNCH FOR PER-SVC? %V408246 00286000
  287. BZ PRGSVCPE YES - SPECIAL HANDLING %V408246 00287000
  288. TM VMESTAT,VMEXTCM IS VM IN EXTENDED-CONTROL MODE? %V408246 00288000
  289. BZ PRESTAT NO %V408246 00289000
  290. ST R1,VMPSW+4 SAVE PSW ADDRESS %V408246 00290000
  291. LH R1,PROPSW+2 GET CC & PROGRAM MASK %V408246 00291000
  292. STH R1,VMPSW+2 %V408246 00292000
  293. B PRNSTAT DETERMINE INTERRUPT TYPE %V408246 00293000
  294. * 00294000
  295. ENTRY DMKPRGCT @V408246 00295000
  296. DMKPRGCT DS F'0' COUNT OF USER PROGRAM INTERRUPTS @V408246 00296000
  297. EJECT 00297000
  298. PRESTAT EQU * BASIC-CONTROL 360 PSW FORMAT %V3M4038 00298000
  299. ICM R1,8,PROPSW+2 NO, ADD IN THE CC AND PGM MASK %V3M4038 00299000
  300. ALR R2,R2 ADJUST ILC CODE FOR INDEXING... %V3M4038 00300000
  301. O R1,ORTABLE(R2) ...AND ADD CORRECT ILC BITS %V3M4038 00301000
  302. ST R1,VMPSW+4 STORE NEW CC-PROG/MSK-ADDRESS %V3M4038 00302000
  303. PRNSTAT EQU * %V3M4038 00303000
  304. CLI INTPR+1,16 PAGING INTERRUPT OR SUCH ? %V3M4038 00304000
  305. BCR 4,R7 BL IF 16, MUST BE VANILLA INT. %V3M4038 00305000
  306. BE SEGEXCP BRANCH IF = 16, SEGMENT EXCEPTION 00306000
  307. CLI INTPR+1,X'12' TRANSLATION EXCEPTION? 00307000
  308. BE TRANSEX YES - CHECK IT OUT 00308000
  309. BL PAGEXCP NO - PAGING EXCEPTION CODE X'11' 00309000
  310. CLI INTPR+1,X'40' IF > 16, IS IT A MONITOR CALL ? 00310000
  311. BH CHEKPER CHECK FOR PER EVENT INCLUDED 00311000
  312. BCR 7,R7 <BNE> IF NOT, SOME SPECIAL INTERRUPT (X'13'?) 00312000
  313. SPACE 00313000
  314. REFMC EQU * 00314000
  315. TM VMPSTAT,VMV370R DOES V. MACH. HAVE EC OPTION? 00315000
  316. BZ FASTEXIT TAKE FAST-REDISPATCH EXIT @VA07661 00316000
  317. LH R8,MONCLASS YES, MONITOR CLASS INTO R8, 00317000
  318. L R9,MONCODE AND MONITOR CODE INTO R9, 00318000
  319. B 4(0,R7) AND CONTINUE BELOW. 00319000
  320. CHEKPER BAL R9,CHECKPER GO CHECK FOR PER EVENT. PER001 00319100
  321. CLI INTPR+1,00 ANY INTERRUPTS LEFT NOW? PER001 00319200
  322. BNZ PRNSTAT GO CHECK FOR OTHER INTERRUPTS. PER001 00319300
  323. SLR R6,R6 CLEAR THE INTERUPT CODE. PER001 00319400
  324. B PRGSIMI GO FINISH UP NOW, FOLKS. PER001 00319500
  325. PRG01 EQU * %V3M4038 00320000
  326. L R8,FFS -1 IN R8 = "NOT A MONITOR CALL" %V3M4038 00321000
  327. LH R6,INTPR GET INTERRUPT CODE INTO R6 %V3M4038 00322000
  328. CLI INTPR+1,X'02' PRIVILEGED INTERRUPT ? %V3M4038 00323000
  329. BL GOTOPRV NO - OPERATION %V3M4038 00324000
  330. BH PRGSIMI SOME OTHER KIND - REFLECT IT %V3M4038 00325000
  331. TM VMPSW+1,PROBMODE PRIV OP FROM VIRT PROB MODE ? %V3M4038 00326000
  332. BO PRGSIMI YES - REFLECT IT %V3M4038 00327000
  333. GOTOPRV GOTO DMKPRVLG LET DMKPRV HANDLE IT %V3M4038 00328000
  334. SPACE 2 00329000
  335. PRGSVCPE EQU * SVC AND PER INTERRUPTS SEQUENTIALLY 00330000
  336. TM VMTRCTL,VMTRPER PER TRACING ACTIVE ? 00331000
  337. BO OKEVENT YES. INTERUPT WAS VALID PER001 00332100
  338. TM VMESTAT,VMPERCM HE BETTER BE USING VIRTUAL PER 00333000
  339. BZ PRG255 NO - HALT AND DISIST PROCESSING 00334000
  340. OKEVENT BAL R9,PRGEVEN RECORD PER DATA + SET PENDING PER001 00335100
  341. SPACE 00336000
  342. * THE FOLLOWING CODE RESTORES THE VIRTUAL MACHINE STATUS AND 00337000
  343. * SIMULATES A REAL SVC INTERRUPT VIA 'LPSW'. DMKSVCIN WILL 00338000
  344. * DECODE FOR ADSTOP AND TRACE SVC'S AND THE PER INTERRUPT WILL 00339000
  345. * BE UNSTACKED BY DMKDSPCH (VIRTUAL PER IMPLIES EC-MODE, 00340000
  346. * WHICH FORCES THE LONGER REFLECT PATH THROUGH DMKDSPCH). 00341000
  347. SPACE 00342000
  348. NI VMRSTAT,255-VMEXWAIT OUT OF WAIT 00343000
  349. CHARGE STOP STOP CHARGING SUPERVISOR OVERHEAD@V407579 00344000
  350. SPT VMTMOUTQ START CHARGING PROBLEM TIME 00345000
  351. LM R0,R15,VMGPRS RESTORE ALL USER'S REGISTERS 00346000
  352. LCTL C0,C0,RUNCR0 RESTORE VIRTUAL MACHINE'S CR0 @VA04930 00347000
  353. LPSW SVCNPSW SIMULATE REAL SVC 00348000
  354. EJECT 00349000
  355. *---------------------------------------------------------------------* 00350000
  356. * PROGRAM EVENT RECORDING - "PER" INTERRUPT CHECKING * 00351000
  357. * ------------------------------- * 00352000
  358. * PER INTERRUPTS CAN COME IN CONCURRENTLY, OR'ED WITH OTHER * 00353000
  359. * PROGRAM INTERRUPTS. BECAUSE OF THIS, THE PER DATA IS SAVED * 00354000
  360. * IN THE VMBLOK EXTENSION FOR LATER REFLECTION (IF REQUIRED), * 00355000
  361. * AND THE PER BIT IN THE PROGRAM INTERRUPT CODE IS TURNED * 00356000
  362. * OFF. IF THE PER INTERRUPT COMES IN ALONE, THE INTERRUPT * 00357000
  363. * IS REFLECTED TO THE VIRTUAL MACHINE IMMEDIATELY. * 00358000
  364. * OTHERWISE, THE REMAINING INTERRUPT CODE IS DECODED NORMALLY * 00359000
  365. * AND THE PER INTERRUPT REFLECTED AT A LATER TIME. * 00360000
  366. *---------------------------------------------------------------------* 00361000
  367. CHECKPER TM INTPR+1,X'80' PER EVENT RECORDED? PER001 00362000
  368. BZR R9 NO. DON'T WORRY ABOUT IT. PER001 00363000
  369. PRGEVEN OI VMPEND,VMPERPND SET FLAG FOR PER PENDING. PER001 00364000
  370. TM VMTRCTL,VMTRPER WAS CP USING THE PERSON'S PER?PER001 00365000
  371. BZ OWNPER NO. BETTER REFLECT IT TO HIM, THEN.PER001 00366000
  372. L R10,VMPERCTL LOAD ADDRESS OF THE CONTROL BLOCK. PER001 00367000
  373. LA R10,PERADDR-PERBLOK(,R10) LOAD ADDR TO RECORD EVENPER001 00368000
  374. B PERJOIN AND JOIN WITH REFLECTION SECTION. PER001 00369000
  375. OWNPER L R10,VMECEXT LOAD ADDR OF EXT CNTRL BLOCK. PER001 00370000
  376. LA R10,EXTPERAD-ECBLOK(,R10) LOAD ADDR TO RECORD PER001 00371000
  377. PERJOIN MVC 4(2,R10),PERCODE SET THE INTERRUPTION CODE NOW.PER001 00372000
  378. MVC 0(4,R10),PERADD SET THE INTERRUPTION ADDRESS, PER001 00373000
  379. NI INTPR+1,X'FF'-X'80' TURN OFF THE P.E.R. BIT. PER001 00374000
  380. BR R9 AND RETURN TO OUR CALLER. PER001 00375000
  381. SPACE 2 00387000
  382. ABEND 255 BY - BY 00388000
  383. EJECT 00443000
  384. *---------------------------------------------------------------------* 00444000
  385. * * 00445000
  386. * DMKPRGSM - ENTRY TO SIMULATE A PROGRAM INTERRUPT * 00446000
  387. * * 00447000
  388. * ON ENTRY - GPR 0 = PROGRAM INTERRUPT CODE * 00448000
  389. * VMPSW, VMPRGIL CONTAIN OLD PSW, ILC DATA * 00449000
  390. *---------------------------------------------------------------------* 00450000
  391. SPACE 00451000
  392. DMKPRGSM DS 0D 00452000
  393. USING *,R12 00453000
  394. L R12,=A(DMKPRGIN) COMMON BASE ADDRESS 00454000
  395. USING DMKPRGIN,R12 00455000
  396. L R8,FFS "NOT A MONITOR CALL" 00456000
  397. LR R6,R0 INTERRUPT CODE TO R6 00457000
  398. AIF (NOT &AP).APCHK4 00458000
  399. TM APSTAT1,APUOPER TEST AP SYSTEM @V407579 00459000
  400. BZ PRGSIMLK SKIP ACCESS OF SYSTEM LOCK @V4M0133 00460000
  401. L R15,=A(DMKLOKSY+2) ACCESS THE GLOBAL SYSLOCK @V407579 00461000
  402. CLC LPUADDR,0(R15) TEST IF CURRENTLY HELD @V407579 00462000
  403. BE PRGSIMLK CONTINUE IF ALREADY LOCKED @V407579 00463000
  404. SPACE 00464000
  405. AGO .APCHK5 00465000
  406. .APCHK4 ANOP 00466000
  407. B PRGSIMLK SKIP ACCESS OF SYSTEM LOCK @V4M0133 00467000
  408. .APCHK5 ANOP 00468000
  409. PRGSIMI EQU * REFLECT REAL PROGRAM INTERRUPT 00469000
  410. BAL R10,OBSLOCK SYSTEM LOCKED CODE BEYOND HERE***@V407579 00470000
  411. PRGSIMLK EQU * @V407579 00471000
  412. LTR R6,R6 IS IT A REGULAR INTERRUPT? PER001 00471100
  413. BNZ REGULAR YES. DON'T WORRY ABOUT A THING. PER001 00471200
  414. TM VMTRCTL,VMTRPER WAS CP USING THE P.E.R? PER001 00471300
  415. BO PRGEXT YES. GO TO DMKDSP TO HANDLE IT. PER001 00471400
  416. REGULAR DS 0H HERE IF WE MUST REFLECT THE THING. PER001 00471500
  417. LA R1,PROPSW OLD PSW ADDRESS 00472000
  418. BAL R10,PSWTRAN "TRANS 2,1,OPT=(BRING,DEFER)" 00473000
  419. L R3,VMPSW MOVE CURRENT VMPSW... 00474000
  420. ST R3,0(,R2) INTO USER'S OLD-PSW SLOT 00475000
  421. L R3,VMPSW+4 ... 00476000
  422. ST R3,4(,R2) ... 00477000
  423. AIF (NOT &TRACE(6)).NTR2 **AIF** 00478000
  424. TM VMTRCTL,VMTRPRG+VMTRBRIN TRACING PROGRAM INTS ? 00479000
  425. BZ CHKECMD NO - SKIP TRACE CALL 00480000
  426. LM R0,R1,0(R2) OLD PSW INTO R0-R1 00481000
  427. LM R2,R3,PRNPSW-PROPSW(R2) NEW PSW INTO R2-R3 00482000
  428. LR R4,R6 INTERRUPT CODE INTO R4, 00483000
  429. ICM R4,B'1100',VMPRGIL WITH ILC FROM INTERRUPT 00484000
  430. CALL DMKTRCPG TRACE THE PROGRAM INTERRUPT 00485000
  431. LA R1,PROPSW MUST RE-ISSUE 'TRANS' 00486000
  432. BAL R10,PSWTRAN ...TO GET VM'S PAGE ZERO 00487000
  433. L R3,4(0,R2) RESTORE ADDRESS PORTION OF OLD PSW 00488000
  434. CHKECMD EQU * CHECK FOR EC-MODE PSW FORMAT 00489000
  435. .NTR2 ANOP 00490000
  436. TM VMESTAT,VMEXTCM IS THE VM IN EC-MODE? 00491000
  437. BZ PRGSM01 NO - FILL IN INTERRUPT CODE 00492000
  438. STH R6,INTPR-PROPSW(,R2) PASS BACK INTERRUPT CODE 00493000
  439. LH R1,VMPRGIL PICK UP ILC HALF-WORD... 00494000
  440. STH R1,INTPRL-PROPSW(,R2) ...FOR THE USER 00495000
  441. CLC PRNPSW-PROPSW(2,R2),0(R2) PROG INTERRUPT LOOP ? @VA04506 00496000
  442. BNE CHKPEND NO..CONTINUE... @VA04506 00497000
  443. SLR R3,R1 BACK UP OLD PSW ADDRESS 00498000
  444. CL R3,PRNPSW+4-PROPSW(,R2) INTERRUPT LOOP ? 00499000
  445. BE PRGLOOP YES - STOP IT NOW 00500000
  446. CHKPEND EQU * TEST FOR PENDING 'PER' EVENT 00501000
  447. TM VMPEND,VMPERPND IS THERE PER DATA ALSO? 00502000
  448. BZ PRG04 NO - HANDLE AS USUAL 00503000
  449. TM VMTRCTL,VMTRPER WERE WE DOING CP PER TRACING? PER001 00503100
  450. BO PRG04 YES. DON'T TRY TO REFLECT IT, THEN.PER001 00503200
  451. L R10,VMECEXT EXTENSION BLOCK ADDRESS 00504000
  452. USING ECBLOK,R10 00505000
  453. LH R1,EXTPERCD PER CODE BITS 00506000
  454. STH R1,PERCODE-PROPSW(,R2) SET IN USER'S CORE 00507000
  455. L R1,EXTPERAD PER EVENT ADDRESS 00508000
  456. ST R1,PERADD-PROPSW(,R2) ... 00509000
  457. OI INTPR+1-PROPSW(R2),X'80' SET PER BIT IN CODE 00510000
  458. NI VMPEND,255-VMPERPND EVENT HAS BEEN UNSTACKED 00511000
  459. B PRG04 GO SWAP USER PSW'S 00512000
  460. SPACE 2 00513000
  461. PRGSM01 EQU * NORMAL-MODE 360 PSW 00514000
  462. STH R6,2(0,R2) INTERRUPT CODE IS IN OLD PSW 00515000
  463. LH R1,VMPRGIL ILC FROM INTERRUPT 00516000
  464. CLC PRNPSW-PROPSW(2,R2),0(R2) LOOP CONDITION ? @VA04506 00517000
  465. BNE PRG04 NO..CONTINUE... @VA04506 00518000
  466. SLR R3,R1 BACK UP TO INSTRUCTION START 00519000
  467. CLM R3,B'0111',PRNPSW+5-PROPSW(R2) INTERRUPT LOOP ? 00520000
  468. BNE PRG04 NO -- REFLECT PROGRAM INTERRUPT 00521000
  469. PRGLOOP EQU * PROGRAM INTERRUPT LOOP IN PROGRESS 00522000
  470. TM VMPEND,VMPERPND IF 'PER' EVENT IS PENDING... 00523000
  471. BO SKIPSWP ...LET DMKDSPCH UNSTACK IT 00524000
  472. LM R0,R1,PRNPSW-PROPSW(R2) GET USER'S NEW PSW 00525000
  473. STM R0,R1,VMPSW STORE IN VMBLOK FOR CLEANLINESS 00526000
  474. SKIPSWP EQU * WARNING MESSAGE FOR VIRT. MACHINE USER 00527000
  475. MSG 'DMKPRG453W CP ENTERED; PROGRAM INTERRUPT LOOP' 00528000
  476. SKIPSWP1 DS 0H @VA10343 00528500
  477. CALL DMKQCNWT,PARM=NORET+ERRMSG @VA04506 00529000
  478. OI VMRSTAT,VMCFWAIT MAKE SURE HE ENTERS CFMODE 00530000
  479. NI VMOSTAT,255-VMCFRUN MAKE SURE HE DOESNT RUN EITHER 00531000
  480. CALL DMKCFMBK PUT VM IN CONSOLE FUNCTION MODE 00532000
  481. B NRFEXIT GOTO DMKDSPCH 00533000
  482. SPACE 3 00534000
  483. OBSLOCK DC 0H'0' SUBROUTINE TO OBTAIN SYSTEM LOCK @V407579 00535000
  484. LOCK OBTAIN,TYPE=SYS,SPIN=NO TRY TO OBTAIN SYSLOCK @V407579 00536000
  485. AIF (NOT &AP).APCHK6 00537000
  486. BCR EQUAL,R10 RETURN IF LOCK OBTAINED @V407579 00538000
  487. L R15,VMDFTPNT DEFER BLOCK FOR SYNC EVENTS @V407579 00539000
  488. USING CPEXBLOK,R15 @V407579 00540000
  489. STM R0,R15,CPEXREGS PRESERVE REGS OF CALLER @V407579 00541000
  490. LA R0,DEFERETN @V407579 00542000
  491. ST R0,CPEXADD SET KNOWN RETURN POINT @V407579 00543000
  492. DROP R15 @V407579 00544000
  493. LR R1,R15 @V407579 00545000
  494. CALL DMKSTKDE STACK DEFERRED BLOCK @V407594 00546000
  495. LA R10,0(R10) ADDRESS ONLY @V407594 00547000
  496. LA R2,PAGINTRA+4 RETURN ADDRESS FOR PAGE FAULT @V407594 00548000
  497. CR R10,R2 IS THIS A PAGE FAULT @V407594 00549000
  498. BNE EXITRU NO @V407594 00550000
  499. TM VMOSTAT,VMSHR RUNNING SHARED SYSTEM @V407594 00551000
  500. BZ EXITRU NO @V407594 00552000
  501. L R15,VMDFTPNT LOAD CPEXBLOK ADDRESS @V407594 00553000
  502. MVC CPEXPROC-CPEXBLOK(2,R15),LPUADDR SET AFFINITY @V407594 00554000
  503. * TO PREVENT PAGE FAULT THRASHING @V407594 00555000
  504. EXITRU GOTO DMKDSPRU GO RUN ANOTHER USER @V407594 00556000
  505. * 00557000
  506. .APCHK6 ANOP 00558000
  507. DEFERETN BR R10 RETURN TO THE ORIGINAL CALLER @V407579 00559000
  508. EJECT 00560000
  509. *---------------------------------------------------------------------* 00561000
  510. *. 00562000
  511. * DMKPRGRF - REFLECT AN SVC INTERRUPT TO A VIRTUAL MACHINE: 00563000
  512. * 00564000
  513. * DMKPRGRF IS INVOKED VIA 'GOTO' FROM DMKPSASV WHEN A 00565000
  514. * FAST REFLECT IS NOT FEASIBLE (I.E. WHEN VIRTUAL PAGE 00566000
  515. * ZERO IS NOT IN CORE OR FOR EC-MODE MACHINES). 00567000
  516. * THE SYSTEM LOCK IS HELD ON ENTRY TO DMKPRGRF. 00568000
  517. * 00569000
  518. * AT ENTRY, USER'S REGISTERS HAVE ALL BEEN SAVED; 00570000
  519. * AND REGISTERS ARE SET UP AS FOLLOWS: 00571000
  520. * R1 = ADDRESS OF SVC-OLD-PSW OR PROGRAM-OLD-PSW 00572000
  521. * R3 = ADDRESS OF SVC OR PROGRAM ILC-INT CODE WORD 00573000
  522. * R4 = CONTENTS OF SVC OLD PSW ON INTERRUPT (FIRST HALF) 00574000
  523. * R5 = CONTENTS OF SVC OLD PSW ON INTERRUPT (LAST HALF) 00575000
  524. * R6 = CONTENTS OF EXTENDED INTERRUPT ILC/CODE 00576000
  525. * R11 = ADDRESS OF USER'S VMBLOK 00577000
  526. * R12 = A(DMKPRGRF) 00578000
  527. * 00579000
  528. *. 00580000
  529. *---------------------------------------------------------------------* 00581000
  530. SPACE 2 00582000
  531. DMKPRGRF DS 0D = OLD "REFLECT" ENTRY POINT 00583000
  532. USING *,R12 00584000
  533. L R12,=A(DMKPRGIN) COMMON ADDRESSABILITY. 00585000
  534. USING DMKPRGIN,R12 00586000
  535. L R8,FFS -1 INTO R8 = "NOT A MONITOR CALL" 00587000
  536. SPACE 2 00588000
  537. REFLECT EQU * REFLECT SVC/PROGRAM INTERRUPT TO USER: 00589000
  538. * (N.B. - CODE TO 'PRGEXT' OPTIMIZED FOR 145) 00590000
  539. * 00591000
  540. BAL R10,PSWTRAN GET REAL ADDRESS OF USER'S PAGE ZERO 00592000
  541. ST R5,4(,R2) STORE 2ND HALF OF OLD PSW 00593000
  542. TM VMESTAT,VMEXTCM IS VM IN EXTENDED MODE NOW ? 00594000
  543. BZ PRG03 IF NOT, MAKE A "PLAIN" OLD PSW. 00595000
  544. SLR R3,R1 IF YES, OBTAIN R3 - R1 (A DISPLACEMENT) 00596000
  545. ST R6,0(R3,R2) STORE ILC/INT-CODE WORD WHERE IT GOES, 00597000
  546. STCM R4,3,2(R2) STORE CC/PROGRAM MASK, @V407579 00598000
  547. LH R4,VMPSW GET 1ST 2 BYTES OF VMPSW, 00599000
  548. STH R4,0(,R2) AND STORE IN OLD PSW 00600000
  549. B PRG04 GO HANDLE NEW PSW AND FINISH UP. 00601000
  550. EJECT 00602000
  551. PRG03 EQU * 00603000
  552. LR R7,R6 MANIPULATE ILC @V407579 00604000
  553. SRL R7,3 PUT IN BITS 16,17 @V407579 00605000
  554. OR R4,R7 COMBINE WITH CC/PGM MASK @V4M0171 00606000
  555. STCM R4,2,4(R2) STOR IN BC MODE OLD PSW @V4M0171 00607000
  556. ICM R6,12,VMPSW GET VMPSW 1ST TWO BYTES WITH INT-CODE, 00608000
  557. ST R6,0(,R2) AND STORE FIRST HALF OF OLD PSW. 00609000
  558. * 00610000
  559. PRG04 LTR R8,R8 CHECK R8 - WAS THIS A MONITOR CALL ? 00611000
  560. BM PRG05 NOPE IF R8 STILL = -1. 00612000
  561. * 00613000
  562. STH R8,MONCLASS-PROPSW(,R2) IF YES, STORE MONITOR CLASS AND 00614000
  563. ST R9,MONCODE-PROPSW(,R2) MONITOR CODE IN VM'S PAGE 0. 00615000
  564. * 00616000
  565. PRG05 L R4,PRNPSW-PROPSW(,R2) GET CORRECT NEW PSW, 00617000
  566. L R5,PRNPSW-PROPSW+4(,R2) ... 00618000
  567. ST R4,VMPSW AND STORE AS VIRTUAL MACHINE PSW. 00619000
  568. ST R5,VMPSW+4 ... 00620000
  569. * 00621000
  570. PRGEXT NI VMRSTAT,255-(VMIOWAIT+VMEXWAIT) REMOVE FROM INST. WAIT 00622000
  571. GOTO DMKDSPB 'NEW PSW' ENTRY TO DISPATCH 00623000
  572. SPACE 00624000
  573. * INDEXED TABLE TO OBTAIN APPROPRIATE ILC IN LEFT-MOST TWO BITS: 00625000
  574. ORTABLE DC F'0' 00 (NOT TOO LIKELY) 00626000
  575. DC X'40000000' 01 00627000
  576. DC X'80000000' 10 00628000
  577. DC X'C0000000' 11 00629000
  578. SPACE 1 00630000
  579. * THE FOLLOWING 4 FIELDS ARE FOR USE BY VM MONITOR. 00631000
  580. DMKPRGC8 DC F'0' CNTRL REG 8 --ENABLED CLASSES OF MC 00632000
  581. DMKPRGMI DC A(0) ADDR OF DMKMON PROG INT HANDLER @V2B2638 00633000
  582. DMKPRGMC DC A(0) MONITOR COMMUNICATIONS AREA ADDRESS 00634000
  583. DMKPRGTI DC H'0' TIMER INTERVAL IN SECONDS FOR MONITOR 00635000
  584. SPACE 1 00636000
  585. EJECT 00637000
  586. *---------------------------------------------------------------------* 00638000
  587. * PAGING EXCEPTION ENCOUNTERED IN PROBLEM MODE * 00639000
  588. *---------------------------------------------------------------------* 00640000
  589. PAGEXCP EQU * PAGING EXCEPTION INTERRUPT 00641000
  590. TM VMESTAT,VMEXTCM IS IT A VIRTUAL 370R IN EXTENDED MODE ? 00642000
  591. BZ PAGINTR NO 00643000
  592. TM VMPSW,TRANMODE YES, WITH RELOCATION BIT ON? 00644000
  593. BZ CHEKPPF NO -- CHECK PSEUDO PAGE FAULTS @V2A3135 00645000
  594. GOTO DMKVATPX VIRTUAL PAGING EXCEPTION, MAYBE 00646000
  595. SPACE 00647000
  596. CHEKPPF EQU * TEST FOR PSEUDO PAGE FAULTS ON @V2A3135 00648000
  597. TM VMPSTAT,VMPAGEX DOES USER WANT THEM ? @V2A3135 00649000
  598. BZ PAGINTR NO -- @V2A3135 00650000
  599. TM VMPSW,VMIOPND IS HE ENABLED FOR THEM ? @V2A3135 00651000
  600. BZ PAGINTR NO -- @V2A3135 00652000
  601. GOTO DMKVATPF ALL SET TO GO SIMULATE PAGE FAULT@V2A3135 00653000
  602. SPACE 00654000
  603. *---------------------------------------------------------------------* 00655000
  604. * SEGMENT EXCEPTION DETECTED FROM PROBLEM MODE * 00656000
  605. *---------------------------------------------------------------------* 00657000
  606. SEGEXCP EQU * SEGMENT EXCEPTION @V407579 00658000
  607. TM VMESTAT,VMEXTCM TEST FOR EC-MODE MACHINE @V407579 00659000
  608. BZ PAGINTR NO, TREAT LIKE PAGING EXC. @V408246 00660000
  609. TM VMPSW,TRANMODE YES, TEST FOR TRANSLATE MODE @V407579 00661000
  610. BZ PAGINTR NO, TREAT LIKE PAGING EXC. @V408246 00662000
  611. GOTO DMKVATSX VIRTUAL SEGMENT EXCEPTION @V407579 00663000
  612. SPACE 00664000
  613. *---------------------------------------------------------------------* 00665000
  614. * TRANSLATION EXCEPTION - INTERRUPT CODE X'12' * 00666000
  615. *---------------------------------------------------------------------* 00667000
  616. TRANSEX EQU * @V407579 00668000
  617. TM VMESTAT,VMEXTCM IN EXTENDED CONTROL MODE? @V407579 00669000
  618. BZ TRANSEX1 NO,BRANCH PUT INTO CPREAD @VA10343 00670500
  619. TM VMPEND,VMPERPND IS PER ALSO PENDING ? @V407579 00671000
  620. BCR 1,R7 <BO> YES - GO TO PROPER ROUTINE @V407579 00672000
  621. L R8,FFS "NOT A MONITOR CALL" @V407579 00673000
  622. B PRGSIMI SIMULATE PROGRAM INTERRUPT @V407579 00674000
  623. TRANSEX1 DS 0H @VA10343 00674100
  624. MSG 'DMKPRG411W CP ENTERED; TRANSLATION EXCEPTION; WHILE IN X00674200
  625. NON EC MODE' 00674300
  626. B SKIPSWP1 @VA10343 00674400
  627. EJECT 00675000
  628. PAGINTR EQU * USER PAGING EXCEPTION 00676000
  629. L R9,TREXADD GET INTERRUPTING ADDRESS @V407579 00677000
  630. PAGINTRA BAL R10,OBSLOCK SYS LOCKED CODE BEYOND HERE @V407594 00678000
  631. * ********************************* 00679000
  632. LR R1,R9 PASS ADDRESS TO PAGER @V407579 00680000
  633. CALL DMKPTRAN,PARM=BRING+DEFER+VFAULT @V400141 00681000
  634. BC 2,UPPSW VIRTUAL ADRESSING EXCEPTION 00682000
  635. NI VMPEND,X'FF'-VMPERPND PER WILL COME IN AGAIN 00683000
  636. FASTEXIT DS 0H EXIT TO DSPA ENTRY OF DISPATCHER @VA07661 00684000
  637. NI VMRSTAT,X'FF'-(VMIOWAIT+VMEXWAIT) REMOVE FROM @V408246 00685000
  638. * WAIT 00686000
  639. GOTO DMKDSPA FAST RE-DISPATCH ON RECLAIM @V408246 00687000
  640. SPACE 2 00688000
  641. NRFEXIT EQU * EXIT TO NORMAL DISPATCH ENTRY 00689000
  642. NI VMRSTAT,X'FF'-(VMIOWAIT+VMEXWAIT) REMOVE FROM WAIT 00690000
  643. GOTO DMKDSPCH EXIT TO DISPATCH 00691000
  644. SPACE 2 00692000
  645. PSWTRAN EQU * "TRANS 2,1,OPT=(BRING,DEFER)" 00693000
  646. TRANS 2,1,OPT=(BRING,DEFER) 00694000
  647. BR R10 00695000
  648. SPACE 00696000
  649. UPPSW EQU * IF "ADDRESSING EXCEPTION" DUE TO PAGE FAULT, UP PSW 00697000
  650. L R1,VMPSW+4 GET FAILING INSTRUCTION 00698000
  651. LH R2,VMPRGIL ILC IN BYTES... 00699000
  652. ALR R1,R2 (PSW ADDRESS MAY BE NEGATIVE - ILC) 00700000
  653. ST R1,VMPSW+4 UPDATE .. 00701000
  654. LA R6,X'05' ADDRESSING EXCEPTION CODE 00702000
  655. STH R6,INTPR RESET INTERRUPT CODE 00703000
  656. TM VMPEND,VMPERPND IS PER ALSO PENDING ? 00704000
  657. BCR 1,R7 <BO> YES - GO TO APPROPRIATE ROUTINE 00705000
  658. L R8,FFS "NOT A MONITOR CALL" 00706000
  659. B PRGSIMLK SIMULATE PROGRAM INTERRUPT @V407579 00707000
  660. SPACE 00708000
  661. EJECT 00709000
  662. *********************************************************************** 00710000
  663. * * 00711000
  664. * HERE ON A PROGRAM INTERRUPT WITHIN THE CONTROL * 00712000
  665. * PROGRAM INDICATING A CONTROL PROGRAM ERROR. * 00713000
  666. * * 00714000
  667. *********************************************************************** 00715000
  668. SPACE 2 00716000
  669. DROP R12 DROP NORMAL ADDRESSABILITY, 00717000
  670. USING DMKPRGIN,R15 @V407579 00718000
  671. * 00719000
  672. * 00720000
  673. * HANDLE VM/370 NUCLEUS MONITOR INTERRUPTS 00721000
  674. * 00722000
  675. CKMON DS 0H @V408246 00723000
  676. TM INTPR+1,X'40' WAS IT A MONITOR CALL? @V408246 00724000
  677. BNZ CKMONA YES @V408246 00725000
  678. CLC PROPSW(8),SVCNPSW 1-2 PUNCH? @V408246 00726000
  679. BNE CKMONA NO, TRACE AND THEN TAKE CP ABEND @V408246 00727000
  680. TM SVCOPSW+1,PROBMODE PER INTERRUPT? @V408246 00728000
  681. BNZ PRGVRT YES @V408246 00729000
  682. CKMONA DS 0H @V408246 00730000
  683. NI VMDSTAT-VMBLOK(R14),255-VMDSP FORCE LONG DISP. @VA08236 00731000
  684. AIF (NOT &TRACE(9)).TR1 @V408246 00732000
  685. TM TRACFLG1,TRAC03 TRACING ACTIVE? @V408246 00733000
  686. BZ NOTRAC1 BRANCH IF NOT @V408246 00734000
  687. STM R12,R13,TEMPR12 PRESERVE REGS OVER TRACE @V407579 00735000
  688. TRACE CODE=TRCPGM,R14,R12,R13 TRACE PROGRAM CHECK @V407579 00736000
  689. USING TRACETBL,R14 @V407579 00737000
  690. XC TRACEADR,TRACEADR CLEAR @V407579 00738000
  691. MVC TRACECOD,INTPRL SAVE INTERRUPT ILC AND CODE @V407579 00739000
  692. MVC TRACEPSW,PROPSW SAVE PROGRAM INTERRUPT PSW @V407579 00740000
  693. DROP R14 @V407579 00741000
  694. LM R12,R13,TEMPR12 REFRESH REGS @V407579 00742000
  695. NOTRAC1 EQU * @V408246 00743000
  696. .TR1 ANOP 00744000
  697. TM INTPR+1,X'40' RECHECK AFTER TRACE FOR MONITOR @V408246 00745000
  698. * CALL 00746000
  699. BZ CPERROR NO, ABORT CP @V408246 00747000
  700. AIF (NOT &AP).APPRG @VA11772 00747100
  701. CLC DMKPRGMC,ZEROES IS THE MONITOR ACTIVE @VA11772 00747200
  702. BNE CKMONB YES-GO DO YOUR THING @VA11772 00747300
  703. LCTL C8,C8,CPCREG8 RELOAD THE MONITOR CONTROL REG @VA11772 00747400
  704. LM R14,R15,TEMPR14 RESTORE REGS @VA11772 00747500
  705. LPSW PROPSW RETURN THE MONITOR IS NOT ACTIVE @VA11772 00747600
  706. CKMONB EQU * @VA11772 00747700
  707. .APPRG ANOP @VA11772 00747800
  708. STM R0,R13,MONREGS PASS REGISTER CONTENTS AT 'MC' @V4M0114 00748000
  709. MVC MONREGS+R14*4(2*4),TEMPR14 @V4M0114 00749000
  710. L R12,DMKPRGMI ADDRESS OF MONITOR INT HANDLER @V408246 00750000
  711. GOTO (12) GOTO MONITOR WHO WILL LPSW EXIT @V4M0114 00751000
  712. EJECT 00752000
  713. CPERROR DS 0H PROGRAM INTERRUPT IN TRUE SUPERVISOR MODE 00753000
  714. MVC CPABEND(3),=C'PRG' MOVE IN THE ABEND CODE ID 00754000
  715. MVC CPABEND+3(1),INTPR+1 AND THE PROGRAN INTERUPT CODE 00755000
  716. STM R0,R13,DUMPSAVE PRESERVE REGISTERS FOR DUMP @V407579 00756000
  717. MVC DUMPSAVE+R14*4(2*4),TEMPR14 @V407579 00757000
  718. GOTO DMKDMPDK INVOKE DUMP ROUTINE @V407579 00758000
  719. * 00759000
  720. DROP R15 00760000
  721. SPACE 3 00761000
  722. LTORG 00762000
  723. SPACE 3 00763000
  724. TRACETBL DSECT , LAYOUT OF SYSTEM TRACE ENTRIES @V407579 00764000
  725. TRACETYP DS X TRACE TYPE (INCL. PROCESSOR) @V407579 00765000
  726. TRACEADR DS AL3 ADDRESS POINTER @V407579 00766000
  727. TRACECOD DS F INTERRUPT CODE @V407579 00767000
  728. TRACEPSW DS D OLD PSW @V407579 00768000
  729. TRACELNG EQU *-TRACETBL ENTRY LENGTH @V407579 00769000
  730. EJECT 00770000
  731. COPY EQU 00771000
  732. COPY SAVE @V407579 00772000
  733. COPY VMBLOK USER MACHINE DEFINITION. 00773000
  734. COPY PERBLOKS "PER" EXTENSION BLOCK PER001 00774000
  735. PSA 00775000
  736. END 00776000