User Tools

Site Tools


cdc:nos2.source:nam5871:hhir

Table of Contents

HHIR

Table Of Contents

  • [00015] PROC HHIR
  • [00090] PROC HWLP
  • [00091] PROC MGETS
  • [00092] PROC MRELS
  • [00093] PROC OSCHAPP
  • [00094] PROC OTIME
  • [00095] PROC OVLCALL
  • [00096] PROC HGETNWL
  • [00097] PROC XRECALL
  • [00098] PROC XTRACE

Source Code

HHIR.txt
  1. *DECK HHIR
  2. USETEXT NIPDEF
  3. USETEXT ACB
  4. USETEXT APPSTAT
  5. USETEXT AT
  6. USETEXT DRHDR
  7. USETEXT FREETAB
  8. USETEXT NWLHEAD
  9. USETEXT NWLNTRY
  10. USETEXT OVERLAY
  11. USETEXT PT
  12. USETEXT STATTAB
  13. USETEXT SYSCOMD
  14. USETEXT SWAPIN
  15. PROC HHIR; # HOST INTERFACE ROUTINE #
  16. STARTIMS;
  17. #
  18. *1DC HHIR
  19. *
  20. * 1. PROC NAME AUTHOR DATE
  21. * HHIR E. GEE 78/02/07
  22. *
  23. * 2. FUNCTIONAL DESCRIPTION.
  24. * THIS ROUTINE IS THE TOP LEVEL HOST-SIDE PROCESSING ROUTINE. ALL
  25. * PROCESSING NEEDED TO HANDLE CPU PROGRAM ACCESS TO THE NETWORK
  26. * IS INITIATED FROM HERE.
  27. *
  28. * 3. METHOD USED.
  29. * CHECK TO SEE IF THERE IS WORK TO DO. I.E. GET NWL BUFFER OR
  30. * PROCESS WORKLIST FROM OPERATING SYSTEM
  31. * IF NOTHING TO DO, GO INTO RECALL AND RETURN
  32. * GET SECOND NWL BUFFER
  33. * UNLESS ALREADY HAVE ONE, SO ONLY TWO WORKLISTS PROCESSED
  34. * OR UNLESS IN SHUTDOWN MODE AND THERE IS NO OTHER WORKLIST
  35. * SO THAT ONLY ONE WORKLIST IS PROCESSED DURING SHUTDOWN
  36. * IF NIP HAS A WORKLIST TO PROCESS, EXECUTE THE FOLLOWING
  37. * STEPS:
  38. * IF SECOND NWL EXISTS AND NOT IN SHUTDOWN, RESET
  39. * RA.SSC TO POINT TO SECOND NWL
  40. * SO OPERATING SYSTEM CAN SEND ANOTHER WORKLIST FOR NIP
  41. * TO PROCESS WHILE NIP IS PROCESSING FIRST ONE
  42. * IF NETOFF WORKLIST, CALL HPNOFF TO PROCESS IT
  43. * IF NETON WORKLIST, CALL HPNON TO PROCESS IT
  44. * IF NORMAL WORKLIST, VERIFY WORKLIST IS OKAY, SET FIELDS
  45. * IN ACB, AND CALL HWLP TO PROCESS THE WORKLIST
  46. * IF APPLICATION IS TO BE ABORTED, CALL XABTAPP TO DO IT
  47. * IF APPLICATION HAS FAILED, CALL HAPFAIL TO PROCESS IT
  48. * GET NEW NWL UNLESS IN SHUTDOWN MODE.
  49. * SWITCH NWL PTR WITH SECOND NWL PTR
  50. * SO NEXT NWL TO BE PROCESSED IS OLDER ONE
  51. * SET UP RA.SSC IF NOT PREVIOUSLY DONE
  52. *
  53. * 4. ENTRY PARAMETERS.
  54. * NWLADDR BUFFER TO HOLD SCP REQUEST
  55. * NWLPN PROCESS NUMBER OF APPLICATION AFTER NETON
  56. * NWLSIZE
  57. * SSCWORD LOCATION OF SUBSYSTEM CALL WORD
  58. *
  59. * 5. EXIT PARAMETERS.
  60. * NWLADDR LOCATION FOR AWL
  61. *
  62. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  63. * ACB APPSTAT AT
  64. * DRHDR NIPDEF NWLHEAD
  65. * NWLNTRY OVERLAY PT
  66. * STATTAB SYSCOMD
  67. * DRHDR MSGIDX NIPDEF
  68. * NWLHEAD NWLNTRY OVERLAY PARAMP
  69. * PARAMS PT STATTAB SYSCOMD
  70. *
  71. * 7. ROUTINES AND OVERLAYS CALLED.
  72. * HAPFAIL OVL PROCESS AN APPLICATION FAILURE
  73. * HPNOFF OVL PROCESS A *NETOFF* WORKLIST ENTRY
  74. * HPNON OVL PROCESS A *NETON* WORKLIST ENTRY
  75. * HWLP PROCESS WORKLIST
  76. * OTIME GET SYSTEM RTIME
  77. * OVLCALL LOAD OVERLAY
  78. * XABTAPP OVL ABORT THE APPLICATION
  79. * XTRACE TRACES CALLS
  80. *
  81. * 8. DAYFILE MESSAGE. NONE
  82. * THIS PROCEDURE IS CALLED BY XEXEC.
  83. *
  84.  #
  85. STOPIMS;
  86. #
  87.   EXTERNAL VARIABLES
  88. #
  89. XREF BEGIN
  90. PROC HWLP; # PROCESS WORKLIST #
  91. PROC MGETS; # ALLOCATE EMPTY BUFFER #
  92. PROC MRELS ;
  93. PROC OSCHAPP; # SCHEDULE APPLICATION #
  94. PROC OTIME; # GET SYSTEM RTIME #
  95. PROC OVLCALL; # LOAD AND EXECUTE OVERLAY #
  96. PROC HGETNWL; # UPDATE RA.SSC WORD #
  97. PROC XRECALL; # RECALL #
  98. PROC XTRACE; # TRACE CALLS #
  99. END
  100. #
  101.   INTERNAL VARIABLES
  102. #
  103. ITEM AN U; # APPLICATION NUMBER #
  104. ITEM NEXTNWL U; # NEXT NWL BUFFER ADDRESS #
  105. ITEM HOSTSD B; # HOST SHUTDOWN INDICATOR #
  106.  
  107. CONTROL IFEQ STAT,1;
  108. ARRAY STIME P(1); # RTIME BUFFER FOR STARTING TIME #
  109. BEGIN
  110. ITEM SMILS U(0,24,36); # STARTING TIME IN MILLESECONDS #
  111. END
  112. ARRAY ETIME P(1); # RTIME BUFFER FOR ENDING TIME #
  113. BEGIN
  114. ITEM EMILS U(0,24,36); # ENDING TIME IN MILLESECONDS #
  115. END
  116.  
  117. ITEM STTEMP; # TEMPORARY STATISTICS VARIABLE #
  118. CONTROL FI;
  119.  
  120.  
  121. #**********************************************************************#
  122. BEGIN
  123.  
  124. CONTROL IFEQ DEBUG,1;
  125. XTRACE("HHIR ") ;
  126. CONTROL FI;
  127.  
  128. IF SSCLK[0]
  129. THEN # RECEIVED NEW NETWORK WORKLIST FROM APPLICATION #
  130. BEGIN # PROCESS INCOMING WORKLIST #
  131.  
  132. CONTROL IFEQ STAT,1;
  133. OTIME(STIME); # GET SYSTEM TIME BEFORE PROCESSING WKLST #
  134. CONTROL FI;
  135.  
  136. HOSTSD = SHUTDOWN;
  137. NWLADDR = SSCAP[0] - BLKHSIZE; # FWA OF NWL #
  138. #
  139.   PRESET ABORT PARAMETERS IN CASE APPLICATION IS TO BE ABORTED
  140. #
  141. ABTADDR = NWLADDR; # FWA OF BUFFER TO HOLD SF.REGR SCP FUNC #
  142. ABTSIZE = SIZENWL; # SIZE OF SF.REGR SCP BUFFER #
  143.  
  144. P<DRHDRWD> = 0;
  145. NEXTNWL = NEXTPTR[NWLADDR]; # NEXT FREE BUFFER AVAILABLE #
  146.  
  147. IF NOT HOSTSD
  148. THEN # HOST NOT IN LOCAL SHUTDOWN MODE #
  149. BEGIN # TWO NWL WORKLISTS MAY BE OUTSTANDING AT ANY ONE TIME #
  150. HGETNWL(NEXTNWL); # UPDATE RA.SSC WORD TO PROVIDE NEW NWL #
  151. END
  152.  
  153. P<NWLHEADER> = NWLADDR; # FWA OF NWL #
  154. #
  155.   CHECK IF APPLICATION HAS FAILED
  156. #
  157. IF NWLSTAT[0] NQ 0
  158. THEN # APPLICATION HAS FAILED #
  159. FAILADR = NWLADDR; # NETWORK WORKLIST ADDRESS #
  160.  
  161. ELSE
  162. BEGIN
  163. #
  164.   CHECK IF APPLICATION IS REQUESTING NETOFF
  165. #
  166. P<NWLENTRY> = NWLADDR + NWLHSIZE;
  167. IF NWLOP[0] EQ WLOPNOFF
  168. THEN
  169. BEGIN # PROCESS NETOFF #
  170. OVLNAME = HPNOFFP; # NAME OF OVERLAY PROGRAM TO LOAD #
  171. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  172. END
  173.  
  174. ELSE
  175. BEGIN
  176. #
  177.   CHECK IF APPLICATION IS REQUESTING NETON
  178. #
  179. AN = NWLPN[0]; # APPLICATION NUMBER #
  180. IF AN EQ 0
  181. THEN
  182. BEGIN # ONLY NETON IS ALLOWED #
  183. IF NWLOP[0] EQ WLOPNON
  184. THEN
  185. BEGIN # PROCESS NETON #
  186. OVLNAME = HPNONP; # NAME OF OVERLAY PROGRAM TO LOAD #
  187. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  188. END
  189.  
  190. ELSE # ABORT APP CAUSE IT HAS NOT NETTED ON #
  191. ABTAPPF = XNOTNETON; # SET ABORT-APPLICATION FLAG #
  192. END
  193.  
  194. ELSE # APPLICATION NETTED ON #
  195. BEGIN
  196. #
  197.   VALIDATE WORKLIST
  198. #
  199. IF AN GR ATHAN[0]
  200. THEN # APPLICATION NUMBER UNKNOWN #
  201. ABTAPPF = XBADPN; # SET ABORT-APPLICATION FLAG #
  202.  
  203. ELSE
  204. BEGIN
  205. ACBADDR = ATACBA[AN]; # FWA OF APPLICATION-S ACB #
  206. P<ACB> = ACBADDR;
  207. IF NWLOP[0] EQ WLOPRSET
  208. THEN
  209. BEGIN # RESET WORKLIST COMING IN #
  210. IF P<ACB> NQ 0
  211. THEN
  212. BEGIN
  213. IF ACBWLFWA[0] NQ 0
  214. THEN
  215. BEGIN # RELEASE THE WHOLE WL #
  216. P<DRHDRWD> = ACBWLFWA[0] ;
  217. BLKBS [0] = ACBWLLWA[0] - P<DRHDRWD> + 1 ;
  218. MRELS(P<DRHDRWD>) ;
  219. ACBNWLWD[0] = 0 ;
  220. END # RELEASE THE WHOLE WORKLIST #
  221.  
  222. IF ACBFLIST[0] NQ 0
  223. THEN
  224. BEGIN
  225. MRELS(ACBFLIST[0]) ;
  226. ACBFLIST[0] = 0 ;
  227. END
  228.  
  229. END
  230. ATASBR[AN] = FALSE; # CLEAR NETWAIT FLAG IF SET#
  231. END # RESET WORKLIST #
  232. IF P<ACB> EQ 0 # APPLICATION NOT EXISTS #
  233. OR ACBJNWD[0] NQ NWLJOBID[0] # BAD APP NUMBER #
  234. OR ATNVFN[AN] # APPLICATION NETTED OFF #
  235. THEN # ABORT MISBEHAVED APPLICATION #
  236. ABTAPPF = XBADPN;
  237.  
  238. ELSE
  239. BEGIN
  240. IF ACBWLFWA[0] NQ 0
  241. THEN # NIP IS STILL PROCESSING EARLIER WORKLIST#
  242. ABTAPPF = XOSWL; # SO ABORT ILL-BEHAVED APP #
  243.  
  244. ELSE # NO OUTSTANDING WORKLIST EXISTS #
  245. BEGIN
  246. IF NWLAWLADDR[0] EQ 0
  247. THEN # NO ADDRESS WAS SPECIFIED TO WRITE AWL #
  248. ABTAPPF = XNOAWLA;
  249.  
  250. ELSE # VALID WORKLIST FROM APPLICATION #
  251. BEGIN
  252. IF ATASBI[AN]
  253. THEN # SWAPIN PREVIOUSLY ISSUED FOR APP #
  254. BEGIN
  255. IF ACBSCPCB[0] EQ 0
  256. THEN # SWAPIN NOT COMPLETE YET #
  257. BEGIN # WAIT FOR SWAPIN TO COMPLETE #
  258. XRECALL(LOC(ACBSCPCB[0])); # ENTER RECALL #
  259. END
  260. ATASBSO[AN] = FALSE; # CLEAR SWAPPED OUT FLG#
  261. ATASBI[AN] = FALSE; # CLEAR SWAP IN FLAG #
  262. ACBID[0] = ACBIDVALUE; # RESTORE ACB ID #
  263. END
  264. ACBUCPADR[0] = NWLHADDR[0]; # UCP COMP BIT ADR #
  265. ACBNWLE[0] = NWLNE[0]; # NUMBER OF ENTRIES #
  266. ACBWLFWA[0] = NWLADDR; # FWA OF NWL #
  267. ACBWLADR[0] = NWLADDR + NWLHSIZE;
  268. ACBWLLWA[0] = NWLADDR + SIZENWL - 1; # LWA NWL #
  269. ACBAWLADDR[0] = NWLAWLADDR[0];
  270.  
  271. HWLP; # PROCESS ALL NWL ENTRIES #
  272.  
  273. END
  274. END
  275. END
  276. END
  277. END
  278. END
  279. END
  280. #
  281.   CHECK IF APPLICATION IS TO BE ABORTED
  282. #
  283. IF ABTAPPF NQ 0
  284. THEN
  285. BEGIN # ABORT APPLICATION #
  286. OVLNAME = XABTAPPP; # NAME OF OVERLAY PROGRAM TO LOAD #
  287. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  288. END
  289. #
  290.   CHECK IF APPLICATION HAS FAILED
  291. #
  292. IF FAILADR NQ 0
  293. THEN
  294. BEGIN # PROCESS APPLICATION FAILURE #
  295. OVLNAME = HAPFAILP; # NAME OF OVERLAY PROGRAM TO LOAD #
  296. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  297. END
  298.  
  299. IF HOSTSD
  300. THEN # NAM IS IN LOCAL SHUTDOWN MODE #
  301. BEGIN # ONLY ONE WORKLIST MAY BE OUTSTANDING #
  302. HGETNWL(NEXTNWL); # UPDATE RA.SSC TO PROVIDE NEW NWL BUFFER #
  303. END
  304.  
  305.  
  306. CONTROL IFEQ STAT,1;
  307. OTIME(ETIME); # GET SYSTEM TIME AFTER PROCESSING WORKLST#
  308. STTEMP = EMILS[0] - SMILS[0];
  309. IF STTEMP GR ST$LHI
  310. THEN # FOUND LARGER TIME INTERVAL #
  311. BEGIN
  312. ST$LHI = STTEMP; # LARGEST TIME INTERVAL #
  313. END
  314. IF STTEMP GR 200
  315. THEN # SPENT MORE THAN .2 SECONDS IN INTERVAL #
  316. BEGIN
  317. ST$MHI = ST$MHI + 1; # INCREMENT NO OF TIMES GREATER .2 SEC#
  318. END
  319. ST$THI = ST$THI + STTEMP; # INCREMENT TOTAL TIME PROCESSING #
  320. CONTROL FI;
  321.  
  322. END # END NWL WORKLIST PROCESSING #
  323.  
  324. ELSE # NO INCOMING WORKLIST TO PROCESS #
  325. BEGIN
  326.  
  327. CONTROL IFEQ STAT,1; # STATISTICS ON #
  328. ST$ESB = ST$ESB + 1; # INCR NO OF TIMES WORKLIST FOUND EMPTY #
  329. CONTROL FI;
  330.  
  331. END
  332.  
  333. #
  334.   CHECK FOR NETWORK SHUTDOWN
  335. #
  336. IF SHUTDOWN
  337. AND ATENTRYW[NVFAN] EQ 0 # NVF NETTED OFF #
  338. AND SWAPINFP EQ 0 # NO-ACB-SWAPIN-RING NOT EXIST #
  339. THEN
  340. BEGIN # PROCESS NETWORK TERMINATION #
  341. OVLNAME = XENDNAMP;
  342. OVLCALL;
  343. END
  344.  
  345. RETURN;
  346. END
  347. TERM
cdc/nos2.source/nam5871/hhir.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator