User Tools

Site Tools


cdc:nos2.source:nam5871:exreduc

EXREDUC

Table Of Contents

  • [00006] REDUCE TSB SIZE.

Source Code

EXREDUC.txt
  1. *DECK EXREDUC
  2. PROC EXREDUC( (REDSIZE), TSBN, FIFO, TSBADDR );
  3. BEGIN
  4. *IF DEF,IMS
  5. #
  6. ** EXREDUC - REDUCE TSB SIZE.
  7. *
  8. * M. E. VATCHER 81/03/16
  9. *
  10. * EXREDUC REMOVES EITHER THE UPPER OR LOWER ADDRESS PORTION OF
  11. * AN ASSIGNED TSB.
  12. *
  13. * PROC EXREDUC((REDSIZE),TSBN,FIFO,TSBADDR)
  14. *
  15. * ENTRY REDSIZE NUMBER OF WORDS TO RELEASE
  16. * TSBN TSB NUMBER OF TSB TO HAVE REDUCED SIZE
  17. * FIFO BOOLEAN INDICATING UPPER OR LOWER PORTION
  18. * OF TSB TO BE RELEASED
  19. *
  20. * EXIT TSBADDR FWA OF USER AREA OF NON-MOVABLE TSB
  21. *
  22. * METHOD
  23. *
  24. * IF SOMETHING IS WRONG WITH THE TSB NUMBER THEN SET TSBADDR = -1
  25. * AND RETURN. IF THE NUMBER OF WORDS TO REMOVE IS GREATER THAN
  26. * THE TSB LENGTH THEN SET TSBADDR TO -1 AND RETURN. OTHERWISE
  27. * IF NOT FIFO THEN MAKE A FREE TSB WITH THE HIGHER ADDRESS
  28. * PORTION OF THE TSB. IF FIFO THEN MAKE A FREE TSB WITH THE
  29. * LOWER ADDRESS PORTION OF THE TSB.
  30. *
  31. #
  32. *ENDIF
  33. CONTROL NOLIST; # TSBDEFS, TSBDATA, TSBBASE, CYBERDEFS #
  34. *CALL CYBERDEFS
  35. *CALL TSBDEFS
  36. *CALL TSBDATA
  37. *CALL TSBBASE
  38. CONTROL LIST;
  39.  
  40. XREF
  41. BEGIN
  42. PROC ABORT;
  43. PROC GIVETSB;
  44. END
  45.  
  46. ITEM FFWA U; # FWA OF NEW FREE TSB #
  47. ITEM FIFO B; #INDICATES WHICH PORTION OF TSB TO RELEASE#
  48. ITEM REDSIZE U; # NUMBER OF WORDS TO RELEASE #
  49. ITEM TSBADDR U; # FWA OF USER AREA OF NON-MOVABLE TSB #
  50. ITEM TSBN U; # TSB NUMBER OF TSB TO SHRINK #
  51. ITEM TSBSIZE U; # SIZE OF SHRUNK TSB #
  52.  
  53. IF ( NOT TBUSY[TSBN] ) OR ( TSBN GR LENGTH[0] )
  54. OR ( TSBN LQ 0 )
  55. THEN # TSBN IS ILLEGAL #
  56. BEGIN
  57. $BEGIN
  58. ABORT;
  59. $END
  60. TSBADDR = -1; # NEGATIVE ADDRESS INDICATES REJECT #
  61. TSBN = BADTSBN; # BAD TSBN ERROR CODE #
  62. RETURN; # ***** EXIT ***** #
  63.  
  64. END
  65. P<BTSBHDR> = TTSBFWA[TSBN];
  66. IF REDSIZE GQ BTSBL[0]
  67. THEN # AMOUNT TO RELEASE EXCEEDS TSB LENGTH #
  68. BEGIN
  69. $BEGIN
  70. ABORT;
  71. $END
  72. TSBADDR = -1; # NEGATIVE ADDRESS INDICATES REJECT #
  73. TSBN = BADSIZE; # BAD TSB SIZE ERROR CODE #
  74. RETURN; # ***** EXIT ***** #
  75.  
  76. END
  77. TSBSIZE = BTSBL[0] - REDSIZE; # SHRUNK TSB SIZE #
  78. IF NOT FIFO
  79. THEN # RELEASE HIGH ADDRESS PORTION #
  80. BEGIN
  81. FFWA = TTSBFWA[TSBN] + TSBSIZE; # FWA OF NEW FREE TSB #
  82. BNOTMOV[0] = TRUE; # SET NOT MOVABLE #
  83. BTSBL[0] = TSBSIZE; # SET NEW BUSY TSB LENGTH #
  84. P<FTSBHDR> = FFWA; # POINT TO AREA TO RELEASE #
  85. FHDRRSV[0] = 0;
  86. FPTSBL[0] = TSBSIZE;
  87. FTSBL[0] = REDSIZE; # PREPARE FOR CALL TO GIVETSB #
  88. P<BTSBHDR> = LOC(FTSBHDR) + REDSIZE; #POINT TO NEXT TSB #
  89. BPTSBL[0] = REDSIZE; # SET PREVIOUS TSB SIZE #
  90. GIVETSB(FFWA); # CONSOLIDATE FREE SPACE #
  91. END
  92. ELSE # RELEASE LOWER ADDRESS PORTION #
  93. BEGIN
  94. P<BTSBHDR> = TTSBFWA[TSBN] + REDSIZE; # FORMAT NEW BUSY HEADER #
  95. BBUSY[0] = TRUE;
  96. BNOTMOV[0] = TRUE; # SET NOT MOVABLE #
  97. BIDENT[0] = TSBN; # SET TSB NUMBER #
  98. BHDRRSV[0] = 0;
  99. BTSBL[0] = TSBSIZE; # SET TSB SIZE #
  100. BPTSBL[0] = REDSIZE; # SET PREVIOUS TSB SIZE #
  101. P<FTSBHDR> = TTSBFWA[TSBN]; # POINT TO NEW FREE TSB #
  102. TTSBFWA[TSBN] = TTSBFWA[TSBN] + REDSIZE;
  103. FTSBL[0] = REDSIZE; # PREPARE FOR CALL TO GIVETSB #
  104. FHDRRSV[0] = 0;
  105. P<BTSBHDR> = LOC(BTSBHDR) + BTSBL[0]; # POINT TO NEXT TSB #
  106. BPTSBL[0] = TSBSIZE; #SET PREVIOUS TSB LENGTH #
  107. GIVETSB(LOC(FTSBHDR)); # CONSOLIDATE FREE SPACE IF POSSIBLE #
  108. END
  109. TSBADDR = TTSBFWA[TSBN] + TSBHDRL; # FWA OF USER AREA #
  110. END TERM # EXREDUC #
cdc/nos2.source/nam5871/exreduc.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator