User Tools

Site Tools


cdc:nos2.source:nam5871:hpgetmm

HPGETMM

Table Of Contents

  • [00013] PROC HPGETMM

Source Code

HPGETMM.txt
  1. *DECK HPGETMM
  2. USETEXT NIPDEF
  3. USETEXT ACB
  4. USETEXT ACNT
  5. USETEXT APPSTAT
  6. USETEXT AHEADER
  7. USETEXT AWLNTRY
  8. USETEXT DBGBUF
  9. USETEXT DRHDR
  10. USETEXT GETMM
  11. USETEXT OVERLAY
  12. USETEXT PARAMS
  13. PROC HPGETMM;
  14. STARTIMS;
  15. #
  16. *1DC HPGETMM
  17. *
  18. * 1. PROC NAME AUTHOR DATE
  19. * HPGETMM E. GEE 85/05/01
  20. *
  21. * 2. FUNCTIONAL DESCRIPTION.
  22. * PROCESS AIP NETGETMM WORKLIST ENTRY
  23. *
  24. * 3. METHOD USED.
  25. * VALIDATE GETMM WORKLIST ENTRY.
  26. * IF NOT VALID,
  27. * CALL HLGLERR TO SEND ERR/LGL SUP MSG TO APP.
  28. * ELSE (VALID GETMM WORKLIST ENTRY),
  29. * SET UP INITIAL GETMM AWL ENTRY IN ACB.
  30. * IF DATA MESSAGES TO DELIVER,
  31. * CALL MGETS TO GET BUFFER FOR HOLDING DATA MESSAGES.
  32. * LOOP GETTING DATA MESSAGES UNTIL BUFFER FULL OR NO MORE.
  33. * CALL HGETDA TO GET DATA MESSAGE.
  34. * IF DATA MESSAGE IS TOO LARGE FOR BUFFER,
  35. * DISCONTINUE LOOP.
  36. * IF DATA MESSAGES WERE FOUND,
  37. * CREATE SCP FUNCTION LIST TO WRITE DATA BACK TO APP.
  38. * CALL HWRTDA TO WRITE DATA BACK TO APP.
  39. * UPDATE GETMM AWL ENTRY WITH DELIVERED DATA INFORMATION.
  40. *
  41. * 4. ENTRY PARAMETERS.
  42. * ACBADDR ACB ADDRESS
  43. * WLADDR NWL NETMM WORKLIST ENTRY ADDRESS
  44. *
  45. * 5. EXIT PARAMETERS.
  46. * DONE TRUE IF WORKLIST PROCESSING COMPLETED
  47. *
  48. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  49. * ACB APPLICATION CONTROL BLOCK
  50. * DBGBUF DEBUG TRACE BUFFER
  51. * MEM MEMORY LOCATION TEMPLATE
  52. * APPSTAT NETWORK WORKLIST PROCESSING TABLE
  53. * AT APPLICATION TABLE
  54. * AWLHEAD APPLICATION WORKLIST HEADER WORD
  55. * AWLNTRY APPLICATION WORKLIST ENTRY TEMPLATE
  56. * APPSTAT NETWORK WORKLIST PROCESSING TABLE
  57. * DRHDR BUFFER HEADER WORD TEMPLATE
  58. * FLIST SCP FUNCTION LIST TEMPLATE
  59. * GETMM GETMM WORKLIST TEMPLATE
  60. * NIPDEF CONSTANT DEFINITIONS
  61. *
  62. * 7. ROUTINES CALLED.
  63. * BDELINK DELINK DATA BLK FROM ACB/ACNB DATA RING
  64. * HBSMABH COMPUTE LENGTH OF SUP MSG
  65. * HGETDA GET DATA MESSAGE TO DELIVER
  66. * HLGLERR OVL ISSUE ERR/LGL SUPERVISORY MESSAGE
  67. * MGETS ALLOCATE EMPTY BUFFER
  68. * MRELS RELEASE BUFFER SPACE
  69. * OSCCALL ISSUE SCP FUNCTION
  70. * OSCHAPP SCHEDULE APPLICATION
  71. * XTRACE RECORD PROCEDURE CALLS
  72. *
  73. * 8. DAYFILE MESSAGES. NONE
  74. *
  75.  #
  76. STOPIMS;
  77. #
  78.   EXTERNAL VARIABLES
  79. #
  80. XREF PROC HGETDA; # GET DATA MESSAGE FOR DELIVERY #
  81. XREF PROC HWRTDA; # WRITE DATA TO APP FIELD LENGTH #
  82. XREF PROC MGETS; # GET BUFFER #
  83. XREF PROC MRELS; # RETURN BUFFER #
  84. XREF PROC OVLCALL; # LOAD AND EXECUTE OVERLAYS #
  85. XREF PROC XTRACE;
  86.  
  87. #
  88.   INTERNAL VARIABLES
  89. #
  90. ITEM ABHWD U; # WORD FOR SAVING ABH OF DELINKED MSGS #
  91. ITEM ACNBADR; # ADDRESS OF ACNB #
  92. ITEM ACNALN ; # APPLICATION LIST OR CONNECTION NUMBER #
  93. ITEM BUFADDR; # ADDR OF BUF FOR HOLDING DATA MSGS #
  94. ITEM BUFSIZE; # SIZE OF BUF SPECIFIED BY APP #
  95. ITEM FLSIZ; # SIZE OF SCP FUNCTION REQUEST #
  96. ITEM FOUND B; # TRUE IF DATA MSG DELINKED #
  97. ITEM LIST B; # LIST NUMBER SCAN FLAG #
  98. ITEM NDEL; # NUMBER OF DATA MSGS DELIVERED #
  99. ITEM NEXT; # ADDR OF NEXT FREE LOCATION IN BUFFER #
  100. ITEM NWDS; # NUMBER OF WORDS TO WRITE BACK TO APP #
  101. ITEM SIZE; # SIZE OF DELINKED DATA BLOCKS #
  102.  
  103. ARRAY FLW P(3); # ARRAY FOR ISSUING SCP CALL #
  104. BEGIN
  105. ITEM FLWRC U(00,00,06); # RETURN CODE FROM SCP CALL #
  106. ITEM FLWFP U(00,06,12); # NUMBER OF WORDS TO READ #
  107. ITEM FLWUCPA U(00,18,18); # UCP ADR FOR SF.WRITE SCP FUNC #
  108. ITEM FLWSCPA U(00,36,18); # SCP ADR FOR SF.WRITE SCP FUNC #
  109. ITEM FLWFC U(00,54,06); # SCP FUNCTION CODE #
  110. ITEM FLWCB U(00,59,01); # SCP FUNCTION COMPLETION BIT #
  111. ITEM FLWWD0 U(00,00,60) = [0]; # WORD 0 OF SCP FUNCTION BUFFER #
  112. ITEM FLWJSNWD U(01,00,60); # UCP JSN / EJT ORDINAL WORD #
  113. ITEM FLWXUCPA U(02,12,24); # UCP ADR FOR SF.XWRITE SCP FUNC#
  114. ITEM FLWXSCPA U(02,36,24); # SCP ADR FOR SF.XWRITE SCP FUNC#
  115. ITEM FLWWD2 U(02,00,60) = [0]; # WORD 2 OF SCP FUNCTION BUFFER #
  116. END
  117.  
  118. #**********************************************************************#
  119.  
  120. BEGIN
  121. CONTROL IFEQ DEBUG,1 ;
  122. XTRACE("HPGMM") ;
  123. CONTROL FI;
  124. DONE = FALSE; # ASSUME FUNC NOT COMPLTE UNLESS OTHERWISE#
  125. LIST = FALSE; # ASSUME NOT GETTING DATA FROM LIST #
  126. P<GETMM> = WLADDR; # WORKLIST ADDRESS #
  127. P<ACB> = ACBADDR; # ACB ADDRESS #
  128. P<ACNT> = ACBACNT[0] ;
  129. NDEL = 0;
  130. NWDS = 0;
  131. #
  132.   COPY NEEDED INFORMATION FROM GETMM WORKLIST ENTRY
  133. #
  134. BUFSIZE = GETMMSZ[0]; # SIZE OF APP MULTIPLE MSG BUFFER #
  135. ACNALN = GETMMACN[0]; # GET MULTIPLE MSGS CONNECTION NUMBER #
  136. IF ACNALN EQ 0
  137. THEN # GET MULTIPLE MSGS FROM LIST #
  138. BEGIN
  139. LIST = TRUE;
  140. ACNALN = GETMMALN[0]; # LIST NUMBER FOR GETTING MULTIPLE MSGS #
  141. END
  142. #
  143.   VALIDATE GETMM WORKLIST ENTRY
  144. #
  145. IF ( NOT LIST ) AND
  146. ( ( ACNALN GR ACNTHCN[0] ) OR # CONNECTION NO TOO LARGE #
  147. ( ACNALN LS ACNTMINACN[0] ) OR # CONNECTION NO TOO SMALL #
  148. ( ACNTACNB[ACNALN+ACNTHSIZE-ACNTMINACN[0]] EQ 0 ) )
  149. THEN # INVALID CON NUMBER WAS SPECIFIED #
  150. BEGIN
  151. PARAMS1 = RLG"ACN"; # REASON CODE FOR ERR/LGL SM #
  152. OVLNAME = HLGLERRP; # NAME OF OVERLAY TO LOAD #
  153. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  154. END
  155. ELSE # VALID CON NUMBER OR GETTING FROM LIST #
  156. BEGIN
  157. #
  158.   COPY NETGETMM WORKLIST ENTRY TO AWL
  159. #
  160. P<AWLENTRY> = LOC(ACBAWL2[0]);
  161. AWLEAIPH[0] = GETMMWD0[0]; # AIP OPCODE WORD #
  162. AWLEWD1[0] = GETMMWD1[0]; # SECOND WORD OF GETMM ENTRY #
  163. P<GETMM> = P<AWLENTRY>; # BASED ARRAY NOW POINTS TO AWL ENTRY #
  164. IF (BUFSIZE NQ 0) AND
  165. (ACBBLKSQ[0] NQ 0)
  166. THEN # THERE ARE DATA MSGS TO DELIVER #
  167. BEGIN
  168. MGETS(BUFSIZE+BLKHSIZE+1,BUFADDR,FALSE); # GET BUF FOR DATA #
  169.  
  170. P<DRHDRWD> = BUFADDR;
  171. BLKID[0] = MOUTIDVALUE;
  172. NEXT = BUFADDR + BLKHSIZE; # FWA TO WRITE DATA MESSAGE TO #
  173. #
  174.   GET DATA MESSAGES
  175. #
  176. FOUND = TRUE; # INITIALIZE FLAG TO DATA MSG FOUND #
  177. FOR ACNALN=ACNALN WHILE FOUND
  178. DO # LOOP UNTIL NO MORE MSGS OR BUF FULL #
  179. BEGIN
  180. SIZE = BUFSIZE - ABHSIZE; # NO OF WDS LEFT TO HOLD TEXT #
  181. HGETDA(NEXT,SIZE,ACNALN,LIST,ABHWD);
  182. P<AHEADER> = NEXT; # ADDR OF WORD TO HOLD ABH #
  183. ABHWORD[0] = ABHWD; # COPY ABH WORD TO BUFFER #
  184. IF (ABHWD EQ 0) OR # NO DATA MSG FOUND #
  185. (ABHIBU[0] NQ 0) # DATA MSG WAS NOT DELIVERABLE #
  186. THEN # DISCONTINUE LOOPING #
  187. BEGIN
  188. FOUND = FALSE;
  189. END
  190. ELSE # FOUND DATA MSG TO DELIVER #
  191. BEGIN
  192.  
  193. CONTROL IFEQ DEBUG,1;
  194. PNVALUE[0] = ACBAN[0]; # APPL. NUMBER #
  195. BGETW[BGETP] = PNWORD[0] ;
  196. BGETP = BGETP + 1 ;
  197. IF BGETP GR 999
  198. THEN
  199. BEGIN
  200. BGETP = 0;
  201. END
  202. P<TRAP> = NEXT;
  203. FOR TRAPINDEX = 0 STEP 1 UNTIL SIZE
  204. DO
  205. BEGIN
  206. BGETW[BGETP] = WORD[TRAPINDEX] ;
  207. BGETP = BGETP + 1;
  208. IF BGETP GR 999
  209. THEN
  210. BEGIN
  211. BGETP = 0;
  212. END
  213. END
  214. CONTROL FI;
  215.  
  216. NDEL = NDEL + 1;
  217. NWDS = NWDS + SIZE; # NO OF WORDS TO WRITE BACK #
  218. NEXT = NEXT + SIZE; # ADDR OF NEXT FREE WORD IN BUFFER #
  219. BUFSIZE = BUFSIZE - SIZE; # REMAINING SIZE OF BUFFER #
  220. END
  221. END
  222. IF NWDS NQ 0
  223. THEN # DATA MESSAGES TO WRITE BACK TO APP BUF #
  224. BEGIN
  225. #
  226.   CREATE SCP FUNCTION LIST TO WRITE MSGS BUFFER TO UCP FL
  227. #
  228. FLWFP[0] = NWDS; # NO OF WORDS TO WRITE TO UCP FL #
  229. FLWJSNWD[0] = ACBJNWD[0]; # JOB ID WORD #
  230. IF NWDS GR 64
  231. THEN # SCP WRITE FUNCTION USED TO WRITE MSGS #
  232. BEGIN
  233. FLSIZ = FLXSIZE; # SIZE OF SCP FUNCTION REQUEST #
  234. FLWXUCPA[0] = GETMMTA[0]; # AIP GETMM BUF ADDRESS #
  235. FLWXSCPA[0] = BUFADDR + BLKHSIZE; # ADDR OF FIRST SUP MSG#
  236. FLWFC[0] = SFXWRT;
  237. END
  238. ELSE # SCP EXTENDED WRITE FUNCTION MUST BE USED#
  239. BEGIN
  240. FLSIZ = FLSIZE; # SIZE OF SCP FUNCTION REQUEST #
  241. FLWUCPA[0] = GETMMTA[0]; # AIP GETMM BUF ADDRESS #
  242. FLWSCPA[0] = BUFADDR + BLKHSIZE; # ADDR OF FIRST SUP MSG #
  243. FLWFC[0] = SFWRITE;
  244. END
  245. HWRTDA(FLW,FLSIZ,BUFADDR);
  246. END
  247. ELSE # NO DATA MESSAGES TO WRITE TO APP FL #
  248. BEGIN
  249. MRELS(BUFADDR); # RELEASE GETMM BUFFER #
  250. DONE = TRUE;
  251. END
  252. END # BUFFER SIZE IS NOT ZERO #
  253. ELSE
  254. BEGIN
  255. DONE = TRUE; # SET FUNCTION-COMPLETED FLAG #
  256. END
  257. END
  258. #
  259.   FILL AWL NETGETMM ENTRY
  260. #
  261. GETMMND[0] = NDEL; # NO OF DATA MSGS WRITTEN TO UCP FL #
  262. GETMMCB[0] = 1; # SET WORKLIST ENTRY COMPLETION BIT #
  263. GETMMNW[0] = NWDS; # NO OF WDS WRITTEN TO AIP SUP MSG BUF #
  264. GETMMALN[0] = ACNALN ;
  265. RETURN;
  266. END
  267. TERM
cdc/nos2.source/nam5871/hpgetmm.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator