User Tools

Site Tools


cdc:nos2.source:nam5871:exrqtsb

EXRQTSB

Table Of Contents

Source Code

EXRQTSB.txt
  1. *DECK EXRQTSB
  2. PROC REQTSB ( (TSBSIZE), TSBADDR , TSBN );
  3. BEGIN # REQTSB #
  4. *IF DEF,IMS
  5. #
  6. **
  7. *
  8. * 1. PROC NAME AUTHOR DATE
  9. * REQTSB M. D. PICKARD 76/11/20
  10. *
  11. * 2. FUNCTIONAL DESCRIPTION
  12. * REQTSB WILL ASSIGN A TASK SEQUENCE BLOCK (TSB) OF THE
  13. * REQUESTED SIZE AS A FIXED POSITION BLOCK.
  14. *
  15. * 3. METHOD USED
  16. * THE VALIDITY OF THE CALLING PARAMETERS IS CHECKED. GETTSBN
  17. * IS CALLED TO GET AN ENTRY IN THE TSBIT TO BE USED FOR THIS
  18. * BLOCK, THIS ALSO ASSIGNS A TSBN. GETTSB IS CALLED TO FIND A
  19. * BLOCK AND RESERVE IT. OVENTER IS CALLED TO ADD THE TIME-OUT
  20. * OVERLAY TO THE OEL, IF NECESSARY. THE ADDRESS AND IDENT ARE
  21. * RETURNED TO THE USER.
  22. *
  23. * 4. ENTRY PARAMETERS
  24. * TSBSIZE (FORMAL) SIZE OF TSB BEING REQUESTED
  25. * MUST BE GREATER THAN ZERO AND LESS
  26. * THAN MAXTSBL
  27. *
  28. * 5. EXIT PARAMETERS
  29. * TSBADDR (FORMAL) ADDRESS OF BLOCK ASSIGNED, RETURNED TO
  30. * USER. IF NEGATIVE, THE REQUEST WAS
  31. * REJECTED, THE ERROR CODE WILL BE IN TSBN
  32. * TSBN (FORMAL) TSB NUMBER, BLOCK IDENTIFIER. IF TSBADDR
  33. * IS NEGATIVE, THEN A REQUEST ERROR CODE
  34. * IS HERE
  35. * BADSIZE, ILLEGAL TSB SIZE
  36. * BADTO, ILLEGAL TO
  37. *
  38. * 6. COMDECKS USED
  39. * TSBBASE TSB MANAGER BASED ARRAY DEFINITIONS
  40. * TSBDATA TSB MANAGER DATA AREA DEFINITIONS
  41. * TSBDEFS TSB MANAGER SYMPL DEFS
  42. * CYBERDEFS CYBER DEPENDENT VALUES
  43. *
  44. * 7. ROUTINES CALLED
  45. * GETTSB GETS A TSB
  46. * GETTSBN GETS TSBN AND ENTRY IN TSBIT
  47. *
  48. * 8. DAYFILE MESSAGES
  49. * NONE.
  50. *
  51. #
  52. *ENDIF
  53. *CALL CYBERDEFS
  54. *CALL TSBDEFS
  55. *CALL TSBBASE
  56. ITEM
  57. TSBSIZE U, # SIZE OF BLOCK BEING REQUESTED #
  58. TSBADDR U, # ADDRESS OF ASSIGNED BLOCK #
  59. TSBN U; # TSB IDENTIFIER #
  60. XREF
  61. BEGIN
  62. PROC GETTSB;
  63. END
  64. *CALL TSBDATA
  65. XREF PROC ABORT;
  66. ITEM
  67. RETFWA U, # USED AS PARAMETER TO PASS TO GETTSB #
  68. SIZE U, # USED AS PARAMETER TO PASS TO GETTSB #
  69. TEMP U, # TEMPORY UNSIGNED INTEGER #
  70. TEMPB B; # TEMPORARY BOOLEAN #
  71. CONTROL EJECT;
  72. PROC GETTSBN ( TSBN );
  73. BEGIN # GETTSBN #
  74. *IF DEF,IMS
  75. #
  76. **
  77. *
  78. * 1. PROC NAME AUTHOR DATE
  79. * GETTSBN M. D. PICKARD 76/11/23
  80. *
  81. * 2. FUNCTIONAL DESCRIPTION
  82. * GETTSBN WILL ASSIGN A POSITION IN THE TSB INFORMATION TABLE
  83. * (TSBIT), THE ORDINAL OF THE POSITION IS THE TSBN. GETTSBN
  84. * WILL INCREASE THE SIZE OF THE TSBIT AS NEEDED.
  85. *
  86. * 3. METHOD USED
  87. * IF THERE ARE AVAILABLE ENTRIES, ASSIGN LOWEST VALUE IN
  88. * CHAIN OF AVAILABLE ENTRIES. IF NOT, GET ANOTHER TSB, MOVE
  89. * THE DATA, BUILD THE CHAIN OF NEW AVAILABLE ENTRIES, ASSIGN
  90. * THE LOWEST VALUE AVAILABLE ENTRY.
  91. *
  92. * 4. ENTRY PARAMETERS
  93. * TSBIT (TSBMGR GLOBAL) BASED ARRAY IS SET TO TSB CONTAINING
  94. * TSBIT, TSB IS NOT MOVEABLE
  95. *
  96. * 5. EXIT CONDITIONS
  97. * TSBN ORDINAL IN TSBIT ASSIGNED, IDENTIFIES
  98. * BLOCK TO USER AND TSBMGR
  99. *
  100. * 6. COMDECKS CALLED
  101. * NONE.
  102. *
  103. * 7. ROUTINES CALLED
  104. * GETTSB GET A TSB FROM FREE SPACE
  105. * GIVETSB GIVES BACK A TSB
  106. * MOVEI MOVES CENTRAL MEMORY WORDS IN BLOCK
  107. *
  108. * 8. DAYFILE MESSAGES
  109. * NONE.
  110. *
  111. #
  112. *ENDIF
  113. ITEM
  114. TSBN U; # TSB NUMBER/IDENT ASSIGNED AND RETURNED #
  115. XREF
  116. BEGIN
  117. PROC GIVETSB;
  118. PROC MOVEI;
  119. END
  120. ITEM
  121. ADDRESS U, # ADDRESS PASSED TO MOVECM #
  122. DONE B, # COMPLETE FLAG #
  123. I U, # LOOP INDUCTION VARIABLE #
  124. J U, # LOOP INDUCTION VARIABLE #
  125. IDENT U, # IDENT FOR GETTSB REQUEST #
  126. SIZE U; # SIZE FOR GETTSB REQUEST #
  127. DONE = FALSE;
  128. FOR I=0 WHILE NOT DONE DO
  129. BEGIN # ASSIGN A TSBN #
  130. IF NUMFREE[0] NQ 0
  131. THEN # THERE IS A ENTRY TO ASSIGN #
  132. BEGIN
  133. NUMFREE[0] = NUMFREE[0] - 1; # DECREASE NUMBER OF FREE ENT. #
  134. TSBN = LOWFREE[0]; # ASSIGN LOWEST FREE TSBN #
  135. LOWFREE[0] = FWDPTR[LOWFREE[0]]; # ASSIGN NEW LOWEST FREE #
  136. TBUSY[TSBN] = TRUE; # SET ENTRY BUSY #
  137. FWDPTR[TSBN] = 0; # CLEAR FORWARD POINTER IN ASSIGNED ENT. #
  138. DONE = TRUE; # SET COMPLETE FLAG #
  139. END
  140. ELSE # GET SOME MORE SPACE #
  141. BEGIN
  142. SIZE = LENGTH[0] + TSBITL + TSBHDRL; # NEW SIZE OF TSBIT TSB #
  143. IDENT = 1; # TSBIT PERMANENT IDENT #
  144. GETTSB(SIZE,IDENT,ADDRESS); # GET A TSB OF NEW LENGTH #
  145. TTSBFWA[1] = ADDRESS; # SET NEW ADDRESS IN TSBIT #
  146. MOVEI(LENGTH[0],LOC(TSBIT),ADDRESS+TSBHDRL); # MOVE TSBIT #
  147. GIVETSB(LOC(TSBIT) - TSBHDRL); # GIVE BACK OLD TSB FOR TSBIT #
  148. P<TSBIT> = ADDRESS + TSBHDRL; # RESET TSBIT BASED ARRAY #
  149. NUMFREE[0] = TSBITL; # NUMBER OF FREE ENTRIES NOW #
  150. LOWFREE[0] = LENGTH[0]; # NEW LOWEST FREE ORDINAL #
  151. FOR J = LENGTH[0] STEP 1 UNTIL (SIZE - 1 - TSBHDRL) DO
  152. BEGIN # SET UP NEW PART OF TSBIT #
  153. TBUSY[J] = FALSE; # SET FREE #
  154. FWDPTR[J] = J + 1; # SET FORWARD POINTER FOR FREE CHAIN #
  155. END
  156. FWDPTR[SIZE - 1 - TSBHDRL] = 0; # SET END OF CHAIN POINTER #
  157. LENGTH[0] = SIZE - TSBHDRL; # SET NEW SIZE OF TSBIT IN HEADER#
  158. P<BTSBHDR> = TTSBFWA[1]; # TSBIT TSB FIRST WORD ADDRESS #
  159. BNOTMOV[0] = FALSE; # MAKE TSBIT MOVEABLE #
  160. END
  161. END
  162. RETURN;
  163. END # GETTSBN #
  164. CONTROL EJECT; # *** REQTSB CODE STARTS HERE #
  165. IF (TSBSIZE LQ 0) OR (TSBSIZE GR MAXTSBL)
  166. THEN # BAD REQUEST SIZE #
  167. BEGIN
  168. $BEGIN
  169. ABORT;
  170. $END
  171. TSBADDR = -1; # NEGATIVE ADDRESS INDICATES REJECT #
  172. TSBN = BADSIZE; # ILLEGAL SIZE SPECIFIED ERROR CODE #
  173. RETURN; # ***** EXIT ***** #
  174.  
  175. END
  176. GETTSBN(TEMP); # GET A TSB IDENTIFIER #
  177. TSBN = TEMP; # SET TSB NUMBER FOR USER #
  178. SIZE = TSBSIZE + TSBHDRL; # REAL SIZE OF BLOCK WANTED #
  179. GETTSB(SIZE,TEMP,RETFWA); # GET THE BLOCK #
  180. TTSBFWA[TEMP] = RETFWA; # SET ADDRESS OF TSB IN TSBIT #
  181. TSBADDR = RETFWA + TSBHDRL; # ADDRESS OF USER AREA #
  182. END TERM # REQTSB #
cdc/nos2.source/nam5871/exrqtsb.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator