TITLE  'ICATS RESTART COMMAND ROUTINE'                         RES00010
*********************************************************************** RES00020
*                                                                     * RES00030
*  MODULE NAME =  RESTART                                             * RES00040
*                                                                     * RES00050
*  FUNCTION =  PROCESS THE RESTART COMMAND.  CALLS ATTACH TO TRY      * RES00060
*              TO VARY ON AND ATTACH THOSE UTS MACHINES THAT ARE      * RES00070
*              NOW OFFLINE.                                           * RES00080
*                                                                     * RES00090
*  ENTRY POINTS =  RESTART                                            * RES00100
*                                                                     * RES00110
*  LINKAGE =  BALR R14,R15 FROM ICATS MAINLINE.                       * RES00120
*                                                                     * RES00130
*  REGISTER CONTENTS UPON ENTRY =                                     * RES00140
*      R2  = POINTS TO THE ICATS COMMON DATA AREA, AS ALWAYS.         * RES00150
*      R14 = RETURN ADDRESS BACK TO ICATS MAINLINE                    * RES00160
*      R15 = ENTRY POINT TO THIS MODULE                               * RES00170
*                                                                     * RES00180
*  REGISTER USAGE =                                                   * RES00190
*      R0-R1 = USED TO PASS PARAMETERS TO SUBROUTINES.                * RES00200
*      R2 =  USED TO ADDRESS THE ICATS COMMON DATA AREA.              * RES00210
*      R3-R10 = FREE                                                  * RES00220
*      R11 = MY BASE REGISTER                                         * RES00230
*      R14 = MY RETURN ADDRESS WHEN I CALL SOMEBODY                   * RES00240
*      R15 = SUBROUTINE ADDRESS                                       * RES00250
*                                                                     * RES00260
*  MODULE LOGIC:                                                      * RES00270
*      1)  CALL THE ATTACH ROUTINE.                                   * RES00280
*      2)  IF THIS IS A UTS COMMAND, THEN GIVE A REPLY CONTROL        * RES00290
*          BLOCK TO THE UTS.  ELSE THE CONSOLE OR THE SMSG'ER         * RES00300
*          HAS ALREADY GOTTEN A REPLY FROM THE ATTACH ROUTINE.        * RES00310
*      3)  RETURN TO ICATS MAINLINE.                                  * RES00320
*                                                                     * RES00330
*  NORMAL EXIT =                                                      * RES00340
*      R15 = 0                                                        * RES00350
*                                                                     * RES00360
*  EXTERNAL REFERENCES = ATTACH                                       * RES00370
*                                                                     * RES00380
*  MACROS =  ICDATA = ICATS COMMON DATA AREA                          * RES00390
*            ETTE   = ENTER TRACE TABLE ENTRY SUBROUTINE              * RES00400
*                                                                     * RES00410
*  CHANGE ACTIVITY                                                    * RES00420
*    DATE        NAME       REASON FOR CHANGE                         * RES00430
*  04/25/83  RICK JASPER    INITIAL PROGRAM CREATION                  * RES00440
*  09/16/83  RICK JASPER    CHANGED TO CALL ATTACH RIGHT NOW INSTEAD  * RES00450
*                           OF SETTING A BIT TO HAVE THE DISPATCHER   * RES00460
*                           CALL HIM (THAT WAS A STUPID WAY OF DOING  * RES00470
*                           IT).                                      * RES00480
*                                                                     * RES00490
*********************************************************************** RES00500
         PRINT GEN,NODATA                                               RES00510
RESTART  CSECT                                                          RES00520
         USING ICDATA,R2            ADDRESS ICATS COMMON DATA AREA      RES00530
         USING *,R15              USE R15 FOR NEXT INSTRUCTION ONLY     RES00540
         STM   R0,R14,SAVEREGS    SAVE ALL THE REGISTERS                RES00550
         DROP  R15                                                      RES00560
         USING RESTART,R11                                              RES00570
         LR    R11,R15            SWITCH BASE REGISTER TO R11           RES00580
*                                                                       RES00590
         L     R15,=V(ATTACH)                                           RES00600
         BALR  R14,R15            GO GET OFFLINE UTS'S ONLINE           RES00610
         TM    FLAGB,UTSCMD       IF NOT FROM A UTS, THEN WE'RE DONE    RES00620
         BNO   CONTB                                                    RES00630
*********************************************************************** RES00640
*  WHETHER THINGS WORKED OK OR NOT, ATTACH ALWAYS RETURNS A RETURN    * RES00650
*  CODE OF 0.  SINCE THERE'S NO ERROR INDICATION IF THERE WAS AN      * RES00660
*  ERROR, THEN GIVE THE UTS MACHINE A ZERO RETURN CODE IN HIS REPLY   * RES00670
*  CONTROL BLOCK.  ALSO, THERE'S NO DATA FOLLOWING THIS REPLY CB.     * RES00680
*********************************************************************** RES00690
         MVC   PARM15,=X'0000000000000000'   RETURN CODE = LENGTH = 0   RES00700
         LA    R0,128           REPLY CONTROL BLOCK = 128 BYTES BIG     RES00710
         LA    R1,PARM0         STARTING AT PARM0                       RES00720
         L     R15,AWRITUTS     GO GIVE THE REPLY TO THE UTS MACHINE    RES00730
         BALR  R14,R15          IGNORE ANY ERRORS                       RES00740
CONTB    SR    R15,R15                RETURN CODE = 0                   RES00750
         LM    R0,R14,SAVEREGS        RESTORE ALL THE REGISTERS         RES00760
         BR    R14                    BYE BYE                           RES00770
SAVEREGS DS    15F                                                      RES00780
         LTORG                                                          RES00790
         ICDATA                                                         RES00800
         END                                                            RES00810