Table of Contents

DMKVCA Source

References

Source Listing

DMKVCA.ASSEMBLE.txt
  1. VCA TITLE 'DMKVCA (CP) VM/370 - RELEASE 6' 00001000
  2. ISEQ 73,80 VALIDATE SEQUENCING OF SYSIN 00002000
  3. COPY OPTIONS 00003000
  4. COPY LOCAL 00004000
  5. SPACE 3 00005000
  6. *. 00006000
  7. * MODULE NAME - 00007000
  8. * 00008000
  9. * DMKVCA 00009000
  10. * 00010000
  11. * CONTENTS - 00011000
  12. * 00012000
  13. * DMKVCAST -- START I/O SIMULATION 00013000
  14. * DMKVCATS -- TEST I/O SIMULATION 00014000
  15. * DMKVCASH -- HALT I/O SIMULATION 00015000
  16. * DMKVCARD -- DEVICE RESET (WITHOUT DE-COUPLE) 00016000
  17. * DMKVCARS -- RESET AND DROP CTCA CONNECTION 00017000
  18. *. 00018000
  19. SPACE 00019000
  20. DMKVCA START 00020000
  21. SPACE 00021000
  22. USING SAVEAREA,R13 00022000
  23. USING DMKVCA,R12 00023000
  24. USING VMBLOK,R11 00024000
  25. USING IOBLOK,R10 00025000
  26. USING CHXBLOK,R7 00026000
  27. USING CHYBLOK,R6 00027000
  28. USING PSA,0 00028000
  29. SPACE 2 00029000
  30. DC CL8'DMKVCA' PAGEABLE MODULE IDENTIFIER 00030000
  31. SPACE 2 00031000
  32. EXTRN DMKSTKCP,DMKSTKIO 00032000
  33. EXTRN DMKDIBSM,DMKVIOIN @V407510 00033100
  34. EXTRN DMKCVTBH,DMKSCNVU 00034000
  35. AIF (NOT &TRACE(6)).NTR1 **AIF** 00035000
  36. EXTRN DMKTRDSI,DMKSYSRM @V4M0240 00036100
  37. EXTRN DMKSCHDL @VA00998 00037000
  38. .NTR1 ANOP 00038000
  39. EJECT 00039000
  40. *. 00040000
  41. * SUBROUTINE NAME - 00041000
  42. * 00042000
  43. * DMKVCAST 00043000
  44. * 00044000
  45. * FUNCTION - 00045000
  46. * 00046000
  47. * TO SIMULATE THE CHANNEL AND DEVICE OPERATIONS OF THE 00047000
  48. * CHANNEL-TO-CHANNEL ADAPTER (CTCA) CONNECTED BETWEEN TWO 00048000
  49. * VIRTUAL MACHINES UNDER VM/370 00049000
  50. * 00050000
  51. * ATTRIBUTES - 00051000
  52. * 00052000
  53. * REENTRANT, PAGEABLE, CALLED VIA SVC 00053000
  54. * 00054000
  55. * ENTRY POINT - 00055000
  56. * 00056000
  57. * DMKVCAST - SIMULATE VIRTUAL START I/O INSTRUCTION 00057000
  58. * 00058000
  59. * ENTRY CONDITIONS - 00059000
  60. * 00060000
  61. * GPR 13 = ADDRESS OF STANDARD SAVE-AREA 00061000
  62. * GPR 12 = ADDRESS OF ENTRY POINT 00062000
  63. * GPR 11 = VMBLOK ADDRESS OF ACTIVE USER 00063000
  64. * GPR 10 = IOBLOK ADDRESS OF ACTIVE I/O TASK 00064000
  65. * GPR 8 = VDEVBLOK ADDRESS OF VIRTUAL CTCA 00065000
  66. * 00066000
  67. * EXIT CONDITIONS - 00067000
  68. * 00068000
  69. * GPRS 0-15 UNCHANGED 00069000
  70. * 00070000
  71. * CALLS TO OTHER ROUTINES - 00071000
  72. * 00072000
  73. * DMKFREE - TO OBTAIN FREE STORAGE 00073000
  74. * DMKFRET - TO RELEASE FREE STORAGE OBTAINED FROM DMKFREE 00074000
  75. * DMKDIBSM - TO SIMULATE STATUS FOR A NOT READY DEVICE @V407510 00075100
  76. * DMKSCNVU - TO LOCATE VDEVBLOK, VCUBLOK, VCHBLOK 00076000
  77. * DMKSTKCP - TO STACK CPEXBLOKS FOR DEFERRED EXECUTION 00077000
  78. * DMKSTKIO - TO STACK IOBLOKS FOR THE SLIH 00078000
  79. * DMKTRDSI - TO TRACE SIO'S AND CCW STRINGS TO VIRTUAL CTCA 00079100
  80. * 00080000
  81. * EXTERNAL REFERENCES - 00081000
  82. * 00082000
  83. * DMKVIOIN - USED TO SET 'IOBIRA' FOR ATTENTION INTERRUPTS 00083000
  84. * 00084000
  85. * TABLES / WORK AREAS - 00085000
  86. * 00086000
  87. * CHXBLOK, CHYBLOK, IOBLOK 00087000
  88. * 00088000
  89. * REGISTER USAGE - 00089000
  90. * 00090000
  91. * GPR 13 = SAVE AREA BASE ADDRESS 00091000
  92. * GPR 12 = ADDRESS OF DMKVCA 00092000
  93. * GPR 11 = VMBLOK OF CHANNEL X USER 00093000
  94. * GPR 10 = IOBLOK FOR X-SIDE CHANNEL PROGRAM 00094000
  95. * GPR 9 = ADDRESS OF ACTIVE CCW 00095000
  96. * GPR 7 = CHXBLOK ADDRESSABILITY 00096000
  97. * GPR 6 = CHYBLOK ADDRESSABILITY 00097000
  98. * GPRS 0-5 = SCRATCH 00098000
  99. * GPRS 14,15 = EXTERNAL LINKAGE 00099000
  100. * 00100000
  101. * OPERATION - 00101000
  102. * 00102000
  103. * DMKVCAST IS CALLED FROM DMKVIOEX AT THE SAME POINT WHERE 00103000
  104. * DMKIOSQV IS CALLED FOR NON-SIMULATED DEVICES. AT ENTRY, 00104000
  105. * DMKVCAST INITIALIZES THE IOBLOK AS DMKIOSQV WOULD, AND 00105000
  106. * THEN TESTS THE VDEVBLOK TO DETERMINE IF THE VIRTUAL CTCA 00106000
  107. * IS 'COUPLE'D TO ANOTHER CTCA. IF NOT, DMKDIASM IS CALLED 00107000
  108. * TO INTERPRET THE CCW STRING AND SIMULATE THE CORRECT 00108000
  109. * CSW AND SENSE STATUS. IF YES, START I/O SIMULATION 00109000
  110. * PROCEEDS AS FOLLOWS: 00110000
  111. * 00111000
  112. * 1. THE 'CHXBLOK' AND 'CHYBLOK' ARE REFERENCED THRU THE 00112000
  113. * X-SIDE AND Y-SIDE VDEVBLOK'S (IN THIS DISCUSSION, THE 00113000
  114. * X-SIDE IS ALWAYS THE INITIATING CHANNEL). 00114000
  115. * 2. THE FIRST REAL CCW AND THE IOBCAW ARE VALIDATED. IF 00115000
  116. * ANY ERRORS ARE DETECTED, A CHANNEL PROGRAM CHECK IS 00116000
  117. * GENERATED AND THE SIMULATION TERMINATES VIA STEP ?? 00117000
  118. * 3. THE REAL CCW STRING PRODUCED BY DMKCCWTR IS INTERPRETED 00118000
  119. * ONE CCW AT A TIME BASED ON THE OPERATION TYPE: 00119000
  120. * 00120000
  121. * TRANSFER IN CHANNEL: X'08' 00121000
  122. * IF 'TIC' IS FIRST CCW, GENERATE CHANNEL PROGRAM CHK 00122000
  123. * IF 'TIC' POINTS TO 'TIC', CAUSE CHANNEL PROGRAM CHK 00123000
  124. * OTHERWISE, RESTART WITH NEW CCW STRING. 00124000
  125. * 00125000
  126. * SENSE ADAPTER STATE (EXTENDED MODE ONLY): X'14' 00126000
  127. * TEST FOR A PREVIOUS Y-SIDE RESET NOT YET CLEARED 00127000
  128. * AND PRESENT INTERVENTION REQUIRED IF YES. 00128000
  129. * TEST FOR ATTENTION PENDING FROM Y-SIDE, PRESENT 00129000
  130. * 'ATTN + BUSY' IN INITIAL STATUS IF YES. 00130000
  131. * OTHERWISE, PRESENT SENSE BYTE ZERO. 00131000
  132. * IN ALL CASES, SUPPRESS DATA TRANSFER IF 'SKIP' IN CCW. 00132000
  133. * 00133000
  134. * SENSE COMMAND BYTE: X'04' 00134000
  135. * EXTENDED MODE: IF PREVIOUS X-SIDE RESET OR HALT I/O 00135000
  136. * HAS NOT BEEN CLEARED, CLEAR RESET CONDITION, 00136000
  137. * PRESENT DEVICE END TO Y-SIDE, AND STORE COMMAND 00137000
  138. * BYTE OF ZERO. 00138000
  139. * IF PREVIOUS Y-SIDE RESET OR HALT I/O HAS NOT BEEN 00139000
  140. * CLEARED, PRESENT UNIT CHECK IN INITIAL STATUS. 00140000
  141. * IF X-SIDE END-OF-FILE LATCH IS SET, RESET LATCH 00141000
  142. * AND STORE COMMAND BYTE OF ZERO. 00142000
  143. * OTHERWISE, STORE COMMAND BYTE FROM Y-SIDE ADAPTER 00143000
  144. * BLOCK. IF THE Y-SIDE COMMAND WAS A CONTROL, PRESENT 00144000
  145. * DEVICE END TO THE Y-SIDE CHANNEL. 00145000
  146. * COMPATIBILITY MODE: STORE COMMAND BYTE FROM Y-SIDE 00146000
  147. * ADAPTER BLOCK. IF THE Y-SIDE COMMAND WAS A CONTROL, 00147000
  148. * PRESENT DEVICE END TO THE Y-SIDE CHANNEL. 00148000
  149. * IN ALL CASES, SUPPRESS DATA TRANSFER IF 'SKIP' IN CCW. 00149000
  150. * 00150000
  151. * EXTENDED-MODE ONLY - WRITE, READ CONTROL: 00151000
  152. * IF A PREVIOUS X-SIDE HALT I/O OR RESET HAS NOT BEEN 00152000
  153. * CLEARED, CLEAR THE CONDITION AND PRESENT DEVICE END 00153000
  154. * TO THE Y-SIDE CHANNEL. 00154000
  155. * IF A PREVIOUS Y-SIDE HALT I/O OR RESET HAS NOT BEEN 00155000
  156. * CLEARED, PRESENT UNIT CHECK IN INITIAL STATUS. 00156000
  157. * OTHERWISE, CONTINUE WITH COMMAND PROCESSING. 00157000
  158. * 00158000
  159. * CONTROL IMMEDIATE: X'07' 00159000
  160. * RESET THE X-SIDE END-OF-FILE LATCH IF SET. 00160000
  161. * IF THE Y-SIDE HAS AN ACTIVE READ, WRITE OR CONTROL 00161000
  162. * COMMAND, PRESENT 'ATTN + BUSY'. 00162000
  163. * OTHERWISE, PRESENT ATTENTION TO THE Y-SIDE CHANNEL, 00163000
  164. * CHANNEL END TO THE X-SIDE CHANNEL, AND WAIT FOR 00164000
  165. * A 'SENSE COMMAND BYTE' FROM THE Y-SIDE. 00165000
  166. * 00166000
  167. * DISABLE COMPATIBILITY - MODIFIED NO-OP X'C3': 00167000
  168. * SET THE INHIBIT COMPATIBILITY LATCH IN THE X-SIDE 00168000
  169. * ADAPTER BLOCK, INIDCATE THAT BOTH SIDES OF THE 00169000
  170. * ADAPTER ARE IN EXTENDED MODE, ADVANCE TO NEXT CCW. 00170000
  171. * 00171000
  172. * ENABLE COMPATIBILITY - MODIFIED NO-OP X'43': 00172000
  173. * RESET THE X-SIDE INHIBIT COMPATIBILITY LATCH. 00173000
  174. * IF THE Y-SIDE INHIBIT COMPATIBILITY LATCH IS SET, 00174000
  175. * LEAVE ADAPTER IN EXTENDED MODE AND ADVANCE TO NEXT 00175000
  176. * CCW. IF THE Y-SIDE LATCH IS NOT SET, FORCE THE 00176000
  177. * ADAPTER INTO COMPATIBILITY MODE. 00177000
  178. * 00178000
  179. * WRITE: X'01' 00179000
  180. * RESET THE X-SIDE END-OF-FILE LATCH IF SET. 00180000
  181. * IF THE Y-SIDE HAS AN ACTIVE READ COMMAND, ENTER DATA 00181000
  182. * TRANSFER MODE. 00182000
  183. * IF THE Y-SIDE HAS AN ACTIVE WRITE OR CONTROL COMMAND, 00183000
  184. * PRESENT 'ATTN + BUSY'. 00184000
  185. * IF THERE IS NO ACTIVE Y-SIDE COMMAND, PRESENT 'ATTN' 00185000
  186. * TO THE Y-SIDE CHANNEL AND WAIT FOR Y-SIDE ACTIVITY. 00186000
  187. * 00187000
  188. * WRITE END OF FILE: X'81' (EXTENDED MODE ONLY) 00188000
  189. * RESET THE X-SIDE END-OF-FILE LATCH IF SET. 00189000
  190. * IF THE Y-SIDE HAS NO ACTIVE COMMAND, SET THE Y-SIDE 00190000
  191. * END-OF-FILE LATCH AND CONTINUE PROCESSING. 00191000
  192. * IF THE Y-SIDE HAS AN ACTIVE READ COMMAND, PRESENT 00192000
  193. * CHANNEL END, DEVICE END, UNIT EXCEPTION TO THE Y-SIDE. 00193000
  194. * IF THE Y-SIDE HAS AN ACTIVE CONTROL OR WRITE COMMAND, 00194000
  195. * PRESENT 'ATTN + BUSY' TO THE X-SIDE CHANNEL. 00195000
  196. * 00196000
  197. * READ X'02' OR READ BACKWARD X'0C': 00197000
  198. * EXTENDED MODE: IF THE X-SIDE END-OF-FILE LATCH IS SET, 00198000
  199. * RESET THE LATCH AND PRESENT UNIT EXCEPTION IN 00199000
  200. * INITIAL STATUS. 00200000
  201. * IF THE Y-SIDE HAS AN ACTIVE WRITE COMMAND, ENTER 00201000
  202. * DATA TRANSFER MODE. 00202000
  203. * IF THE Y-SIDE HAS AN ACTIVE WRITE OR CONTROL COMMAND, 00203000
  204. * PRESENT 'ATTN + BUSY'. 00204000
  205. * IF THERE IS NO ACTIVE Y-SIDE COMMAND, PRESENT 'ATTN' 00205000
  206. * TO THE Y-SIDE CHANNEL AND WAIT FOR Y-SIDE ACTIVITY. 00206000
  207. * 00207000
  208. * WHENEVER IT IS NECESSARY TO WAIT FOR ACTIVITY FROM THE 00208000
  209. * Y-SIDE CHANNEL, A CPEXBLOK IS BUILT AND THE ADDRESS STORED 00209000
  210. * IN THE CHXBLOK FOR LATER RE-CONNECTION VIA A CALL TO 00210000
  211. * DMKSTKCP. ANOTHER CPEXBLOK IS BUILT FOR AN EXIT TO THE 00211000
  212. * CALLING ROUTINE WHILE PRESERVING THE ENTRY SAVE-AREA. 00212000
  213. * AT APPROPRIATE PLACES DURING COMMAND PROCESSING, A CPEXBLOK 00213000
  214. * EXIT FOLLOWED BY A CPEXBLOK RESTART IS TAKEN FOR SEQUENCING 00214000
  215. * CONTROL AND TIMING CONSIDERATIONS. 00215000
  216. * 00216000
  217. * DATA TRANSFER MODE: 00217000
  218. * 00218000
  219. * UPON ENTERING DATA TRANSFER MODE, THE FOLLOWING INIT- 00219000
  220. * IALIZATION STEPS ARE TAKEN: 00220000
  221. * 1. RESET ANY PENDING ATTENTION INTERRUPTS OR FLAGS ON 00221000
  222. * BOTH THE X-SIDE AND Y-SIDE ADAPTERS. 00222000
  223. * 2. BUILD A CPEXBLOK FOR THE X-SIDE SUCH THAT BOTH X AND Y 00223000
  224. * ADAPTERS ARE IN A SOFTWARE 'WAIT' STATUS. 00224000
  225. * 3. PRESENT ZERO INITIAL STATUS TO THE X-SIDE CHANNEL. 00225000
  226. * 4. EXCHANGE THE X-SIDE AND Y-SIDE IF NECESSARY SUCH THAT 00226000
  227. * THE 'READ' OPERATION IS ALWAYS THE X-SIDE ADAPTER. 00227000
  228. * 00228000
  229. * DATA TRANSFER WILL PROCEED UNINTERRUPTIBLY TO COMPLETION, 00229000
  230. * IN THE FOLLOWING MANNER: 00230000
  231. * 1. EXAMINE THE Y-SIDE (WRITE) CCW TO DETERMINE THE 00231000
  232. * MAXIMUM SEGMENT LENGTH FOR DATA TRANSFER. 00232000
  233. * 2. EXAMINE THE X-SIDE (READ) CCW TO DETERMINE ITS 00233000
  234. * MAXIMUM SEGMENT LENGTH FOR DATA TRANSFER. 00234000
  235. * 3. EXAMINE THE 'CAW' PROTECTION KEY FOR THE READ CCW 00235000
  236. * AND SIMULATE A PROTECTION CHECK IF IT DOES NOT MATCH 00236000
  237. * THE REAL STORAGE KEY OF THE READ AREA. 00237000
  238. * 4. COMPARE THE DATA SEGMENT LENGTHS FOR READ AND WRITE. 00238000
  239. * 5. IF THE READ COUNT IS GREATER THAN THE WRITE COUNT, 00239000
  240. * TRANSFER THE DATA SEGMENT AS SPECIFIED BY THE WRITE 00240000
  241. * COUNT, AND UPDATE THE WRITE COUNT BY RESTARTING AT 00241000
  242. * STEP 1. AND SKIPPING STEPS 2. AND 3. 00242000
  243. * 6. IF THE WRITE COUNT IS GREATER THAN THE READ COUNT, 00243000
  244. * TRANSFER THE DATA SEGMENT AS SPECIFIED BY THE READ 00244000
  245. * COUNT AND UPDATE THE READ COUNT BY RESTARTING AT STEP 00245000
  246. * 2. 00246000
  247. * 7. IF THE READ COUNT EQUALS THE WRITE COUNT, TRANSFER 00247000
  248. * THE DATA SEGMENT AND RESTART AT STEP 1. 00248000
  249. * 8. WHEN EITHER THE READ OR WRITE CCW STRING HAS BEEN 00249000
  250. * EXHAUSTED, DETERMINE IF INCORRECT LENGTH SHOULD BE 00250000
  251. * INDICATED FOR EITHER OR BOTH CHANNELS AND RE-CONNECT 00251000
  252. * BOTH SIDES VIA CALLS TO DMKSTKCP. 00252000
  253. * 00253000
  254. * THE MAXIMUM DATA SEGMENT LENGTH WHICH MAY BE TRANSFERRED 00254000
  255. * IN A SINGLE STEP IS DETERMINED AS FOLLOWS: 00255000
  256. * 1. NO MORE THAN 2048 BYTES AT ANY TIME - FOR PROTECTION 00256000
  257. * KEY CHECKING. 00257000
  258. * 2. NO MORE THAN THE LENGTH OF BUFFER FROM THE STARTING 00258000
  259. * ADDRESS TO THE NEAREST 2048-BYTE STORAGE BOUNDARY. 00259000
  260. * 3. NO MORE THAN THE TOTAL OR REMAINING CCW DATA COUNT. 00260000
  261. * DATA TRANSFER WILL CONTINUE SO LONG AS THERE IS REMAINING 00261000
  262. * CCW DATA COUNT OR DATA CHAINED CCW'S. COMMAND CHAINING WILL 00262000
  263. * STOP DATA TRANSFER IF THE PREVIOUS CCW COUNT IS EXHAUSTED. 00263000
  264. * 00264000
  265. * READ BACKWARD DATA TRANSFER: 00265000
  266. * THE READ BACKWARD COMMAND TO A CHANNEL-TO-CHANNEL 00266000
  267. * ADAPTER RESULTS IN THE DATA BEING INVERTED ON A 00267000
  268. * CHARACTER BASIS., SINCE THE WRITE-ING CHANNEL IS 00268000
  269. * SENDING DATA IN FORWARD SEUENCE, BUT THE INDEPENDENT 00269000
  270. * READ-ING CHANNEL IS READING IN BACKWARD SEQUENCE. 00270000
  271. * DATA INVERSION IS PERFORMED IN THE FOLLOWING MANNER: 00271000
  272. * 1. IF THE READ BUFFER STARTS AT A 7-BYTE BOUNDARY (I.E. AT 00272000
  273. * THE LOW-ORDER BYTE OF A DOUBLE WORD), SKIP TO STEP 3. 00273000
  274. * 2. MOVE DATA ONE BYTE AT A TIME UNTIL A 7-BYTE BOUNDARY IS 00274000
  275. * REACHED, OR THE DATA COUNT IS EXHAUSTED. 00275000
  276. * 3. LOAD INTO A REGISTER PAIR EIGHT BYTES OF WRITE DATA IN 00276000
  277. * INVERTED ORDER, AND MOVE TO READ BUFFER VIA A DOUBLE- 00277000
  278. * WORD STORE, UNTIL THE LAST DOUBLE-WORD-ALIGNED DATA HAS 00278000
  279. * BEEN MOVED. 00279000
  280. * 4. MOVE THE REMAINDER OF THE DATA SEGMENT A SINGLE CHARACTER 00280000
  281. * AT A TIME UNTIL THE COUNT IS EXHAUSTED. 00281000
  282. *. 00282000
  283. EJECT 00283000
  284. DMKVCAST RELOC , SIO TO VIRTUAL CHAN-TO-CHAN ADAPTER 00284000
  285. USING VDEVBLOK,R8 TEMPORARILY 00285000
  286. XC SAVEWRK1(4),SAVEWRK1 CLEAR A WORD FOR FLAGS 00286000
  287. SPACE 00287000
  288. ST R11,IOBUSER SET IOBLOK VMBLOK POINTER 00288000
  289. ST R10,IOBLINK FORCE IOBLOK TO LINK TO ITSELF 00289000
  290. SLR R0,R0 (ZERO CONSTANT) 00290000
  291. ST R0,IOBIOER NO IOERBLOK 00291000
  292. L R1,VDEVIOCT INCREMENT COUNT OF SIO'S TO THIS DEVICE 00292000
  293. AL R1,F1 ... 00293000
  294. ST R1,VDEVIOCT ... 00294000
  295. MVC IOBCSW(8),ZEROES ZERO OUT THE CSW 00295000
  296. MVI IOBSTAT,X'00' CLEAR IOBLOK STATUS 00296000
  297. TM VDEVSTAT,VDEVNRDY IS THE CTCA COUPLED ? 00297000
  298. BZ VCASTART YES -- START UP THE PROCESS 00298000
  299. SPACE 00299000
  300. SL R8,VMDVSTRT REDUCE VDEVBLOK ADDR. TO DISPLACEMENT 00300000
  301. CALL DMKDIBSM,PARM=TYPCTCA SIMULATE I/O STATUS @V407510 00301100
  302. B VCAEXIT ...AND RETURN TO DMKVIO 00302000
  303. DROP R8 00303000
  304. SPACE 00304000
  305. * 00305000
  306. * INTERNAL FLAGS USED IN 'SAVEWRK1': 00306000
  307. * 00307000
  308. * CPWAIT EQU X'80' DEFER ATTENTION UNTIL EOF LATCH RESET 00308000
  309. * IOBRSTRT EQU X'40' RESTART PROCESSING AFTER CPEXBLOK 'EXIT' 00309000
  310. * CPEX EQU X'20' EXIT TO DMKVIO VIA CPEXBLOK 00310000
  311. * VDEVCCW1 EQU X'10' PROCESSING FIRST USER CCW 00311000
  312. * VMRUN EQU X'08' CPEXBLOK HAS BEEN STACKED FOR EXECUTION 00312000
  313. * CHBREAD EQU X'02' DATATRN - UPDATE READ DATA NEXT TIME 00313000
  314. * CHBWRIT EQU X'01' DATATRN - UPDATE WRITE DATA NEXT TIME 00314000
  315. * 00315000
  316. * 'SAVEWRK1'+1 IS USED AS A SWITCH TO PREVENT DOUBLE EXIT TO DMKVIO 00316000
  317. * 00317000
  318. SPACE 00318000
  319. USING CHXBLOK,R7 00319000
  320. USING CHYBLOK,R6 00320000
  321. VCASTART EQU * 'SIO' INITIAL PROCESSING 00321000
  322. BAL R5,GETCTCA ACCESS CHXBLOK, CHYBLOK 00322000
  323. STH R0,CHXSTAT SET X-SIDE STATUS INITIALLY ZERO 00323000
  324. L R9,IOBCAW ADDRESS OF FIRST REAL CCW 00324000
  325. USING RCWCCW,R9 ... 00325000
  326. STCM R9,B'1000',CHXPKEY SAVE CAW PROTECTION KEY 00326000
  327. LA R9,0(0,R9) STRIP OFF CAW KEY 00327000
  328. OI SAVEWRK1,VDEVCCW1 WORKING ON FIRST CCW 00328000
  329. B VCACCHK GO VALIDATE FIRST CCW 00329000
  330. EJECT 00330000
  331. VCACCWS EQU * CCW DECODING -- MAJOR LOOP 00331000
  332. IC R1,RCWCOMND PICK UP REAL CCW COMMAND BYTE 00332000
  333. STC R1,CHXCMDB ...PRESERVE IN CHXBLOK 00333000
  334. SLR R5,R5 CCW DATA COUNT CARRIED IN GR5 00334000
  335. ICM R5,B'0011',RCWCNT 'LOAD LOGICAL HALFWORD' 00335000
  336. ST R5,CHXRCNT SAVE IT IN CHXBLOK FOR TRANSFER 00336000
  337. SPACE 00337000
  338. CLI RCWCOMND,X'08' TRANSFER IN CHANNEL ? 00338000
  339. BE VCATIC YES - VALIDATE 00339000
  340. TM RCWCOMND,B'00001011' SENSE-TYPE COMMAND ? 00340000
  341. BZ VCASENS YES -- 00341000
  342. TM CHXFLAG,CHBHIO+CHBREST PREVIOUS X-SIDE RESET ? 00342000
  343. BZ VCADCOD NO -- CONTINUE PROCESSING 00343000
  344. NI CHXFLAG,255-(CHBHIO+CHBREST) X-SIDE COMES READY AGAIN 00344000
  345. OI CHXFLAG,CHBM370 BACK TO EXTENDED MODE 00345000
  346. BAL R14,DECHANY DEVICE END TO CHANNEL Y 00346000
  347. VCADCOD EQU * CONTINUE CCW INTERPRETATION 00347000
  348. TM CHYFLAG,CHBREST HAS THE Y-SIDE BEEN RESET ? 00348000
  349. BO VCAUCIR YES - UNIT CHECK, INT. REQ'D 00349000
  350. TM CHYFLAG,CHBHIO MAYBE A Y-SIDE HALT I/O ? 00350000
  351. BO VCASLRS YES - UNIT CHECK, SEL. RESET 00351000
  352. TM RCWCOMND,B'00000011' CONTROL COMMAND ? 00352000
  353. BO VCACNTL YES -- 00353000
  354. TM RCWCOMND,B'00000001' WRITE-TYPE ? 00354000
  355. BO VCAWRIT YES -- 00355000
  356. B VCAREAD READ - 00356000
  357. SPACE 00357000
  358. VCATIC EQU * TRANSFER IN CHANNEL - X'08' 00358000
  359. TM SAVEWRK1,VDEVCCW1 WORKING ON FIRST CCW ? 00359000
  360. BO VCAPRGC YES -- CC = 1 PROGRAM CHECK 00360000
  361. L R9,RCWADDR LOAD NEXT CCW ADDRESS 00361000
  362. CLI RCWCOMND,X'08' TIC POINTING TO A TIC ? 00362000
  363. BE VCAPRGC YES - CHANNEL PROGRAM CHECK 00363000
  364. B VCACCHK ...AND VALIDATE IT 00364000
  365. SPACE 00365000
  366. VCANEXT EQU * ADVANCE TO NEXT CCW 00366000
  367. L R9,CHXNCCW PICK UP ACTIVE CCW ADDRESS 00367000
  368. TM RCWFLAG,CC COMMAND CHAINED ? 00368000
  369. BZ VCACEDE NO -- STORE CSW AND EXIT 00369000
  370. LA R9,8(0,R9) NEXT CCW FETCH 00370000
  371. BAL R14,USRWAIT TAKE USER OUT OF WAIT IF FIRST CCW 00371000
  372. OI SAVEWRK1,IOBRSTRT RESTART AFTER EXIT IF NECESSARY 00372000
  373. BAL R3,VCAGOTO LET DMKVIO CONTINUE BEFORE WE FINISH 00373000
  374. VCACCHK EQU * VALIDATE NEXT CCW 00374000
  375. ST R9,CHXNCCW STORE ADDRESS IN CHXBLOK 00375000
  376. BAL R14,CHANCHK TEST CCW FOR VALIDITY 00376000
  377. BNZ VCAPRGC NO GOOD -- CHANNEL PROGRAM CHECK 00377000
  378. TM SAVEWRK1,VDEVCCW1 HAVE WE ALREADY VALIDATED THE CAW ? 00378000
  379. BZ VCACCWS YES - GO INTERPRET CCW STRING 00379000
  380. TM CHXPKEY,X'0F' IS THE 'CAW' VALID ? 00380000
  381. BZ VCACCWS YES - GO INTERPRET CCW STRING 00381000
  382. B VCAPRGC NO -- CHANNEL PROGRAM CHECK 00382000
  383. EJECT 00383000
  384. VCAUCIR EQU * SET UNIT CHECK, INTERVENTION REQUIRED 00384000
  385. OI CHXSTAT,UC CSW STATUS = UNIT CHECK 00385000
  386. LA R8,INTREQ SENSE DATA = INTERVENTION REQUIRED 00386000
  387. B VCACEDE TERMINATE CHANNEL PROGRAM 00387000
  388. VCASLRS EQU * SET UNIT CHECK, SELECTIVE RESET 00388000
  389. OI CHXSTAT,UC CSW STATUS = UNIT CHECK 00389000
  390. LA R8,INTREQ+X'01' INTREQ + SELECTIVE RESET 00390000
  391. B VCACEDE GO TERMINATE CHANNEL PROGRAM 00391000
  392. VCAPRGC EQU * CHANNEL PROGRAM CHECK 00392000
  393. OI CHXSTAT+1,PRGC CSW STATUS = PROGRAM CHECK 00393000
  394. B VCACEDE GO STORE CSW 00394000
  395. VCAPRTC EQU * CHANNEL PROTECTION CHECK 00395000
  396. OI CHXSTAT+1,PRTC CSW STATUS = PROTECTION CHECK 00396000
  397. B VCACEDE GO STORE CSW 00397000
  398. ATNBUSY EQU * ATTENTION PLUS BUSY 00398000
  399. OI CHXSTAT,ATTN+BUSY CSW STATUS = ATTN + BUSY 00399000
  400. B VCASEND GO SET CSW STATUS ALONE 00400000
  401. VCACEDE EQU * SET STATUS, ADD CHANNEL END, DEVICE END 00401000
  402. TM SAVEWRK1,VDEVCCW1 IF THIS IS THE FIRST CCW... 00402000
  403. BO VCASEND ...DO NOT INCLUDE CE, DE 00403000
  404. OI CHXSTAT,DE SET DEVICE END AT LEAST 00404000
  405. TM CHXFLAG,CHBCENT HAS CHANNEL END BEEN GIVEN YET ? 00405000
  406. BO VCASEND YES - PRESENT DEVICE END ALONE 00406000
  407. OI CHXSTAT,CE ADD CHANNEL END TO STATUS ALSO 00407000
  408. VCASEND EQU * CLEAR COMMAND FROM X-SIDE 00408000
  409. MVI CHXCMDB,X'00' ... 00409000
  410. MVI CHXCMDT,X'00' ... 00410000
  411. BAL R3,RESEOFL RESET END-OF-FILE IF SET 00411000
  412. NI CHXFLAG,255-CHBCENT REMOVE CHANNEL-END-PRESENTED FLAG 00412000
  413. VCASCSW EQU * STORE CSW IN IOBLOK, STACK IOBLOK 00413000
  414. LH R1,CHXSTAT STATUS BITS FOR INTERRUPT 00414000
  415. STH R1,IOBCSW+4 ...INTO IOBLOK CSW FIELD 00415000
  416. TM SAVEWRK1,VDEVCCW1 IS THIS THE FIRST CCW ? 00416000
  417. BO VCASTAT YES - STORE STATUS ONLY 00417000
  418. TM IOBCSW+4,CE+BUSY CHANNEL CLASS INTERRUPT ? @VA02497 00418000
  419. BZ VCASIOB YES -- DO NOT FILL IN CHANNEL DATA 00419000
  420. L R9,CHXNCCW GET PREVIOUS CCW ADDRESS 00420000
  421. LA R9,8(0,R9) GR9 = CSW ADDRESS 00421000
  422. ST R9,IOBCSW ... 00422000
  423. IC R1,CHXPKEY GET CAW PROTECTION KEY 00423000
  424. STC R1,IOBCSW ...INTO CSW 00424000
  425. L R5,CHXRCNT GET RESIDUAL COUNT FROM CHXBLOK 00425000
  426. STH R5,IOBCSW+6 SET CSW RESIDUAL COUNT 00426000
  427. NI IOBSTAT,X'FF'-IOBCC3 THIS IS AN INTERRUPT 00427000
  428. B VCASIOB GO CLEAR STATUS + STACK IOBLOK 00428000
  429. EJECT 00429000
  430. VCASTAT EQU * SET CC = 1, STORE STATUS ONLY 00430000
  431. MVI IOBSTAT,IOBCC1 CC = 1 TO SIO 00431000
  432. CH R0,IOBCSW+4 IF WE LEFT THE STATUS ZERO... 00432000
  433. BNE VCASIOB (NO -- JUST STACK THE IOBLOK) 00433000
  434. OI IOBCSW+4,CE+DE ...WE REALLY MEANT 'CE+DE' 00434000
  435. VCASIOB EQU * STACK IOBLOK FOR DMKVIO 00435000
  436. STH R0,CHXSTAT CLEAR STATUS FROM X-SIDE 00436000
  437. TM IOBCSW+4,UC WAS THERE A UNIT CHECK ? 00437000
  438. BZ CALLSTK NO -- JUST STACK THE IOBLOK 00438000
  439. LM R4,R5,IOBCSW GET SET TO BUILD AN IOERBLOK 00439000
  440. LR R3,R8 SENSE DATA TO GR3 00440000
  441. BAL R14,BLDIOER BUILD IOERBLOK FOR DMKVIO 00441000
  442. ST R1,IOBIOER ...AND PASS BACK WITH IOBLOK 00442000
  443. CALLSTK EQU * 00443000
  444. CALL DMKSTKIO ... 00444000
  445. NI SAVEWRK1,255-VDEVCCW1 NO LONGER ON FIRST CCW 00445000
  446. TM SAVEWRK1,CPEX EXIT VIA CPEXBLOK ? 00446000
  447. BO VCAGOTO YES - GO MODIFY THE SAVE-AREA 00447000
  448. B VCAEXIT NORMAL SVC EXIT 00448000
  449. SPACE 00449000
  450. USRWAIT EQU * IF FIRST CCW, TAKE USER OUT OF IOWAIT 00450000
  451. TM SAVEWRK1,VDEVCCW1 IS THIS THE FIRST CCW ? 00451000
  452. BCR 8,R14 NO -- NOTHING NEEDS DOING 00452000
  453. NI SAVEWRK1,255-VDEVCCW1 NO LONGER FIRST CCW 00453000
  454. NI VMRSTAT,255-VMIOWAIT OUT OF IOWAIT 00454000
  455. LR R3,R14 @VA00998 00455000
  456. AIF (NOT &TRACE(6)).NTR2 **AIF** 00456000
  457. TM VMTRCTL,VMTRSIO SIO TRACING TODAY ? 00457000
  458. BZ USRSCHDL NO -- CHECK FOR SCHDL CALL @VA00998 00458000
  459. OI VMRSTAT,VMIOWAIT BACK INTO IO-WAIT 00459000
  460. LH R1,CHYXADD WHILE WE GET VIRTUAL ADDRESS 00460000
  461. CALL DMKTRDSI ...AND TRACE THE SIO CC = 0 @V4M0240 00461100
  462. NI VMRSTAT,255-VMIOWAIT OUT OF IOWAIT ONCE MORE 00462000
  463. .NTR2 ANOP 00463000
  464. USRSCHDL EQU * @VA00998 00464000
  465. CL R11,RUNUSER WILL DISPATCH CALL DMKSCHDL? @VA00998 00465000
  466. BCR 8,R3 YES - WE DON'T HAVE TO @VA00998 00466000
  467. CALL DMKSCHDL ALTER USER DISPATCH STATUS @VA00998 00467000
  468. BR R3 RETURN @VA00998 00468000
  469. EJECT 00469000
  470. GOCHANY EQU * RE-CONNECT Y-SIDE FOR EXECUTION 00470000
  471. NI CHXFLAG,255-CHBATTN REMOVE ATTENTION FROM X-SIDE 00471000
  472. NI CHYFLAG,255-CHBWAIT REMOVE WAIT FLAG FROM Y-SIDE 00472000
  473. L R1,CHYCNCT CPEXBLOK FOR RE-CONNECT 00473000
  474. CALL DMKSTKCP STACK IT FOR EXECUTION 00474000
  475. ST R0,CHYCNCT CLEAR OUT CPEXBLOK POINTER 00475000
  476. OI SAVEWRK1,VMRUN CPEXBLOK HAS BEEN STACKED 00476000
  477. BR R3 RETURN TO CALLER 00477000
  478. SPACE 2 00478000
  479. RESEOFL EQU * RESET END-OF-FILE LATCH 00479000
  480. TM CHXFLAG,CHBEOFL IS THE END-OF-FILE LATCH SET ? 00480000
  481. BCR 8,R3 NO -- NOTHING NEEDS TO BE DONE 00481000
  482. NI CHXFLAG,255-CHBEOFL RESET END-OF-FILE LATCH 00482000
  483. LR R1,R10 SAVE CURRENT IOBLOK POINTER 00483000
  484. L R10,CHYDATN CHECK FOR Y-SIDE DEFERRED 'ATTN' 00484000
  485. LTR R10,R10 IS THERE A DEFERRED IOBLOK ? 00485000
  486. BZ RESEOFR NO -- JUST RETURN 00486000
  487. CALL DMKSTKIO STACK THE IOBLOK FOR DMKVIO 00487000
  488. ST R0,CHYDATN CLEAR OUT THE POINTER WORD 00488000
  489. OI CHXFLAG,CHBATTN SET ATTENTION PENDING, X-SIDE 00489000
  490. RESEOFR EQU * RESTORE IOBLOK ADDRESS, RETURN 00490000
  491. LR R10,R1 MUST HAVE PREVIOUS IOBLOK ADDRESS 00491000
  492. BR R3 RETURN TO CALLER 00492000
  493. EJECT 00493000
  494. VCASENS EQU * SENSE COMMAND BYTE, SENSE ADAPTER STATUS 00494000
  495. TM CHYFLAG,CHBREST Y-SIDE SYSTEM RESET ? 00495000
  496. BZ SNSDCOD NO -- DECODE COMMAND 00496000
  497. * 'CHBREST' FOR Y-SIDE IMPLIES NON-COMPATIBILITY MODE 00497000
  498. TM CHXCMDB,X'10' SENSE STATUS OR SENSE COMMAND ? 00498000
  499. BO VCAUCIR SENSE COMMAND - UNIT CHK, INTREQ 00499000
  500. LA R4,INTREQ SENSE DATA = INTERVENTION REQUIRED 00500000
  501. B SNSTORE GO STORE SENSE BYTE 00501000
  502. SNSDCOD EQU * CHECK X-SIDE STATUS 00502000
  503. TM CHXFLAG,CHBM370 CHECK ADAPTER OPERATING MODE 00503000
  504. BZ SNSCOMD COMPATIBILITY MODE - SENSE CMD BYTE 00504000
  505. TM CHXCMDB,X'10' SENSE STATUS OR SENSE COMMAND 00505000
  506. BZ SNSADST SENSE ADAPTER STATUS - X'04' 00506000
  507. TM CHXFLAG,CHBHIO+CHBREST X-SIDE HIO OR SYSTEM RESET ? 00507000
  508. BZ SNSCRS1 NO -- CONTINUE 00508000
  509. NI CHXFLAG,255-(CHBHIO+CHBREST) ADAPTER READY AGAIN 00509000
  510. OI CHXFLAG,CHBM370 BACK INTO EXTENDED MODE 00510000
  511. BAL R14,DECHANY DEVICE END TO Y-SIDE 00511000
  512. SLR R4,R4 CMD BYTE ZERO 00512000
  513. B SNSTORE ...GO STORE DATA 00513000
  514. SNSCRS1 EQU * CONTINUE RESET CHECKING 00514000
  515. TM CHYFLAG,CHBHIO HALT I/O ON Y-SIDE ? 00515000
  516. BO VCASLRS YES - UNIT CHK, SEL. RESET 00516000
  517. SLR R4,R4 00517000
  518. TM CHXFLAG,CHBEOFL IF END-OF-FILE IS SET... 00518000
  519. BZ SNSCOMD NO -- THAT'S NORMAL... 00519000
  520. BAL R3,RESEOFL ...RESET LATCH FIRST 00520000
  521. B SNSTORE ...BUT STORE COMMAND BYTE OF ZERO 00521000
  522. SNSADST EQU * SENSE ADAPTER STATUS 00522000
  523. TM CHXFLAG,CHBATTN IS THE Y-SIDE ACTIVE ? 00523000
  524. BO ATNBUSY YES - GIVE 'ATTN + BUSY' 00524000
  525. SLR R4,R4 SENSE BYTE ZERO IF WE GOT HERE 00525000
  526. B SNSTORE GO STORE SENSE DATA 00526000
  527. EJECT 00527000
  528. SNSCOMD EQU * RELATIVELY ORDINARY SENSE CMD BYTE 00528000
  529. IC R4,CHYCMDB COMMAND BYTE FROM Y-SIDE 00529000
  530. TM CHYFLAG,CHBWAIT IS THE Y-SIDE WAITING ? 00530000
  531. BZ SNSTORE NO -- JUST DO THE COMMAND 00531000
  532. CLI CHYCMDT,CHBCNTL WAITING ON CONTROL COMMAND ? 00532000
  533. BNE SNSTORE NO -- JUST DO THE COMMAND 00533000
  534. BAL R3,GOCHANY RE-CONNECT THE Y-SIDE 00534000
  535. SNSTORE EQU * STORE SENSE BYTE 00535000
  536. BAL R14,USRWAIT FORCE ZERO INITIAL STATUS TO SENSE 00536000
  537. TM RCWFLAG,SKIP SHOULD WE TRANSFER DATA ? 00537000
  538. BO SNSFINS NO -- 00538000
  539. L R2,RCWADDR PICK UP REAL DATA ADDRESS 00539000
  540. LA R2,0(,R2) CLEAR OUT COMMAND CODE @VA03162 00540000
  541. TM RCWFLAG,IDA IS IDA SET ? 00541000
  542. BZ *+8 NO -- 00542000
  543. L R2,0(0,R2) GET DATA ADDRESS FROM FIRST IDAW 00543000
  544. L R14,=A(DMKSYSRM) GET REAL MACHINE @VA03162 00544000
  545. L R14,0(,R14) SIZE @VA03162 00545000
  546. CLR R2,R14 VALID ADDRESS ? @VA03162 00546000
  547. BNL VCAPRGC NO..CHANNEL PROGRAM CHECK @VA03162 00547000
  548. BAL R14,CHKPKEY TEST FOR PROTECTION VIOLATION 00548000
  549. BNZ VCAPRTC OOPS...GENERATE PROTECTION CHECK 00549000
  550. STC R4,0(0,R2) STORE THE SENSE BYTE 00550000
  551. SNSFINS EQU * 00551000
  552. L R5,CHXRCNT PICK UP CCW DATA COUNT 00552000
  553. BCTR R5,0 DECREMENT DATA COUNT 00553000
  554. ST R5,CHXRCNT SAVE RESIDUAL COUNT IN CHXBLOK 00554000
  555. TM RCWFLAG,CD IF CHAIN DATA IS SET... 00555000
  556. BO MARKILI ...INCORRECT LENGTH IS AUTOMATIC 00556000
  557. LTR R5,R5 IS THE RESIDUAL COUNT ZERO ? 00557000
  558. BZ CHEKRUN YES - CONTINUE WITHOUT IMPEDIMENT 00558000
  559. TM RCWFLAG,SILI SUPPRESS INCORRECT LENGTH ? 00559000
  560. BO CHEKRUN YES - JUST CONTINUE 00560000
  561. MARKILI EQU * 00561000
  562. OI CHXSTAT+1,IL SET INCORRECT LENGTH 00562000
  563. B VCACEDE ...AND TERMINATE THE CHANNEL PROGRAM 00563000
  564. CHEKRUN EQU * SEE IF DELAY IS RECOMMENDED 00564000
  565. TM SAVEWRK1,VMRUN HAS A CPEXBLOK BEEN STACKED ? 00565000
  566. BZ VCANEXT NO -- JUST CONTINUE 00566000
  567. LA R3,VCANEXT CONTINUE AFTER SEQUENCE DELAY 00567000
  568. OI SAVEWRK1,IOBRSTRT 00568000
  569. B VCAGOTO EXIT VIA CPEXBLOK, RETURN LATER 00569000
  570. EJECT 00570000
  571. VCACNTL EQU * CONTROL OR NO-OP 00571000
  572. BAL R3,RESEOFL RESET END-OF-FILE LATCH IF SET 00572000
  573. TM CHXFLAG,CHBATTN IS THE Y-SIDE ACTIVE ? 00573000
  574. BO ATNBUSY YES - 'BUSY + ATTN' 00574000
  575. TM CHXCMDB,B'00000111' CONTROL OR NO-OP ? 00575000
  576. BO CTLIMED CONTROL - X'07' 00576000
  577. TM CHXCMDB,X'40' IS THIS A MODIFIED NO-OP ? 00577000
  578. BZ VCANEXT NO -- JUST GO TO NEXT CCW 00578000
  579. * MODIFIED NO-OPS: X'43' = ENABLE S/360 X'C3' = DISABLE S/360 00579000
  580. TM CHXCMDB,X'80' DISABLE COMPATIBILITY ? 00580000
  581. BO VCADSBL YES - BOTH SIDES GO EXTENDED 00581000
  582. NI CHXFLAG,255-CHBMNOP FORGET THAT X-SIDE DID 'DISABLE' 00582000
  583. TM CHYFLAG,CHBMNOP DID THE Y-SIDE DO A DISABLE ? 00583000
  584. BO VCANEXT YES - NO CHANGE UNTIL HE DOES 'ENABLE' 00584000
  585. NI CHXFLAG,255-CHBM370 ENABLE COMPATIBILITY 00585000
  586. NI CHYFLAG,255-CHBM370 ... ... 00586000
  587. B VCANEXT 00587000
  588. VCADSBL EQU * SET CTCA IN S/370 EXTENDED MODE 00588000
  589. OI CHXFLAG,CHBM370+CHBMNOP X-SIDE DID 'DISABLE' 00589000
  590. OI CHYFLAG,CHBM370 BOTH SIDES GO EXTENDED 00590000
  591. B VCANEXT 00591000
  592. SPACE 00592000
  593. CTLIMED EQU * CONTROL, OTHER THAN NO-OP 00593000
  594. MVI CHXCMDT,CHBCNTL CONTROL ACTIVE 00594000
  595. STH R0,CHXSTAT CLEAR X-SIDE STATUS 00595000
  596. LA R3,CHKSTAT RETURN AFTER SENSE 00596000
  597. BAL R14,BLDCPEX BUILD CPEXBLOK FOR RE-CONNECT 00597000
  598. ST R1,CHXCNCT ... 00598000
  599. OI CHXFLAG,CHBWAIT X-SIDE WAITING FOR ACTIVITY 00599000
  600. BAL R14,ATTNCHY SET ATTENTION FOR Y-SIDE 00600000
  601. LA R14,VCAGOTO EXIT VIA CPEXBLOK IF CHAINED @VA00998 00601000
  602. TM RCWFLAG,CC MORE ON THIS SIO? @VA00998 00602000
  603. BO USRWAIT YES. OUT OF I/O @VA00998 00603000
  604. * BUILD IOBLOK FOR INITIAL CHANNEL END 00604000
  605. LA R0,IOBSIZE 00605000
  606. CALL DMKFREE GET AN IOBLOK 00606000
  607. MVC 0(IOBSIZE*8,R1),IOBLOK COPY ACTIVE IOBLOK 00607000
  608. LR R10,R1 USE THE NEW ONE NOW 00608000
  609. SLR R0,R0 RESTORE ZERO CONSTANT 00609000
  610. OI CHXSTAT,CE STATUS = CHANNEL END 00610000
  611. OI CHXFLAG,CHBCENT REMEMBER THAT CHANNEL END IS DONE 00611000
  612. OI SAVEWRK1,CPEX EXIT VIA CPEXBLOK 00612000
  613. B VCASCSW GO SET IOBLOK PENDING 00613000
  614. EJECT 00614000
  615. VCAGOTO EQU * RETURN TO CALLER VIA CPEXBLOK 00615000
  616. TS SAVEWRK1+1 HAVE WE ALREADY RETURNED ? 00616000
  617. BNZ VCAWAIT YES -- SKIP THE CONVULSIONS 00617000
  618. LA R0,CPEXSIZE 00618000
  619. CALL DMKFREE GET CPEXBLOK 00619000
  620. USING CPEXBLOK,R1 00620000
  621. MVC CPEXR0(R12*4),SAVER0 MOVE REGS 0-11 00621000
  622. MVC CPEXR12(8),SAVER12 MOVE REGS 12-13 00622000
  623. L R0,SAVERETN RETURN ADDRESS... 00623000
  624. ST R0,CPEXADD ...IS EXECUTION ADDRESS 00624000
  625. MVC CPEXFPNT(12),ZEROES CLEAR FIRST WORDS 00625000
  626. CALL DMKSTKCP STACK IT FOR LATER 00626000
  627. L R15,ADSPCH FIX OUR SAVE-AREA FOR EXIT TO DMKDSPCH 00627000
  628. ST R15,SAVERETN ... 00628000
  629. ST R15,SAVER12 ... 00629000
  630. TM SAVEWRK1,IOBRSTRT RESTART AFTER CPEXBLOK EXIT ? 00630000
  631. BZ VCADSPCH NO -- JUST LET HIM GO 00631000
  632. VCARSTRT EQU * FORCE SEQUENCING DELAY VIA CPEXBLOK 00632000
  633. BAL R14,BLDCPEX EXECUTION ADDRESS IS IN GR3 00633000
  634. CALL DMKSTKCP RETURN AFTER UNSTACK OF EXIT BLOCK 00634000
  635. B VCADSPCH 00635000
  636. VCAWAIT EQU * NO EXIT IS REQUIRED - CHECK RESTART 00636000
  637. TM SAVEWRK1,IOBRSTRT RESTART REQUESTED ? 00637000
  638. BZ VCADSPCH NO -- JUST WAIT FOR SOME ACTIVITY 00638000
  639. TM SAVEWRK1,VMRUN ARE THERE BLOCKS ALREADY STACKED ? 00639000
  640. BO VCARSTRT YES - FORCE THE DELAY 00640000
  641. NI SAVEWRK1,255-(IOBRSTRT+CPEX) UNFLAG 00641000
  642. BR R3 RESTART - NO EXIT NECESSARY 00642000
  643. VCADSPCH EQU * WAIT FOR Y-SIDE ACTIVITY 00643000
  644. NI SAVEWRK1,255-(CPEX+IOBRSTRT+VMRUN) RESET FLAGS 00644000
  645. GOTO DMKDSPCH WE WILL BE BACK LATER 00645000
  646. DROP R1 00646000
  647. EJECT 00647000
  648. ATTNCHY EQU * ATTENTION TO Y-SIDE 00648000
  649. OI CHYFLAG,CHBATTN SET ATTENTION PENDING 00649000
  650. LA R2,ATTN(,0) CSW STATUS 00650000
  651. TM CHYFLAG,CHBEOFL END-OF-FILE LATCH ON Y-SIDE ? 00651000
  652. BZ UNSOLIT NO -- JUST PRESENT THE ATTENTION 00652000
  653. NI CHYFLAG,255-CHBATTN HOLD OFF ON THAT ATTENTION 00653000
  654. OI SAVEWRK1,CPWAIT INDICATE 'ATTN' TO BE DEFERRED 00654000
  655. B UNSOLIT GO PRESENT INTERRUPT 00655000
  656. DECHANY EQU * DEVICE END TO Y-SIDE 00656000
  657. NI CHXFLAG,255-(CHBHIO+CHBREST) X-SIDE NOW READY AGAIN 00657000
  658. LA R2,DE(,0) CSW STATUS 00658000
  659. UNSOLIT EQU * PRESENT UNSOLICITED INTERRUPT 00659000
  660. LR R3,R14 SAVE INTERNAL RETURN 00660000
  661. LA R0,IOBSIZE GET AN IOBLOK 00661000
  662. CALL DMKFREE ... 00662000
  663. LR R9,R10 SAVE ACTIVE IOBLOK 00663000
  664. LR R10,R1 ...AND USE THE NEW ONE NOW 00664000
  665. XC IOBLOK(IOBSIZE*8),IOBLOK CLEAR IT 00665000
  666. ST R10,IOBLINK FORCE IOBLOK TO LINK TO ITSELF 00666000
  667. LH R1,CHXYADD VADDR OF Y-SIDE 00667000
  668. STH R1,IOBVADD ... 00668000
  669. L R1,CHXOTHR VMBLOK FOR Y-SIDE USER 00669000
  670. ST R1,IOBUSER ... 00670000
  671. L R1,=A(DMKVIOIN) INTERRUPT RETURN ADDRESS 00671000
  672. ST R1,IOBIRA ... 00672000
  673. STC R2,IOBCSW+4 SET UNIT STATUS BYTE IN CSW 00673000
  674. TM SAVEWRK1,CPWAIT PRESENT ATTENTION OR DEFER IT ? 00674000
  675. BO DEFERAT OOPS -- MUST BE DEFERRED 00675000
  676. CALL DMKSTKIO STACK IOBLOK FOR DMKVIO 00676000
  677. UNSOLRET EQU * RESTORE REGISTERS AND RETURN 00677000
  678. LR R10,R9 RESTORE IOBLOK POINTER 00678000
  679. L R9,CHXNCCW ...AND GR9 00679000
  680. SLR R0,R0 RESTORE CONVENIENT ZERO CONSTANT 00680000
  681. BR R3 RETURN... 00681000
  682. DEFERAT EQU * SAVE THE IOBLOK WHILE EOF LATCH IS SET 00682000
  683. NI SAVEWRK1,255-CPWAIT RESET INDICATOR 00683000
  684. ST R10,CHXDATN SAVE IOBLOK ADDRESS IN THE CHXBLOK 00684000
  685. B UNSOLRET GO RESTORE AND RETURN 00685000
  686. EJECT 00686000
  687. VCAWRIT EQU * WRITE, WRITE END-OF-FILE 00687000
  688. BAL R3,RESEOFL RESET END-OF-FILE LATCH IF SET 00688000
  689. TM CHXFLAG,CHBATTN IS THE Y-SIDE ACTIVE ? 00689000
  690. BZ WRITIDL NO -- WILL GIVE ATTN TO Y-SIDE 00690000
  691. TM CHYCMDT,CHBREAD+CHBRDBK IS COMMAND PAIR O.K. ? 00691000
  692. BZ ATNBUSY NO -- SET ATTN + BUSY 00692000
  693. MVI CHXCMDT,CHBWRIT ASSUME NORMAL WRITE CMD 00693000
  694. TM CHXFLAG,CHBM370 SHOULD WE DECODE FOR WRITE EOF ? 00694000
  695. BZ DATATRN NO -- JUST TRANSFER DATA 00695000
  696. TM CHXCMDB,X'80' IS THIS WRITE END-OF-FILE ? 00696000
  697. BZ DATATRN NO -- DATA TRANSFER WRITE 00697000
  698. MVI CHXCMDT,CHBWEOF THIS IS WRITE END-OF-FILE 00698000
  699. OI CHYSTAT,CE+DE+UE SET ENDING STATUS FOR Y-SIDE 00699000
  700. BAL R3,GOCHANY RE-ACTIVATE Y-SIDE 00700000
  701. LA R3,CHKSTAT RETURN AFTER SEQUENCE DELAY 00701000
  702. OI SAVEWRK1,IOBRSTRT RESTART AFTER SEQUENCING DELAY 00702000
  703. B VCAGOTO ... 00703000
  704. SPACE 2 00704000
  705. WRITIDL EQU * X-SIDE WRITE, Y-SIDE IS IDLE 00705000
  706. MVI CHXCMDT,CHBWRIT ASSUME NORMAL WRITE 00706000
  707. TM CHXFLAG,CHBM370 DECODE FOR WRITE EOF ? 00707000
  708. BZ RDWRITE NO -- GIVE ATTN TO Y-SIDE 00708000
  709. TM CHXCMDB,X'80' IS THIS WRITE END-OF-FILE ? 00709000
  710. BZ RDWRITE NO -- GIVE ATTN TO Y-SIDE 00710000
  711. MVI CHXCMDT,CHBWEOF ... 00711000
  712. OI CHYFLAG,CHBEOFL SET END-OF-FILE LATCH IN Y-SIDE 00712000
  713. B VCANEXT CONTINUE -- EFFECTIVE NO-OP 00713000
  714. EJECT 00714000
  715. RDWRITE EQU * READ OR WRITE FOR DATA TRANSFER 00715000
  716. L R1,RCWADDR GET CCW DATA OR IDAL ADDRESS 00717000
  717. LA R1,0(0,R1) ...WITHOUT THE CCW OP-CODE 00718000
  718. ST R1,CHXIDAW SET FOR DATA TRANSFER ROUTINE 00719000
  719. LA R3,CHKSTAT RETURN AFTER TRANSFER IS COMPLETE 00720000
  720. BAL R14,BLDCPEX BUILD CPEXBLOK FOR RE-CONNECT 00721000
  721. ST R1,CHXCNCT ... 00722000
  722. OI CHXFLAG,CHBWAIT INDICATE WAIT STATUS 00723000
  723. BAL R14,ATTNCHY ATTENTION TO Y-SIDE 00724000
  724. BAL R14,USRWAIT ZERO STATUS TO X-SIDE,DO TRACING @VA10302 00724100
  725. B VCAGOTO EXIT, WAIT FOR SOMETHING TO HAPPEN 00725000
  726. SPACE 2 00726000
  727. VCAREAD EQU * READ, READ BACKWARD 00727000
  728. LA R3,RDWRITE BRANCH VECTOR FOR COMMAND DECODER 00728000
  729. TM CHXFLAG,CHBATTN+CHBEOFL IS THE Y-SIDE ACTIVE ? 00729000
  730. BZ FWDBACK NO -- DECODE COMMAND TYPE 00730000
  731. TM CHXFLAG,CHBEOFL PRESENT END-OF-FILE TO THIS READ ? 00731000
  732. BO READEOF YES - SET IT UP 00732000
  733. TM CHYCMDT,CHBWRIT IS COMMAND PAIR O.K. ? 00733000
  734. BZ ATNBUSY NO -- GIVE ATTN + BUSY 00734000
  735. LA R3,DATATRN BRANCH VECTOR FOR COMMAND DECODER 00735000
  736. SPACE 00736000
  737. FWDBACK EQU * DECIDE IF READ OR READ BACKWARD 00737000
  738. MVI CHXCMDT,CHBREAD ASSUME FORWARD READ 00738000
  739. TM CHXCMDB,X'02' IS IT ? 00739000
  740. BCR 1,R3 YES - (BO) 00740000
  741. MVI CHXCMDT,CHBRDBK SET READ BACKWARD 00741000
  742. BR R3 ...AND CONTINUE PROCESS 00742000
  743. SPACE 2 00743000
  744. READEOF EQU * READ, EOF LATCH IS SET 00744000
  745. BAL R3,RESEOFL RESET END-OF-FILE LATCH 00745000
  746. OI CHXSTAT,UE SET EOF, UNIT EXCEPTION 00746000
  747. B VCACEDE ...AND TERMINATE CHANNEL PROGRAM 00747000
  748. EJECT 00748000
  749. CHKSTAT EQU * RETURN AFTER DATA TRANSFER IS COMPLETE 00749000
  750. TM SAVEWRK1+2,DEFCPX IS THERE A DEFERRED TASK @VA13548 00749070
  751. BZ CPEXDONE NO, NOTHING TO DO ON OTHER SIDE @VA13548 00749140
  752. NI SAVEWRK1+2,255-DEFCPX YES, WE'LL DO IT NOW @VA13548 00749210
  753. L R1,CHYCNCT GET THE CPEXBLOK ON OTHER SIDE @VA13548 00749280
  754. LTR R1,R1 IS IT THERE ... SHOULD BE @VA13548 00749350
  755. BZ CPEXLOST NO, CLEAN UP AND CONTINUE @VA13548 00749420
  756. CALL DMKSTKCP LET OTHER SIDE CONTINUE NOW @VA13548 00749490
  757. SR R3,R3 ZERO POINTER TO CPEXBLOK @VA13548 00749560
  758. ST R3,CHYCNCT RIGHT HERE @VA13548 00749630
  759. CPEXLOST DS 0H @VA13548 00749700
  760. NI CHYFLAG,255-CHBWAIT TAKE Y-SIDE OUT OF WAIT @VA13548 00749770
  761. CPEXDONE DS 0H CONTINUE WITH X-SIDE PROCESSING @VA13548 00749840
  762. L R10,SAVER10 ACCESS THE IOBLOK FOR A MOMENT 00750000
  763. USING IOBLOK,R10 ,,, 00751000
  764. TM IOBFLAG,IOBRES HAS THIS IOTASK BEEN RESET ? 00752000
  765. BZ CHKYRES NO -- CHECK FOR OTHER RESET STATUS 00753000
  766. MVI CHXFLAG,CHBREST WE CALL THIS SYSTEM RESET 00754000
  767. LR R9,R10 SAVE IOBLOK ADDRESS IN GR9 00755000
  768. TM CHYFLAG,CHBEOFL IS Y-SIDE EOF LATCH SET ? 00756000
  769. BZ CHKXRES NO -- DON'T CHECK FOR 'CHXDATN' 00757000
  770. L R10,CHXDATN THERE MIGHT BE A DEFERRED ATTENTION 00758000
  771. LTR R10,R10 ... ? 00759000
  772. BZ CHKXRES NO -- 00760000
  773. BAL R3,FRETIOB RELEASE THE IOBLOK 00761000
  774. ST R0,CHXDATN CLEAR OUT THE POINTER WORD 00762000
  775. CHKXRES EQU * CONTINUE RESET PROCESSING 00763000
  776. LR R10,R9 MAKE SURE WE HAVE THE RIGHT IOBLOK ADDR 00764000
  777. TM CHYFLAG,CHBMNOP DID THE Y-SIDE SAY 'DISABLE' ? 00765000
  778. BO CHKWAIT YES - LEAVE IN EXTENDED MODE 00766000
  779. NI CHXFLAG,255-CHBM370 DROP OUT OF EXTENDED MODE 00767000
  780. NI CHYFLAG,255-CHBM370 ... 00768000
  781. CHKWAIT EQU * RE-ACTIVATE Y-SIDE IF HE IS WAITING 00769000
  782. TM CHYFLAG,CHBWAIT IS THE Y-SIDE WAITING ? 00770000
  783. BZ VCACEDE NO -- JUST TERMINATE X-SIDE 00771000
  784. BAL R3,GOCHANY RE-CONNECT Y-SIDE 00772000
  785. B VCACEDE TERMINATE X-SIDE CHANNEL PROGRAM 00773000
  786. CHKYRES EQU * CHECK Y-SIDE RESET VIA 'HIO' OR 'HDV' 00774000
  787. TM CHYFLAG,CHBREST HAS Y-SIDE BEEN RESET ? 00775000
  788. BO CHKXCOM YES - CHECK ADAPTER MODE 00776000
  789. TM CHXFLAG,CHBHIO WAS THIS A HALT I/O TO X-SIDE ? 00777000
  790. BO CHKSHIO YES - TERMINATE X-SIDE 00778000
  791. TM CHYFLAG,CHBHIO RUNNING UNDER Y-SIDE HIO ? 00779000
  792. BZ CHKXCSW NO -- EXAMINE CSW STATUS 00780000
  793. TM CHXFLAG,CHBM370 COMPATIBILITY MODE ? 00781000
  794. BO VCASLRS NO -- UNIT CHECK, SEL. RESET 00782000
  795. NI CHYFLAG,255-CHBHIO RESET AFTER RECOGNITION 00783000
  796. B VCACEDE TERMINATE X-SIDE PROGRAM 00784000
  797. CHKXCSW EQU * EXAMINE CSW STATUS FOR ERRORS 00785000
  798. L R1,=AL1(255-(CE+DE),255-PCI,0,0) MASK FOR ERRORS 00786000
  799. N R1,CHXSTAT CAN WE CONTINUE ? 00787000
  800. BNZ VCACEDE NO -- TERMINATE CHANNEL PROGRAM 00788000
  801. B VCANEXT CONTINUE UN-IMPEDED 00789000
  802. CHKSHIO EQU * RESET HALT I/O BIT IF COMPATIBILITY 00790000
  803. TM CHYFLAG,CHBM370 IS Y-SIDE STILL EXTENDED MODE ? 00791000
  804. BO VCACEDE YES - LEAVE 'CHBHIO' SET 00792000
  805. NI CHXFLAG,255-CHBHIO RESET AFTER RECOGNITION 00793000
  806. B VCACEDE TERMINATE X-SIDE CHANNEL PROGRAM 00794000
  807. CHKXCOM EQU * SEE IF WE SHOULD SET UNIT CHECK 00795000
  808. TM CHXFLAG,CHBM370 STILL IN EXTENDED MODE ? 00796000
  809. BO VCAUCIR YES - UNIT CHECK, INT REQ 00797000
  810. NI CHYFLAG,255-CHBREST FORGET THAT THE RESET OCCURRED 00798000
  811. B VCACEDE ...BUT TERMINATE ANYWAY 00799000
  812. EJECT 00800000
  813. DATATRN EQU * COMMON DATA TRANSFER SUBROUTINE 00801000
  814. L R1,RCWADDR GET CCW DATA OR IDAL ADDRESS 00802000
  815. LA R1,0(0,R1) ...WITHOUT THE CCW OP-CODE 00803000
  816. ST R1,CHXIDAW SET FOR DATA TRANSFER ROUTINE 00804000
  817. LA R3,CHKSTAT RETURN AFTER TRANSFER IS COMPLETE 00805000
  818. BAL R14,BLDCPEX BUILD CPEXBLOK FOR RE-CONNECT 00806000
  819. ST R1,CHXCNCT ... 00807000
  820. OI CHXFLAG,CHBWAIT X-SIDE WAITING FOR GODOT 00808000
  821. BAL R14,USRWAIT ZERO STATUS TO X-SIDE 00809000
  822. LA R3,TRANSFER RETURN HERE VIA CPEXBLOK 00810000
  823. OI SAVEWRK1,IOBRSTRT RESTART AFTER EXIT, IF NECESSARY 00811000
  824. B VCAGOTO EXIT VIA CPEXBLOK, RETURN LATER 00812000
  825. TRANSFER EQU * ACTUAL TRANSFER OF DATA 00813000
  826. STM R6,R7,SAVEWRK6 SAVE CHXBLOK, CHYBLOK ORIGINS 00814000
  827. LH R2,CHXYADD GET DEVICE ADDRESSES FOR BOTH SIDES 00815000
  828. LH R1,CHYXADD ... 00816000
  829. L R10,CHXOTHR AND Y-SIDE VMBLOK ADDRESS 00817000
  830. CALL DMKSCNVU LOCATE VDEVBLOK (X-SIDE FIRST) 00818000
  831. USING VDEVBLOK,R8 00819000
  832. NI VDEVINTS,255-ATTN REMOVE POSSIBLE FALSE ATTENTION 00820000
  833. LR R1,R2 NOW GET THE Y-SIDE DEVICE 00821000
  834. LR R11,R10 (SWITCH VMBLOK'S MOMENTARILY) 00822000
  835. CALL DMKSCNVU LOCATE VDEVBLOK (Y-SIDE NEXT) 00823000
  836. NI VDEVINTS,255-ATTN REMOVE POSSIBLE FALSE ATTENTION 00824000
  837. DROP R8 00825000
  838. L R11,SAVER11 VMBLOK REGISTER BACK IN SHAPE 00826000
  839. LM R6,R7,SAVEWRK6 RE-LOAD CHXBLOK, CHYBLOK REGS 00827000
  840. TM CHXCMDT,CHBWRIT IS THE X-SIDE THE DATA SOURCE ? 00828000
  841. BZ DATACPX NO -- THE DIRECTION IS CORRECT 00829000
  842. LR R6,R7 MAKE THE X-SIDE THE 'READ'ING SIDE 00830000
  843. L R7,SAVEWRK6 ...WHENEVER DATA TRANSFER OCCURRS 00831000
  844. DATACPX EQU * SET UP FOR SYMMETRICAL STATUS 00832000
  845. NI CHXFLAG,255-CHBATTN RESET STATUS BITS 00833000
  846. NI CHYFLAG,255-CHBATTN ... ... 00834000
  847. SPACE 00835000
  848. FANGORN EQU * WHEN YOU CAN'T SEE THE FOREST FOR THE TREES, 00836000
  849. * WATCH OUT FOR THE ENTS ! 00837000
  850. * GR7 = 'CHXBLOK' => DATA SINK - 'READ'ING 00838000
  851. * GR6 = 'CHYBLOK' => DATA SOURCE 'WRITE'ING 00839000
  852. LR R8,R6 CHYBLOK TO GR8 - GET WRITE DATA 00840000
  853. BAL R10,DATABLK ... 00841000
  854. BC 8+1,ENDTRAN END DATA TRANSFER IF PROGRAM CHECK 00842000
  855. ST R9,BALR9 SAVE CCW ADDRESS FOR UPDATE 00843000
  856. STM R2,R5,BALRSAVE SAVE WRITE DATA FOR A MOMENT 00844000
  857. LR R8,R7 CHXBLOK TO GR8 - GET READ DATA 00845000
  858. BAL R10,DATABLK ... 00846000
  859. BC 8+1,ENDTRAN END DATA TRANSFER IF PROGRAM CHECK 00847000
  860. ST R9,CHXNCCW UPDATE X-SIDE CCW POINTER 00848000
  861. L R9,BALR9 00849000
  862. ST R9,CHYNCCW UPDATE Y-SIDE CCW POINTER 00850000
  863. LM R14,R1,BALRSAVE GET WRITE DATA IN GR14-GR1 00851000
  864. EJECT 00852000
  865. * AT THIS POINT, WE HAVE THE FOLLOWING: 00853000
  866. * X-SIDE (READ) Y-SIDE (WRITE) 00854000
  867. * FIRST DATA ADDRESS GR4 GR0 00855000
  868. * FIRST DATA LENGTH GR5 GR1 00856000
  869. * NEXT DATA OR IDAW GR2 GR14 00857000
  870. * REMAINING DATA COUNT GR3 GR15 00858000
  871. * 00859000
  872. * NOW, WE FIGURE OUT EXACTLY HOW MUCH DATA CAN BE MOVED AT ONCE, 00860000
  873. * AND WHICH SIDE HAS THE CONTROLLING COUNT. 00861000
  874. * 00862000
  875. LA R10,UPDATEY FIRST TIME, UPDATE BOTH BLOCKS 00863000
  876. UPDATEX EQU * ADVANCE X-SIDE CHANNEL PROGRAM 00864000
  877. L R9,CHXNCCW ADDRESS OF ACTIVE X-SIDE CCW 00865000
  878. TM RCWFLAG,SKIP SUPPRESS DATA TRANSFER ? 00866000
  879. BO UPDATXE YES - SUPPRESS PROTECTION TEST ALSO 00867000
  880. STM R14,R5,FREESAVE SAVE ALL DATA REGISTERS 00868000
  881. LR R2,R4 DATA READ ADDRESS TO GR2 00869000
  882. BAL R14,CHKPKEY TEST CAW PROTECTION KEY 00870000
  883. LM R14,R5,FREESAVE RESTORE REGISTERS IMMEDIATELY 00871000
  884. BNZ READPRTC PROTECTION CHECK ON READ 00872000
  885. UPDATXE EQU * UPDATE WITHOUT TESTING PROTECTION 00873000
  886. ST R3,CHXRCNT RESIDUAL COUNT 00874000
  887. ST R2,CHXIDAW NEXT DATA OR IDAW ADDRESS 00875000
  888. BR R10 GO WHERE NECESSARY 00876000
  889. UPDATEY EQU * ADVANCE Y-SIDE CHANNEL PROGRAM 00877000
  890. ST R15,CHYRCNT RESIDUAL COUNT 00878000
  891. ST R14,CHYIDAW NEXT DATA OR IDAW ADDRESS 00879000
  892. SPACE 00880000
  893. GETBOSS EQU * WHICH SIDE HAS CONTROLLING COUNT ? 00881000
  894. NI SAVEWRK1,255-(CHBREAD+CHBWRIT) CLEAR UPDATE FLAGS 00882000
  895. CR R1,R5 WHICH COUNT CONTROLS THE TRANSFER ? 00883000
  896. BL TRANWRT THE WRITER - Y-SIDE 00884000
  897. BH TRANSRD THE READER - X-SIDE 00885000
  898. * HIT IT ON THE NOSE - UNUSUAL 00886000
  899. OI SAVEWRK1,CHBREAD+CHBWRIT UPDATE BOTH NEXT TIME 00887000
  900. B DATAFLY GO MOVE SOME DATA 00888000
  901. SPACE 00889000
  902. TRANWRT EQU * READ COUNT .GT. WRITE COUNT 00890000
  903. OI SAVEWRK1,CHBWRIT UPDATE WRITE ONLY NEXT TIME 00891000
  904. SR R5,R1 GET REMAINING READ COUNT (THIS BLOCK) 00892000
  905. LR R3,R5 ...INTO GR3 00893000
  906. LR R5,R1 SET ACTUAL COUNT = WRITE COUNT 00894000
  907. LR R2,R4 GET STARTING ADDRESS IN GR2 00895000
  908. AR R2,R5 COMPUTE NEXT START ADDRESS 00896000
  909. TM CHXCMDT,CHBRDBK DIFFERENT IF READ BACKWARD 00897000
  910. BZ DATAFLY NO -- WE'VE GOT IT RIGHT 00898000
  911. SR R2,R5 RE-ADJUST 00899000
  912. SR R2,R5 ... 00900000
  913. B DATAFLY GO MOVE SOME DATA 00901000
  914. EJECT 00902000
  915. TRANSRD EQU * WRITE COUNT .GT. READ COUNT 00903000
  916. OI SAVEWRK1,CHBREAD UPDATE READ ONLY NEXT TIME 00904000
  917. SR R1,R5 GET REMAINING WRITE COUNT (THIS BLOCK) 00905000
  918. LR R15,R1 ...INTO GR15 00906000
  919. LR R1,R5 SET ACTUAL COUNTS EQUAL 00907000
  920. LR R14,R0 GET CURRENT START ADDRESS 00908000
  921. AR R14,R1 COMPUTE NEXT START ADDRESS 00909000
  922. STM R14,R15,BALR14 SAVE INFO - R14,15 DESTROYED 00910000
  923. DATAFLY EQU * TRANSFER DATA 00911000
  924. L R9,CHXNCCW ADDRESS OF ACTIVE READ CCW 00912000
  925. TM RCWFLAG,SKIP SUPPRESS DATA TRANSFER ? 00913000
  926. BO DATAUPD YES - JUST UPDATE AND MOVE ALONG 00914000
  927. TM CHXCMDT,CHBRDBK IS THIS FORWARD OR BACKWARD ? 00915000
  928. BO READBACK BACKWARD - MESSYTHING 00916000
  929. * 00917000
  930. MVCL R4,R0 TRANSFER DATA FORWARD 00918000
  931. * 00919000
  932. DATAUPD EQU * UPDATE ADDRESSES, LENGTHS 00920000
  933. TM SAVEWRK1,CHBREAD+CHBWRIT BOTH SIDES TO BE UPDATED ? 00921000
  934. BO FANGORN YES -- DO IT FROM THE TOP 00922000
  935. TM SAVEWRK1,CHBREAD OTHERWISE, WHICH ONE ? 00923000
  936. BO UPDREAD UPDATE READ - X-SIDE 00924000
  937. * UPDATE WRITE - Y-SIDE 00925000
  938. STM R2,R3,BALR2 SAVE READ DATA FOR A MOMENT 00926000
  939. LR R8,R6 ...WHILE WE UPDATE THE WRITE SIDE 00927000
  940. BAL R10,DATABLK ... 00928000
  941. BC 8+1,UPDWRIT OOPS...FATAL ERROR OR NO MORE DATA 00929000
  942. ST R9,CHYNCCW UPDATE CCW FETCH POINTER 00930000
  943. LM R14,R1,TEMPR2 GET WRITE DATA IN GR14-GR1 00931000
  944. LM R4,R5,BALR2 GET REST OF THE READ DATA 00932000
  945. B UPDATEY ...AND CONTINUE FROM HERE 00933000
  946. UPDWRIT EQU * ERROR, ADJUST RESIDUAL COUNTS 00934000
  947. L R3,BALR3 GET READ COUNT UNUSED 00935000
  948. L R1,CHXRCNT OLD RESIDUAL COUNT 00936000
  949. AR R1,R3 ADD IN UNUSED COUNT 00937000
  950. ST R1,CHXRCNT ...FOR ACCURATE CSW DATA 00938000
  951. ST R5,CHYRCNT Y-SIDE RESIDUAL COUNT 00939000
  952. B ENDTRAN END DATA TRANSFER 00940000
  953. UPDREAD EQU * UPDATE READ-SIDE DATA 00941000
  954. LR R8,R7 GET MORE X-SIDE DATA 00942000
  955. BAL R10,DATABLK ... 00943000
  956. BC 8+1,CSWREAD OOPS...FATAL ERROR OR NO MORE DATA 00944000
  957. ST R9,CHXNCCW UPDATE CCW FETCH POINTER 00945000
  958. LM R0,R1,BALR14 GET SAVED WRITE DATA 00946000
  959. LA R10,GETBOSS UPDATE ONLY THE CHXBLOK 00947000
  960. B UPDATEX ...AND CONTINUE FROM HERE 00948000
  961. CSWREAD EQU * ERROR, ADJUST RESIDUAL COUNT 00949000
  962. L R1,BALR15 GET REMAINING WRITE COUNT 00950000
  963. L R8,CHYRCNT OLD RESIDUAL COUNT 00951000
  964. AR R1,R8 UPDATE IT WITH UNUSED PORTION 00952000
  965. ST R1,CHYRCNT ...FOR ACCURATE CSW DATA 00953000
  966. ST R5,CHXRCNT X-SIDE RESIDUAL COUNT 00954000
  967. B ENDTRAN END DATA TRANSFER 00955000
  968. EJECT 00956000
  969. READBACK EQU * INVERT THE DATA AS WE MOVE IT 00957000
  970. STM R14,R9,FREESAVE FREE UP SOME REGISTERS 00958000
  971. LR R9,R4 START ADDRESS FOR READ 00959000
  972. SR R9,R5 GR9 = LOWER LIMIT FOR READ 00960000
  973. L R6,FFS INCREMENT FOR MINOR LOOPS 00961000
  974. LR R3,R0 START ADDRESS FOR WRITE 00962000
  975. L R8,=F'-8' INCREMENT FOR MAJOR LOOP 00963000
  976. LA R14,7(0,0) TEST FOR START AT 7-BYTE BOUNDARY 00964000
  977. OR R14,R4 GR14 = HIGHER SEVEN-BYTE BOUNDARY 00965000
  978. CR R14,R4 IF THESE ARE EQUAL, WE CAN MOVE DBL-WDS 00966000
  979. BE RDBACK4 YES - USE THE FAST LOOP 00967000
  980. LR R7,R8 ...INTO GR7 FOR A MASK 00968000
  981. NR R7,R4 GR7 = LOWER DOUBLE-WORD BOUNDARY 00969000
  982. CR R7,R9 WILL WE MOVE ALL THE DATA FIRST ? 00970000
  983. BNL RDBACK1 NO -- LET IT GO THROUGH AS IS 00971000
  984. LA R2,1(0) BUMP GR4 BY ONE FOR TRAILER LOOP 00972000
  985. B RDBACK5 GO SET LOWER LIMIT, MOVE DATA FAST 00973000
  986. RDBACK1 EQU * ONE AT A TIME TO A BOUNDARY 00974000
  987. IC R1,0(0,R3) ONE CHARACTER WRITTEN 00975000
  988. STC R1,0(0,R4) ONE CHARACTER READ 00976000
  989. LA R3,1(0,R3) 00977000
  990. BXH R4,R6,RDBACK1 CONTINUE 00978000
  991. LA R4,1(,R4) RE-ADJUST READ ADDRESS @VM08637 00979000
  992. RDBACK2 EQU * MAJOR LOOP - EIGHT BYTES AT A TIME 00980000
  993. LA R2,8(0,0) COUNT FOR INSERTION IN REGISTERS 00981000
  994. BXLE R4,R8,RDBACK5 JUMP OUT WHEN LAST DOUBLE-WORD MOVED 00982000
  995. RDBACK3 EQU * FILL UP TWO REGISTERS - INVERTED 00983000
  996. SRDL R0,8(0) THIS IS A FAST SHIFT 00984000
  997. ICM R0,B'1000',0(R3) FASTEST 'ICM' IN THE WEST 00985000
  998. LA R3,1(0,R3) NEXT CHARACTER FOR WRITE 00986000
  999. BCT R2,RDBACK3 FILL UP TWO REGISTERS 00987000
  1000. STM R0,R1,0(R4) FILL UP A DOUBLE-WORD 00988000
  1001. B RDBACK2 ...AND REPEAT 00989000
  1002. RDBACK4 EQU * STARTED ON 7-BYTE BOUNDARY 00990000
  1003. LA R4,1(0,R4) BUMP UP ONE FOR 'BXLE' LOOP 00991000
  1004. B RDBACK2 GO MOVE DOUBLE-WORD AT A TIME 00992000
  1005. RDBACK5 EQU * FILL OUT THE UNEVEN TAIL 00993000
  1006. AR R4,R2 BUMP R4 BACK TO PREVIOUS VALUE 00994000
  1007. LR R7,R9 ACTUAL LIMIT FOR READING 00995000
  1008. RDBACK6 EQU * MOVE REMAINDER OF DATA 00996000
  1009. BXLE R4,R6,RDBACK7 JUMP OUT WHEN TRANSFER COMPLETE 00997000
  1010. IC R1,0(0,R3) 00998000
  1011. STC R1,0(0,R4) 00999000
  1012. LA R3,1(0,R3) 01000000
  1013. B RDBACK6 CONTINUE UNTIL COMPLETE 01001000
  1014. RDBACK7 EQU * TRANSFER OF THIS DATA BLOCK IS COMPLETE 01002000
  1015. LM R14,R9,FREESAVE RESTORE ALL THOSE REGISTERS 01003000
  1016. B DATAUPD ...AND GET SOME MORE DATA 01004000
  1017. EJECT 01005000
  1018. READPRTC EQU * PROTECTION CHECK DURING READ 01006000
  1019. OI CHXSTAT+1,PRTC CHANNEL PROTECTION CHECK 01007000
  1020. TM SAVEWRK1,CHBREAD+CHBWRIT ARE THE COUNTS CORRECT ? 01008000
  1021. BNM ENDTRAN YES -- BOTH SIDES ARE CORRECT 01009000
  1022. AR R5,R3 FIX THE READ-SIDE COUNT 01010000
  1023. B CSWREAD ...AND UPDATE THE CHXBLOK 01011000
  1024. SPACE 2 01012000
  1025. ENDTRAN EQU * END OF DATA TRANSFER 01013000
  1026. L R1,CHXRCNT GET X-SIDE RESIDUAL COUNT 01014000
  1027. L R2,CHYRCNT GET Y-SIDE RESIDUAL COUNT 01015000
  1028. SLR R3,R3 ZERO CONSTANT 01016000
  1029. L R9,CHXNCCW ACTIVE CCW, X-SIDE 01017000
  1030. TM RCWFLAG,CD IS CHAIN DATA SET ? 01018000
  1031. BZ *+8 NO -- 01019000
  1032. OI CHXSTAT+1,IL INCORRECT LENGTH IS AUTOMATIC IF YES 01020000
  1033. L R9,CHYNCCW ACTIVE CCW, Y-SIDE 01021000
  1034. TM RCWFLAG,CD IS CHAIN DATA SET ? 01022000
  1035. BZ *+8 NO -- 01023000
  1036. OI CHYSTAT+1,IL INCORRECT LENGTH IS AUTOMATIC IF YES 01024000
  1037. CR R1,R3 IS THE X-SIDE COUNT ZERO ? 01025000
  1038. BE ZEROREAD YES - CHECK FURTHER 01026000
  1039. LA R10,ILCHANY INCORRECT LENGTH TO BOTH SIDES 01027000
  1040. B ILCHANX ... 01028000
  1041. SPACE 2 01029000
  1042. ZEROREAD EQU * X-SIDE RESIDUAL COUNT EQUAL TO ZERO 01030000
  1043. CR R2,R3 Y-SIDE RESIDUAL COUNT ALSO ZERO ? 01031000
  1044. BE ILCHANY YES - INCORRECT LENGTH TO Y-SIDE ONLY 01032000
  1045. LA R10,ILCHANY PROBABLY 'IL' TO BOTH SIDES 01033000
  1046. C R2,F2 Y-SIDE COUNT MORE THAN TWO .GT. X ? 01034000
  1047. BH ILCHANX YES - INCORRECT LENGTH TO BOTH 01035000
  1048. BL CHKMODE Y-SIDE COUNT = X-SIDE COUNT PLUS ONE 01036000
  1049. TM CHXFLAG,CHBM370 IF WE ARE IN EXTENDED MODE... 01037000
  1050. BZ ILCHANX ...NOPE - BOTH GET IT 01038000
  1051. LA R10,RECONCT ...YES - X-SIDE ONLY 01039000
  1052. B ILCHANX 01040000
  1053. EJECT 01041000
  1054. CHKMODE EQU * O.K. IF IN COMPATIBILITY MODE 01042000
  1055. TM CHXFLAG,CHBM370 ARE WE IN COMPATIBILITY MODE ? 01043000
  1056. BO ILCHANX NO -- BOTH SIDES GET INCORRECT LEN 01044000
  1057. LA R10,RECONCT ONLY THE X-SIDE SEES IT 01045000
  1058. SPACE 2 01046000
  1059. ILCHANX EQU * SET INCORRECT LENGTH FOR X-SIDE CHANNEL 01047000
  1060. L R9,CHXNCCW GET ACTIVE CCW 01048000
  1061. TM RCWFLAG,SILI SUPPRESS INCORRECT LENGTH ? 01049000
  1062. BCR 1,R10 YES - CONTINUE WHERE DESTINED 01050000
  1063. OI CHXSTAT+1,IL SET INCORRECT LENGTH 01051000
  1064. BR R10 ...AND CONTINUE 01052000
  1065. ILCHANY EQU * SET INCORRECT LENGTH FOR Y-SIDE CHANNEL 01053000
  1066. L R9,CHYNCCW GET ACTIVE CCW 01054000
  1067. TM RCWFLAG,SILI SUPPRESS INCORRECT LENGTH ? 01055000
  1068. BO RECONCT YES - JUST FINISH UP 01056000
  1069. OI CHYSTAT+1,IL SET INCORRECT LENGTH 01057000
  1070. SPACE 2 01058000
  1071. RECONCT EQU * RECONNECT THE Y-SIDE AND DEFER @VA13548 01059000
  1072. * THE X-SIDE UNTIL Y-SIDE COMPLETES 01059300
  1073. L R1,CHYCNCT GET THE Y-SIDE CPEXBLOK @VA13548 01059600
  1074. LTR R1,R1 IS THERE ONE ? @VA13548 01059900
  1075. BZ NOCPEX1 NO, GO TAKE CARE OF X-SIDE @VA13548 01060200
  1076. CALL DMKSTKCP STACK THE Y-SIDE CPEXBLOK @VA13548 01060500
  1077. USING CPEXBLOK,R1 GET ADDRESSABILITY TO Y-SIDE @VA13548 01060800
  1078. L R3,CHXCNCT SEE IF THERE IS AN X-SIDE BLOK @VA13548 01061100
  1079. LTR R3,R3 IS THERE ONE ? @VA13548 01061400
  1080. BZ YEXIT1 NO, NO NEED TO DEFER IT THEN @VA13548 01061700
  1081. LR R3,R13 SAVE ADDR OF OUR SAVE AREA @VA13548 01062000
  1082. L R13,CPEXR13 GET Y-SIDE SAVEAREA ADDR @VA13548 01062300
  1083. OI SAVEWRK1+2,DEFCPX INDICATE WE'RE DEFERRING TASK @VA13548 01062600
  1084. LR R13,R3 RE-ESTABLISH OUR SAVE AREA ADDR @VA13548 01062900
  1085. YEXIT DS 0H @VA13548 01063200
  1086. NI CHYFLAG,255-CHBWAIT TAKE Y-SIDE OUT OF WAIT @VA13548 01063500
  1087. SR R3,R3 ZERO CONSTANT @VA13548 01063800
  1088. ST R3,CHYCNCT ZERO OUT THE Y-SIDE CPEX POINTER @VA13548 01064100
  1089. B VCADSPCH GO TO DISPATCHER @VA13548 01064400
  1090. DROP R1 DROP CPEXBLOK ADDRESSABILITY @VA13548 01064700
  1091. SPACE 2 01065000
  1092. NOCPEX1 DS 0H @VA13548 01065300
  1093. L R1,CHXCNCT GET THE X-SIDE CPEXBLOK @VA13548 01065600
  1094. LTR R1,R1 IS THERE ONE ? @VA13548 01065900
  1095. BZ YEXIT1 NO, GO RESET AND EXIT @VA13548 01066200
  1096. CALL DMKSTKCP YES, STACK THE X-SIDE CPEXBLOK @VA13548 01066500
  1097. SR R3,R3 GET A ZERO CONSTANT @VA13548 01066800
  1098. ST R3,CHXCNCT RESET THE X-SIDE CPEXBLOK POINTER@VA13548 01067100
  1099. YEXIT1 NI CHXFLAG,255-CHBWAIT TAKE X-SIDE OUT OF WAIT @VA13548 01067400
  1100. B YEXIT GO TO RESET THE Y-SIDE @VA13548 01067700
  1101. EJECT 01069000
  1102. * DATABLK - CALCULATE NEXT ADDRESS AND LENGTH FOR DATA TRANSFER 01070000
  1103. * GR8 = ADDRESS OF CHXBLOK OR CHYBLOK ON ENTRY 01071000
  1104. * ON EXIT: 01072000
  1105. * GR2 = NEXT DATA OR IDAW ADDRESS 01073000
  1106. * GR3 = TOTAL REMAINING CCW DATA COUNT 01074000
  1107. * GR4 = START DATA ADDRESS 01075000
  1108. * GR5 = DATA SEGMENT LENGTH 01076000
  1109. * CC = 0 --> END OF DATA TRANSFER 01077000
  1110. * CC = 1 --> DATA TO BE TRANSFERRED, AS ABOVE 01078000
  1111. * CC = 3 --> SIMULATE CHANNEL PROGRAM CHECK 01079000
  1112. * 01080000
  1113. DROP R6,R7 USE INDEPENDENT ADDRESSABILITY 01081000
  1114. DATABLK EQU * FIGURE OUT NEXT DATA SEGMENT FOR TRANSFER 01082000
  1115. USING CHXBLOK,R8 01083000
  1116. STM R0,R7,TEMPR0 SAVE SOME REGISTERS 01084000
  1117. L R9,CHXNCCW CURRENT CCW ADDRESS 01085000
  1118. L R5,CHXRCNT REMAINING DATA COUNT 01086000
  1119. LTR R5,R5 IS THERE MORE ON THIS CCW ? 01087000
  1120. BZ DATACHN THIS CCW IS DONE - TEST DATA CHAINING 01088000
  1121. L R4,CHXIDAW DATA ADDRESS OR IDAW ADDRESS 01089000
  1122. DATAGIN EQU * RE-ENTER FOR DATA-CHAINING 01090000
  1123. LA R2,2047(0) MASK CONSTANT IN GR2 01091000
  1124. LR R3,R2 ...AND IN GR3 01092000
  1125. TM RCWFLAG,IDA IS THERE AN IDAL ? 01093000
  1126. BO DATAIDA YES - SEPARATE TECHNIQUE 01094000
  1127. DATAFWD EQU * GET LENGTH OF NEXT DATA BLOCK 01095000
  1128. NR R3,R4 GR3 = DISP. WITHIN 2048-BYTE BLOCK 01096000
  1129. TM CHXCMDT,CHBRDBK IS THIS CCW GOING BACKWARDS ? 01097000
  1130. BO DATBACK YES - ADDRESS IS THE LENGTH 01098000
  1131. SR R2,R3 GR2 = (DISP. TO 2K BOUNDARY) - 1 01099000
  1132. LR R3,R2 ...INTO GR3 01100000
  1133. DATBACK EQU * GR3 = LENGTH-1 UP TO BOUNDARY 01101000
  1134. LA R3,1(0,R3) MAXIMUM LENGTH OF THIS MOVE 01102000
  1135. L R1,=A(DMKSYSRM) GET REAL MACHINE @VA03162 01103000
  1136. L R1,0(,R1) SIZE... @VA03162 01104000
  1137. CLR R4,R1 VALID ADDRESS ? @VA03162 01105000
  1138. BNL DATACC3 NO..EXIT... @VA03162 01106000
  1139. ST R4,TEMPR4 PASS BACK DATA START ADDRESS 01107000
  1140. CR R5,R3 WOULD WE HIT THE BOUNDARY ? 01108000
  1141. BL DATAEND NO -- USE CCW DATA COUNT 01109000
  1142. SR R5,R3 ADJUST COUNT FOR BYTES TO BE MOVED 01110000
  1143. ST R5,TEMPR3 ... 01111000
  1144. ST R3,TEMPR5 PASS BACK DATA SEGMENT LENGTH 01112000
  1145. TM RCWFLAG,IDA IF THE IDA FLAG IS SET... 01113000
  1146. BO DATACC1 ...'TEMPR2' HAS ALREADY BEEN UPDATED 01114000
  1147. ALR R4,R3 ASSUME FORWARD CCW 01115000
  1148. TM CHXCMDT,CHBRDBK ARE WE CORRECT ? 01116000
  1149. BZ DATAXIT YES - UPDATE TEMPR2 AND EXIT, CC = 1 01117000
  1150. SLR R4,R3 RE-ADJUST TO GET NEXT ADDRESS FOR RDBK 01118000
  1151. SLR R4,R3 ... 01119000
  1152. B DATAXIT GO UPDATE TEMPR2, EXIT CC = 1 01120000
  1153. DATAEND EQU * END OF THIS CCW 01121000
  1154. ST R5,TEMPR5 USE FULL REMAINING COUNT THIS TIME 01122000
  1155. SLR R4,R4 ... 01123000
  1156. ST R4,TEMPR3 NO MORE ON THIS CCW 01124000
  1157. DATAXIT EQU * UPDATE NEXT ADDRESS IN CHXBLOK, EXIT 01125000
  1158. ST R4,TEMPR2 NEXT DATA OR IDAW ADDRESS 01126000
  1159. DATACC1 EQU * CC = 1 IMPLIES DATA TO BE MOVED 01127000
  1160. TM *,X'FF' SET CONDITION MIXED - CC = 1 01128000
  1161. LM R0,R7,TEMPR0 RESTORE REGISTERS 01129000
  1162. BR R10 ...AND RETURN 01130000
  1163. SPACE 2 01131000
  1164. DATAIDA EQU * INDIRECT DATA ADDRESS LIST 01132000
  1165. LA R1,4(0,R4) UPDATE IDAW ADDRESS 01133000
  1166. ST R1,TEMPR2 ...FOR NEXT TIME THROUGH 01134000
  1167. CLM R4,B'0111',RCWADDR+1 FIRST IDAW IN IDAL ? 01135000
  1168. BNE DATATWO NO -- GO VALIDATE IT 01136000
  1169. L R4,0(0,R4) PICK UP FIRST DATA ADDRESS 01137000
  1170. B DATAFWD ...AND CALCULATE ACTUAL LENGTH 01138000
  1171. DATATWO EQU * VALIDATE OTHER THAN FIRST IDAW 01139000
  1172. CLI 0(R4),X'00' HIGH-ORDER MUST BE ZERO 01140000
  1173. BNE DATACC3 NOPE - CC = 3 IMPLIES PRGC 01141000
  1174. L R4,0(0,R4) PICK UP ACTUAL ADDRESS 01142000
  1175. TM CHXCMDT,CHBRDBK BACKWARDS OR FORWARDS TRANSFER ? 01143000
  1176. BO DATABID BACKWARDS IDAL 01144000
  1177. NR R2,R4 TEST ALIGNMENT ON 2048-BYTE BOUNDARY 01145000
  1178. BNZ DATACC3 NOT GOOD - PROGRAM CHECK 01146000
  1179. B DATBACK GR3 = 2047 AS REQUIRED 01147000
  1180. DATABID EQU * VALIDATE REAR-WARD MOVING IDAW 01148000
  1181. NR R3,R4 GR3 STILL = 2047 IF VALID IDAW 01149000
  1182. XR R2,R3 GR2 WILL BE ZERO IF VALID IDAW 01150000
  1183. BZ DATBACK O.K. - GO FIGURE ACTUAL TRANSFER LENGTH 01151000
  1184. DATACC3 EQU * SET PROGRAM CHECK, CC = 3 01152000
  1185. OI CHXSTAT+1,PRGC FATAL ERROR IN CHANNEL PROGRAM 01153000
  1186. ST R9,CHXNCCW REMEMBER WHICH CCW IS INVALID 01154000
  1187. TM *+1,X'FF' SET CONDITION ONES - CC = 3 01155000
  1188. DATACC0 EQU * EXIT, CC = 0 IMPLIES END OF CCW 01156000
  1189. LM R0,R7,TEMPR0 RESTORE REGISTERS 01157000
  1190. BR R10 ...AND RETURN 01158000
  1191. SPACE 01159000
  1192. DATACHN EQU * TEST FOR DATA CHAINED CCW STRINGS 01160000
  1193. ST R5,TEMPR5 PASS BACK ZERO COUNT IF NO MORE 01161000
  1194. TM RCWFLAG,CD IS THERE CHAIN DATA ? 01162000
  1195. BZ DATACC0 NO -- EXIT WITH CC = 0 01163000
  1196. LA R9,8(0,R9) ADVANCE TO NEXT CCW 01164000
  1197. DATATIC EQU * (RE-ENTER HERE IN CASE OF A TIC) 01165000
  1198. ICM R5,B'0011',RCWCNT PICK UP DATA COUNT 01166000
  1199. BAL R14,CHANCHK VALIDATE THE NEW CCW 01167000
  1200. BNZ DATACC3 OOPS -- PROGRAM CHECK ON THIS ONE 01168000
  1201. CLI RCWCOMND,X'18' IT MIGHT BE A 'TIC' AFTER CHAIN DATA 01169000
  1202. BNE DATANTC NO -- THAT'S SOMEWHAT EASIER 01170000
  1203. L R9,RCWADDR TAKE THE CCW TRANSFER 01171000
  1204. CLI RCWCOMND,X'18' 'TIC' TO ANOTHER 'TIC' ? 01172000
  1205. BE DATACC3 YES - CHANNEL PROGRAM CHECK 01173000
  1206. B DATATIC ...AND RE-VALIDATE 01174000
  1207. DATANTC EQU * CHAIN DATA, NOT A TIC - SET UP AGAIN 01175000
  1208. L R4,RCWADDR PICK UP DATA OR IDAL ADDRESS 01176000
  1209. LA R4,0(0,R4) ...WITHOUT THE OP-CODE, PLEASE 01177000
  1210. B DATAGIN GO HOME, CRASH, LOSE ONE TURN 01178000
  1211. DROP R8 01179000
  1212. USING CHXBLOK,R7 01180000
  1213. USING CHYBLOK,R6 01181000
  1214. EJECT 01182000
  1215. *. 01183000
  1216. * SUBROUTINE NAME - 01184000
  1217. * 01185000
  1218. * DMKVCATS 01186000
  1219. * 01187000
  1220. * FUNCTION - 01188000
  1221. * 01189000
  1222. * TO SIMULATE THE TEST I/O INSTRUCTION FOR A VIRTUAL CHANNEL- 01190000
  1223. * TO-CHANNEL ADAPTER WHICH HAS NO INTERRUPTS PENDING. 01191000
  1224. * 01192000
  1225. * ATTRIBUTES - 01193000
  1226. * 01194000
  1227. * RE-ENTRANT, PAGEABLE, CALLED VIA SVC 01195000
  1228. * 01196000
  1229. * ENTRY CONDITIONS - 01197000
  1230. * 01198000
  1231. * GPR 13 = ADDRESS OF STANDARD SAVE-AREA 01199000
  1232. * GPR 12 = ADDRESS OF DMKVCATS 01200000
  1233. * GPR 11 = VMBLOK ADDRESS OF ACTIVE USER 01201000
  1234. * GPR 8 = VDEVBLOK ADDRESS FOR X-SIDE COUPLED CTCA 01202000
  1235. * 01203000
  1236. * EXIT CONDITIONS - 01204000
  1237. * 01205000
  1238. * CC = 0 -> GPRS 0-15 UNCHANGED, RETURN CC = 0 TO TEST I/O 01206000
  1239. * CC = 1 -> RETURN CC = 1 TO TEST I/O, GPR 5 = CSW STATUS, 01207000
  1240. * GPRS 0-4, 6-15 UNCHANGED. 01208000
  1241. * 01209000
  1242. * CALLS TO OTHER ROUTINES - 01210000
  1243. * 01211000
  1244. * DMKSCNVU - TO LOCATE THE Y-SIDE VDEVBLOK 01212000
  1245. * DMKSTKIO - TO STACK AN IOBLOK FOR ATTENTION IF DEFERRED 01213000
  1246. * 01214000
  1247. * OPERATION - 01215000
  1248. * 01216000
  1249. * DMKVCATS IS CALLED FROM DMKVIOEX WHEN A TEST I/O INSTRUCTION 01217000
  1250. * IS ISSUED TO A VIRTUAL CHANNEL-TO-CHANNEL ADAPTER, THE 01218000
  1251. * ADAPTER HAS NO INTERRUPTS PENDING, AND THE ADAPTER IS MARKED 01219000
  1252. * AS READY. IF THE ADAPTER IS IN COMPATIBILITY MODE, THE 01220000
  1253. * Y-SIDE IS EXMAINED FOR AN ACTIVE READ, WRITE OR CONTROL 01221000
  1254. * COMMAND, AND CC = 1 WITH 'ATTN' IS PRESENTED IF YES, 01222000
  1255. * CC = 0 IF NO. 01223000
  1256. * IF THE ADAPTER IS IN EXTENDED MODE, THE FOLLOWING IS DONE: 01224000
  1257. * 1. IF A PREVIOUS X-SIDE RESET OR HALT I/O HAS NOT BEEN 01225000
  1258. * CLEARED, THE CONDITION IS CLEARED AND DEVICE END PRESENTED 01226000
  1259. * TO THE Y-SIDE CHANNEL. 01227000
  1260. * 2. IF A PREVIOUS Y-SIDE RESET OR HALT I/O HAS NOT BEEN 01228000
  1261. * CLEARED, CC = 1 WITH UNIT CHECK IS SET. 01229000
  1262. * 3. IF THE Y-SIDE HAS AN ACTIVE READ, WRITE, OR CONTROL, 01230000
  1263. * CC = 1 WITH 'ATTN' IS SET. 01231000
  1264. * 4. OTHERWISE, SET CC = 0 AND EXIT 01232000
  1265. *. 01233000
  1266. EJECT 01234000
  1267. DMKVCATS RELOC , SIMULATE TEST I/O TO VIRTUAL CTCA 01235000
  1268. BAL R5,GETCTCA GET CHXBLOK AND CHYBLOK REGISTERS 01236000
  1269. TM CHXFLAG,CHBM370 TEST FOR EXTENDED MODE 01237000
  1270. BO TIOCRES YES - DO RESET CHECKING 01238000
  1271. TIOCATN EQU * TEST FOR ATTENTION STILL PENDING 01239000
  1272. TM CHXFLAG,CHBATTN ATTENTION PENDING FROM Y-SIDE ? 01240000
  1273. BZ VCAEXC0 NO -- EXIT WITH CC = 0 01241000
  1274. L R5,=AL1(0,0,ATTN,0) CSW STATUS = ATTENTION 01242000
  1275. ST R5,SAVER5 PASS STATUS BACK TO DMKVIO 01243000
  1276. B VCAEXC1 EXIT, COND. CODE ONE => CSW STORED 01244000
  1277. TIOCRES EQU * CHECK FOR EXTENDED-MODE RESET SITUATION 01245000
  1278. TM CHYFLAG,CHBHIO+CHBREST Y-SIDE 'RESET' OR 'HIO' ? 01246000
  1279. BNZ TIOCSUC YES - SET UNIT CHECK 01247000
  1280. TM CHXFLAG,CHBEOFL IS THE END-OF-FILE LATCH SET ? 01248000
  1281. BZ TIOCATN NO -- CHECK FOR PENDING 'ATTN' 01249000
  1282. NI CHXFLAG,255-CHBEOFL RESET END-FO-FILE LATCH 01250000
  1283. L R10,CHYDATN IS THERE A DEFERRED 'ATTN' IOBLOK 01251000
  1284. LTR R10,R10 ... 01252000
  1285. BZ TIOCATN NO -- JUST CHECK PENDING 'ATTN' 01253000
  1286. CALL DMKSTKIO STACK THE IOBLOK FOR DMKVIO 01254000
  1287. ST R0,CHYDATN CLEAR THE HOLD WORD 01255000
  1288. OI CHXFLAG,CHBATTN SET ATTENTION PENDING IN X-SIDE 01256000
  1289. B VCAEXC0 ...AND EXIT WITH COND CODE ZERO 01257000
  1290. TIOCSUC EQU * SET UNIT CHECK IN CSW STATUS 01258000
  1291. LA R5,UC*256 CSW STATUS = UNIT CHECK 01259000
  1292. ST R5,SAVER5 PASS BACK TO DMKVIO 01260000
  1293. B VCAEXC1 SET CONDITION CODE ONE, UNIT CHECK 01261000
  1294. EJECT 01262000
  1295. *. 01263000
  1296. * SUBROUTINE NAME - 01264000
  1297. * 01265000
  1298. * DMKVCASH 01266000
  1299. * 01267000
  1300. * FUNCTION - 01268000
  1301. * 01269000
  1302. * TO SIMULATE THE EXECUTION OF A HALT I/O OR HALT DEVICE 01270000
  1303. * INSTRUCTION FOR A VIRTUAL CHANNEL-TO-CHANNEL ADAPTER. 01271000
  1304. * 01272000
  1305. * ATTRIBUTES - 01273000
  1306. * 01274000
  1307. * RE-ENTRANT, PAGEABLE, CALLED VIA SVC 01275000
  1308. * 01276000
  1309. * ENTRY CONDITIONS - 01277000
  1310. * 01278000
  1311. * GPR 13 = STANDARD SAVE-AREA ADDRESS 01279000
  1312. * GPR 12 = ADDRESS OF DMKVCASH 01280000
  1313. * GPR 11 = VMBLOK ADDRESS OF ACTIVE USER 01281000
  1314. * GPR 8 = VDEVBLOK ADDRESS OF X-SIDE VIRTUAL CTCA 01282000
  1315. * 01283000
  1316. * EXIT CONDITIONS - 01284000
  1317. * 01285000
  1318. * CC = 0 -> GPRS 0-15 UNCHANGED, SET CC = 0 FOR 'HIO', 'HDV' 01286000
  1319. * CC = 1 -> GPR 5 = CSW STATUS, SET CC = 1 FOR 'HIO', 'HDV' 01287000
  1320. * 01288000
  1321. * CALLS TO OTHER ROUTINES - 01289000
  1322. * 01290000
  1323. * DMKSTKCP - TO RE-CONNECT X-SIDE OR Y-SIDE IF ACTIVE 01291000
  1324. * DMKFRET - TO RELEASE FREE STORAGE IN DEFERRED IOBLOKS 01292000
  1325. * DMKSCNVU - TO LOCATE THE Y-SIDE CTCA VDEVBLOK 01293000
  1326. * 01294000
  1327. * OPERATION - 01295000
  1328. * 01296000
  1329. * DMKVCASH IS CALLED FROM DMKVIOEX WHENEVER A HALT I/O OR 01297000
  1330. * HALT DEVICE IS ISSUED AGAINST A VIRTUAL CHANNEL-TO-CHANNEL 01298000
  1331. * ADAPTER. IF THE ADAPTER HAS NOT YET BEEN COUPLED, 01299000
  1332. * CC = 1 (DEVICE HALTED) WITH CSW STATUS ZERO WILL BE 01300000
  1333. * INDICATED. IF THE ADAPTER IS COUPLED, THE Y-SIDE CHYBLOK 01301000
  1334. * IS LOCATED VIA CALLS TO DMKSCNVU AND POINTER PICK-UP. 01302000
  1335. * IF EITHER THE X-SIDE OR THE Y-SIDE HAS THE END-OF-FILE 01303000
  1336. * LATCH SET, THE LATCH IS RESET. IF THERE IS ALSO AN IOBLOK 01304000
  1337. * FOR A DEFERRED ATTENTION, THE IOBLOK IS RELEASED VIA A 01305000
  1338. * CALL TO DMKFRET. IF THE X-SIDE HAS AN ACTIVE COMMAND, 01306000
  1339. * THE COMMAND IS 'HALTED' BY A CALL TO DMKSTKCP FOR RE- 01307000
  1340. * CONNECTION OF THE DMKVCAST CODE, AND CC = 0 (INTERRUPTS 01308000
  1341. * PENDING) IS SET FOR THE HALT I/O. IF THE Y-SIDE HAS AN 01309000
  1342. * ACTIVE COMMAND, THE COMMAND IS 'HALTED' IN THE SAME MANNER, 01310000
  1343. * BUT CC = 1, CSW STATUS ZERO, IS SET UNLESS THE X-SIDE WAS 01311000
  1344. * ALSO ACTIVE AT THE TIME OF THE HALT I/O. IF NEITHER THE 01312000
  1345. * X-SIDE OR THE Y-SIDE WERE ACTIVE, CC = 1, CSW STATUS ZERO 01313000
  1346. * IS SET, AND THE HALT I/O OCCURRENCE IS INDICATED ONLY IF 01314000
  1347. * THE ADAPTER WAS RUNNING IN EXTENDED MODE. 01315000
  1348. *. 01316000
  1349. EJECT 01317000
  1350. DMKVCASH RELOC , HALT I/O OR HALT DEVICE TO VIRTUAL CTCA 01318000
  1351. USING VDEVBLOK,R8 USE THE VDEVBLOK TEMPORARILY 01319000
  1352. SLR R0,R0 (CONVENIENT CONSTANT) 01320000
  1353. ST R0,SAVER5 CSW STATUS USUALLY EQUALS ZERO 01321000
  1354. TM VDEVSTAT,VDEVNRDY IS THE CTCA COUPLED ? 01322000
  1355. BO VCAEXC1 NO -- CC = 1, CSW STORED 01323000
  1356. BAL R5,GETCTCA ACCESS CHXBLOK, CHYBLOK 01324000
  1357. BAL R5,RESATTN RESET DEFERRED ATTENTION IOBLOKS 01325000
  1358. LA R10,VCAEXC1 COND. CODE ONE NORMALLY 01326000
  1359. SPACE 01327000
  1360. TM CHXFLAG,CHBWAIT IS THE X-SIDE ACTIVE ? 01328000
  1361. BO SETHIOX YES -- INDICATE SO 01329000
  1362. LR R5,R10 SAVE RETURN ADDRESS 01330000
  1363. LA R0,IOBSIZE SET UP IOBLOK WITH 01331000
  1364. CALL DMKFREE CHANNEL END AND DEVICE END 01332000
  1365. LR R10,R1 FOR HALT DEVICE WITH CC=1 01333000
  1366. XC IOBLOK(IOBSIZE*8),IOBLOK CLEAR IOBLOK 01334000
  1367. ST R11,IOBUSER CALLER VMBLOK ADDRESS 01335000
  1368. MVI IOBCSW+4,CE+DE INDICATE CHANNEL AND DEVICE END 01336000
  1369. LH R1,SAVER1+2 GET ADDRESS OF CTCA DEVICE 01337000
  1370. STH R1,IOBVADD AND STORE IN IOBLOK 01338000
  1371. L R1,=A(DMKVIOIN) SET INTERRUPT RETURN ADDRESS 01339000
  1372. ST R1,IOBIRA .. 01340000
  1373. ST R10,IOBLINK FORCE IOBLOK TO LINK TOSELF 01341000
  1374. CALL DMKSTKIO STACK IOBLOK FOR DMKVIO 01342000
  1375. LR R10,R5 RESTORE RETURN ADDRESS 01343000
  1376. B VCAHIOX JUST HALT THE Y-SIDE 01344000
  1377. SETHIOX OI CHXFLAG,CHBHIO LET X-SIDE KNOW WHY IT STOPPED 01345000
  1378. NI CHYFLAG,255-CHBATTN X-SIDE WAS JUST HALTED 01346000
  1379. L R1,CHXCNCT CPEXBLOK FOR RE-CONNECT 01347000
  1380. ST R0,CHXCNCT ...CLEAR POINTER... 01348000
  1381. CALL DMKSTKCP STACK FOR EXECUTION 01349000
  1382. NI CHXFLAG,255-CHBWAIT X-SIDE WAS JUST HALTED 01350000
  1383. LA R10,VCAEXC0 SET COND. CODE ZERO ON EXIT 01351000
  1384. VCAHIOX EQU * HIO, X-SIDE IDLE 01352000
  1385. TM CHYFLAG,CHBWAIT IS Y-SIDE ACTIVE ? 01353000
  1386. BZ VCAHIOY NO -- CHECK IF 'HIO' REMEMBERED 01354000
  1387. OI CHXFLAG,CHBHIO LET Y-SIDE KNOW WHY IT STOPPED 01355000
  1388. LR R3,R10 HAVE 'GOCHANY' EXIT DIRECTLY 01356000
  1389. B GOCHANY RE-CONNECT THE Y-SIDE 01357000
  1390. VCAHIOY EQU * CHECK FOR COMPATIBILITY MODE 01358000
  1391. TM CHXFLAG,CHBM370 STILL IN EXTENDED MODE ? 01359000
  1392. BCR 8,R10 NO -- DON'T SET 'CHBHIO' IF IDLE 01360000
  1393. OI CHXFLAG,CHBHIO HALT I/O OR HALT DEVICE 01361000
  1394. BR R10 EXIT WITH CONDITION CODE 01362000
  1395. EJECT 01363000
  1396. *. 01364000
  1397. * SUBROUTINE NAME - 01365000
  1398. * 01366000
  1399. * DMKVCARD 01367000
  1400. * 01368000
  1401. * FUNCTION - 01369000
  1402. * 01370000
  1403. * TO PERFORM A SELECTIVE DEVICE RESET FOR A VIRTUAL 01371000
  1404. * CHANNEL-TO-CHANNEL ADAPTER WITHOUT DE-COUPLING THE 01372000
  1405. * CTCA FROM THE Y-SIDE ADAPTER 01373000
  1406. * 01374000
  1407. * ENTRY CONDITIONS - 01375000
  1408. * 01376000
  1409. * GPR 13 = ADDRESS OF STANDARD SAVE-AREA 01377000
  1410. * GPR 12 = ADDRESS OF DMKVCARD 01378000
  1411. * GPR 11 = VMBLOK ADDRESS FOR ACTIVE USER 01379000
  1412. * GPR 8 = VDEVBLOK ADDRESS OF VIRTUAL CTCA 01380000
  1413. * 01381000
  1414. * EXIT CONDITIONS - GPRS 0-15 UNCHANGED 01382000
  1415. * 01383000
  1416. * OPERATION - 01384000
  1417. * 01385000
  1418. * DMKVCARD IS CALLED VIA SVC FROM DMKCFPRD TO RESET A VIRTUAL 01386000
  1419. * CTCA, EITHER DUE TO THE 'RESET' COMMAND OR A VIRTUAL MACHINE 01387000
  1420. * LOGOUT. IF THE ADAPTER HAS NOT YET BEEN COUPLED, AN EXIT IS 01388000
  1421. * TAKEN IMMEDIATELY. IF THE ADAPTER IS COUPLED, ANY ACTIVE 01389000
  1422. * COMMAND IS 'HALTED' VIA A CALL TO DMKSTKCP FOR THE X-SIDE, 01390000
  1423. * THE Y-SIDE, OR BOTH, AS NEEDED. IF EITHER END-OF-FILE LATCH 01391000
  1424. * IS SET, THE LATCH IS RESET AND ANY DEFERRED ATTENTION 01392000
  1425. * IOBLOKS ARE RELEASED VIA A CALL TO DMKFRET. 01393000
  1426. * IF THE ADAPTER IS RUNNING IN EXTENDED MODE, CHECKS ARE MADE 01394000
  1427. * TO DETERMINE IF THE RESET CONDITION SHOULD BE RECORDED IN 01395000
  1428. * THE CHXBLOK, OR IF THE ADAPTER HAS BEEN FORCED INTO 01396000
  1429. * COMPATIBILITY MODE BY THE SELECTIVE RESET. 01397000
  1430. *. 01398000
  1431. EJECT 01399000
  1432. DMKVCARD RELOC , DEVICE RESET WITHOUT DE-COUPLE 01400000
  1433. SPACE 01401000
  1434. TM VDEVSTAT,VDEVNRDY IS THE CTCA COUPLED ? 01402000
  1435. BO VCAEXIT NO -- JUST EXIT QUIETLY 01403000
  1436. L R9,VDEVREAL ADDRESS OF CHXBLOK @VA09657 01403100
  1437. DROP R7 @VA09657 01403200
  1438. USING CHXBLOK,R9 @VA09657 01403300
  1439. L R11,CHXOTHR Y-SIDE VMBLOK @VA09657 01403400
  1440. TM VMRSTAT,VMLOGOFF IS Y-SIDE LOGGING OFF ? @VA09657 01403500
  1441. BZ FINDCTCA NO,THEN FIND THE CTCA FOR Y-SIDE@VA09657 01403600
  1442. L R11,SAVER11 OTHERWISE LOAD CORRECT VMBLOK @VA09657 01403700
  1443. B VCAEXIT AND EXIT @VA09657 01403800
  1444. FINDCTCA EQU * @VA09657 01403900
  1445. LH R1,CHXYADD Y-SIDE VADDR @VA09657 01404000
  1446. CALL DMKSCNVU GET Y-SIDE VDEVBLOK @VA09657 01404100
  1447. L R6,VDEVREAL ADDRESS OF CHYBLOK @VA09657 01404200
  1448. L R11,SAVER11 LOAD CORRECT VMBLOK ADDRESS @VA09657 01404300
  1449. LR R7,R9 ACCESS CHXBLOK VIA GR7 @VA09657 01404400
  1450. USING CHXBLOK,R7 @VA09657 01404500
  1451. DROP R9 @VA09657 01404600
  1452. TM CHYFLAG,CHBMNOP DID Y-SIDE INHIBIT COMPATIBILITY ? 01405000
  1453. BO RESMODE YES - LEAVE IN EXTENDED MODE 01406000
  1454. NI CHYFLAG,255-CHBM370 DROP INTO COMPATIBILITY MODE 01407000
  1455. RESMODE EQU * 01408000
  1456. BAL R5,RESATTN RESET EOF LATCHES 01409000
  1457. MVI CHXFLAG,0 ZERO X FLAG BYTE 01410000
  1458. TM CHYFLAG,CHBWAIT IS THE Y-SIDE WAITING ? 01411000
  1459. BZ VCAEXIT NO -- ALL DONE 01412000
  1460. OI CHXFLAG,CHBREST 'SYSTEM RESET' FOR X-SIDE 01413000
  1461. BAL R3,GOCHANY RE-CONNECT THE Y-SIDE 01414000
  1462. LA R3,VCAEXIT @VA01079 01415000
  1463. BAL R14,BLDCPEX GET CONTROL BACK AFTER Y-SIDE @VA01079 01416000
  1464. * RECONNECTED 01417000
  1465. CALL DMKSTKCP @VA01079 01418000
  1466. GOTO DMKDSPCH @VA01079 01419000
  1467. SPACE 2 01420000
  1468. RESATTN EQU * RESET EOF LATCHES, CLEAR DEFERRED 'ATTN' 01421000
  1469. TM CHYFLAG,CHBEOFL IS THE Y-SIDE EOF LATCH SET ? 01422000
  1470. BZ RESCTCB NO -- 01423000
  1471. NI CHYFLAG,255-CHBEOFL FIRST, WE RESET IT... 01424000
  1472. L R10,CHXDATN THEN CHECK FOR X-SIDE DEFERRED 'ATTN' 01425000
  1473. LTR R10,R10 IS THERE AN 'ATTN' IOBLOK ? 01426000
  1474. BZ RESCTCB NO -- 01427000
  1475. BAL R3,FRETIOB FRET THE IOBLOK - CANCEL ATTENTION 01428000
  1476. ST R0,CHXDATN CLEAR OUT POINTER WORD 01429000
  1477. RESCTCB EQU * CHECK X-SIDE END-OF-FILE LATCH 01430000
  1478. TM CHXFLAG,CHBEOFL IS THE X-SIDE EOF LATCH SET ? 01431000
  1479. BCR 8,R5 NO -- 01432000
  1480. NI CHXFLAG,255-CHBEOFL FIRST RESET THE LATCH 01433000
  1481. L R10,CHYDATN THEN CHECK FOR Y-SIDE DEFERRED 'ATTN' 01434000
  1482. LTR R10,R10 IS THERE AN 'ATTN' IOBLOK ? 01435000
  1483. BCR 8,R5 NO -- 01436000
  1484. BAL R3,FRETIOB FRET THE IOBLOK - CANCEL ATTENTION 01437000
  1485. ST R0,CHYDATN CLEAR OUT POINTER WORD 01438000
  1486. BR R5 RETURN 01439000
  1487. EJECT 01440000
  1488. *. 01441000
  1489. * SUBROUTINE NAME - 01442000
  1490. * 01443000
  1491. * DMKVCARS 01444000
  1492. * 01445000
  1493. * FUNCTION - 01446000
  1494. * 01447000
  1495. * TO PERFORM A FINAL RESET FOR A VIRTUAL CHANNEL-TO-CHANNEL 01448000
  1496. * ADAPTER AND TO DISCONNECT THE ADAPTER FROM ITS COUPLE'D 01449000
  1497. * TWIN ON THE Y-SIDE VIRTUAL MACHINE. 01450000
  1498. * 01451000
  1499. * ENTRY CONDITIONS - 01452000
  1500. * 01453000
  1501. * GPR 13 = ADDRESS OF STANDARD SAVE-AREA 01454000
  1502. * GPR 12 = ADDRESS OF DMKVCARS 01455000
  1503. * GPR 11 = VMBLOK ADDRESS OF X-SIDE USER 01456000
  1504. * GPR 8 = VDEVBLOK ADDRESS OF X-SIDE VIRTUAL CTCA 01457000
  1505. * 01458000
  1506. * EXIT CONDITIONS - GPRS 0-15 UNCHANGED 01459000
  1507. * 01460000
  1508. * OPERATION - 01461000
  1509. * 01462000
  1510. * DMKVCARS IS CALLED VIA SVC FROM DMKVDBRL WHEN THE VIRTUAL 01463000
  1511. * MACHINE EITHER DETACHES THE VIRTUAL CTCA OR ISSUES THE 01464000
  1512. * CP 'LOGOFF' COMMAND. DMKVCARD HAS BEEN CALLED PRIOR TO THE 01465000
  1513. * CALL TO DMKVCARS, SUCH THAT THE ADAPTER IS KNOWN TO BE IDLE. 01466000
  1514. * THE Y-SIDE VDEVBLOK IS LOCATED VIA A CALL TO DMKSCNVU, 01467000
  1515. * AND BOTH THE X-SIDE AND Y-SIDE VDEVBLOKS ARE MARKED 'NOT 01468000
  1516. * READY' (I.E. NOT COUPLED), AND THE CHXBLOK AND CHYBLOK 01469000
  1517. * POINTERS ARE CLEARED. THE MESSAGE: 01470000
  1518. * 01471000
  1519. * CTCA XXX DROP FROM USERID XXX 01472000
  1520. * 01473000
  1521. * IS BUILT FOR THE Y-SIDE USER, FROM INFORMATION IN THE 01474000
  1522. * CHXBLOK, AND IS SENT TO THE USER IF HE IS NOT IN THE LOGOFF 01475000
  1523. * PROCESS, OR IF THE X-SIDE AND Y-SIDE VIRTUAL MACHINES ARE 01476000
  1524. * IN FACT A SINGLE MACHINE. THE VIRTUAL ADDRESSES IN THE 01477000
  1525. * MESSAGE ARE EXCHANGED AND IT IS SENT TO THE X-SIDE USER IF 01478000
  1526. * HE IS NOT IN THE LOGOFF PROCESS. FINALLY, THE BASE ADDRESS 01479000
  1527. * OF THE CHXBLOK, CHYBLOK COMBINATION IS DETERMINED AND THE 01480000
  1528. * FREE STORAGE IS RELEASED VIA A CALL TO DMKFRET. 01481000
  1529. *. 01482000
  1530. EJECT 01483000
  1531. DROP R6,R7,R10 ABANDON STANDARD USAGES @VA09657 01484000
  1532. DMKVCARS RELOC , INTERNAL RESET FOR CHAN-TO-CHAN ADAPTER 01485000
  1533. USING VDEVBLOK,R8 01486000
  1534. USING CHXBLOK,R9 01487000
  1535. USING CHYBLOK,R10 01488000
  1536. SPACE 01489000
  1537. MVI SAVEWRK1,X'00' CLEAR A FLAG BYTE 01490000
  1538. TM VDEVSTAT,VDEVNRDY IS THE ADAPTER COUPLED ? 01491000
  1539. BO VCAEXIT NO -- JUST EXIT SMOOTHLY 01492000
  1540. OI VDEVSTAT,VDEVNRDY MARK NOT READY TO AVOID DOUBLE FRET 01493000
  1541. L R9,VDEVREAL ADDRESS OF CHXBLOK @VA08419 01494500
  1542. SLR R0,R0 ZERO REG0 @VA08419 01495000
  1543. ST R0,VDEVREAL UNPLUG @VA08419 01495500
  1544. L R11,CHXOTHR Y-SIDE VMBLOK @VA08419 01496000
  1545. LH R1,CHXYADD Y-SIDE VADDR @VA08419 01496500
  1546. CALL DMKSCNVU @VA08419 01497000
  1547. BZ CONTINUE NO, FRET BOTH CHBLOKS @VA13002 01497050
  1548. USING VCUBLOK,R7 Y, RESTORE Y VDEVBLOK ADDR @VA13002 01497100
  1549. LA R8,X'00F' BY ISOLATING DEVICE BIT @VA13002 01497150
  1550. NR R8,R1 @VA13002 01497200
  1551. AR R8,R8 @VA13002 01497250
  1552. LH R8,VCUDVTBL(R8) LOAD VDEVBLOK INDEX @VA13002 01497300
  1553. A R8,VMDVSTRT LOAD VDEVBLOK POINTER @VA13002 01497350
  1554. DROP R7 @VA13002 01497400
  1555. CONTINUE EQU * @VA13002 01497450
  1556. L R10,VDEVREAL ADDRESS OF CHYBLOK @VA08419 01497500
  1557. ST R0,VDEVREAL UNPLUG @VA08419 01498000
  1558. OI VDEVSTAT,VDEVNRDY MARK NOT READY @VA08419 01498500
  1559. L R11,SAVER11 VMBLOK NOW MATCHES CPU TIMER AGAIN 01506000
  1560. EJECT 01507000
  1561. * 01508000
  1562. * SEND DROP MESSAGES TO BOTH USERS 01509000
  1563. * 01510000
  1564. MVC SAVEWRK2(8),BLANKS BLANK OUT SAVE-AREA BUFFER 01511000
  1565. MVC SAVEWRK4(24),SAVEWRK2 ... 01512000
  1566. MVC SAVEWRK2(4),=C'CTCA' DEVICE NAME 01513000
  1567. MVC SAVEWRK4+1(9),=C'DROP FROM' ACTION CUE 01514000
  1568. LH R1,CHXYADD CONVERT THE ADDRESSES 01515000
  1569. CALL DMKCVTBH 01516000
  1570. LR R5,R1 GR5 = Y-SIDE VADDR 01517000
  1571. LH R1,CHYXADD ... 01518000
  1572. CALL DMKCVTBH 01519000
  1573. LR R4,R1 GR4 = X-SIDE VADDR 01520000
  1574. CL R11,CHXOTHR ARE THE CTCA'S WRAPPED ON ONE VM ? 01521000
  1575. BE VCAWRAP YES - GIVE ONLY ONE MESSAGE 01522000
  1576. MVC SAVEWRK6+3(8),VMUSER LOCAL USERID 01523000
  1577. STCM R5,B'0111',SAVEWRK3+1 REMOTE CTCA 01524000
  1578. STCM R4,B'0111',SAVEWRK9 LOCAL CTCA 01525000
  1579. BAL R2,VMYSIDE GET Y-SIDE VMBLOK IN R11 @V407510 01526100
  1580. TM VMRSTAT,VMLOGOFF IS USER IN LOGOFF PROCESS ? 01527000
  1581. BO VCAWRAP YES - SKIP THE DROP MESSAGE 01528000
  1582. LA R0,SAVEWRK9+4-SAVEWRK2 LENGTH 01529000
  1583. LA R1,SAVEWRK2 ADDRESS 01530000
  1584. CALL DMKQCNWT,PARM=NORET 01531000
  1585. VCAWRAP DS 0H BACK TO X-SIDE @V407510 01532100
  1586. BAL R2,VMXSIDE BACK TO X-SIDE VMBLOK @V407510 01532200
  1587. STCM R4,B'0111',SAVEWRK3+1 LOCAL CTCA 01534000
  1588. STCM R5,B'0111',SAVEWRK9 REMOTE CTCA 01535000
  1589. L R11,CHXOTHR MOMENTARILY GET OTHER VMBLOK 01536000
  1590. MVC SAVEWRK6+3(8),VMUSER ...FOR HIS USERID 01537000
  1591. L R11,SAVER11 NOW WE'RE BACK 01538000
  1592. TM VMRSTAT,VMLOGOFF IS USER IN LOGOOF PROCESS ? 01539000
  1593. BO RELEASE YES - SKIP THE DROP MESSAGE 01540000
  1594. LA R0,SAVEWRK9+4-SAVEWRK2 LENGTH 01541000
  1595. LA R1,SAVEWRK2 ADDRESS 01542000
  1596. CALL DMKQCNWT,PARM=NORET 01543000
  1597. EJECT 01544000
  1598. RELEASE EQU * RELEASE THE INTER-CONNECTOR BLOCK 01545000
  1599. LR R1,R9 ADDRESS OF CHXBLOK TO GR1 01546000
  1600. CLR R9,R10 WHICH ONE IS THE REAL ONE ? 01547000
  1601. BL FRETBLK CHXBLOK - O.K. AS IS 01548000
  1602. LR R1,R10 CHYBLOK - USE IT'S ADDRESS 01549000
  1603. FRETBLK EQU * RELEASE CHX, CHY BLOCKS 01550000
  1604. LA R0,CHBSIZE 01551000
  1605. CALL DMKFRET 01552000
  1606. SPACE 01553000
  1607. VCAEXC0 EQU * SET CONDITION CODE ZERO 01554000
  1608. SR R0,R0 ... 01555000
  1609. B VCAEXIT ...AND EXIT WITH COND. CODE SET 01556000
  1610. VCAEXC1 EQU * SET CONDITION CODE ONE => CSW STORED 01557000
  1611. TM *,X'FF' CONDITION MIXED => CC = 1 01558000
  1612. SPACE 01559000
  1613. VCAEXIT EQU * RETURN TO CALLER 01560000
  1614. EXIT 01561000
  1615. SPACE 4 01562000
  1616. VMXSIDE EQU * SWITCH TO X-SIDE VMBLOK 01563000
  1617. L R1,SAVER11 GET CALLER'S VMBLOK @V407510 01564100
  1618. SWTCHVM SWITCH TO CALLER @V407510 01564200
  1619. BR R2 RETURN TO CALLER @V407510 01564300
  1620. SPACE 01568000
  1621. VMYSIDE EQU * SWITCH TO Y-SIDE VMBLOK 01569000
  1622. L R1,CHXOTHR GET Y-SIDE VMBLOK @V407510 01570100
  1623. SWTCHVM SWITCH TO Y-SIDE @V407510 01570200
  1624. BR R2 RETURN TO CALLER @V407510 01570300
  1625. DROP R8,R9,R10 01574000
  1626. SPACE 01575000
  1627. FRETIOB EQU * RELEASE PENDING 'ATTN' IOBLOK 01576000
  1628. LR R1,R10 IOBLOK ADDRESS 01577000
  1629. LA R0,IOBSIZE ...AND SIZE 01578000
  1630. CALL DMKFRET RELEASE FREE STORAGE BLOCK 01579000
  1631. SLR R0,R0 RESTORE CONVENIENT CONSTANT 01580000
  1632. BR R3 ...RETURN 01581000
  1633. EJECT 01582000
  1634. USING CHXBLOK,R7 RE-ASSERT STANDARD USAGE 01583000
  1635. CHANCHK EQU * CCW ADDR IN GR9, RETURN IN GR14 01584000
  1636. USING RCWCCW,R9 VALIDATE CCW FROM CHANNEL VIEWPOINT 01585000
  1637. SLR R1,R1 ZERO STATUS ACCUMULATION 01586000
  1638. TM RCWCTL,RCWINVL IS THE CCW VALID ? 01587000
  1639. BCR 1,R14 NO -- RETURN WITH NON-ZERO COND. CODE 01588000
  1640. CLI RCWCOMND,X'08' IS THIS A TIC COMMAND @VM08638 01589000
  1641. BNE TST18 NO -- CHECK FOR CMD X'18' @VM08638 01590000
  1642. TICADD TM RCWCOMND+3,X'07' IS THE ADDR. DBL-WORD ALIGNED ?@VM08638 01591000
  1643. BR R14 IF YES, CC=ZERO AND NONZERO IF NO@VM08638 01592000
  1644. TST18 CLI RCWCOMND,X'18' MAYBE TIC AFTER CHAIN DATA @VM08638 01593000
  1645. BE TICADD YES, CHECK TIC ADDRESS @VM08638 01594000
  1646. CH R1,RCWCNT COUNT NON-ZERO FOR NON-TIC'S @VM08638 01595000
  1647. BNE CHANFLG YES - VALIDATE IDAW, IF ANY @VM08638 01596000
  1648. TM *,X'FF' SET COND. CODE = NONZERO @VM08638 01597000
  1649. BR R14 ...AND RETURN @VM08638 01598000
  1650. CHANFLG EQU * CHECK IDA FLAG, VALIDATE IDAW 01599000
  1651. TM RCWFLAG,X'03' ARE THE MUST-BE-ZERO BITS ZERO ? 01600000
  1652. BCR 7,R14 NO -- RETURN WITH COND. CODE NON-ZERO 01601000
  1653. TM RCWFLAG,IDA IS THE INDIRECT BIT ON ? 01602000
  1654. BZ CHANPCI NO -- GO TEST FOR 'PCI' 01603000
  1655. L R1,RCWADDR GET ADDRESS OF FIRST IDAW 01604000
  1656. TM 0(R1),X'FF' HIGH-ORDER MUST BE ZERO 01605000
  1657. BCR 7,R14 RETURN WITH COND. CODE IF NOT VALID 01606000
  1658. CHANPCI EQU * TEST FOR PCI IN CCW 01607000
  1659. TM RCWFLAG,PCIF SHOULD WE SET 'PCI' ? 01608000
  1660. BCR 8,R14 NO -- JUST EXIT WITH CC = 0 01609000
  1661. OI CHXSTAT+1,PCI USER WILL SEE THIS SOMEWHAT LATER 01610000
  1662. SR R1,R1 SET COND. CODE = ZERO 01611000
  1663. BR R14 ...AND RETURN 01612000
  1664. SPACE 01613000
  1665. BLDIOER EQU * CSW IN GR4-5, SENSE IN GR6 01614000
  1666. LR R2,R14 SAVE RETURN ADDRESS 01615000
  1667. LA R0,IOERSIZE GET AN IOERBLOK 01616000
  1668. CALL DMKFREE ... 01617000
  1669. USING IOERBLOK,R1 01618000
  1670. XC IOERBLOK(IOERSIZE*8),IOERBLOK 01619000
  1671. STM R4,R5,IOERCSW SET ERROR CSW IN IOERBLOK 01620000
  1672. LA R0,IOERDATA CONSTRUCT DUMMY SENSE CCW 01621000
  1673. ST R0,IOERCCW ...FOR ESTHETIC AND PRACTICAL REASONS 01622000
  1674. MVI IOERCCW,X'04' 01623000
  1675. MVI IOERLEN+1,1 SENSE DATA LENGTH 01624000
  1676. MVI IOERCCW+4,SILI 01625000
  1677. STC R3,IOERDATA SET SENSE DATA 01626000
  1678. BR R2 RETURN TO CALLER 01627000
  1679. SPACE 01628000
  1680. CHKPKEY EQU * TEST FOR PROTECTION VIOLATIONS 01629000
  1681. CLI CHXPKEY,X'00' IF HIS CAW KEY IS ZERO... 01630000
  1682. BCR 8,R14 ...HE CAN STORE ANYWHERE 01631000
  1683. L R1,=X'00FFFFF0' ALIGNMENT MASK 01632000
  1684. NR R1,R2 REAL ADDRESS IS IN GR2 01633000
  1685. ISK R1,R1 GET REAL STORAGE KEY 01634000
  1686. N R1,F240 REDUCE TO FOUR BIT KEY 01635000
  1687. CLM R1,B'0001',CHXPKEY TEST FOR KEY MATCH 01636000
  1688. BR R14 RETURN WITH COND. CODE SET 01637000
  1689. DROP R1,R7,R9 01638000
  1690. EJECT 01639000
  1691. BLDCPEX EQU * BUILD CPEXBLOK FOR DEFERRED EXECUTION 01640000
  1692. STM R14,R15,SAVEWRK2 SAVE GR14, 15 01641000
  1693. LA R0,CPEXSIZE SIZE OF CPEXBLOK 01642000
  1694. CALL DMKFREE 01643000
  1695. USING CPEXBLOK,R1 01644000
  1696. LM R14,R15,SAVEWRK2 RESTORE GR14, 15 01645000
  1697. SLR R0,R0 RESTORE CONVENIENT ZERO CONSTANT 01646000
  1698. STM R0,R15,CPEXR0 SET CPEXBLOK REGISTERS 01647000
  1699. ST R3,CPEXADD SET EXECUTION ADDRESS 01648000
  1700. MVC CPEXFPNT(12),ZEROES CLEAR FIRST THREE WORDS 01649000
  1701. BR R14 RETURN TO INTERNAL CALLER 01650000
  1702. DROP R1 01651000
  1703. SPACE 2 01652000
  1704. USING VDEVBLOK,R8 01653000
  1705. GETCTCA EQU * GET ADDRESSES FOR BOTH BLOCKS 01654000
  1706. L R9,VDEVREAL ADDRESS OF CHXBLOK 01655000
  1707. USING CHXBLOK,R9 TEMPORARILY 01656000
  1708. L R11,CHXOTHR Y-SIDE VMBLOK 01657000
  1709. LH R1,CHXYADD Y-SIDE VADDR 01658000
  1710. CALL DMKSCNVU GET Y-SIDE VDEVBLOK 01659000
  1711. L R6,VDEVREAL ADDRESS OF CHYBLOK 01660000
  1712. L R11,SAVER11 BACK TO CORRECT VMBLOK 01661000
  1713. LR R7,R9 ACCESS CHXBLOK VIA GR7 01662000
  1714. BR R5 RETURN INTERNAL 01663000
  1715. DROP R8,R9 01664000
  1716. SPACE 2 01665000
  1717. LTORG 01666000
  1718. EJECT 01667000
  1719. DEFCPX EQU X'80' FLAG INDICATING DEFERRED CPEXBLOK@VA13548 01667500
  1720. COPY VCTCA 01668000
  1721. COPY IOBLOKS 01669000
  1722. COPY IOER 01670000
  1723. COPY VMBLOK 01671000
  1724. COPY VBLOKS 01672000
  1725. COPY DEVTYPES 01673000
  1726. COPY EQU 01674000
  1727. COPY SAVE 01675000
  1728. PSA 01676000
  1729. END DMKVCA 01677000