User Tools

Site Tools


cdc:nos2.source:nam5871:hpgetsm

HPGETSM

Table Of Contents

  • [00009] PROC HPGETSM

Source Code

HPGETSM.txt
  1. *DECK HPGETSM
  2. USETEXT NIPDEF
  3. USETEXT ACB
  4. USETEXT APPSTAT
  5. USETEXT DBGBUF
  6. USETEXT FREETAB
  7. USETEXT GETSM
  8. USETEXT MEM
  9. PROC HPGETSM; # GET SUPERVISORY MESSAGES #
  10. STARTIMS;
  11. #
  12. *1DC HPGETSM
  13. *
  14. * 1. PROC NAME AUTHOR DATE
  15. * HPGETSM E. GEE 78/01/25
  16. *
  17. * 2. FUNCTIONAL DESCRIPTION.
  18. * PROCESS AIP NETGSM WORKLIST ENTRY
  19. *
  20. * 3. METHOD USED.
  21. * IF NO ROOM, THEN AIP SENT BAD WORKLIST SO ABORT APP
  22. * COPY NETGSM WORKLIST ENTRY TO ACB
  23. * GET BUFFER TO HOLD SCP FUNCTION LIST AND SUP MSGS
  24. * CREATE SCP FUNCTION LIST TO WRITE SUP MSGS TO AIP SUP MSG BUF
  25. * DELINK SUP MSGS FROM ACB AND COPY TO NIP SUP MSG BUFFER
  26. * ISSUE SCP FUNCTION TO WRITE SMS TO AIP SM BUFFER
  27. * PROCESS SCP FUNCTION RETURN CODE
  28. * UPDATE FIELDS IN ACB NETGSM ENTRY
  29. *
  30. * 4. ENTRY PARAMETERS.
  31. * ACBADDR ACB ADDRESS
  32. * WLADDR NWL NETGSM WORKLIST ENTRY ADDRESS
  33. *
  34. * 5. EXIT PARAMETERS.
  35. * ABTAPPF ABORT FLG SET IF NO ROOM IN AWL FOR NETGSM
  36. * ENTRY OR NIP GOT SCP RC = RCUCPAOOR
  37. * DONE SET FALSE IF SUP MSGS NOT SENT TO APP FOR
  38. * REASON OTHER THAN NIP DID NOT HAVE ANY TO
  39. * SEND
  40. * FAILADR FAIL FLG SET IF NIP GOT SCP RC = RCUCPGONE
  41. *
  42. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  43. * ACB APPSTAT
  44. * DBGBUF FREETAB
  45. * GETSM MEM NIPDEF
  46. *
  47. * 7. ROUTINES CALLED.
  48. * BDELINK DELINK DATA BLK FROM ACB/ACNB DATA RING
  49. * HBSMABH COMPUTE LENGTH OF SUP MSG
  50. * HWRTDA WRITE DATA TO APP FIELD LENGTH
  51. * MGETS ALLOCATE EMPTY BUFFER
  52. * MRELS RELEASE BUFFER SPACE
  53. * OMOVE COPY INFORMATION
  54. * XTRACE RECORD PROCEDURE CALLS
  55. *
  56. * 8. DAYFILE MESSAGES. NONE
  57. *
  58.  #
  59. STOPIMS;
  60. #
  61.   EXTERNAL VARIABLES
  62. #
  63. XREF PROC BDELINK; # DELINK DATA BLK FROM DATA RING #
  64. XREF PROC HBSMABH; # BUILD NEW SUP MSG APPLICATION BLK HDR #
  65. XREF PROC HWRTDA; # WRITE DATA TO APP FIELD LENGTH #
  66. XREF PROC MGETS; # ALLOCATE BUFFER SPACE #
  67. XREF PROC MRELS; # ERLEASE BUFFER SPACE #
  68. XREF PROC OMOVE; # COPY INFORMATION #
  69. XREF PROC XTRACE;
  70. #
  71.   INTERNAL VARIABLES
  72. #
  73. ARRAY FLW P(2); # ARRAY FOR ISSUING SCP CALL #
  74. BEGIN
  75. ITEM FLWRC U(00,00,06); # RETURN CODE FROM SCP CALL #
  76. ITEM FLWFP U(00,06,12); # NUMBER OF WORDS TO WRITE #
  77. ITEM FLWUCPA U(00,18,18); # UCP ADR FOR SF.WRITE SCP FUNC #
  78. ITEM FLWSCPA U(00,36,18); # SCP ADR FOR SF.WRITE SCP FUNC #
  79. ITEM FLWFC U(00,54,06); # SCP FUNCTION CODE #
  80. ITEM FLWCB U(00,59,01); # SCP FUNCTION COMPLETION BIT #
  81. ITEM FLWWD0 U(00,00,60) = [0]; # WORD 0 OF SCP FUNCTION BUFFER #
  82. ITEM FLWJSNWD U(01,00,60); # UCP JSN / EJT ORDINAL WORD #
  83. END
  84.  
  85. ITEM BLKADDR;
  86. ITEM BUFADDR; # ADDR OF BUFFER FOR SUP MSG #
  87. ITEM BUFSIZE; # NO OF EMPTY WORDS REMAINING IN SM BUF #
  88. ITEM NDEL; # NO OF SUP MSGS WRITTEN TO AIP-S SM BUF #
  89. ITEM NEXT; # ADDR OF NEXT EMPTY WORD IN SUP MSG BUF #
  90. ITEM NEXTLEN; # LENGTH OF NEXT SUP MSG TO BE DELIVERED #
  91. ITEM NWDS; # NO OF WORDS WRITTEN TO AIP-S SUP MSG BUF#
  92. #**********************************************************************#
  93. BEGIN
  94. CONTROL IFEQ DEBUG,1 ;
  95. XTRACE("HPGSM") ;
  96. CONTROL FI;
  97. DONE = FALSE; # ASSUME FUNC NOT COMPLTE UNLESS OTHERWISE#
  98. P<GETSM> = WLADDR; # WORKLIST ADDRESS #
  99. P<ACB> = ACBADDR; # ACB ADDRESS #
  100. #
  101.   COPY NEEDED INFORMATION FROM GETSM WORKLIST ENTRY
  102. #
  103. BUFSIZE = GETSMLE[0]; # NO OF EMPTY WORD IN AIP-S SUP MSG BUF #
  104. IF BUFSIZE GR 64
  105. THEN # SUP MSG BUFFER IS TOO BIG #
  106. BUFSIZE = 64; # SO REDUCE IT TO MAXIMUM SIZE #
  107. NEXTLEN = 0; # LENGTH OF NEXT SUP MSG TO BE DELIVERED #
  108. NDEL = 0; # NO OF SUP MSGS WRITTEN TO AIP-S SM BUF #
  109. NWDS = 0; # NO OF WORDS WRITTEN TO AIP-S SUP MSG BUF#
  110. #
  111.   COPY NETGETSM WORKLIST ENTRY TO AWL
  112. #
  113. ACBAWL4[0] = GETSMWD0[0]; # AIP OPCODE WORD #
  114. ACBAWL5[0] = GETSMWD1[0]; # SECOND WORD OF GETSM ENTRY #
  115. P<GETSM> = LOC(ACBAWL4[0]); # BASED ARRAY NOW POINTS TO AWL ENT#
  116. IF ACBDRFP[0] NQ 0 AND BUFSIZE NQ 0
  117. THEN # THERE ARE SUP MSGS TO SEND TO APP #
  118. BEGIN
  119. #
  120.   GET BUFFER FOR HOLDING SUPERVISORY MESSAGES
  121. #
  122. MGETS(BUFSIZE+BLKHSIZE,BUFADDR,FALSE);
  123. #
  124.   CREATE SCP FUNCTION LIST TO WRITE SUP MSGS TO UCP FL
  125. #
  126. FLWWD0[0] = 0; # INITIALIZE SCP FUNCTION CODE WD #
  127. FLWUCPA[0] = GETSMTA[0]; # AIP SUP MSG BUF ADDRESS #
  128. FLWSCPA[0] = BUFADDR + BLKHSIZE; # ADDR OF FIRST SUP MSG #
  129. FLWJSNWD[0] = ACBJNWD[0]; # JOB ID WORD #
  130. #
  131.   SET UP NIP SUPERVISOR MESSAGE BUFFER
  132. #
  133. NEXT = BUFADDR + BLKHSIZE; # SUP MSG BUFFER FREE WD PTR #
  134. HBSMABH(NEXTLEN);
  135. BUFSIZE = BUFSIZE - 1; # REDUCE AVAIL SPACE FOR ZERO WORD #
  136. #
  137.   FILL SUPERVISOR MESSAGE BUFFER
  138. #
  139. FOR NEXT=NEXT WHILE NEXTLEN LQ BUFSIZE
  140. AND ACBDRFP[0] NQ 0 DO
  141. BEGIN
  142. BDELINK(ACBADDR,BLKADDR,0);
  143. #
  144.   COPY SUPERVISOR MESSAGE TO SUPERVISOR MESSAGE BUFFER
  145. #
  146. MOLD = BLKADDR + BLKHSIZE;
  147. MNEW = NEXT;
  148. MSIZE = NEXTLEN;
  149. OMOVE;
  150. NEXT = NEXT + NEXTLEN;
  151. MRELS(BLKADDR); # RELEASE DATA BLOCK #
  152. BUFSIZE = BUFSIZE - NEXTLEN; # UPDATE SIZE REMAINING #
  153. NWDS = NWDS + NEXTLEN; # UPDATE COUNT OF WDS TO DELIVER#
  154. NDEL = NDEL + 1; # UPDATE COUNT OF NO OF SUP MSGS #
  155. IF ACBDRFP[0] EQ 0
  156. THEN # NO MORE SUP MSGS AVAILABLE #
  157. BEGIN
  158. NEXTLEN = 0;
  159. ACBERCNT[0] = 0; # CLEAR LOGICAL ERROR COUNT #
  160. END
  161. ELSE
  162. HBSMABH(NEXTLEN);
  163. END
  164.  
  165. CONTROL IFEQ DEBUG,1;
  166. PNVALUE[0] = ACBAN[0];# APPLICATION PROCESS NUMBER #
  167. BGETSMW[BGETSMP] = PNWORD[0]; # STORE PN IN DEBUG BUFFER #
  168. BGETSMP = BGETSMP + 1; # INCREMENT BUFFER OFFSET PTR #
  169. IF BGETSMP GR 999
  170. THEN # END OF BUFFER HAS BEEN REACHED #
  171. BGETSMP = 0; # INITIALIZE OFFSET PTR TO BEG OF BUFFER #
  172.  
  173. # COPY SUPERVISOR MESSAGES TO DEBUG BUFFER #
  174. P<TRAP> = BUFADDR; # ADDR OF SUP MSG BUFFER #
  175. FOR TRAPINDEX = 1 STEP 1 UNTIL NWDS DO
  176. BEGIN
  177. BGETSMW[BGETSMP] = WORD[TRAPINDEX];
  178. BGETSMP = BGETSMP + 1; # INCREMENT BUFFER OFFSET PTR #
  179. IF BGETSMP GR 999
  180. THEN # END OF BUFFER HAS BEEN REACHED #
  181. BGETSMP = 0; # INITIALIZE OFFSET PTR TO BEG OF BUFFER#
  182. END
  183. CONTROL FI;
  184.  
  185.  
  186. MEMORY[NEXT] = 0;# ZERO WORD AT END OF THE BUFFER #
  187. FLWFC[0] = SFWRITE; # SCP WRITE FUNCTION CODE #
  188. FLWFP[0] = NWDS + 1; # NO OF WORDS TO WRITE TO UCP FL #
  189. HWRTDA(FLW,FLSIZE,BUFADDR);
  190. END
  191. ELSE # NO SUP MSGS TO SEND TO APP #
  192. DONE = TRUE; # SET FUNCTION-COMPLETED FLAG #
  193.  
  194. #
  195.   FILL AWL NETGETSM ENTRY
  196. #
  197. GETSMND[0] = NDEL; # NO OF SUP MSGS WRITTEN TO UCP FL #
  198. GETSMCB[0] = 1; # SET WORKLIST ENTRY COMPLETION BIT #
  199. IF NEXTLEN EQ 0
  200. THEN # THERE ARE NO MORE SUP MSGS IN DATA RING #
  201. GETSMNL[0] = 0; # LENGTH OF NEXT SUP MSG FIELD #
  202. ELSE # THERE ARE MORE SUP MSGS IN DATA RING #
  203. GETSMNL[0] = NEXTLEN+1; # LENGTH+1 OF NEXT SUP MSG IN D R #
  204. GETSMNW[0] = NWDS; # NO OF WDS WRITTEN TO AIP SUP MSG BUF #
  205. END
  206. TERM
cdc/nos2.source/nam5871/hpgetsm.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator