User Tools

Site Tools


cdc:nos2.source:nam5871:nprlb

Table of Contents

NPRLB

Table Of Contents

  • [00006] PRGM NPRLB
  • [00057] PROC ABORT
  • [00058] PROC MRELS
  • [00059] PROC OMSG
  • [00060] PROC XTRACE

Source Code

NPRLB.txt
  1. *DECK NPRLB
  2. USETEXT NIPDEF
  3. USETEXT PARAMS
  4. USETEXT PIT
  5. USETEXT PRUBUFF
  6. PRGM NPRLB;
  7. STARTIMS ;
  8. #
  9. *1DC
  10. * 1. PROC NAME AUTHOR DATE
  11. * NPRLB E. GEE 85/05/04
  12. *
  13. * 2. FUNCTIONAL DISCRIPTION.
  14. * RELEASE ALL FREE PRU BUFFERS BELONGING TO A PARTICULAR PIP
  15. * AND OF A PARTICULAR SIZE.
  16. *
  17. * 3. METHOD USED.
  18. * LOOP THROUGH PRU BUFFER FREE CHAIN RELEASING EACH PRU
  19. * BUFFER.
  20. *
  21. * 4. INPUT PARAMS.
  22. * PARAMS1 PRU BUFFER SIZE
  23. * PARAMS2 PIT ENTRY INDEX
  24. *
  25. * 5. EXIT PARAMS.
  26. * NONE.
  27. *
  28. * 6. COMMON DECKS AND SYMPL TEXTS USED.
  29. * NIPDEF CONSTANT DEFINITIONS
  30. * PARAMS BUFFER FOR PASSING PARAMS TO PRIMARY OVLS
  31. * PIT PIP INTERFACE TABLE TEMPLATE
  32. * PRUBUFF PRU BUFFER TEMPLATE
  33. *
  34. * 7. ROUTINES CALLED:
  35. * ABORT ABORT NIP
  36. * MRELS RETURN BUFFER TO FREE CHAIN
  37. * OMSG ISSUE DAYFILE MESSAGE
  38. * XTRACE TRACE PROCEDURE CALL.
  39. *
  40. * 8. DAYFILE MESSAGES OR OTHER IMPORTANT INFORMATION.
  41. *
  42. * * NPRLB - PRU BUFFERS NOT IN CHAIN. *
  43. *
  44. * THIS PROGRAM IS A SECONDARY 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 SECONDARY
  49. * OVERLAY BUFFER SIZE MINUS 5 (360B WORDS).
  50. *
  51. * THIS OVERLAY IS CALLED BY XCHKCET.
  52.  #
  53. STOPIMS;
  54.  
  55. XREF
  56. BEGIN
  57. PROC ABORT; # ABORT NIP #
  58. PROC MRELS; # RETURN BUFFER #
  59. PROC OMSG; # ISSUE DAYFILE MESSAGE #
  60. PROC XTRACE; # TRACE PROCEDURE CALL #
  61. LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
  62. END
  63. #
  64.   INTERNAL VARIABLES
  65. #
  66. ITEM I; # INDUCTION VARIABLE #
  67. ITEM TEMP1; # ADDR OF NEXT PRU BUF IN CHAIN #
  68.  
  69. ARRAY ABTMSG S(4); # ABORT NIP DAYFILE MESSAGE #
  70. BEGIN
  71. ITEM ABTMSG1 C(0,00,34)=[" NPRLB - PRU BUFFERS NOT IN CHAIN."];
  72. ITEM ABTMSGE U(3,24,36)=[0];
  73. END
  74.  
  75. BASED ARRAY PRUNIPWD S(1); # TEMPLATE FOR NIP WORD IN PIT #
  76. BEGIN
  77. ITEM PRUNIPMFB U(0,00,06); # MINIMUM NO OF PRU BUFS #
  78. ITEM PRUNIPMAB U(0,06,06); # MAXIMUM NO OF PRU BUFS #
  79. ITEM PRUNIPNCA U(0,12,12); # CURRENT NO OF BUFFERS ASSIGNED#
  80. ITEM PRUNIPNC U(0,24,12); # CURRENT NO OF PRU CONNECTIONS #
  81. ITEM PRUNIPFPB U(0,42,18); # ADR OF FIRST BUF IN FREE CHAIN#
  82. END
  83.  
  84. #**********************************************************************#
  85. CONTROL EJECT;
  86.  
  87. BEGIN # BEGIN NPRLB #
  88.  
  89. CONTROL IFEQ DEBUG,1;
  90. XTRACE("NPRLB");
  91. CONTROL FI;
  92. P<PRUNIPWD> = LOC(PITW5[PARAMS2]) - 1;
  93. #
  94.   RELEASE ALL BUFFERS OF SIZE PARAMS1 AND LARGER
  95. #
  96. FOR I = PARAMS1 STEP 1 UNTIL MAXPRU
  97. DO # RELEASE ALL PRU BUFS IN CHAIN #
  98. BEGIN
  99. P<PRUBUFF> = PRUNIPFPB[I]; # FIRST BUFFER IN CHAIN #
  100. TEMP1 = PRUBDLFP[0]; # ADDR OF NEXT BUFFER IN CHAIN #
  101. #
  102.   RELEASE ALL BUFFERS IN FREE CHAIN
  103. #
  104. FOR I=I WHILE P<PRUBUFF> NQ 0
  105. DO # RELEASE UNTIL END OF CHAIN #
  106. BEGIN
  107. MRELS(P<PRUBUFF>); # RELEASE THIS BUFFER #
  108. PRUNIPNCA[I] = PRUNIPNCA[I] - 1; # DECRE NO OF PRU BUFFERS #
  109. P<PRUBUFF> = TEMP1; # ADDR OF NEXT BUFFER IN CHAIN #
  110. TEMP1 = PRUBDLFP[0]; # ADDR OF NEW NEXT BUF IN CHAIN #
  111. END
  112. IF PRUNIPNCA[I] EQ 0
  113. THEN # RELEASED LAST BUFFER #
  114. BEGIN
  115. PRUNIPFPB[I] = 0; # CLEAR BUFFER POINTER #
  116. END
  117. ELSE # NOT ALL PRU BUFFERS IN CHAIN #
  118. BEGIN
  119. OMSG(ABTMSG,0); # ISSUE DAYFILE MESSAGE #
  120. ABORT(0,0); # ABORT NIP #
  121. END
  122. END
  123. GOTO RJMAIN; # RETURN TO CALLING PROGRAM #
  124.  
  125. END # END NPRLB #
  126. TERM
cdc/nos2.source/nam5871/nprlb.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator