Table of Contents

DMKSVC Source

References

Source Listing

DMKSVC.ASSEMBLE.txt
  1. SVC TITLE 'DMKSVC (CP) VM/370 - RELEASE 6' 00001000
  2. ISEQ 73,80 VALIDATE SEQUENCING OF SYSIN 00002000
  3. *. 00003000
  4. * MODULE NAME - 00004000
  5. * 00005000
  6. * DMKSVC 00006000
  7. * 00007000
  8. * CONTENTS - 00008000
  9. * 00009000
  10. * DMKSVCIN - SVC INTERRUPT HANDLER 00010000
  11. * 00011000
  12. * FUNCTION - 00012000
  13. * 00013000
  14. * TO PERFORM THE APPROPRIATE ACTIONS FOR VARIOUS 00014000
  15. * TYPES OF SVC INTERRUPT CODES. 00015000
  16. * 00016000
  17. * ATTRIBUTES - 00017000
  18. * 00018000
  19. * SERIALLY REUSABLE, RESIDENT 00019000
  20. * 00020000
  21. * ENTRY POINTS - 00021000
  22. * 00022000
  23. * DMKSVCIN - SVC INTERRUPT HANDLER 00023000
  24. * 00024000
  25. * ENTRY POINTS - NON-EXECUTABLE 00025000
  26. * 00026000
  27. * DMKSVCNS - ADDRESS OF NEXT AVAILABLE SAVE-AREA 00027000
  28. * DMKSVCLO - "DMKFRELO" MINUS LENGTH OF ONE SAVE-AREA 00028000
  29. * DMKSVCHI - "DMKFREHI" 00029000
  30. * 00030000
  31. * ENTRY CONDITIONS - 00031000
  32. * 00032000
  33. * NONE, OTHER THAN THE INFORMATION IN THE 00033000
  34. * OLD PSW AND INTERRUPT CODE. 00034000
  35. * 00035000
  36. * EXIT CONDITIONS - 00036000
  37. * 00037000
  38. * (SEE "OPERATION"). 00038000
  39. * 00039000
  40. * SYSTEM ABEND CODES - 00040000
  41. * 00041000
  42. * SVC001 - SAVE-AREA SCRATCHPAD EXHAUSTED ON LINK REQUEST 00042000
  43. * SVC002 - SUPERVISOR STATE SVC WITHOUT SYSTEM LOCK 00043000
  44. * SVC003 - PAGING I/O ERROR ON LINK TO CP PAGEABLE ROUTINE 00044000
  45. EJECT 00045000
  46. * CALLS TO OTHER ROUTINES - 00046000
  47. * 00047000
  48. * DMKDSPCH - TO DISPATCH A VIRTUAL MACHINE 00048000
  49. * DMKDSPB - TO CHECK OUT A WAIT-STATE PSW 00049000
  50. * DMKDSPRU - TO UNRUN THE CURRENT USER AND DISPATCH ANOTHER 00050000
  51. * DMKSTKDE - TO STACK A DEFERRED RETURN WITH SYSTEM LOCK 00051000
  52. * DMKSTKSW - TO STACK PRIORITY BLOK FOR OTHER PROCESSOR 00052000
  53. * DMKPRGRF - TO REFLECT AN SVC INTERRUPT TO A VIRTUAL MACHINE 00053000
  54. * DMKDMPDK - TO DUMP THE MACHINE IN CASE OF A FATAL ERROR 00054000
  55. * DMKPTRUL - TO UNLOCK A PAGE ON RETURN FROM PAGEABLE PROGRAM 00055000
  56. * DMKFREE - TO OBTAIN FREE STORAGE FOR CALL LINKAGE 00056000
  57. * DMKTRCSV - TO HANDLE A USER SVC WHEN VM TRACING IS ON 00057000
  58. * DMKCFMBK - PLACE USER IN CF MODE ADSTOP 00058000
  59. * DMKQCNWT - WRITE ADSTOP MESSAGE 00059000
  60. * DMKFRET - TO RELEASE ADSTOP BUFFER 00060000
  61. * DMKTRCIT - TO RE-INITIALIZE INSTRUCTION TRACING FOR ADSTOP 00061000
  62. * DMKTRCPB - TO RESET OLD INSTRUCTION TRACING IF NECESSARY 00062000
  63. * DMKVERO - TO PROCESS AN SVC76 REQUEST FROM OS 00063000
  64. * DMKVERD - TO PROCESS AN SVC76 REQUEST FROM DOS 00064000
  65. * DMKCVTBH - TO CONVERT ADSTOP ADDRESS TO PRINTABLE CHARS 00065000
  66. * DMKPSACG - TO END CURRENT SUPERVISOR STATE CHARGES TO USER 00066000
  67. * DMKLOKDF - TO TEST STATE OF GLOBAL SYSTEM LOCK 00067000
  68. SPACE 00068000
  69. * EXTERNAL REFERENCES - 00069000
  70. * 00070000
  71. * DMKSLC - END OF V=R STORAGE FOR FREE SAVE-AREA MGMT. 00071000
  72. * DMKLOKSY - GLOBAL SYSTEM LOCK (FOR AP SUPPORT) 00072000
  73. * 00073000
  74. * TABLES / WORK AREAS - 00074000
  75. * 00075000
  76. * SVCREGS - REGISTER SAVE AREA IN PAGE 0 00076000
  77. * DUMPSAVE - REGISTER CONTENTS AT TIME OF ABEND (IN PAGE 0) 00077000
  78. * DMKSYSVM - VMBLOK OF CP370 SYSTEM 00078000
  79. * DMKSYSOP - SYSTEM OPERATOR'S VMBLOK 00079000
  80. * REGISTER USAGE - 00080000
  81. * 00081000
  82. * GPR 12 = BASE REGISTER FOR CALLED ROUTINE 00082000
  83. * GPR 13 = ADDRESS OF STANDARD SAVE AREA FOR CALLED ROUTINE 00083000
  84. * 00084000
  85. * GPRS 0-11 AND 14-15 NOT USED (OR ARE PRESERVED) 00085000
  86. * 00086000
  87. * SYSTEM LOCK REQUIREMENTS - 00087000
  88. * 00088000
  89. * FROM PROBLEM STATE: 00089000
  90. * THE SYSTEM LOCK IS NEVER HELD ON ENTRY. 00090000
  91. * FOR SVC 76 OR X'B3' THE LOCK IS ACQUIRED IF THE SVC 00091000
  92. * IS NOT TO BE REFLECTED TO THE VIRTUAL MACHINE. 00092000
  93. * FOR SVC S FAST REFLECTED TO THE VIRTUAL MACHINE THE 00093000
  94. * LOCK IS NOT ACQUIRED. 00094000
  95. * FOR SVC S SLOW REFLECTED, THE LOCK IS ACQUIRED BEFORE 00095000
  96. * CONTROL IS PASSED TO DMKPRGRF. 00096000
  97. * FROM SUPERVISOR STATE: 00097000
  98. * SVC 0 - THE STATE OF THE SYSTEM LOCK IS UNPREDICTABLE. 00098000
  99. * ALL OTHER SVC S - THE SYSTEM LOCK IS HELD ON ENTRY. 00099000
  100. EJECT 00100000
  101. * OPERATION - 00101000
  102. * 00102000
  103. * SVC-INTERRUPTIONS ARE HANDLED AS FOLLOWS: 00103000
  104. * 00104000
  105. * 1. IF THE MACHINE WAS IN PROBLEM STATE, DMKSVCIN TAKES 00105000
  106. * THE FOLLOWING ACTION: 00106000
  107. * 00107000
  108. * A. THE SVC INTERRUPT CODE IS EXAMINED TO DETERMINE IF 00108000
  109. * THE INTERRUPT CODE IS FOR 'ADSTOP' (SVC CODE X'B3') 00109000
  110. * OR FOR ERROR RECORDING (SVC CODE X'4C'). IF NOT, 00110000
  111. * CONTROL IS GIVEN TO STEP B. 00111000
  112. * FOR AN 'ADSTOP' SVC, THE SYSTEM LOCK IS ACQUIRED, THE 00112000
  113. * MESSAGE 'ADSTOP AT XXXXX' IS SENT TO THE USER, THE 00113000
  114. * OVERLAYED INSTRUCTION IS REPLACED, AND IF THE USER 00114000
  115. * WANTS VM ASSIST TO HANDLE SVCS, VM ASSIST SVC HANDLING 00115000
  116. * IS TURNED BACK ON. FINALLY THE USER IS 00116000
  117. * PLACED IN CONSOLE FUNCTION MODE VIA A CALL TO 00117000
  118. * DMKCFMBK. 00118000
  119. * FOR AN SVC 76, GENERAL REGISTERS 0 AND 1 ARE CHECKED 00119000
  120. * FOR VALID OS OR DOS ERROR RECORDING PARAMETERS. 00120000
  121. * IF INVALID, CONTROL IS GIVEN TO STEP B. OTHERWISE 00121000
  122. * THE SYSTEM LOCK IS ACQUIRED, AND DMKVER IS CALLED TO 00122000
  123. * FURTHER PROCESS THE RECORDING REQUEST. IF CONTROL IS 00123000
  124. * RETURNED FROM DMKVER, THE REQUEST WAS INVALID, THUS THE 00124000
  125. * SVC 76 MUST BE REFECTED TO THE USER. IN THIS CASE 00125000
  126. * CONTROL IS GIVEN TO STEP C. 00126000
  127. * 00127000
  128. * B. IF THE VIRTUAL MACHINE'S REAL PAGE ZERO IS IN STORAGE 00128000
  129. * AN APPROPRIATE SVC OLD PSW IS STORED, AND NEW PSW 00129000
  130. * FETCHED IN ORDER TO "FAST REFLECT" THE INTERRUPT TO THE 00130000
  131. * VIRTUAL MACHINE WITHOUT UNNECESSARY REGISTER SAVING OR 00131000
  132. * DISPATCHING OVERHEAD. THE NEW PSW IS CHECKED FOR MODE 00132000
  133. * OR ENABLEMENT CHANGES WHICH PRECLUDE "FAST REFLECT", 00133000
  134. * AND IF FOUND, THE SYSTEM LOCK IS ACQUIRED BEFORE 00134000
  135. * CONTROL IS PASSED TO DMKDSPB FOR PSW VALIDATION; FOR 00135000
  136. * SUCCESSFUL "FAST REFLECT" CONTROL IS PASSED DIRECTLY 00136000
  137. * BACK TO THE VIRTUAL MACHINE WITHOUT FURTHER PROCESSING. 00137000
  138. * 00138000
  139. * C. FOR NORMAL REFLECTION OF AN INTERRUPT TO A VIRTUAL 00139000
  140. * MACHINE, ITS GENERAL AND FLOATING POINT REGISTERS ARE 00140000
  141. * SAVED, ITS VMBLOK IS MARKED IN INSTRUCTION-WAIT, THE 00141000
  142. * ACTIVE INTERRUPT STATUS INFORMATION IS LOADED INTO 00142000
  143. * INTO REGISTERS, THE SYSTEM LOCK IS ACQUIRED, AND 00143000
  144. * CONTROL IS PASSED VIA 'GOTO' TO DMKPRGRF. 00144000
  145. EJECT 00145000
  146. * OPERATION (CONTINUED) - 00146000
  147. * 00147000
  148. * 2. IF THE MACHINE WAS IN SUPERVISOR STATE, DMKSVCIN VALIDATES 00148000
  149. * THAT THE SYSTEM LOCK IS HELD FOR ALL CASES EXCEPT SVC 0, 00149000
  150. * ABENDING IF NOT, AND THEN TAKES ONE OF THE FOLLOWING STEPS, 00150000
  151. * DEPENDING ON THE INTERRUPT CODE: 00151000
  152. * 00152000
  153. * SVC 0: THIS INDICATES AN "IMPOSSIBLE" CONDITION, OR FATAL 00153000
  154. * ERROR; THE GENERAL REGISTERS ARE SAVED IN THE 00154000
  155. * DUMPSAVE AREA, AND DMKDMPDK IS INVOKED TO DUMP THE 00155000
  156. * MACHINE. THE SYSTEM THEN DOES A SOFTWARE RE-IPL. 00156000
  157. * 00157000
  158. * SVC 4: RESERVED FOR FUTURE USE. AT PRESENT, THIS IS 00158000
  159. * HANDLED LIKE SVC 0. 00159000
  160. * 00160000
  161. * SVC 8: THIS INDICATES A "CALL" TO A VM/370 ROUTINE WHOSE 00161000
  162. * ADDRESS IS SPECIFIED IN BITS 8-31 OF REGISTER 15. THE 00162000
  163. * AFFINITY FLAG (BIT 0 OF REG 15), IF ON, SPECIFIES THAT 00163000
  164. * WHEN CONTROL IS RETURNED TO THE CALLER, IT SHOULD 00164000
  165. * BE ON THE PROCESSOR INITIATING THE CALL. A NEW SAVE 00165000
  166. * AREA IS OBTAINED (DMKFREE BEING CALLED IF NECESSARY), 00166000
  167. * AND THE CALLER'S ADDRESSABILITY (GPR 12), SAVE-AREA 00167000
  168. * ADDRESS (GPR 13) AND THE RETURN ADDRESS (FROM THE 00168000
  169. * SVC OLD PSW) ARE PRESERVED IN THE NEW SAVE-AREA. 00169000
  170. * (IF AFFINITY WAS SPECIFIED, THE CURRENT PROCESSOR ID 00170000
  171. * IS PLACED IN A SAVE-AREA FIELD WHICH IS OTHERWISE 0.) 00171000
  172. * THEN, IF THE CALLED ROUTINE (SPECIFIED BY GPR 15) IS 00172000
  173. * WITHIN THE CP370 NUCLEUS, ITS ADDRESS IS PLACED IN GPR 00173000
  174. * 12, AND CONTROL IS TRANSFERRED TO THE CALLED ROUTINE. 00174000
  175. * 00175000
  176. * IF, ON THE OTHER HAND, THE CALLED ROUTINE IS NOT 00176000
  177. * WITHIN THE CP370 NUCLEUS, BUT IS IN A PAGEABLE 00177000
  178. * MODULE, THEN ALL NEEDED REGISTERS AND CONTROL 00178000
  179. * INFORMATION IS PRESERVED IN THE NEW SAVE-AREA, AND 00179000
  180. * A "TRANS" IS ISSUED TO HAVE THE PAGING ROUTINES 00180000
  181. * BRING IN THE PAGE CONTAINING THE NEEDED MODULE. 00181000
  182. * WHEN RETURN FROM THE "TRANS" OCCURS, THE REAL 00182000
  183. * ADDRESS OF THE PAGEABLE ROUTINE IS PLACED IN GPR 12, 00183000
  184. * AND CONTROL IS THEN TRANSFERRED TO THE CALLED ROUTINE. 00184000
  185. * 00185000
  186. * SVC 12: THIS INDICATES A "RETURN" FROM A CALLED ROUTINE TO 00186000
  187. * THE CALLING ROUTINE. THE SAVE-AREA IS EXAMINED FOR 00187000
  188. * PROCESSOR AFFINITY, WHICH, IF SPECIFIED AND 00188000
  189. * NON-MATCHING, CAUSES STACKING TO THE SPECIFIED 00189000
  190. * PROCESSOR BEFORE RETURN PROCEEDS. IF THE RETURNING 00190000
  191. * ROUTINE IS A PAGEABLE MODULE, DMKPTRUL IS CALLED 00191000
  192. * RETURN IS A PAGEABLE CP370 MODULE, DMKPTRUL IS CALLED 00192000
  193. * TO UNLOCK THE PAGE; IN ANY EVENT, THE ADDRESSABILITY 00193000
  194. * (GPR 12) AND SAVE-AREA ADDRESS (GPR 13) OF THE CALLER 00194000
  195. * ARE THEN RESTORED, THE RETURN ADDRESS IS PLACED IN THE 00195000
  196. * SVC OLD PSW, AND CONTROL IS RETURNED TO THE CALLING 00196000
  197. * PROGRAM BY LOADING THE SVC OLD PSW. 00197000
  198. EJECT 00198000
  199. * OPERATION (CONTINUED ) - 00199000
  200. * 00200000
  201. * SVC 16: THIS CODE INDICATES THAT THE "CURRENT" SAVE AREA IS 00201000
  202. * TO BE RELEASED, WITHOUT ANY TRANSFER OF CONTROL. THE 00202000
  203. * CHAIN OF SAVE-AREAS USED BY SVC 8 & SVC 12 IS REVISED 00203000
  204. * TO INCLUDE THE SAVE-AREA BEING RETURNED, AND CONTROL 00204000
  205. * IS RETURNED TO THE PROGRAM WHICH ISSUED THE SVC 16. 00205000
  206. * 00206000
  207. * SVC 20: THIS CODE INDICATES THAT A NEW SAVE-AREA IS TO BE 00207000
  208. * GIVEN TO THE CALLER, WITHOUT ANY TRANSFER OF CONTROL. 00208000
  209. * THE NEXT AVAILABLE SAVE-AREA IN THE CHAIN USED BY 00209000
  210. * SVC 8 & SVC 12 IS DETACHED FROM THE CHAIN, AND 00210000
  211. * RETURNED TO THE CALLER IN GPR 13. NO CONTROL TRANSFER 00211000
  212. * TAKES PLACE - CONTROL BEING RETURNED TO THE CALLER 00212000
  213. * OF THE SVC 20. 00213000
  214. * 00214000
  215. * SVC 24: THIS CODE CAUSES CONTROL TO BE PASSED TO THE MAIN 00215000
  216. * PROCESSOR AT THE INSTRUCTION FOLLOWING THE SVC. 00216000
  217. * ALL GENERAL REGISTERS ARE PRESERVED, BUT PSW FIELDS 00217000
  218. * OTHER THAN THE INSTRUCTION COUNTER ARE NOT. 00218000
  219. * 00219000
  220. * 00220000
  221. * 00221000
  222. * SVC 76: THIS CODE IS IGNORED, CAUSING NO OPERATION. 00222000
  223. * IF THIS SYSTEM IS RUNNING ON A VIRTUAL MACHINE, 00223000
  224. * DMKIOF ISSUES AN 'SVC 76' WHICH SHOULD CAUSE THE 00224000
  225. * NATIVE HYPERVISOR TO RECORD AN I/O ERROR AND NO-OP 00225000
  226. * THE SVC; HOWEVER, IF THE NATIVE HYPERVISOR DOES NOT 00226000
  227. * RECOGNIZE VALID ERROR RECORDING REGISTERS AT THE TIME 00227000
  228. * OF THE SVC, IT WILL REFLECT IT TO THIS SYSTEM, IN 00228000
  229. * WHICH CASE IT SHOULD BE IGNORED. 00229000
  230. *. 00230000
  231. EJECT 00231000
  232. COPY OPTIONS 00232000
  233. COPY LOCAL 00233000
  234. DMKSVC START 0 -LOADER CONTROL- @V407579 00234000
  235. SPACE 00235000
  236. ENTRY DMKSVCIN @V407579 00236000
  237. ENTRY DMKSVCNS = INTERNAL SYMBOL "NEXTSAVE" @V407579 00237000
  238. ENTRY DMKSVCLO CONTAINS (DMKFRELO -L'SAVEAREA) @V407579 00238000
  239. ENTRY DMKSVCHI CONTAINS (DMKFREHI) @V407579 00239000
  240. SPACE 00240000
  241. EXTRN DMKPRGRF 00241000
  242. AIF (NOT &TRACE(6)).TRA1 ***AIF*** 00242000
  243. EXTRN DMKTRCSV TO HANDLE USER SVC WHEN VM TRACING IS ON 00243000
  244. EXTRN DMKTRCIT TO RE-INITIALIZE INSTRUCTION TRACING 00244000
  245. EXTRN DMKTRCPB TO RESET OLD INSTRUCTION TRACING (IF ANY) 00245000
  246. .TRA1 ANOP 00246000
  247. EXTRN DMKDMPDK @V407579 00247000
  248. EXTRN DMKCVTBH 00248000
  249. AIF (NOT &VIRREAL).NOVR1 00249000
  250. EXTRN DMKSLC HIGH END OF V=R AREA (IF ANY) - OR 0 00250000
  251. .NOVR1 ANOP 00251000
  252. EXTRN DMKPTRUL @V200820 00252000
  253. EXTRN DMKCFMBK 00253000
  254. EXTRN DMKDSPB 00254000
  255. AIF (NOT &AP).DSPRU4 00254900
  256. EXTRN DMKDSPRU DISPATCH UNLOCKED PARALLEL PATH @V407579 00255000
  257. EXTRN DMKSTKDE STACK OF DEFERRED LOCKED RETURN @V407579 00256000
  258. EXTRN DMKSTKSW STACK BLOK FOR OTHER PROCESSOR @V4M0141 00257000
  259. EXTRN DMKLOKSY GLOBAL SYSTEM LOCK @V407579 00258000
  260. .DSPRU4 ANOP 00258100
  261. EXTRN DMKVERO,DMKVERD @V200226 00259000
  262. SPACE 2 00260000
  263. USING PSA,0 @V407579 00261000
  264. SPACE 1 00262000
  265. OPCODEEX EQU X'44' S/370 OP CODE FOR 'EXECUTE' INST.@V407579 00263000
  266. * 00264000
  267. SVCCRETN EQU 12 VM/370 SVC CODE FOR 'RETURN' @V407579 00265000
  268. SVCCIOER EQU 76 OS/DOS/370 SVC CODE FOR I/O ERROR@V407579 00266000
  269. SVCCSTOP EQU X'B3' VM/370 ADSTOP PLANTED 'SVC' CODE @V407579 00267000
  270. * 00268000
  271. D2MASK EQU X'00000FFF' MASK FOR S/370 INST. DISPLACEMENT@V407579 00269000
  272. * 00270000
  273. INCRBY1 EQU 1 USED TO INCREMENT COUNTERS BY 1 @V407579 00271000
  274. * 00272000
  275. EQUAL EQU B'1000' CONDITION CODE MASK @V407579 00273000
  276. EJECT 00274000
  277. **** SVC ROUTINES **** 00275000
  278. SPACE 00276000
  279. DMKSVCIN DS 0H SVC FLIH %V4M0144 00277000
  280. OI CPSTATUS,CPSUPER INDICATE SUPERVISOR STATE %V4M0144 00278000
  281. STM R12,R15,SVCREGS SAVE REGISTERS %V4M0144 00279000
  282. L R12,SVCNPSW+4 OBTAIN ADDRESSABILITY %V407579 00280000
  283. USING DMKSVCIN,R12 %V407579 00281000
  284. TM SVCOPSW+1,PROBMODE CHECK FOR PROBLEM MODE %V3M4038 00282000
  285. BO REFSVC YES - REFLECT IT. %V3M4038 00283000
  286. AIF (NOT &TRACE(9)).TR1 00284000
  287. TM TRACFLG1,TRAC02 TRACING ACTIVE? %V3M4038 00285000
  288. BZ NOTRAC1 BRANCH IF NOT %V3M4038 00286000
  289. TRACE CODE=TRCSVC,R14,R13,R15 TRACE SUPERVISOR SVC %V407579 00287000
  290. USING TRACETBL,R14 %V407579 00288000
  291. L R13,SVCR13 REFRESH R13 %V407579 00289000
  292. L R15,SVCR15 REFRESH R15 %V407579 00290000
  293. STCM R15,B'0111',TRACEADR TRACE R15 ON ENTRY %V407579 00291000
  294. CLI INTSVC+1,SVCCRETN TEST FOR 'RETURN' SVC %V407579 00292000
  295. BNE NOT0C NO... LEAVE R15 IN ENTRY %V3M4038 00293000
  296. MVC TRACEADR,SAVERTN-SAVEAREA(R13) TRACE CALLER %V407579 00294000
  297. NOT0C MVC TRACECOD,INTSVCL SAVE INTERRUPT ILC AND CODE %V407579 00295000
  298. MVC TRACEPSW,SVCOPSW SAVE SVC OLD PSW %V407579 00296000
  299. DROP R14 %V407579 00297000
  300. NOTRAC1 EQU * %V3M4038 00298000
  301. .TR1 ANOP 00299000
  302. CLI INTSVC+1,SVCCIOER TEST FOR VM/370 ERROR RECORD%V407579 00300000
  303. BE SVCIGNOR IGNORE SVC 76 FROM DMKIOF %V407579 00301000
  304. LH R14,INTSVC GET SVC INTERRUPT-CODE %V407579 00302000
  305. AIF ('&AP' EQ '1').APON4 00302600
  306. B SVCODES(R14) HANDLE SVC VIA BRANCH TABLE %V407579 00302700
  307. AGO .APOFF4 00302800
  308. .APON4 ANOP 00302900
  309. TM APSTAT1,APUOPER TEST FOR AP SYSTEM %V407579 00303000
  310. BZ SVCODES(R14) HANDLE SVC VIA BRANCH TABLE %V407579 00304000
  311. L R15,=A(DMKLOKSY+2) ACCESS THE SYSTEM LOCK %V407579 00305100
  312. CLC LPUADDR,0(R15) TEST FOR CURRENTLY HELD %V407579 00305600
  313. L R15,SVCR15 REFRESH R15 %V407579 00306100
  314. BE SVCODES(R14) HANDLE SVC VIA BRANCH TABLE %V407579 00306600
  315. LTR R14,R14 TEST FOR SVC 0 EXPLICITLY @V407579 00309000
  316. BZ SVCODES(R14) IF SO, VALID DIE @V407579 00310000
  317. ABSVC MVC CPABEND,SVC002 SET ABEND FOR LACK OF LOCK @V407579 00311000
  318. B SVCDIE2 @V407579 00312000
  319. SVC002 DC C'SVC',AL1(2) ABEND CODE FOR SVC W/O SYS LOCK @V407579 00313000
  320. .APOFF4 ANOP 00313100
  321. SPACE 00314000
  322. SVCODES DS 0F BRANCH-TABLE FOR SVC-CODES: 00315000
  323. CODE0 B SVCDIE FATAL CONDITION - INTO HARD WAIT STATE. 00316000
  324. CODE4 B SVCDIE SVC 4 NOT VALID 00317000
  325. CODE8 B SVCLINK LINK REQUEST. %V3M4038 00318000
  326. CODE12 B SVCRET RETURN REQUEST. %V3M4038 00319000
  327. CODE16 B SVCRLSE RELEASE CURRENT SAVE AREA. 00320000
  328. CODE20 B SVCGET GET NEXT SAVE AREA 00321000
  329. CODE24 B SVCSWIT SWITCH CONTROL TO MAIN PROC. @V407579 00322000
  330. NSVCODES EQU *-SVCODES COUNT OF SVC CODES. 00323000
  331. EJECT 00324000
  332. REFSVC DS 0D DO FAST REFLECT OF USER SVC IF POSSIBLE: 00325000
  333. LCTL C8,C8,CPCREG8 RESET HOST SYSTEM'S MC MASK @V3M4026 00326000
  334. LA R15,INCRBY1 COUNT USER SVCS (BY PROCESSOR) @V407579 00327000
  335. AL R15,PSASVCCT @V407579 00328000
  336. ST R15,PSASVCCT AND SAVE 00329000
  337. L R14,RUNUSER ACCESS VMBLOK OF RUNNING USER @V4M0203 00330000
  338. USING VMBLOK,R14 @V4M0203 00331000
  339. STPT VMTMOUTQ STOP CHARGING FOR PROBLEM TIME 00332000
  340. CHARGE START START CHARGING SUPERVISOR TIME @V407579 00333000
  341. DROP R14 @V4M0203 00334000
  342. MVC QUANTUMR,TIMER SAVE INTERVAL TIMER @VA01775 00335000
  343. AIF (NOT &TRACE(9)).TR3 00336000
  344. TM TRACFLG1,TRAC02 TRACING ACTIVE? 00337000
  345. BZ NOTRAC3 BRANCH IF NOT 00338000
  346. TRACE CODE=TRCSVC,R15,R13,R14 TRACE USER SVC REFLECT @V407579 00339000
  347. USING TRACETBL,R15 @V407579 00340000
  348. MVC TRACEADR,SVCR15+1 SHOW R15 AT ENTRY @V407579 00341000
  349. MVC TRACECOD,INTSVCL SAVE INTERRUPT ILC AND CODE @V407579 00342000
  350. MVC TRACEPSW,SVCOPSW SAVE SVC OLD PSW @V407579 00343000
  351. NOTRAC3 EQU * 00344000
  352. .TR3 ANOP 00345000
  353. L R15,RUNUSER ACCESS VMBLOK OF RUNNING USER @V4M0203 00346000
  354. USING VMBLOK,R15 @V4M0203 00347000
  355. CLI INTSVC+1,SVCCIOER TEST FOR ERROR RECORDING @V407579 00348000
  356. BE SVCVER YES - GO VERIFY PARAMETER REGS. @V200226 00349000
  357. CLI INTSVC+1,SVCCSTOP TEST FOR VM/370 ADSTOP @V407579 00350000
  358. BE SVCADSTP YES, CHECK IT OUT @VA05407 00351000
  359. TSTRACE LCTL C0,C0,CPCREG0 SET TO CP ARCHITECTURE @VA05407 00352000
  360. AIF (NOT &TRACE(6)).TRA2 ***AIF*** 00353000
  361. TM VMTRCTL,VMTRSVC+VMTRBRIN VM TRACING IN EFFECT ? 00354000
  362. BNZ REFSVCB TRF IF YES. 00355000
  363. .TRA2 ANOP 00356000
  364. TM VMESTAT,VMEXTCM IS VM IN EXTENDED CONTROL MODE? 00357000
  365. BO REFECMOD DO EC-MODE FAST REFLECT, IF SO @V407579 00358000
  366. LRA R13,PSA TRY ADDRESSABILITY TO USER'S PSA @V407579 00359000
  367. BNZ REFSVCB IF NOT IN, MAKE DMKPRGRF DO THE WORK 00360000
  368. L R14,SVCOPSW+4 GET ADDRESS FROM SVC-OLD-PSW 00361000
  369. ST R14,SVCOPSW+4-PSA(,R13) USER'S OLD IC @V407579 00362000
  370. L R14,INTSVCL GET ILC (BITS 13-14) AND CODE @V407579 00363000
  371. SRL R14,3 MOVE ILC TO BITS 16-17 @V407579 00364000
  372. O R14,SVCOPSW COMBINE WITH CC, PGM MASK @V407579 00365000
  373. STCM R14,B'0010',SVCOPSW+4-PSA(R13) USER'S ILC,CC@V407579 00366000
  374. L R14,INTSVCL GET SVC INTERRUPT CODE @V407579 00367000
  375. REFMASK ICM R14,B'1100',VMPSW GET VIRTUAL MASK, KEY, MODE @V407579 00368000
  376. ST R14,SVCOPSW-PSA(,R13) USER'S MASK, KEY, MODE @V407579 00369000
  377. L R14,SVCNPSW-PSA(,R13) GET USER'S NEW MASK,ETC@V407579 00370000
  378. L R13,SVCNPSW+4-PSA(,R13) GET USER'S NEW IC @V407579 00371000
  379. ST R13,VMPSW+4 00372000
  380. LA R13,0(,R13) STRIP ALL BUT IC @V407579 00373000
  381. ST R13,RUNPSW+4 SET NEW IC FOR RE-ENTRY TO USER @V407579 00374000
  382. L R13,VMPSW KEEP TRACK OF FORMER MASK/MODE @V407579 00375000
  383. ST R14,VMPSW ESTABLISH NEW USER MASK/MODE @V407579 00376000
  384. XR R13,R14 IDENTIFY CHANGING PSW STATES @V407579 00377000
  385. NR R13,R14 GOING FROM ZERO TO ONE @V407579 00378000
  386. N R13,BCBADBIT X'FF0A0000' BITS OF INTEREST @V407579 00379000
  387. BNZ REFSVCA IF NOT, MAKE "DISPATCH" DO THE WORK. 00380000
  388. TM VMPEND,VMPERPND PER INTERRUPT PENDING? PER001 00380100
  389. BO REFSVCA YES. GO TO DMKDSPB TO PROCESS IT. PER001 00380200
  390. ICM R14,B'0010',VMPSW+4 GET USER'S NEW CC, PGM MASK @V407579 00381000
  391. N R14,MODEBUSR X'00F03F00' PSW BITS SET BY USER @V407579 00382000
  392. TM VMPSTAT,VMV370R EXTENTED MACHINE ? @VA08573 00382100
  393. BO REFRUN1 YES,GO RELOAD CTL REGS @VA08573 00382200
  394. REFRUN O R14,MODEBSYS X'070D0000' PSW BITS SET BY CP @V407579 00383000
  395. ST R14,RUNPSW PROPER RE-ENTRY PSW (FIRST HALF) @V407579 00384000
  396. TM VMTRCTL,VMTRPER IS "PER" IN USE? PER001 00384100
  397. BNO *+8 NO, SKIP TURNING IT ON PER001 00384200
  398. OI RUNPSW,PERMODE TURN ON PER BIT PER001 00384300
  399. LR R13,R11 PRESERVE USER'S R11 @V407579 00385000
  400. LR R11,R15 STANDARD ADDRESSABILITY @V407579 00386000
  401. DROP R15 @V407579 00387000
  402. USING VMBLOK,R11 @V407579 00388000
  403. CHARGE STOP END OF SUPERVISOR CHARGES @V407579 00389000
  404. SPT VMTMOUTQ START CHARGING PROBLEM TIME 00390000
  405. DROP R11 @V407579 00391000
  406. LR R11,R13 RESTORE USER'S R11 @V407579 00392000
  407. L R12,QUANTUMR CHECKPOINT TIMER @V4M0167 00393000
  408. S R12,TIMER - (CURRENT TIMER) -> SUPERVISOR @V4M0167 00394000
  409. L R13,QUANTUM ORIGINAL TIME @V4M0167 00395000
  410. SR R13,R12 - SUPERVISOR @V4M0167 00396000
  411. ST R13,QUANTUM . . WILL EVENTUALLY GIVE PROBLEM @V4M0167 00397000
  412. MVI CPSTATUS,CPRUN INDICATE RUNNING USER STATUS @V4M0156 00398000
  413. LM R12,R15,SVCREGS NOW RESTORE THE REG'S WE USED 00399000
  414. LPSW RUNPSW AND AWAY WE GO. 00400000
  415. * 00401000
  416. USING VMBLOK,R15 @V407579 00402000
  417. REFECMOD LCTL C1,C1,VMSEG REVERT TO USER'S REAL SPACE @V407579 00403000
  418. LRA R13,PSA TRY ADDRESSABILITY TO USER'S PSA @V407579 00404000
  419. BNZ REFSVCB IF NOT AVAILABLE, SLOW REFLECT @V407579 00405000
  420. L R14,SVCOPSW+4 GET ADDRESS FROM SVC-OLD-PSW @V407579 00406000
  421. ST R14,SVCOPSW+4-PSA(,R13) USER'S OLD IC @V407579 00407000
  422. L R14,INTSVCL GET ILC (BITS 13-14) AND CODE @V407579 00408000
  423. ST R14,INTSVCL-PSA(,R13) USER'S EC-MODE CODE @V407579 00409000
  424. L R14,SVCOPSW GET CC, PGM MASK @V407579 00410000
  425. ICM R14,B'1100',VMPSW GET VIRTUAL MASK, KEY, MODE @V407579 00411000
  426. ST R14,SVCOPSW-PSA(,R13) USER'S MASK, KEY, MODE @V407579 00412000
  427. L R14,SVCNPSW-PSA(,R13) GET USER'S NEW MASK,ETC@V407579 00413000
  428. L R13,SVCNPSW+4-PSA(,R13) GET USER'S NEW IC @V407579 00414000
  429. ST R13,VMPSW+4 SET NEW IC @V407579 00415000
  430. ST R13,RUNPSW+4 SET NEW IC FOR RE-ENTRY TO USER @V407579 00416000
  431. L R13,VMPSW KEEP TRACK OF FORMER MASK/MODE @V407579 00417000
  432. ST R14,VMPSW ESTABLISH NEW USER MASK/MODE @V407579 00418000
  433. CLI VMPSW+4,0 CHECK MUST-BE-ZERO BITS OF EC PSW@V407579 00419000
  434. BNE REFSVCA IF NOT, MAKE DISPATCH CHECK IT @V407579 00420000
  435. XR R13,R14 IDENTIFY CHANGING PSW STATES @V407579 00421000
  436. N R13,ECBADBIT X'FF0AC0FF' BITS OF INTEREST @V407579 00422000
  437. BNZ REFSVCA USE DISPATCH CHECK-OUT, IF ANY @V407579 00423000
  438. REFRUN1 DS 0H @VA08573 00423100
  439. LCTL C0,C1,RUNCR0 RESTORE RUNNING ADDRESS SPACE @V407579 00424000
  440. L R13,VMECEXT ACCESS EC-MODE VMBLOK EXTENSION @V407579 00425000
  441. LCTL C8,C8,EXTCR8-ECBLOK(R13) TO REFRESH MONITOR MASK@V407579 00426000
  442. B REFRUN CONTINUE INTERRUPT REFLECTION @V407579 00427000
  443. DROP R15 @V407579 00428000
  444. * 00429000
  445. CNOP 0,4 ALIGNMENT FOR FOLLOWING FIELDS @V407579 00430000
  446. BCBADBIT DC AL1(X'FF',EXTMODE+WAIT,0,0) MUST NOT COME ON @V407579 00431000
  447. ECBADBIT DC AL1(X'FF',EXTMODE+WAIT,X'C0',X'FF') NO FLIPS@V407579 00432000
  448. MODEBUSR DC AL1(0,X'F0',X'3F',0) USER BITS: KEY, CC, PGM@V407579 00433000
  449. MODEBSYS DC AL1(TRANMODE+IOMASK+EXTMASK,EXTMODE+MCHEK+PROBMODE,0,0) 00434000
  450. SPACE 3 00435000
  451. REFSVCA DS 0H LET 'DISPATCH' TAKE CARE OF IT: 00436000
  452. STM R0,R11,VMGPRS-VMBLOK(R15) SAVE VM REGS 0-11 @V407579 00437000
  453. LR R11,R15 SWITCH VMBLOK ADDRESSABILITY 00438000
  454. USING VMBLOK,R11 @V407579 00439000
  455. AIF (NOT &FLOATPT).NOFP1 00440000
  456. STD Y0,VMFPRS STORE 00441000
  457. STD Y2,VMFPRS+8 FLOATING 00442000
  458. STD Y4,VMFPRS+16 POINT 00443000
  459. STD Y6,VMFPRS+24 REGISTERS 00444000
  460. .NOFP1 ANOP 00445000
  461. MVC VMGPRS+R12*4(4*4),SVCREGS SAVE REGS 12-15 @V407579 00446000
  462. OI VMRSTAT,VMEXWAIT USER IN SIMULATION WAIT @V407579 00447000
  463. BAL R10,OBSLOCK SYSTEM LOCK NEEDED BEFORE DMKDSP @V407579 00448000
  464. * ********************************* 00449000
  465. NI VMRSTAT,X'FF'-VMEXWAIT SIMULATION WAIT ENDED @V407579 00450000
  466. GOTODSPB GOTO DMKDSPB AND LET "DISPATCH" CARRY THE BALL. 00451000
  467. * 00452000
  468. SPACE 3 00453000
  469. REFSVCB DS 0H LET "REFLECT" TAKE CARE OF IT: 00454000
  470. STM R0,R11,VMGPRS-VMBLOK(R15) SAVE REGISTERS 0-11 00455000
  471. LR R11,R15 SWITCH VMBLOK ADDRESSABILITY 00456000
  472. MVC VMGPRS+R12*4(4*4),SVCREGS AND SAVE REGISTERS 12-15 00457000
  473. AIF (NOT &FLOATPT).NOFP2 00458000
  474. STD Y0,VMFPRS SAVE FLOATING POINT REGISTERS 00459000
  475. STD Y2,VMFPRS+8 ... 00460000
  476. STD Y4,VMFPRS+16 ... 00461000
  477. STD Y6,VMFPRS+24 ... 00462000
  478. .NOFP2 ANOP 00463000
  479. LM R4,R5,SVCOPSW PRESERVE PAGE 0 INTERRUPT PSW @V407579 00464000
  480. L R6,INTSVCL AND INTERRUPT ILC/CODE @V407579 00465000
  481. BAL R10,OBSLOCK SYSTEM LOCKED CODE BEYOND HERE **@V407579 00466000
  482. * ********************************* 00467000
  483. REFSVCC EQU * HERE TO REFLECT AN SVC 76 THAT @VA01775 00468000
  484. * CP ISN'T HANDLING 00469000
  485. AIF (NOT &TRACE(6)).TRA3 ***AIF*** 00470000
  486. TM VMTRCTL,VMTRSVC+VMTRBRIN VM TRACING IN EFFECT ? 00471000
  487. BNZ REFTRACE TRF IF YES. 00472000
  488. .TRA3 ANOP 00473000
  489. OI VMRSTAT,VMEXWAIT USER IN SIMULATION WAIT @V4M0108 00474000
  490. LA R1,SVCOPSW LET R1 POINT TO SVC OLD-PSW, AND 00475000
  491. LA R3,INTSVCL LET R3 POINT TO SVC ILC & INT-CODE; 00476000
  492. GOTO DMKPRGRF GO "REFLECT" IT. 00477000
  493. SPACE 1 00478000
  494. AIF (NOT &TRACE(6)).TRA4 ***AIF*** 00479000
  495. REFTRACE DS 0H TRACING ON, LET DMKTRCSV DO THE WORK: 00480000
  496. LR R0,R4 ARGUMENTS IN REGS FOR TRACE @V407579 00481000
  497. LR R1,R5 SVCOLD PSW @V407579 00482000
  498. LR R2,R6 @V407579 00483000
  499. SRL R2,16 SVC ILC IN BITS 16-31 @V407579 00484000
  500. LR R4,R6 SVC ILC/CODE @V407579 00485000
  501. LR R10,R1 SVC OLD PSW ADDRESS INTO R10, 00486000
  502. SLR R10,R2 MINUS LENGTH = ADDRESS OF SVC (OR EX-SVC) 00487000
  503. CALL DMKTRCSV CALL DMKTRCSV TO HANDLE EVERYTHING ELSE 00488000
  504. BNZ GOTODSPB CC NONZERO - MUST GO TO "DMKDSPB" 00489000
  505. GOTO DMKDSPCH CC 0 - GO TO REGULAR DISPATCH ENTRY POINT 00490000
  506. .TRA4 ANOP 00491000
  507. SPACE 3 00492000
  508. OBSLOCK DC 0H'0' SUBROUTINE TO OBTAIN SYSTEM LOCK @V407579 00493000
  509. AIF (NOT &AP).APCHK6 00493900
  510. LOCK OBTAIN,TYPE=SYS,SPIN=NO TRY TO OBTAIN SYSLOCK @V407579 00494000
  511. BCR EQUAL,R10 RETURN IF LOCK OBTAINED @V407579 00495000
  512. L R15,VMDFTPNT DEFER BLOCK FOR SYNC EVENTS @V407579 00496000
  513. USING CPEXBLOK,R15 @V407579 00497000
  514. STM R0,R15,CPEXREGS PRESERVE REGS OF CALLER @V407579 00498000
  515. LA R0,DEFERETN @V407579 00499000
  516. ST R0,CPEXADD SET KNOWN RETURN POINT @V407579 00500000
  517. DROP R15 @V407579 00501000
  518. LR R1,R15 @V407579 00502000
  519. CALL DMKSTKDE STACK THE LOCK DEFERRAL @V407579 00503000
  520. GOTO DMKDSPRU AND RUN ANOTHER WHILE WAITING.. @V407579 00504000
  521. * 00505000
  522. .APCHK6 ANOP 00505100
  523. DEFERETN BR R10 RETURN TO THE ORIGINAL CALLER @V407579 00506000
  524. EJECT 00507000
  525. *********************************************************************** 00508000
  526. * * 00509000
  527. * 'SVCDIE' IS REACHED VIA AN SVC 0 FROM WITHIN THE CONTROL * 00510000
  528. * PROGRAM INDICATING AN IMPOSSIBLE CONDITION OR FATAL ERROR. * 00511000
  529. * * 00512000
  530. *********************************************************************** 00513000
  531. * 00514000
  532. SVCDIE L R13,SVCOPSW+4 POINT TO THE SVC ZERO ABEND CODE 00515000
  533. MVC CPABEND(4),0(R13) AND MOVE IT INTO PSA 00516000
  534. SVCDIE2 STM R0,R11,DUMPSAVE SAVE REGS FOR DUMP ROUTINE @V407579 00517000
  535. MVC DUMPSAVE+4*R12(4*4),SVCREGS .. @V407579 00518000
  536. GOTO DMKDMPDK GO TO DUMP ROUTINE VIA R12. 00519000
  537. EJECT 00520000
  538. *********************************************************************** 00521000
  539. * * 00522000
  540. * SVC 8 - 'SVCLINK' PASSES CONTROL FROM ONE CP MODULE TO ANOTHER, * 00523000
  541. * OBTAINING A NEW SAVE AREA. GR12,15 = ADR OF CALLED MODULE* 00524000
  542. * GR13 = ADR OF SAVE AREA. * 00525000
  543. * * 00526000
  544. *********************************************************************** 00527000
  545. SPACE 00528000
  546. *. 00529000
  547. *********************************************************************** 00530000
  548. * 00531000
  549. * 00532000
  550. * CP ASSIST INSTRUCTION "LINK" - SVC 8 IN SUPERVISOR STATE 00533000
  551. * 00534000
  552. * 00535000
  553. * REGISTER INPUT: 00536000
  554. * GPR 15 = ADDRESS OF THE MODULE BEING CALLED 00537000
  555. * 00538000
  556. * SYSTEM DATA AREAS REFERENCED (BY MODULE WHERE APPLICABLE): 00539000
  557. * DMKPSA - 'APAGCP', 'ASVCLIST', 'SVCLIST', TRACE FIELDS 00540000
  558. * SAVEAREA,ALOKSY 00541010
  559. * 00542000
  560. * 00543000
  561. * EXITS: 00544000
  562. * 00545000
  563. * 1. ADDRESS IN GPR 15 (NORMAL COMPLETION) 00546000
  564. * 00547000
  565. * REGISTER OUTPUT: 00548000
  566. * GPR 12 = SAME AS GPR 15 00549000
  567. * GPR 13 = ADDRESS OF SAVEAREA 00550000
  568. * GPR 14 = ADDRESS OF THE NEXT SEQUENTIAL INSTRUCTION 00551000
  569. * AFTER THE SVC 8 (RETURN ADDRESS OF CALLER) 00552000
  570. * 00553000
  571. * 2. ADDRESS IN SVC NEW PSW - AT X'65' (ABNORMAL COMPLETION) 00554000
  572. * 00555000
  573. * NOTE: THIS EXIT WILL GENERATE AN SVC INTERRUPT 00556000
  574. * 00557000
  575. *********************************************************************** 00558000
  576. *. 00559000
  577. SPACE 00560000
  578. SVCLINK DS 0D SVC 8 - CALL A CP ROUTINE: %V3M4038 00561000
  579. L R15,SVCOPSW+ADDR PICK UP RETURN ADDRESS %V4M0126 00562000
  580. L R13,NEXTSAVE GET POINTER TO SAVE-AREA(IF ANY) %V3M4038 00563000
  581. LTR R13,R13 ANY? %V3M4038 00564000
  582. BZ GETFREE8 NO, GO GET A 12 DBLWD SAVE AREA %V3M4038 00565000
  583. USING SAVEAREA,R13 USE THE SAVEAREA DSECT %V3M4038 00566000
  584. SVCLINKC L R14,SAVENEXT GET NEXT SAVE-AREA PTR (IF ANY) %V407579 00567000
  585. ST R14,NEXTSAVE DE-QUEUE THIS ELEMENT %V407579 00568000
  586. MVC SAVER12(2*4),SVCR12 SAVE CALLER'S R12-R13 %V407579 00569000
  587. ST R15,SAVERETN SET RETURN ADDRESS (FROM PSW) %V4M0126 00570000
  588. L R15,SVCR15 REFRESH REG 15 %V4M0126 00571000
  589. DROP R12 %V407579 00572000
  590. SVCLINKR LR R12,R15 ESTABLISH BASE FOR CALLEE %V407579 00573000
  591. CL R12,APAGCP IS HE IN NUCLEUS OR PAGEABLE CP? %V3M4038 00574000
  592. BCR 4,R12 'BL' IF IN NUCLEUS - BRANCH NOW. %V3M4038 00575000
  593. * 00576000
  594. L R12,SVCNPSW+4 RE-ESTABLISH CURRENT BASE @V407579 00577000
  595. USING DMKSVCIN,R12 @V407579 00578000
  596. LTR R15,R15 TEST FOR AFFINITY REQUEST @V407579 00579000
  597. BM SVCLINKA IF SO, HANDLE AS SPECIAL CASE @V407579 00580000
  598. * 00581000
  599. * CALL A PAGEABLE CP ROUTINE: 00582000
  600. * 00583000
  601. STM R1,R2,SAVEWRK2 IF PAGEABLE, SAVE R1-R2 IN WORK-AREA 00584000
  602. LR R1,R15 REQUESTED CALLEE ADDRESS IN R1 @V407579 00585000
  603. TRANS 2,1,OPT=(BRING,DEFER,LOCK,SYSTEM),IOER=ABEND3 GO GET IT 00586000
  604. LCTL C1,C1,VMSEG RESTORE USERS SEGMENT TABLE @V304635 00587000
  605. DROP R12 @V407579 00588000
  606. LR R12,R2 REAL ADDRESS INTO R12 00589000
  607. LM R1,R2,SAVEWRK2 RESTORE R1-R2 FROM WORK-AREA, 00590000
  608. BR R12 NOW GO TO CALLEE. 00591000
  609. SPACE 00592000
  610. ABEND3 ABEND 3 PERMANENT I/O PAGING ERROR 00593000
  611. SPACE 1 00594000
  612. USING DMKSVCIN,R12 @V407579 00595000
  613. SVCLINKA MVC SAVEPROC,LPUADDR+1 SAVE THE ID OF PROCESSOR @V407579 00596000
  614. LA R15,0(,R15) REMOVE THE AFFINITY FLAG @V407579 00597000
  615. B SVCLINKR NOW COMPLETE THE LINK @V407579 00598000
  616. EJECT 00599000
  617. *********************************************************************** 00600000
  618. * * 00601000
  619. * SVC 12- 'SVCRET' RETURNS CONTROL TO CALLING CP MODULE, RELEASING * 00602000
  620. * THE SAVE AREA AND RESTORING CALLER'S R12 AND R13. * 00603000
  621. * * 00604000
  622. *********************************************************************** 00605000
  623. SPACE 1 00606000
  624. *. 00607000
  625. *********************************************************************** 00608000
  626. * 00609000
  627. * 00610000
  628. * CP ASSIST INSTRUCTION "RETURN" - SVC 12 IN SUPERVISOR STATE 00611000
  629. * 00612000
  630. * 00613000
  631. * REGISTER INPUT: 00614000
  632. * GPR 12 = BASE ADDRESS OF MODULE ISSUING THE 'RETURN' SVC 00615000
  633. * GPR 13 = ADDRESS OF SAVEAREA 00616000
  634. * 00617000
  635. * SYSTEM DATA AREAS REFERENCED (BY MODULE WHERE APPLICABLE): 00618000
  636. * DMKPSA - 'APAGCP', 'ASVCLIST', 'SVCLIST', TRACE FIELDS 00619000
  637. * SAVEAREA,ALOKSY 00620010
  638. * 00621000
  639. * 00622000
  640. * EXITS: 00623000
  641. * 00624000
  642. * 1. ADDRESS IN FIRST WORD OF SAVEAREA (NORMAL COMPLETION) 00625000
  643. * 00626000
  644. * REGISTER OUTPUT: 00627000
  645. * GPR 12-13 = RESTORED FROM SAVEAREA 00628000
  646. * 00629000
  647. * 2. ADDRESS IN SVC NEW PSW - AT X'65' (ABNORMAL COMPLETION) 00630000
  648. * 00631000
  649. * NOTE: THIS EXIT WILL GENERATE AN SVC INTERRUPT 00632000
  650. * 00633000
  651. *********************************************************************** 00634000
  652. *. 00635000
  653. SPACE 00636000
  654. SVCRET DS 0D SVC 12 - RETURN TO CALLER: %V3M4038 00637000
  655. L R14,SAVERETN GET RETURN-ADDRESS %V407579 00638000
  656. CLI SAVEPROC,0 TEST FOR SPECIFIC PROC. RETURN %V407579 00639000
  657. BNE SVCRETAF SPECIAL HANDLING FOR AFFINITY %V407579 00640000
  658. SVCRETC ST R14,SVCOPSW+4 SET UP SVCOLD PSW FOR RETURN %V407579 00641000
  659. L R14,SVCR12 GET CALLEE'S BASE ADDRESS %V407579 00642000
  660. CL R14,APAGCP WAS CALLEE A PAGEABLE MODULE ? %V407579 00643000
  661. BNL RELPAGE YES - GO UNLOCK HIM. %V3M4038 00644000
  662. AIF (NOT &VIRREAL).NOVR2 %V407579 00645000
  663. CL R14,SLCADDR MAYBE - EXIT FROM V=R STORAGE ? %V407579 00646000
  664. BL RELPAGE YES - RELEASE THE PAGE %V407579 00647000
  665. * (NO EXITS FROM ANY MODULE IN PAGE 0) 00648000
  666. .NOVR2 ANOP 00649000
  667. SVCRETJ CL R13,DMKSVCHI SAVE-AREA ABOVE DYN. PAGING AREA %V407579 00650000
  668. BNL SVCRETJ1 YES - GOOD. %V3M4038 00651000
  669. CL R13,DMKSVCLO CHECK IF IN DYNAMIC PAGING AREA %V407579 00652000
  670. BH SVCRETJ2 IF SO, FRET SAVE-AREA %V3M4038 00653000
  671. AIF (NOT &VIRREAL).SVCRET1 00654000
  672. CL R13,SLCADDR ONE MORE CHECK < END OF V=R ? %V3M4038 00655000
  673. BL SVCRETJ2 IF YES THAT'S IN PAGING AREA TOO %V3M4038 00656000
  674. .SVCRET1 ANOP 00657000
  675. SVCRETJ1 L R14,NEXTSAVE R13 OK, GET OLD TOP-OF-LIST, %V407579 00658000
  676. ST R14,SAVENEXT CHAIN ONTO THIS ELEMENT, %V407579 00659000
  677. ST R13,NEXTSAVE PUSH DOWN LIST %V3M4038 00660000
  678. LM R12,R13,SAVER12 RESTORE CALLER'S R12-R13 %V3M4038 00661000
  679. LPSW SVCOPSW AND RETURN TO CALLER. %V3M4038 00662000
  680. * 00663000
  681. RELPAGE LR R13,R2 PRESERVE CALLER'S R2 @V407579 00664000
  682. LR R2,R14 PASS UNLOCK ADDR TO UNLOCK @V407579 00665000
  683. CALL DMKPTRUL UNLOCK PAGE (WITHOUT CTL. LOSS) @V407579 00666000
  684. LR R2,R13 REFRESH CALLER'S R2 @V407579 00667000
  685. L R13,SVCR13 AND R13 OF ISSUER @V407579 00668000
  686. B SVCRETJ BACK TO MAIN PATH @V407579 00669000
  687. * 00670000
  688. SVCRETAF LA R14,0(,R14) CLEAR SPECIFIED PROCESSOR ID @V407579 00671000
  689. LA R15,INCRBY1 COUNT OCCURANCES @V407579 00672000
  690. AL R15,SVCRAFCT @V407579 00673000
  691. ST R15,SVCRAFCT @V407579 00674000
  692. AIF (NOT &AP).APCHK7 00674900
  693. CLC SAVEPROC,LPUADDR+1 TEST FOR SAME PROCESSOR @V407579 00675000
  694. BE SVCRETC CONTINUE NORMAL EXIT @V407579 00676000
  695. LA R15,INCRBY1 COUNT OCCURANCES OF REQ'D SWITCH @V407579 00677000
  696. AL R15,SVCRAFSS @V407579 00678000
  697. ST R15,SVCRAFSS @V407579 00679000
  698. STM R0,R8,SAVER0 SAVE REGS IN A KNOWN PATTERN @V407579 00680000
  699. LR R3,R14 SAVE R14 ACROSS CALLS @V407510 00681000
  700. LM R4,R7,SVCREGS PRESERVE SVCREGS THRU CTL PASS @V407579 00682000
  701. L R2,SVCOPSW AND SUPERVISOR STATE PSW @V407579 00683000
  702. LA R0,CPEXSIZE OBTAIN A BLOCK TO STACK CTL XFER @V407579 00684000
  703. CALL DMKFREE (FREE WILL RETURN ON SAME PROC.) @V407579 00685000
  704. USING CPEXBLOK,R1 @V407579 00686000
  705. LA R0,SVCRETUS SET RETURN CONTROL POINT @V407579 00687000
  706. ST R0,CPEXADD @V407579 00688000
  707. LR R14,R3 REFRESH R14 TO ENTRY STATE @V407579 00689000
  708. STM R0,R15,CPEXREGS SET REGS FOR RETURN @V407579 00690000
  709. DROP R1 @V407579 00691000
  710. CALL DMKSTKSW STACK FOR OTHER PROCESSOR @V4M0141 00692000
  711. TSTDSP L R15,PREFIXB ACCESS OTHER PSA @VA09257 00692100
  712. TM XCPEND-PSA(R15),XCDISP DISPATCH PENDING @VA09257 00692200
  713. BZ GOTODSP NO @VA09257 00692300
  714. LOCK RELEASE,TYPE=SYS YES, RELEASE LOCK @VA09257 00692400
  715. GOTO DMKDSPRU UNLOCKED ENTRY TO DSP @VA09257 00692500
  716. GOTODSP DS 0H @VA09257 00692600
  717. GOTO DMKDSPCH RELINQUISH CONTROL HERE. @V407579 00693000
  718. SVCRETUS ST R2,SVCOPSW RESTORE RETURN EXIT PSW @V407579 00694000
  719. STM R4,R7,SVCREGS RESTORE SVCREGS TO ENTRY STATE @V407579 00695000
  720. LM R0,R8,SAVER0 RESTORE REGS TO CALLEE'S VALUES @V407579 00696000
  721. .APCHK7 ANOP 00696100
  722. B SVCRETC NOW COMPLETE THE RETURN @V407579 00697000
  723. SPACE 00698000
  724. * SAVE-AREA IN R13 WAS IN DYNAMIC PAGING AREA: 00699000
  725. SVCRETJ2 LM R14,R15,SVCOPSW REMEMBER SVC OLD PSW (TO BE SAFE) 00700000
  726. STM R14,R1,FRTSAV SAVE SVC-OLD-PSW AND CALLER'S R0-R1 00701000
  727. LR R1,R13 ADDRESS OF SAVE-AREA INTO R1 00702000
  728. MVC FRTSAV+4*4(2*4),SAVER12 COPY CALLER'S R12-13 @V407579 00703000
  729. LA R0,SAVESIZE SAVE-AREA SIZE IN DOUBLE WORDS 00704000
  730. CALL DMKFRET GIVE BACK AREA IN DYNAMIC PAGING AREA 00705000
  731. LA R15,INCRBY1 COUNT HOW MANY TIMES WE DID IT @V407579 00706000
  732. AL R15,DYNFRET ... 00707000
  733. ST R15,DYNFRET ... 00708000
  734. LM R14,R1,FRTSAV PICK UP PSW AND R0-1 @V407579 00709000
  735. STM R14,R15,SVCOPSW RETURNING PSW @V407579 00710000
  736. LM R12,R13,FRTSAV+16 RESTORE CALLERS R12-13 @V407579 00711000
  737. LPSW SVCOPSW BACK TO ORIGINAL CALLER @V407579 00712000
  738. EJECT 00713000
  739. *********************************************************************** 00714000
  740. * * 00715000
  741. * SVC 16- 'SVCRLSE' RELEASES CURRENT SAVE AREA, UNLOCKS BYPASSED * 00716000
  742. * MODULE(IF PAGEABLE), AND POINTS R13 AT FORMER SAVE AREA. * 00717000
  743. * SVC 20- 'SVCGET' GET NEXT SAVE AREA * 00718000
  744. * * 00719000
  745. *********************************************************************** 00720000
  746. SPACE 1 00721000
  747. SVCRLSE DS 0D SVC 16 - RELEASE CURRENT SAVE AREA: 00722000
  748. L R14,SAVER12 GET BASE OF BYPASSED MODULE @V407579 00723000
  749. CL R14,APAGCP WAS CALLEE A PAGEABLE MODULE ? @V407579 00724000
  750. BNL RELPAGE1 YES - GO UNLOCK HIM. 00725000
  751. AIF (NOT &VIRREAL).NOVR3 @V407579 00726000
  752. CL R14,SLCADDR ARE WE RELEASING V=R STORAGE? @V407579 00727000
  753. BNL SVCRLSEX NO - NORMAL RELEASE. 00728000
  754. CL R14,F4095 RELEASING FROM PAGE 0 ? @V407579 00729000
  755. BH RELPAGE1 NO--UNLOCK THE PAGE @V407579 00730000
  756. .NOVR3 ANOP 00731000
  757. SVCRLSEX L R15,SAVER13 GET CALLER'S SAVE AREA @V407579 00732000
  758. L R14,NEXTSAVE TAKE CURRENT CHAIN @V407579 00733000
  759. ST R14,SAVENEXT APPEND IT TO RETURNING SAVE-AREA @V407579 00734000
  760. ST R13,NEXTSAVE RESET ANCHOR @V407579 00735000
  761. LR R13,R15 PASS PREDECESSOR'S SAVE-AREA @V407579 00736000
  762. B SVCSEXIT BACK TO ISSUER(WITHOUT CTL XFER) @V407579 00737000
  763. * 00738000
  764. RELPAGE1 LR R13,R2 PRESERVE CALLER'S R2 @V407579 00739000
  765. LR R2,R14 PASS UNLOCK ADDR TO UNLOCK @V407579 00740000
  766. CALL DMKPTRUL UNLOCK THE PAGE @V407579 00741000
  767. LR R2,R13 REFRESH CALLER'S R2 @V407579 00742000
  768. L R13,SVCR13 AND R13 OF ISSUER @V407579 00743000
  769. B SVCRLSEX BACK TO MAIN PATH @V407579 00744000
  770. SPACE 3 00745000
  771. SVCGET DS 0D SVC 20 - GET NEXT SAVE AREA: 00746000
  772. L R13,NEXTSAVE GET NEXT SAVE AREA 00747000
  773. LTR R13,R13 ANY SAVE AREA? 00748000
  774. BNZ *+8 YES 00749000
  775. BAL R14,SVCFR NO, GET ONE FROM FREE @V407579 00750000
  776. L R14,SAVENEXT GET SUCCESSOR POINTER @V407579 00751000
  777. ST R14,NEXTSAVE DEQUEUE CURRENT ELEMENT @V407579 00752000
  778. MVC SAVER12(2*4),SVCR12 SAVE R12 AND R13 @V407579 00753000
  779. SVCSEXIT L R12,SVCR12 RESTORE R12 @V407579 00754000
  780. LM R14,R15,SVCR14 AND R14-15. (R13 ALREADY SET) @V407579 00755000
  781. LPSW SVCOPSW AND RETURN. 00756000
  782. * 00757000
  783. DROP R13 @V407579 00758000
  784. EJECT 00759000
  785. *********************************************************************** 00760000
  786. * * 00761000
  787. * SVC 24- 'SVCSWIT' SWITCH CONTROL TO MAIN PROCESSOR * 00762000
  788. * SVC 76- 'SVCIGNOR' IGNORE DMKIOF ERROR RECORD IN VIRTUAL MACHINE * 00763000
  789. * * 00764000
  790. *********************************************************************** 00765000
  791. SPACE 1 00766000
  792. SVCSWIT DS 0D SVC 24 - SWITCH TO MAIN PROCESSOR@V407579 00767000
  793. AIF (NOT &AP).APCHK8 00767900
  794. LA R15,INCRBY1 COUNT OCCURANCES REQUIRING SWITCH@V407579 00768000
  795. AL R15,SVCSWTSS @V407579 00769000
  796. ST R15,SVCSWTSS @V407579 00770000
  797. L R13,PREFIXA ADDRESS THE ABSOLUTE PREFIX @V407579 00771000
  798. L R15,PSACPXBP-PSA(,R13) CPEXBLOK FOR SWITCH @V407579 00772000
  799. USING CPEXBLOK,R15 @V407579 00773000
  800. LTR R15,R15 CHECK FOR NON-RECURSIVE USE @V407579 00774000
  801. BZ ABSVC ABEND HERE FOR ANALYSIS @V407579 00775000
  802. SLR R14,R14 @V407579 00776000
  803. ST R14,PSACPXBP-PSA(,R13) CATCH FUTURE RECURSION @V407579 00777000
  804. STM R0,R11,CPEXREGS SAVE REGS FOR RETURN @V407579 00778000
  805. MVC CPEXR12(4*4),SVCREGS @V407579 00779000
  806. MVC CPEXADD,SVCOPSW+4 ADDR TO RETURN TO SWITCHER @V407579 00780000
  807. DROP R15 @V407579 00781000
  808. LR R3,R15 RETAIN THE STACK BLOCK @V407579 00782000
  809. LA R0,CPEXSIZE OBTAIN REPLACEMENT BLOCK @V407579 00783000
  810. CALL DMKFREE (FREE WILL RETURN ON SAME PROC.) @V407579 00784000
  811. ST R1,PSACPXBP-PSA(,R13) REPLENISH USED BLOCK @V407579 00785000
  812. LR R1,R3 STACK THE SWITCHING REQUEST @V407579 00786000
  813. CALL DMKSTKSW STACK FOR OTHER PROCESSOR @V4M0141 00787000
  814. USING CPEXBLOK,R1 SET UP ADDRESSABILITY @V407510 00788000
  815. OI CPEXTYPE,CPEXLPSW INDICATE CONTROL VIA LPSW @V407510 00789000
  816. DROP R1 @V407510 00790000
  817. B TSTDSP EXIT TO DMKDSPCH/RU @VA09257 00791100
  818. SPACE 1 00792000
  819. .APCHK8 ANOP 00792100
  820. SVCIGNOR LM R12,R15,SVCREGS REFRESH REGS ON ENTRY @V407579 00793000
  821. LPSW SVCOPSW RETURN, AS IF SVC = NO-OP @V407579 00794000
  822. EJECT 00795000
  823. GETFREE8 DS 0H GET SAVE AREA FOR SVC 8 (LINK) 00796000
  824. LA R14,SVCLINKC ESTABLISH RETURN ADDR @V407579 00797000
  825. * 00798000
  826. SVCFR DS 0H GET SAVE AREA FROM FREE STORAGE: 00799000
  827. L R13,ASCRATCH GET ADDRESS OF SCRATCH-AREA 00800000
  828. CL R13,SAVARLIM BEWARE GOING OVER THE LIMIT WE CAN HANDLE 00801000
  829. BNH SVCFR2 WE'RE OK - SAVE GOODIES & CALL DMKFREE. 00802000
  830. *>>>>>>>> 00803000
  831. ABEND 1 WELL, ANYWAY, WE TRIED HARD 00804000
  832. *>>>>>>>> 00805000
  833. SPACE 00806000
  834. * GET A 12-WORD SAVE-AREA FROM REGULAR 'DMKFREE' ENTRY-POINT: 00807000
  835. * (DEPENDENT ON SUCCESSFUL FREE CALL, RETURNING ON SAME PROCESSOR) 00808000
  836. SVCFR2 MVC 0(4*4,R13),SVCREGS SAVE 'SVCREGS' @V407579 00809000
  837. STM R14,R1,16(R13) SAVE R14 THRU R1 00810000
  838. A R13,SAVARLEN INCREMENT POINTER FOR NEXT TIME 00811000
  839. ST R13,ASCRATCH AND STORE 00812000
  840. LA R0,SAVESIZE SAVE AREA SIZE IN DBL WORDS INTO R0 00813000
  841. CALL DMKFREE GET SAVE-AREA FROM FREE STG. @V407579 00814000
  842. LA R14,INCRBY1 COUNT THIS EVENT @V407579 00815000
  843. AL R14,FRECKLES ... @V407579 00816000
  844. ST R14,FRECKLES ... 00817000
  845. * 00818000
  846. SVCFR3 XC 0(SAVESIZE*8,R1),0(R1) CLEAR THE NEW SAVE AREA 00819000
  847. LR R13,R1 SAVE AREA ADDR. 00820000
  848. L R14,ASCRATCH GET ADDRESS OF SCRATCH-AREA 00821000
  849. S R14,SAVARLEN DECREMENT THE POINTER 00822000
  850. ST R14,ASCRATCH AND REPLACE 00823000
  851. MVC SVCREGS(4*4),0(R14) RESTORE 'SVCREGS' @V407579 00824000
  852. LM R14,R1,16(R14) RELOAD R14 THRU R1, AND ... 00825000
  853. BR R14 RETURN TO SVC 8 OR 20 PROCESSING @V407579 00826000
  854. EJECT 00827000
  855. USING VMBLOK,R15 @V202232 00828000
  856. SVCADSTP DC 0H'0' HANDLE SVC X'B3', POSSIBLE ADSTOP@V407579 00829000
  857. STM R0,R11,VMGPRS SAVE USER'S REGISTERS 00830000
  858. MVC VMGPRS+R12*4(4*4),SVCREGS SAVE REGS 12-15 @V407579 00831000
  859. L R13,SVCOPSW+4 GET OLD PSW ADDRESS 00832000
  860. SH R13,INTSVCL AND SUBTRACT LENGTH OF INTERRUPTING INST 00833000
  861. LRA R14,0(,R13) FIND INSTRUCTION IMAGE @V407579 00834000
  862. BNZ TSTRACE NOT A PROPER ADSTOP, REFLECT SVC @V407579 00835000
  863. CLI 0(R14),OPCODEEX DID 'EXECUTE' CAUSE ADSTOP? @V407579 00836000
  864. BNE CKADDR NO .. GO VALIDATE ADSTOP ADDRESS 00837000
  865. MVC VMINST(2),0(R14) SAVE IMAGE OF FIRST HALF @V407579 00838000
  866. LRA R14,2(,R13) @V407579 00839000
  867. BNZ TSTRACE NOT A PROPER ADSTOP, REFLECT SVC @V407579 00840000
  868. MVC VMINST+2(2),0(R14) SAVE IMAGE OF SECOND HALF @V407579 00841000
  869. LA R13,D2MASK GET DISPLACEMENT OF 'EX' OPERAND @V407579 00842000
  870. N R13,VMINST @V407579 00843000
  871. IC R14,VMINST+2 GET BASE .. @V407579 00844000
  872. SRL R14,2 @V407579 00845000
  873. N R14,F60 (F60=X'3C') BASE*4 @V407579 00846000
  874. BZ NOBASE BASE IS ZERO 00847000
  875. L R14,VMGPRS(R14) GET VALUE OF BASE @V407579 00848000
  876. LA R13,0(R14,R13) ADD BASE TO DISPLACEMENT @V407579 00849000
  877. NOBASE IC R14,VMINST+1 GET INDEX .. @V407579 00850000
  878. SLL R14,2 @V407579 00851000
  879. N R14,F60 (F60=X'3C') INDEX*4 @V407579 00852000
  880. BZ CKADDR INDEX IS ZERO @V407579 00853000
  881. L R14,VMGPRS(R14) GET VALUE OF INDEX @V407579 00854000
  882. LA R13,0(R14,R13) ADD INDEX TO BASE+DISPLACEMENT @V407579 00855000
  883. SPACE 00856000
  884. CKADDR L R14,VMADSTOP ADDRESS THE ADSTOP BUFFER @V407579 00857000
  885. LTR R14,R14 IF PRESENT @V407579 00858000
  886. BZ TSTRACE REFLECT, IF NOT @V407579 00859000
  887. USING ADSTBLOK,R14 @V407579 00860000
  888. TM VMESTAT,VMEXTCM TEST FOR EC MODE EXECUTION @V407579 00861000
  889. BZ CKREAL NO, TEST GUEST REAL @VA05407 00862000
  890. TM VMPSW,TRANMODE TRANSLATE MODE? @VA05407 00863000
  891. BZ CKREAL NO, TEST GUEST REAL @VA05407 00864000
  892. LRA R13,0(,R13) FIND REAL ADDR OF SVC X'B3' @V407579 00865000
  893. BNZ TSTRACE REFLECT, IF NOT PRESENT @V407579 00866000
  894. LCTL C0,C0,CPCREG0 RESTORE VIRTUAL MACHINE'S @V407579 00867000
  895. LCTL C1,C1,VMSEG FIRST LEVEL ADDRESS SPACE @V407579 00868000
  896. L R14,ADSTINAD ADSTOP W.R.T. FIRST LEVEL SPACE @V407579 00869000
  897. LRA R14,0(,R14) FIND REAL ADDR OF REQUESTED STOP @V407579 00870000
  898. BNZ TSTRACE REFLECT, IF NOT PRESENT @V407579 00871000
  899. CLR R14,R13 TEST FOR MATCH @V407579 00872000
  900. BNE TSTRACE REFLECT, IF NOT @V407579 00873000
  901. L R14,VMADSTOP REFRESH ADDRESSABILITY @V407579 00874000
  902. B REPLINST REFRESH THE INSTRUCTION IMAGE @V407579 00875000
  903. * 00876000
  904. CKREAL CL R13,ADSTINAD IS THIS THE ADSTOP? @VA05407 00877000
  905. BNE TSTRACE REFLECT, IF NOT @V407579 00878000
  906. LRA R13,0(,R13) FIND REAL ADDR OF SVC X'B3' @V407579 00879000
  907. BNZ TSTRACE REFLECT, IF NOT PRESENT @V407579 00880000
  908. REPLINST MVC 0(2,R13),ADSTINST RESTORE INSTRUCTION IMAGE @V407579 00881000
  909. DROP R14 @V407579 00882000
  910. LR R2,R14 RETAIN ADSTOP BUFFER ADDRESS @V407579 00883000
  911. SLR R14,R14 @V407579 00884000
  912. ST R14,VMADSTOP CLEAR ADSTOP BUFFER POINTER @V407579 00885000
  913. L R13,SVCOPSW+4 BACK UP THE PSW @V407579 00886000
  914. SH R13,INTSVCL @V407579 00887000
  915. AIF (NOT &FLOATPT).NOFP3 00888000
  916. STD Y0,VMFPRS STORE 00889000
  917. STD Y2,VMFPRS+8 FLOATING 00890000
  918. STD Y4,VMFPRS+16 POINT 00891000
  919. STD Y6,VMFPRS+24 REGISTERS 00892000
  920. .NOFP3 ANOP 00893000
  921. ST R13,VMPSW+4 SET VM PSW TO CONTINUE @V407579 00894000
  922. IC R0,SVCOPSW+2 GET CC AND MASK 00895000
  923. TM VMESTAT,VMEXTCM EXTENDED CONTROL MACHINE ?? 00896000
  924. BZ SVCABC NO -- SAVE PSW IN BC MODE FORMAT 00897000
  925. STC R0,VMPSW+2 SAVE EXTENDED SPW 00898000
  926. B *+8 .. 00899000
  927. SVCABC STC R0,VMPSW+4 SAVE CC AND PGM MASK 00900000
  928. OI VMRSTAT,VMEXWAIT MAKE SURE CAN'T GET DISPATCHED 00901000
  929. LR R11,R15 VMBLOK ADDRESS TO R11 00902000
  930. DROP R15 00903000
  931. USING VMBLOK,R11 00904000
  932. BAL R10,OBSLOCK SYSTEM LOCKED CODE BEYOND HERE **@V407579 00905000
  933. * ********************************* 00906000
  934. TM VMESTAT,VMMICSVC USER RQST MICRO HANDLE SVCS?@V201537 00907000
  935. BZ NOMICRO NO, LEAVE SVC BIT SET TO 1 @V201537 00908000
  936. NI VMMCR6,X'FF'-VMMSVC YES, INDICATE MICRO DO SVCS @V201537 00909000
  937. NOMICRO DS 0H @V201537 00910000
  938. LR R1,R2 ADDRESS OF OLD ADSTOP BUFFER @V407579 00911000
  939. LA R0,ADSTBFSZ BUFFER SIZE 00912000
  940. CALL DMKFRET FRET BUFFER 00913000
  941. LA R0,3 GET BUFFER 00914000
  942. CALL DMKFREE ... 00915000
  943. LR R4,R1 SAVE BUFFER ADDRESS 00916000
  944. LR R1,R13 INSTRUCTION ADDRESS TO R1 00917000
  945. N R1,XRIGHT24 AND OFF HIGH BYTE 00918000
  946. CALL DMKCVTBH CONVERT TO HEX 00919000
  947. MVC 0(16,R4),STOPMSG TEXT OF ADSTOP MSG 00920000
  948. STH R0,10(R4) ADDRESS 00921000
  949. ST R1,12(R4) .. 00922000
  950. LA R0,16 SIZE 00923000
  951. LR R1,R4 MSG ADDRESS 00924000
  952. LA R3,3 BUFFER SIZE FOR DFRET 00925000
  953. CALL DMKQCNWT,PARM=NORET+DFRET 00926000
  954. AIF (NOT &TRACE(6)).TRA5 ***AIF*** 00927000
  955. TM VMTRCTL,VMTRBRIN INSTRUCTION TRACING TODAY ? 00928000
  956. BZ SVCACON NOPE - CONTINUE ... 00929000
  957. L R1,VMPSW+4 YES - ADDRESS OF THIS INSTRUCTION 00930000
  958. L R15,VMTREXT REFERENCE TRACE-CONTROL BLOCK 00931000
  959. USING TREXT,R15 00932000
  960. CLC TREXIN1(8),FFS ANYTHING ALREADY SET ? 00933000
  961. BE CALTRCIT NOPE - OK TO CALL DMKTRCIT FORTHWITH. 00934000
  962. DROP R15 AHA - IF SOMETHING THERE, WE MUST... 00935000
  963. CALL DMKTRCPB RESET THE OLD INSTRUCTION(S) FIRST, THEN: 00936000
  964. CALTRCIT CALL DMKTRCIT NOW SET INSTRUCTION TRACING AGAIN 00937000
  965. SVCACON DS 0H 00938000
  966. .TRA5 NI VMRSTAT,255-VMEXWAIT TURN OFF INSTRUCTION-WAIT FLAG 00939000
  967. NI VMPEND,255-VMPERPND IF PER PENDING, IT WILL RECUR LATER 00940000
  968. CALL DMKCFMBK GO TO BREAK ENTRY OF CFM 00941000
  969. GOTO DMKDSPCH GET OUT 00942000
  970. DROP R11 @V407579 00943000
  971. SPACE 2 00944000
  972. STOPMSG DC CL16'ADSTOP AT ......' 00945000
  973. EJECT 00946000
  974. USING VMBLOK,R15 @V200226 00947000
  975. SPACE 00948000
  976. SVCVER EQU * @V200226 00949000
  977. * 00950000
  978. * DO BASIC CHECKS ON PARM REGS FOR VALID SVC 76. 00951000
  979. LTR R1,R1 TEST FOR DOS PARM @V407579 00952000
  980. BM CKDOSR0 BRANCH IF DOS POSSIBILITY @V407579 00953000
  981. BZ TSTRACE IF ZERO, MUST NOT BE RECORDING @V407579 00954000
  982. LTR R0,R0 IF R0 = NEG, MIGHT BE OS,VS, VM @V407579 00955000
  983. BNM TSTRACE IF NOT, GO REFLECT THE SVC @V407579 00956000
  984. LA R13,AVEROS O.WISE POINT TO OS ERROR CAPTURE @V407579 00957000
  985. B SVCVERVM AND SAVE VIRTUAL MACHINE STATE @V407579 00958000
  986. CKDOSR0 LTR R0,R0 IF POSITIVE - MIGHT BE DOS @V407579 00959000
  987. BNP TSTRACE ELSE REFLECT SVC @V407579 00960000
  988. LA R13,AVERDOS POINT TO DOS ERROR CAPTURE @V407579 00961000
  989. * 00962000
  990. SVCVERVM STM R0,R11,VMGPRS SAVE USER REGS @V407579 00963000
  991. MVC VMGPRS+R12*4(4*4),SVCREGS SAVE REGS 12-15 @V407579 00964000
  992. AIF (NOT &FLOATPT).NOFP5 @V200226 00965000
  993. STD Y0,VMFPRS SAVE @V200226 00966000
  994. STD Y2,VMFPRS+8 FLOATING @V200226 00967000
  995. STD Y4,VMFPRS+16 POINT @V200226 00968000
  996. STD Y6,VMFPRS+24 REGS. @V200226 00969000
  997. .NOFP5 ANOP 00970000
  998. LM R4,R5,SVCOPSW PRESERVE PAGE 0 INTERRUPT PSW @V407579 00971000
  999. L R6,INTSVCL AND INTERRUPT ILC/CODE @V407579 00972000
  1000. LR R11,R15 USE STANDARD VMBLOK ADDRESSING @V407579 00973000
  1001. DROP R15 @V407579 00974000
  1002. USING VMBLOK,R11 @V407579 00975000
  1003. ST R5,VMPSW+4 UPDATE VIRTUAL PSW @V407579 00976000
  1004. TM VMESTAT,VMEXTCM ECMODE? @VA01775 00977000
  1005. BZ BCMODE NO, GO CHANGE PSW TO BC @VA01775 00978000
  1006. STH R4,VMPSW+2 VIRT. PSW FORMAT = REAL PSW @V407579 00979000
  1007. LCTL C0,C0,CPCREG0 RE-ESTABLISH STD. TRANSLATE ARCH.@V407579 00980000
  1008. B AX @VA01775 00981000
  1009. BCMODE EQU * CHANGE PSW TO BC MODE BEFORE @VA01775 00982000
  1010. LR R3,R6 OPERATE ON ILC @V407579 00983000
  1011. SRL R3,3 MOVE TO BITS 16-17 @V407579 00984000
  1012. OR R3,R4 ADD CC AND PGM MASK @V407579 00985000
  1013. STCM R3,B'0010',VMPSW+4 PROPER PLACE FOR BC DATA @V407579 00986000
  1014. AX EQU * @VA01775 00987000
  1015. OI VMRSTAT,VMEXWAIT PUT IN WAIT @V200226 00988000
  1016. LR R3,R1 SAVE ADDRESS OF RECORD @V4M0012 00989000
  1017. LR R7,R0 2'S COMPLEMENT OF REC LENGTH @V4M0012 00990000
  1018. BAL R10,OBSLOCK SYSTEM LOCKED CODE BEYOND HERE **@V407579 00991000
  1019. * ********************************* 00992000
  1020. LR R1,R3 RESTORE R1 @V4M0012 00993000
  1021. LR R0,R7 RESTORE R0 @V4M0012 00994000
  1022. VERCALL L R15,0(,R13) ADDRESS THE PROPER RECORDING CODE@V407579 00995000
  1023. CALL (15) GO TO DMKVER TO PROCESS FURTHER @V200226 00996000
  1024. * 00997000
  1025. * A RETURN FROM DMKVER MEANS THAT SOMETHING INVALID WAS 00998000
  1026. * FOUND SO MUST REFLECT THE SVC TO THE USER 00999000
  1027. * 01000000
  1028. LCTL C1,C1,VMSEG INSURE CONTROL REG IS CORRECT @V200226 01001000
  1029. B REFSVCC GO REFLECT IT @VA01775 01002000
  1030. EJECT 01003000
  1031. AVEROS DC A(DMKVERO) ENTRY TO OS ERROR RECORD CAPTURE@V407579 01004000
  1032. AVERDOS DC A(DMKVERD) ENTRY TO DOS ERROR RECORD CAPTURE@V407579 01005000
  1033. * 01006000
  1034. ASCRATCH DC A(SVCRFRST) POINTER TO <FIRST> SCRATCH-AREA (VARIES) 01007000
  1035. SAVARLIM DC A(SVCRLAST) LIMIT = POINTER TO LAST SCRATCH-AREA 01008000
  1036. * 01009000
  1037. * AT LEAST TWO "SCRATCH" SAVE-AREAS TO SAVE SVCREGS & R14 THRU R1 01010000
  1038. * (NEEDED FOR CALLING DMKFREE FOR SAVE-AREA FOR SVC 8 & SVC 20) 01011000
  1039. * NOTE: ADD MORE BETWEEN "SVCRFRST" & "SVCRLAST" AS NEEDED 01012000
  1040. SVCRFRST DS 4D FIRST SAVE-AREA FOR SVCREGS & R14 THRU R1 01013000
  1041. DS 4D ANOTHER 01014000
  1042. SVCRLAST DS 4D LAST SAVE-AREA FOR SVCREGS & R14 THRU R1 01015000
  1043. SPACE 01016000
  1044. FRTSAV DS 3D SAVE PSW, R14-1 OVER FRET CALL @V407579 01017000
  1045. FRECKLES DC F'0' NO. OF CALLS TO DMKFREE FOR SAVE-AREAS 01018000
  1046. DYNFRET DC F'0' NO OF CALLS TO DMKFRET FOR SAVE-AREAS 01019000
  1047. SVCSWTSS DC F'0' COUNT OF ACTUAL SWITCHES OCCURRED@V407579 01020000
  1048. * 01021000
  1049. SVCRAFCT DC F'0' COUNT OF AFFINITY RETURNS ISSUED @V407579 01022000
  1050. SVCRAFSS DC F'0' COUNT OF AFFINITY RETURNS SWITCHD@V407579 01023000
  1051. * (IN DYNAMIC PAGING AREA ON AN EXIT) 01024000
  1052. SPACE 01025000
  1053. SAVARLEN DC F'32' LENGTH OF ONE SCRATCH-AREA 01026000
  1054. SPACE 3 01027000
  1055. * THE FOLLOWING 16-BYTE DATA LIST MUST BE KEPT CONTIGUOUS AND IN ORDER 01028000
  1056. * BECAUSE IT IS USED BY THE CP ASSIST INSTRUCTIONS "LINK" AND "RETURN". 01029000
  1057. SPACE 01030000
  1058. SVCLIST DS 0F @V3M4026 01031000
  1059. NEXTSAVE DC A(0) +0 PTR TO NEXT AVAIL. SAVE AREA @V3M4026 01032000
  1060. AIF (NOT &VIRREAL).NOVR4 @VA05876 01033000
  1061. SLCADDR DC A(DMKSLC) +4 A(END OF V=R STORAGE OR ZERO) @V3M4026 01034000
  1062. AIF (&VIRREAL).VR4 @VA05876 01035000
  1063. .NOVR4 ANOP 01036000
  1064. SLCADDR DC A(0) +4 (ZERO FOR NON-VIRTUAL=REAL) @VA05876 01037000
  1065. .VR4 ANOP 01038000
  1066. DMKSVCHI DC A(0) +8 "DMKFREHI" @V407579 01039000
  1067. DMKSVCLO DC A(0) +12 "DMKFRELO" MINUS L'SAVEAREA @V407579 01040000
  1068. DMKSVCNS EQU NEXTSAVE (EXTERNALLY-REFERENCED NAME) @V407579 01041000
  1069. ADDR EQU 4 DISPLACEMENT OF ADDRESS IN PSW @V4M0126 01042000
  1070. EJECT 01043000
  1071. LTORG 01044000
  1072. SPACE 3 01045000
  1073. ADSTBLOK DSECT 01046000
  1074. ADSTINAD DS 1F ANSTRUCTION ADDRESS 01047000
  1075. ADSTINST DS 1F INSTRUCTION 01048000
  1076. ADSTFLAG DS 1H FLAG AREA 01049000
  1077. DS 0D 01050000
  1078. ADSTBFSZ EQU (*-ADSTBLOK)/8 BUFFER SIZE IN DOUBLE WORDS 01051000
  1079. SPACE 3 01052000
  1080. TRACETBL DSECT , LAYOUT OF SYSTEM TRACE ENTRIES @V407579 01053000
  1081. TRACETYP DS X TRACE TYPE (INCL. PROCESSOR) @V407579 01054000
  1082. TRACEADR DS AL3 ADDRESS POINTER @V407579 01055000
  1083. TRACECOD DS F INTERRUPT CODE @V407579 01056000
  1084. TRACEPSW DS D OLD PSW @V407579 01057000
  1085. TRACELNG EQU *-TRACETBL ENTRY LENGTH @V407579 01058000
  1086. EJECT 01059000
  1087. COPY EQU 01060000
  1088. PSA , @V407579 01061000
  1089. ORG SVCREGS DEFINE REGS FOR EASE OF REFERENCE@V407579 01062000
  1090. SVCR12 DS F @V407579 01063000
  1091. SVCR13 DS F @V407579 01064000
  1092. SVCR14 DS F @V407579 01065000
  1093. SVCR15 DS F @V407579 01066000
  1094. ORG , @V407579 01067000
  1095. COPY SAVE 01068000
  1096. COPY VMBLOK 01069000
  1097. COPY TREXT 01070000
  1098. END DMKSVC @V407579 01071000