User Tools

Site Tools


cdc:nos2.source:nam5871:xchkabc

XCHKABC

Table Of Contents

  • [00008] PRGM XCHKABC
  • [00057] PROC MGETS
  • [00058] PROC XTRACE

Source Code

XCHKABC.txt
  1. *DECK XCHKABC
  2. USETEXT NIPDEF
  3. USETEXT FREETAB
  4. USETEXT PARAMP
  5. USETEXT PIT
  6. USETEXT PRUBUFF
  7. USETEXT SYSTIME
  8. PRGM XCHKABC ;
  9. STARTIMS ;
  10. #
  11. *1DC
  12. * 1. PROC NAME AUTHOR DATE
  13. * XCHKABC E. GEE 85/05/04
  14. *
  15. * 2. FUNCTIONAL DISCRIPTION:
  16. * ALLOCATE PRU BUFFERS FOR PIP.
  17. *
  18. * 3. METHOD USED:
  19. * LOOP CHECKING PIT ENTRY FOR EACH SIZE OF PRU BUFFER
  20. * IF BUFFERS NEEDED,
  21. * CALL MGETS TO ALLOCATE PRU BUFFER.
  22. * INITIALIZE PRU BUFFER.
  23. * LINK BUFFERS TOGETHER.
  24. *
  25. * 4. INPUT PARAMS:
  26. * PARAMP1 PIT ENTRY INDEX
  27. *
  28. * 5. EXIT PARAMS :
  29. * NONE.
  30. *
  31. * 6. COMMON DECKS AND SYMPL TEXTS USED.
  32. * NIPDEF CONSTANT DEFINITIONS
  33. * FREETAB FREE BUFFER TABLE
  34. * PARAMP BUFFER FOR PASSING PARAMS TO PRIMARY OVLS
  35. * PIT PIP INTERFACE TABLE TEMPLATE
  36. * PRUBUFF PRU BUFFER TEMPLATE
  37. * SYSTIME SYSTEM TIME TABLE
  38. *
  39. * 7. ROUTINES CALLED:
  40. * MGETS TO GET BUFFER.
  41. * XTRACE TRACE PROCEDURE CALL.
  42. *
  43. * 8. DAYFILE MESSAGES OR OTHER IMPORTANT INFORMATION.
  44. * THIS PROGRAM IS A PRIMARY OVERLAY LOADED BY SUBROUTINE
  45. * OVLCALL. WHEN EXECUTION HAS COMPLETED, A JUMP IS MADE TO
  46. * LOCATION RJMAIN TO RETURN TO THE CALLING PROGRAM.
  47. *
  48. * W A R N I N G - THIS PROGRAM CANNOT EXCEED THE PRIMARY
  49. * OVERLAY BUFFER SIZE MINUS 5 (560B WORDS).
  50. *
  51. * THIS OVERLAY IS CALLED BY XEXEC.
  52.  #
  53. STOPIMS;
  54.  
  55. XREF
  56. BEGIN
  57. PROC MGETS; # GET BUFFER #
  58. PROC XTRACE; # TRACE PROCEDURE CALL #
  59. LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
  60. END
  61. #
  62.   INTERNAL VARIABLES
  63. #
  64. ITEM BUFFER; # NEWLY ALLOCATED PRU BUFFER #
  65. ITEM FIRSTBUF; # ADDR OF FIRST BUF ALLOCATED #
  66. ITEM I; # INDUCTION VARIABLE #
  67. ITEM J; # INDUCTION VARIABLE #
  68. ITEM K; # INDUCTION VARIABLE #
  69. ITEM L; # INDUCTION VARIABLE #
  70. ITEM NUMALLOC; # NUMBER OF PRU BUFFERS ALLOCATD#
  71. ITEM TEMP1; # ADDR OF NEXT PRU BUF IN CHAIN #
  72. ITEM TMP; # FWA OF CIO BUFFER IN PRU BUF #
  73.  
  74. BASED ARRAY PRUNIPWD S(1); # TEMPLATE FOR NIP WORD IN PIT #
  75. BEGIN
  76. ITEM PRUNIPMFB U(0,00,06); # MINIMUM NO OF PRU BUFS #
  77. ITEM PRUNIPMAB U(0,06,06); # MAXIMUM NO OF PRU BUFS #
  78. ITEM PRUNIPNCA U(0,12,12); # CURRENT NO OF BUFFERS ASSIGNED#
  79. ITEM PRUNIPNC U(0,24,12); # CURRENT NO OF PRU CONNECTIONS #
  80. ITEM PRUNIPFPB U(0,42,18); # ADR OF FIRST BUF IN FREE CHAIN#
  81. END
  82.  
  83. BASED ARRAY PRUPIPWD S(1); # TEMPLATE FOR PIP WORD IN PIT #
  84. BEGIN
  85. ITEM PRUPIPNFB U(0,00,12); # NO OF BUFS IN FREE CHAIN #
  86. ITEM PRUPIPNRA U(0,12,12); # NO OF BUS NEEDED BY PIP #
  87. ITEM PRUPIPRPB U(0,42,18); # ADDR OF BUF TO RELEASE #
  88. END
  89.  
  90. #**********************************************************************#
  91. CONTROL EJECT;
  92.  
  93. BEGIN # BEGIN XCHKABC #
  94.  
  95. CONTROL IFEQ DEBUG,1;
  96. XTRACE("XCHKA");
  97. CONTROL FI;
  98.  
  99. #
  100.   CHECK EACH PIT ENTRY
  101. #
  102. FOR L = 1 STEP 1 UNTIL MAXPIP
  103. DO
  104. BEGIN
  105. P<PRUNIPWD> = LOC(PITW5[L])-1;
  106. P<PRUPIPWD> = LOC(PITW8[L])-1;
  107. #
  108.   CHECK EACH SIZE OF PRU BUFFER
  109. #
  110. FOR I = 1 STEP 1 UNTIL MAXPRU
  111. DO # PROCESS EACH SIZE OF PRU BUF #
  112. BEGIN
  113. J = PRUPIPNRA[I] - PRUNIPNCA[I]; # NO OF BUFFERS PIP NEEDS #
  114. IF PRUPIPNRA[I] GR PRUNIPMAB[I]
  115. THEN # PIP NEEDS MORE BUF THAN MAX #
  116. BEGIN
  117. J = PRUNIPMAB[I] - PRUNIPNCA[I]; # MAX NO THAT CAN BE ADDED #
  118. END
  119. IF J GR 0
  120. THEN # PRU BUFFERS NEED TO BE ALLOCAT#
  121. #
  122.   ALLOCATE PRU BUFFERS
  123. #
  124. BEGIN
  125. NUMALLOC = 0; # INITIALIZE NO OF BUFS ALLOCATD#
  126. TEMP1 = 0; # INIT ADDR OF PREV ALLOCATD BUF#
  127. FOR K = 1 STEP 1 WHILE K LQ J AND HRL EQ HRLV3
  128. DO # ALLOCATE PRU BUFFER #
  129. BEGIN
  130. NUMALLOC = NUMALLOC + 1; # INCREMENT NO OF BUFS ALLOCATED#
  131. MGETS(PBHSIZE + I*PRUSIZE + I,BUFFER,TRUE);
  132. # ALLOCATE BUFFER FOR EACH SIZE #
  133. # FOR 1 PRU BUFFER SIZE = 102 #
  134. # FOR 2 PRU BUFFER SIZE = 204 #
  135. # FOR 3 PRU BUFFER SIZE = 306 #
  136. #
  137.   SET UP PRU BUFFERS AND LINK TOGETHER
  138. #
  139. IF TEMP1 EQ 0
  140. THEN # THIS IS FIRST BUF ALLOCATED #
  141. BEGIN
  142. FIRSTBUF = BUFFER; # ADDR OF FIRST BUF ALLOCATED #
  143. END
  144. P<PRUBUFF> = BUFFER;
  145. PRUBID[0] = PRUBIDVALUE;
  146. PRUBPBS[0] = I - 1;
  147. PRUBTBA[0] = MSECS[0];
  148. PRUBUP[0] = TRUE; # SET USER PROCESSING BIT #
  149. PRUBEP[0] = TRUE; # SET ERROR PROCESSING BIT #
  150. PRUBFETL[0] = 2;
  151. TMP = P<PRUBUFF> + PBHSIZE - 1;
  152. PRUBFIRST[0] = TMP;
  153. PRUBIN[0] = TMP;
  154. PRUBOUT[0] = TMP;
  155. PRUBLIMIT[0] = P<PRUBUFF> + PRUBBS[0];
  156. PRUBDLFP[0] = TEMP1; # POINTER TO NEXT BUF IN CHAIN #
  157. TEMP1 = BUFFER;
  158. END
  159.  
  160. IF TEMP1 NQ 0
  161. THEN # AT LEAST ONE BUF WAS ALLOCATED#
  162. BEGIN
  163. P<PRUBUFF> = FIRSTBUF; # ADDR OF FIRST ALLOCATED BUF #
  164. PRUBDLFP[0] = PRUNIPFPB[I];# ADDR OF FIRST BUF IN CHAIN #
  165. PRUNIPFPB[I] = BUFFER; # ADDR OF NEW FIRST BUF IN CHAIN#
  166. PRUNIPNCA[I] = PRUNIPNCA[I] + NUMALLOC; # UPDATE PIT FIELD#
  167. END
  168. END
  169. END
  170. END
  171. GOTO RJMAIN ; # RETURN TO CALLING PROGRAM #
  172.  
  173. END # END XCHKABC #
  174. TERM
cdc/nos2.source/nam5871/xchkabc.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator