*DECK OSCPSI
USETEXT NIPDEF
USETEXT APPSTAT
USETEXT DRHDR
USETEXT FLIST
USETEXT NWLHEAD
USETEXT NWLNTRY
USETEXT PARAMS
USETEXT SCPCOM
USETEXT SWAPIN
PRGM OSCPSI; # SWAP IN APPLICATION WHICH HAS NO PCB #
STARTIMS;
#
*1DC OSCPSI
*
* 1. PROC NAME AUTHOR DATE
* OSCPSI P.C.TAM 80/02/07
*
* 2. FUNCTIONAL DESCRIPTION.
* SWAPIN (NO-ACB) APPLICATION
*
* 3. METHOD USED.
* CREATE (NO-ACB) SWAPIN ENTRY
* CREATE SCP FUNCTION LIST TO SWAP IN APPLICATION
* ISSUE SCP FUNCTION
* LINK SWAPIN ENTRY TO (NO-ACB) SWAPIN RING
*
* 4. ENTRY PARAMETERS.
* PARAMS1 ADDR OF ORIGINAL SCP FUNCTION LIST
* PARAMS2 ADDR OF BUF TO HOLD (NO-ACB) SWAPIN ENTRY
* PARAMS3 ADDR OF DATA, IF ANY, TO WRITE TO APP FL
*
* 5. EXIT PARAMETERS.
* NONE
*
* 6. COMDECKS CALLED AND SYMPL TEXTS USED.
* APPSTAT FLIST NIPDEF
* OSSIZE PARAMS
* SCPCOM SWAPIN
*
* 7. ROUTINES AND OVERLAYS CALLED.
* OSWAPIN SWAP IN APPLICATION
* XTRACE RECORD PROCEDURE CALLS
*
* 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION.
*
* THIS PROGRAM IS A SECONDARY OVERLAY LOADED BY SUBROUTINE
* OVLCALL. WHEN EXECUTION HAS COMPLETED, A JUMP IS MADE TO
* LOCATION RJMAIN TO RETURN TO THE CALLING PROGRAM.
*
* W A R N I N G - THIS PROGRAM CANNOT EXCEED THE SECONDARY
*CALL OSSIZE
*
* THIS OVERLAY IS CALLED BY HPNOFF, HPNON, HPNONSA, AND XABTAPP.
*
#
STOPIMS;
#
EXTERNAL VARIABLES
#
XREF
BEGIN
PROC OSWAPIN; # ISSUE SF.SWPI SCP CALL #
PROC XTRACE; # RECORD CALL #
LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
END
#
LOCAL VARIABLES
#
ITEM SWAPADR; # ADDR OF BUFFER FOR SF.SWPI ENTRY #
#**********************************************************************#
BEGIN
CONTROL IFEQ DEBUG,1;
XTRACE("OSCPS") ;
CONTROL FI;
SWAPADR = PARAMS2; # ADDR OF BUFFER FOR SF.SWPI ENTRY #
#
CREATE (NO ACB) SWAPIN CHAIN ENTRY
#
P<SCPCALL> = PARAMS1; # ADDR OF ORIGINAL SCP FUNCTION LIST #
P<SWPIE> = SWAPADR;
SWPIWD0[0] = 0;
SWPIID[0] = SWPEIDVALUE; # (NO ACB) SWAPIN ENTRY ID VALUE #
SWPIBS[0] = SWPISIZE; # (NO ACB) SWAPIN ENTRY SIZE #
SWPIFW[0] = 0;
SWPIJOBID[0] = SCPJOBID[0]; # APP JOB ID WORD #
SWPIWR[0] = PARAMS3; # ADDR OF DATA, IF ANY, TO WRITE TO APP FL#
SWPIFL[0] = PARAMS1; # ADDR OF ORIGINAL SCP FUNCTION LIST #
#
ISSUE SYSTEM CONTROL POINT FUNCTION TO SWAP IN APPLICATION
#
P<FLE> = LOC(SWPIFW[0]);
OSWAPIN(FLE); # SWAP IN APPLICATION #
#
INSERT NEW SWAPIN ENTRY IN (NO ACB) SWAPIN CHAIN
#
IF SWAPINFP EQ 0
THEN # (NO PCB) SWAPIN CHAIN IS EMPTY #
BEGIN
SWPINFP[0] = LOC(SWAPINFP); # SET SWAPIN ENTRY FORWARD PTR #
SWPINBP[0] = LOC(SWAPINBP); # SET SWAPIN ENTRY BACKWARD PTR #
SWAPINFP = SWAPADR; # UPDATE BEGINNING-OF-CHAIN PTR #
SWAPINBP = SWAPADR; # UPDATE END-OF-CHAIN PTR #
END
ELSE # ADD NEW ENTRY TO END OF CHAIN #
BEGIN
SWPINFP[0] = LOC(SWAPINFP); # UPDATE SWAPIN ENTRY FORWARD PTR #
SWPINBP[0] = SWAPINBP; # BACK PTR PTS TO PREVIOUS LAST ENTRY #
P<SWPIE> = SWAPINBP;
SWPINFP[0] = SWAPADR; # UPDATE FORWARD PTR OF PREV LAST ENTRY #
SWAPINBP = SWAPADR; # UPDATE END-OF-CHAIN PTR #
END
GOTO RJMAIN; # RETURN TO CALLING PROGRAM #
END
TERM