*DECK SSCATR
USETEXT TEXTSS
PROC SSCATR (TRBSS);
# TITLE SSCATR - ACCEPTS TIMER REQUEST. #
BEGIN # SSCATR #
#
** SSCATR - ACCEPTS TIMER REQUEST.
*
* F. HOU. 81/09/10.
*
* THIS PROCEDURE ACCEPTS THE NEW TIMER REQUEST BLOCK - TRBSS.
*
* PROC SSCATR (TRBSS)
*
* ENTRY TRBSS = NEW TIMER REQUEST BLOCK.
*
* EXIT THE TIMER REQUEST HAS BEEN ACCEPTED.
*
* NOTES THE NEW TIMER REQUEST BLOCK - TRBSS.
* THE TIMER REQUEST QUEUE - TRQ1.
* THE CTM COMMON BLOCK - CTM.
*
* METHOD
*
* ASSIGN NEXT TIMER-CANCELLATION-NUMBER AND INSERT INTO
* TIMER REQUEST BLOCK - TRBSS.
* CALL SSCUTD TO UPDATE TIME-OF-DAY.
* COMPUTE TRBSS FTIME BY USING TRBSS DELAY-TIME & CTM TIME-OF-DAY.
* IF(TRBSS FTIME < CTM FIRE-TIME) SET CTM FIRE-TIME TO TRBSS FTIME.
* INSERT TRBSS IN SORT ORDER IN TIMER REQUEST INTO TRQ1.
* RETURN WITH TIMER-CANCELLATION-NUMBER.
*
#
#
** TRBSS - TIMER REQUEST BLOCK.
*
* TRBSS CONTAINS THE TIMER REQUEST BLOCK DESCRIPTION.
*
#
DEF TRBLEN #4#; # LENGTH OF TRBSS #
ARRAY TRBSS [0:0] S(4);
BEGIN
ITEM TRB$WD0 U(00,00,60); # OVERLAPPING WORD 0 #
ITEM TRB$ENTRY U(00,48,12); # ENTRY SIZE #
ITEM TRB$WD1 U(01,00,60); # OVERLAPPING WORD 1 #
ITEM TRB$CNUM U(01,18,18); # CANCELLATION NUMBER #
ITEM TRB$WD2 U(02,00,60); # OVERLAPPING WORD 2 #
ITEM TRB$FDQ U(03,00,60); # OVERLAPPING WORD 3 #
ITEM TRB$FTIME U(03,00,24); # FIRE TIME #
ITEM TRB$DELAY U(03,24,18); # DELAY TIME #
ITEM TRB$QNUM U(03,42,18); # Q NUMBER #
END
#
**** PROC SSCATR - XREF LIST.
#
XREF
BEGIN
PROC SSCUTD; # UPDATES CURRENT TIME-OF-DAY. #
PROC SSTETS; # ENLARGES TABLE SPACE. #
END
#
****
#
ITEM CNUM I=1; # CANCELLATION NUMBER PRESET TO 1. #
ITEM I U; # I IS A LOOP VARIABLE #
ITEM II I; # II=I #
CONTROL EJECT;
P<TRQ1>=SSTRQ[0]; # SET BASED ARRAY-TRQ1 POINTER #
TRB$CNUM[0]=CNUM; # NEXT TIMER CANCELLATION NUMBER #
CNUM=CNUM+1;
SSCUTD; # UPDATE TIME-OF-DAY #
TRB$FTIME[0]=TRB$DELAY[0]+CTM$RTSEC[0];
# FIRE-TIME = DELAY-TIME + TIME-OF-DAY #
IF(TRB$FTIME[0] LS CTM$FTIME[0])
THEN
BEGIN
CTM$FTIME[0]=TRB$FTIME[0]; # SET CTM FIRE-TIME TO TRBSS FTIME #
END
II=0; # INITIAL VALUE FOR II #
FOR I=0 STEP 1 WHILE I LS (SSTRQL[0]/4)
AND (TRB$FTIME[0] GQ TRQ1$FTIME[I])
DO
BEGIN
II=I; # FIND RIGHT POSITION IN TRQ1 FOR TRBSS #
END
# I=0 CASE #
IF (II EQ 0) AND
((SSTRQL[0] EQ 0) OR (TRB$FTIME[0] LS TRQ1$FTIME[0]))
THEN
BEGIN
II=II-1;
END
SSTETS (SSITRQ,(II+1)*4,TRB$ENTRY[0]); # ENLARGE TRQ SPACE #
P<TRQ1>=SSTRQ[0]; # SET BASED ARRAY-TRQ1 POINTER AGAIN #
TRQ1$WD0[II+1]=TRB$WD0[0]; # MOVE TRBSS TO TRQ1 #
TRQ1$WD1[II+1]=TRB$WD1[0];
TRQ1$WD2[II+1]=TRB$WD2[0];
TRQ1$FDQ[II+1]=TRB$FDQ[0];
END # SSCATR #
TERM