Table of Contents

DMSSVN Source

References

Source Listing

DMSSVN.ASSEMBLE.txt
  1. SVN TITLE 'DMSSVN (CMS) VM/370 - RELEASE 6' 00001000
  2. SPACE 2 00002000
  3. *. 00003000
  4. * 00004000
  5. * 00005000
  6. *********************************************************************** 00006000
  7. * OS SUPERVISOR SIMULATION ROUTINES 00007000
  8. * SEVERAL ROUTINES MUST BE KEPT WITHIN THE CMS NUCLEUS 00008000
  9. * 00009000
  10. ******************************************************************** 00010000
  11. * 00011000
  12. *MODULE NAME: 00012000
  13. * 00013000
  14. * DMSSVN (DMSSVN) 00014000
  15. * 00015000
  16. *FUNCTION: 00016000
  17. * 00017000
  18. * THE CMS DMSSVN ROUTINE PROCESSES OS WAIT AND POST 00018000
  19. * MACROS. ALL THE OS MACRO OPTIONS ARE SUPPORTED. 00019000
  20. * 00020000
  21. *ATTRIBUTES: 00021000
  22. * 00022000
  23. * REENTRANT, SEGMENT RESIDENT 00023000
  24. * 00024000
  25. *ENTRY POINTS: 00025000
  26. * 00026000
  27. * DMSSVN1 - OS WAIT MACRO 00027000
  28. * DMSSVN2 - OS POST MACRO 00028000
  29. * DMSSVN93 - TSO TGET-TPUT MACRO 00029000
  30. * DMSSVN94 - TSO TCLEARQ MACRO 00030000
  31. * 00031000
  32. *ENTRY CONDITIONS: 00032000
  33. * 00033000
  34. * MUST BE CALLED BY OS WAIT OR POST MACRO 00034000
  35. * 00035000
  36. *EXIT CONDITIONS: 00036000
  37. * 00037000
  38. * NORMAL -- CONTROL IS RETURNED TO THE USER. 00038000
  39. * ERROR -- USER IS ABENDED IF WAIT COUNT IS LARGER THAN ECB COUNT 00039000
  40. * 00040000
  41. *CALLS TO OTHER ROUTINES: 00041000
  42. * 00042000
  43. * DMSSAB. 00043000
  44. * 00044000
  45. *ENTERNAL REFERENCES: 00045000
  46. * 00046000
  47. * NUCON 00047000
  48. * 00048000
  49. *TABLES/WORKAREAS: 00049000
  50. * 00050000
  51. * NONE 00051000
  52. * 00052000
  53. *REGISTER USAGE: 00053000
  54. * 00054000
  55. * R0-R9 WORK 00055000
  56. * R10 OPSECT DSECT 00056000
  57. * R11 MACSECT DSECT 00057000
  58. * R12 DMSSVN BASE 00058000
  59. * R13 SAVE AREA 00059000
  60. * R14,R15 WORK 00060000
  61. * 00061000
  62. *NOTES: 00062000
  63. * 00063000
  64. * NONE 00064000
  65. * 00065000
  66. *OPERATION: 00066000
  67. * 00067000
  68. * THE DMSSVN ROUTINE HAS FOUR ENTRY POINTS: DMSSVN1,DMSSVN2, 00068000
  69. * DMSSVN93 AND DMSSVN94. 00069000
  70. * 00070000
  71. * IF AN OS WAIT MACRO IS ISSUED, CONTROL IS PASSED TO THE 00071000
  72. * DMSSVN1 ENTRY POINT IN DMSSVN. DMSSVN CHECKS TO SEE 00072000
  73. * IF ENOUGH ECB'S ARE POSTED TO SATISFY THE ECB COUNT 00073000
  74. * INDICATED. IF NOT, THE WAIT BITS IN THE ECB'S ARE TURNED 00074000
  75. * ON AND SUCCESSIVE WAIT PSW'S ARE LOADED UNTIL THE WAIT 00075000
  76. * COUNT IS SATISFIED. AFTER THE WAIT COUNT IS SATISFIED, THE 00076000
  77. * WAIT BITS IN THE ECB'S SPECIFIED ARE TURNED OFF AND CONTROL 00077000
  78. * IS RETURNED TO THE USER. IF THE WAIT COUNT IS LARGER THAN THE 00078000
  79. * ECB COUNT, THE USER IS ABENDED. 00079000
  80. * 00080000
  81. * IF AN OS POST MACRO IS ISSUED, CONTROL IS PASSED TO THE 00081000
  82. * DMSSVN2 ENTRY POINT IN DMSSVN. DMSSVN STORES THE 00082000
  83. * COMPLETION CODE IN THE ECB, SETS THE COMPLETION BIT IN 00083000
  84. * THE FIRST BYTE OF THE ECB AND RETURNS CONTROL TO THE 00084000
  85. * USER. 00085000
  86. * 00086000
  87. * 00087000
  88. * IF A TGET OR TPUT SVC IS ISSUED, CONTROL IS PASSED TO THE 00088000
  89. * DMSSVN93 (SVC 93) ENTRY POINT IN DMSSVN. THIS ROUTINE 00089000
  90. * CHECKS THE HIGH ORDER BIT OF USER REGISTER 1. IF IT IS ON, 00090000
  91. * TGET HAS BEEN REQUESTED, IF OFF, THE REQUEST IS FOR TPUT. 00091000
  92. * 00092000
  93. * TGET STORES THE ADDRESS OF THE USER'S I/O AREA INTO THE 00093000
  94. * 'WAITRD' PLIST, AND ISSUES A CALL TO DMSCRD VIA AN SVC. 00094000
  95. * UPON RETURN FROM DMSCRD, THE LENGTH OF THE I/O OPERATION 00095000
  96. * IS STORED INTO THE USER'S REGISTER SAVE AREA, AND RETURN IS MADE 00096000
  97. * THROUGH A COMMON RETURN ROUTINE, DESCRIBED IN TPUT. 00097000
  98. * 00098000
  99. * TPUT STORES THE USER'S BUFFER ADDRESS AND I/O LENGTH INTO 00099000
  100. * THE DMSCWR P-LIST AND LINKS TO DMSCWR VIA SVC. UPON RETURN, 00100000
  101. * RETURN IS MADE AFTER CHECKING IF AN ATTENTION 00101000
  102. * INTERUPT HAS OCCURRED DURING THE I/O OPERATION. IF IT HAS NOT, 00102000
  103. * A RETURN CODE OF '0' IS STORED INTO THE USER'S REGISTER SAVE 00103000
  104. * AREA,IF THE INTERUPT HAS OCCURRED A RETURN CODE OF '4' IS SET. 00104000
  105. * 00105000
  106. * IF A TCLEARQ SVC (SVC 94) IS ISSUED, CONTROL IS PASSED TO 00106000
  107. * ENTRY POINT DMSSVN94 IN DMSSVN. A CHECK IS MADE TO DETERMINE 00107000
  108. * IF THE REQUEST IS FOR INPUT OR OUTPUT BY CHECKING THE HI- 00108000
  109. * ORDER BIT OF REGISTER 0. IF THE BIT IS OFF, THE REQUEST IS FOR 00109000
  110. * OUTPUT. SINCE THIS OPTION IS NOT SUPPORTED, CONTROL IS RETURNED 00110000
  111. * TO THE USER. IF THE BIT IS ON, A CALL IS MADE TO DMSCIT 00111000
  112. * (DMSCITDB/DESBUF) TO DESTROY THE TERMINAL INPUT BUFFER VIA BALR. 00112000
  113. * UPON RETURN, CONTROL IS RETURNED TO THE CALLER. 00113000
  114. * 00114000
  115. * 00115000
  116. *. 00116000
  117. EJECT 00117000
  118. MACRO 00118000
  119. &LABEL INITIAL 00119000
  120. &LABEL DS 0H 00120000
  121. USING *,R12 00121000
  122. L R12,AOSSVC SET COMMON ADDRESSABILITY 00122000
  123. USING DMSSVN,R12 00123000
  124. BAL R5,OSINIT SET BASE REGS 00124000
  125. MEND 00125000
  126. DMSSVN START 0 00126000
  127. ENTRY DMSSVN1,DMSSVN2,DMSSVN93,DMSSVN94 00127000
  128. USING DMSSVN,R12 00128000
  129. USING FCBSECT,R8 00129000
  130. USING OPSECT,R10 00130000
  131. USING NUCON,R0 00131000
  132. USING SSAVE,R13 00132000
  133. OSINIT DS 0H PERFORM COMMON INITIALIZATION 00133000
  134. L R13,CURRSAVE 00134000
  135. L R10,AOPSECT 00135000
  136. BR R5 00136000
  137. EJECT 00137000
  138. ********************************************************************** 00138000
  139. DMSSVN2 INITIAL 00139000
  140. POST EQU * 02-SIGNIFY END OF OPERATION 00140000
  141. * C(R1) = A(ECB), C(R0) = COMPLETION CODE 00141000
  142. ST R0,0(,R1) STORE CC IN ECN 00142000
  143. NI 0(R1),X'7F' SET BIT 0 = 0 00143000
  144. OI 0(R1),X'40' SET BIT 1 = 1 00144000
  145. B CMSCLEAR 00145000
  146. SPACE 00146000
  147. *********************************************************************** 00147000
  148. DMSSVN1 INITIAL 00148000
  149. WAIT DS 0H 01 - WAIT FOR I/O COMPLETION 00149000
  150. LISTCHK EQU * @VM08901 00151000
  151. SSM *+1 DISABLE FOR ECB SCAN @VA07966 00151100
  152. LTR R1,R1 ECB POINTER OR LIST POINTER? 00152000
  153. BP ONEECB ECB POINTER. 00153000
  154. LPR R5,R1 RESTORE LIST PTR ADDRESS, SAVE R1 @VA01924 00154000
  155. * R0=WAIT EVENT COUNT R1=ECB LIST POINTER 00155000
  156. LISTECB DS 0H A(ECB LIST) WAS SPECIFIED 00156000
  157. LTR R2,R0 GET EVENT COUNT 00157000
  158. BZ WAITEND IF ZERO, THEN RETURN 00158000
  159. SR R3,R3 CLEAR INDEX REGISTER 00159000
  160. LIST01 EQU * SEARCH LIST FOR POSTED ECB'S 00160000
  161. L R4,0(R3,R5) GET A(ECB) @VA01924 00161000
  162. LA R3,4(0,R3) ADVANCE INDEX 00162000
  163. TM 0(R4),X'40' POSTED? 00163000
  164. BZ LIST02 NO. CONTINUE 00164000
  165. BCT R2,LIST02 DECREMENT TEST COUNTER 00165000
  166. SR R3,R3 CLEAR REG 3 00166000
  167. RESETECB L R4,0(R3,R5) GET A(ECB) @VA01924 00167000
  168. LA R3,4(,R3) UPDATE POINTER 00168000
  169. NI 0(R4),X'7F' TURN OFF WAIT BIT 00169000
  170. LTR R4,R4 IS THIS LAST ECB 00170000
  171. BNM RESETECB NO, GO GET NEXT ECB 00171000
  172. B WAITEND YES, RETURN TO USER 00172000
  173. LIST02 OI 0(R4),X'80' TURN ON WAIT BIT 00173000
  174. LTR R4,R4 IS THIS LAST ECB 00174000
  175. BNM LIST01 NO, GO GET NEXT ECB 00175000
  176. SRL R3,2 GET COUNT OF ECBS 00176000
  177. CR R0,R3 WAIT COUNT GREATER THAN ECB COUNT 00177000
  178. BH WAITERR YES, THEN ABEND 00178000
  179. OI OSSFLAGS,OSWAIT INDICATE OS WAIT @V305665 00179000
  180. LPSW ECBPSW ENTER WAIT STATE @VM08901 00180000
  181. WAKEUP EQU * @VM08901 00181000
  182. L R3,AEXTSECT @VM08901 00182000
  183. USING EXTSECT,R3 @VM08901 00183000
  184. L R4,STIMEXIT GET 'STIMER EXIT ADD' IF ANY @VA04419 00184000
  185. LA R4,0(R4) @VA04419 00185000
  186. TM EXTFLAG,REALTIMR REAL TIMER BEING USED? @VA04419 00186000
  187. BZ LISTCHK NO, THEN CONTINUE ELSEWHERE @VA05500 00187000
  188. NI EXTFLAG,255-REALTIMR TURN OFF REAL TIMER FLAG @VA04419 00188000
  189. CKBLIP LTR R4,R4 IS THERE AN STIMER IN EFFECT? @VA04419 00189000
  190. BNZ RESTORE YES, THEN RESTORE THE REMAINING @VA04419 00190000
  191. * TIME 00191000
  192. CLI TIMCHAR,0 IS BLIP ON? @VA04419 00192000
  193. BNE RESTORE NO, THEN RESTORE TIME @VA04419 00193000
  194. MVC TIMINIT(4),=X'000258F6' SET 2 SECOND VALUE @VA04419 00194000
  195. RESTORE MVC TIMER(4),TIMINIT RESET INTERVAL TIMER @VA04419 00195000
  196. B LISTCHK AND CONTINUE @VA04419 00196000
  197. DROP R3 @VA04419 00197000
  198. * R1=V(SINGLE ECB) 00198000
  199. ONEECB TM 0(R1),X'40' IS ECB POSTED? 00199000
  200. BO WAITEND YES, COMPLETE 00200000
  201. OI 0(R1),X'80' SET WAIT BIT ON 00201000
  202. OI OSSFLAGS,OSWAIT INDICATE OS WAIT @V305665 00202000
  203. LPSW ECBPSW GO TO WAIT STATE 00203000
  204. WAITEND EQU * @V305665 00204000
  205. NI OSSFLAGS,255-OSWAIT REMOVE WAIT INDICATOR @V305665 00205000
  206. B CMSCLEAR @V305665 00206000
  207. WAITERR ABEND X'101' 00207000
  208. * 00208000
  209. ENTRY WAKEUP ...FOR DMSCIT'S USE AFTER STAX EXIT @V2D4598 00209000
  210. DS 0D 00210000
  211. ECBPSW DC X'FF060000',A(WAKEUP) @VM08901 00211000
  212. SPACE 3 @VA04603 00212000
  213. * 00213000
  214. * RETURN TO CMS 00214000
  215. * 00215000
  216. CMSCLEAR SR R15,R15 NO ERROR 00216000
  217. CMSRET ST R15,EGPR15 SET ERROR CODE INTO SAVE 00217000
  218. BR R14 00218000
  219. EJECT @VA04603 00219000
  220. PRINT GEN 00220000
  221. *********************************************************************** 00221000
  222. * 00222000
  223. * TGET AND TPUT SIMULATION ROUTINE 00223000
  224. * 00224000
  225. *********************************************************************** 00225000
  226. DMSSVN93 INITIAL 00226000
  227. USING SSAVE,R13 SET UP USER REG. SAVE DSECT 00227000
  228. NI TSOFLAGS,255-TSOATCNL RESET ATTENTION INDICATOR P3108 00228000
  229. TM EGPR1,TPUTFLG CHECK IF REQUEST FOR TGET OR TPUT 00229000
  230. * AS INDICATED BY HI-ORDER BIT OF REG 1 00230000
  231. BZ TPUT IF BIT IS OFF, IT'S TPUT 00231000
  232. TGET LA R1,CONREAD GET ADDR OF READ PLIST V0022 00232000
  233. MVI CONRDCOD,CHARS SET OPTION TO 'NO TRANSLATE' @VA07268 00233000
  234. SVC 202 V0022 00234000
  235. DC AL4(*+4) V0022 00235000
  236. MVI CONRDCOD,CHARU RESET OPTION TO UPPER CASE @VA07268 00236000
  237. LH R2,CONRDCNT GET NO. BYTES READ V0022 00237000
  238. LH R15,EGPR0+2 GET BYTES REQUESTED V0022 00238000
  239. L R6,EGPR1 GET BUFFER ADDR V0022 00239000
  240. CR R2,R15 BYTES< BYTES REQUESTED V0022 00240000
  241. BNH SETRDCNT YES, SET READ COUNT V0022 00241000
  242. LR R2,R15 BYTES READ= BYTES REQUESTED V0022 00242000
  243. SETRDCNT ST R2,EGPR1 SET BYTES READ V0022 00243000
  244. L R2,CONRDBUF GET CMS CON BUFF V0022 00244000
  245. BCTR R15,R0 DECREMENT ONE FOR MOVE @VA04474 00245000
  246. EX R15,MOVEBUF MOVE DATA TO USER AREA V0022 00246000
  247. B SVC93RET RETURN TO USER V0022 00247000
  248. TPUT MVC CONWRCNT(2),EGPR0+2 SET NO. TO BE WRITTEN V0022 00248000
  249. MVC CONWRBUF+1(3),EGPR1+1 SET BUFFER ADDR V0022 00249000
  250. OI CONWRCOD+1,LONGOP SET SPECIAL "LONG WRITE" BIT @VA04603 00250000
  251. LA R1,CONWRITE GET PLIST ADDR V0022 00251000
  252. SVC 202 V0022 00252000
  253. DC AL4(*+4) V0022 00253000
  254. NI CONWRCOD+1,255-LONGOP RESET LONGOP BIT @VA04603 00254000
  255. SVC93RET EQU * V0022 00255000
  256. LA R15,0 SET UP NORMAL RETURN 00256000
  257. TM TSOFLAGS,TSOATCNL DID ATTENTION OCCUR DURING READP3108 00257000
  258. BZ RCSET IF NOT EVERYTHING IS SET 00258000
  259. LA R15,8 RETURN CODE FOR ATTENTION CONDITION P3108 00259000
  260. RCSET EQU * 00260000
  261. ST R15,EGPR15 SET IT UP IN USER'S SVC SAVE AREA 00261000
  262. BR R14 BACK TO CALLER 00262000
  263. SPACE 2 @VA04603 00263000
  264. LONGOP EQU X'10' "LONG WRITE" BIT FOR DMSCWR (Q.V.) @VA04603 00264000
  265. EJECT @VA04854 00265000
  266. ******************************************************************** 00266000
  267. * TCLEARQ SIMULATION 00267000
  268. * TCLEARQ WILL CLEAR THE TERMINAL INPUT QUEUE BY CALLING 00268000
  269. * DESBUF , AND THEN RETURN TO THE USER 00269000
  270. ********************************************************************** 00270000
  271. DMSSVN94 INITIAL 00271000
  272. LR R4,R14 SAVE RETURN ADDR 00272000
  273. LA R2,X'80' CHECK IF 'INPUT' IS SPECIFIED 00273000
  274. CR R1,R2 IF NOT, JUST RETURN 00274000
  275. BNE SVC94RET THROUGH COMMON RETURN 00275000
  276. LA R14,CONSTACK RESET WRITE-STACK POINTER @V305665 00276000
  277. ST R14,PENDWRIT @V305665 00277000
  278. SR R3,R3 CLEAR REGISTER @V305665 00278000
  279. STH R3,NUMPNDWR CLEAR PENDING WRITES @V305665 00279000
  280. LH R4,NUMFINRD GET READ BUFFERS @V305665 00280000
  281. LTR R4,R4 ARE THERE ANY? @V305665 00281000
  282. BZ CKPENRD BRANCH IF NOT, MAYBE NO @V305665 00282000
  283. L R5,FSTFINRD MAYBE YES @V305665 00283000
  284. CKFINRD EQU * @V305665 00284000
  285. LTR R1,R5 IS THERE A CHAIN? @V305665 00285000
  286. BZ CKPENRD BRANCH IF NOT @V305665 00286000
  287. L R5,0(,R4) GET NEXT AREA ADDRESS @V305665 00287000
  288. TM 4(R1),ATTN IS IT AN 'ATTN' BUFFER? @V305066 00288000
  289. BZ CKR4 BRANCH IF NOT @V305665 00289000
  290. LA R0,SEVTEEN FREE THE BUFFER @V305066 00290000
  291. DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR @V305665 00291000
  292. CKR4 EQU * @V305665 00292000
  293. BCT R4,CKFINRD LOOP IF MORE @V305665 00293000
  294. CKPENRD EQU * @V305665 00294000
  295. ST R3,FSTFINRD SET CONSTANTS TO ZERO @V305665 00295000
  296. ST R3,LSTFINRD @V305665 00296000
  297. STH R3,NUMFINRD @V305665 00297000
  298. L R5,PENDREAD GET PENDING READ ADDRESS @V305665 00298000
  299. LTR R1,R5 IS THERE ONE? @V305665 00299000
  300. BZ ENDES BRANCH IF NOT @V305665 00300000
  301. TM 4(R1),ATTN IS IT AN ATTENTION READ? @V305066 00301000
  302. BZ ENDES BRANCH IF NOT @V305665 00302000
  303. LA R0,SEVTEEN FREE THE BUFFER @V305066 00303000
  304. DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR @V305665 00304000
  305. ENDES EQU * @V305665 00305000
  306. ST R3,PENDREAD ZERO THIS FIELD, TOO @V305665 00306000
  307. SVC94RET EQU * 00307000
  308. LA R15,0 SET NORMAL RETURN CODE 00308000
  309. ST R15,EGPR15 STORE IN USER'S SAVE AREA 00309000
  310. LR R14,R4 RESET RETURN REG. 00310000
  311. BR R14 RETURN TO SVCINT AND USER 00311000
  312. EJECT 00312000
  313. AOSSVC DC A(DMSSVN) 00313000
  314. DS 0D 00314000
  315. TPUTFLG EQU X'80' TPUT-TGET FLAG, IF ON, TGET REQUEST 00315000
  316. MOVEBUF MVC 0(0,R6),0(R2) MOVE I/O READ V0022 00316000
  317. ATTN EQU X'40' ATTENTION BUFFER/READ @V305066 00317000
  318. SEVTEEN EQU 17 DOUBLEWORDS FREE/FRET @V305066 00318000
  319. CHARS EQU C'S' CHARACTER 'S' @VA07268 00319000
  320. CHARU EQU C'U' CHARACTER 'U' @VA07268 00320000
  321. * 00321000
  322. DCBD DSORG=(PS) 00322000
  323. CMSCB 00323000
  324. IO 00324000
  325. FSTB 00325000
  326. NUCON 00326000
  327. CMSAVE 00327000
  328. REGEQU 00328000
  329. EXTSECT @VM08901 00329000
  330. END 00330000