Use this system macro to:
- Switch an existing entry control block (ECB) to another I-stream
- Create a new ECB on another I-stream.
Format
- label
- A symbolic name can be assigned to the macro statement.
- name
- The name of the program to activate (same as for ENTDC macros).
- PROGRAM
- The name of the program to activate.
- prog
- The name of the program to be activated.
- (Rx)
- A register (R0 through R7) that contains the address of where the program
name can be found.
- BYPASS
- Specify one of the following:
- NO
- The default. The IS value is limited to the I-streams usable by
applications, as controlled by the ZCNIS command.
- YES
- The IS value is limited to all the I-streams online (active) in the
CPC.
- DECB=(reg)|label1
- A register (R0-R7) or a label containing the address of a data event
control block (DECB), which contains the data to be passed to the new
ECB.
When a DECB is specified, the data block is attached to data level D0 of
the created ECB.
- IS
- Specify one of the following:
- MAIN
- The main I-stream is the target.
- MPIF
- The MPIF I-stream is the target.
- Ry
- The specified register, R0 through R7, is set to the target I-stream
number. At run time the register must contain the I-stream number where
the ECB is to be created or switched. If the register contains zero,
load balancing is used and the ECB is created or switched to the least busy
I-stream.
- LEV
- Specify one of the following:
- NONE
- No data level is to be passed to the new ECB.
- Dn
- The data on data level Dn is to be passed to the new ECB.
- Ry
- The data level equate value specified in Ry is to be passed to the new
ECB.
When a data level is specified by either Dn or Ry, the data block is
attached to data level D0 of the created ECB.
- LIST
- Specify one of the following:
- #CLHINP
- Will get the entry added to the input list.
- #CLHRDY
- Will get the entry added to the ready list.
- #CLHDEF
- Will get the entry added to the deferred list.
- TYPE
- Specify one of the following:
- ENTER
- This entry is switched through an ENTDC macro.
- CREATE
- An entry is created on the dispatch list specified by the LIST
parameter.
Entry Requirements
- R9 must contain the address of the ECB being processed.
- When TYPE=CREATE is specified R14 must have the length of passed data and
R15 must have the address of passed data subject to the restrictions of Create
macros. A variable number of bytes (1-104) is passed to the
created ECB work area.
Return Conditions
- Control is returned to the next sequential instruction (NSI).
- The contents of R14 and R15 are unknown. The contents of all other
registers are preserved across this macro call.
Programming Considerations
- This macro can be run on any I-stream.
- Use of the SWISC macro is not supported in the control program
(CP).
- If TYPE=ENTER, this entry will be switched to the target I-stream and all
program nesting will be cleared when control is passed to the new
program.
- The value of LIST is restricted to those dispatch list values defined in
CLHEQ.
- If LEV or DECB is coded for TYPE=CREATE, the data level or DECB specified
must have an attached block. This block will be unhooked from the
calling ECB on return from the macro service.
- No I/O should be outstanding when calling this macro.
- The system functions required to act on physical I-streams must specify
BYPASS=YES.
- If the target I-stream is zero, the TPF scheduler will be invoked.
- In addition to the normal macro trace information the SWISC trace entry
will contain the activation type, ENTER or CREATE, the name of the target
program and the target I-stream number.
- If the data event control block address specified by the DECB parameter
does not refer to a valid DECB, control is transferred to the system error
routine and the entry is exited.
- If you use this macro to create an ECB that will enter a dynamic load
module (DLM) with an entry point defined by the C language main
function, the TPF system assumes that any core block attached to data level 0
(D0) contains a command string that will be parsed into argc and
argv parameters for the main function. See TPF Application Programming for more information about
the main function.
Examples
This example creates a new ECB that initially enters the WXYZ
segment.
***********************************************************************
* SWISC to WXYZ *
* *
* Registers: *
* *
* 1. R5 is set to point to the name 'WXYZ'. *
* *
* 2. R3 is set to zero to request that load balancing will schedule *
* the created ECB to run on the least busy I-stream. *
* *
* 3. A core block is set up on data level D5. A copy of this core *
* block will be attached to the created ECB on D0. R4 is set up *
* to point to the core block's CBRW. *
* *
* 4. R14 and R15 are set up to contain the length and address of the *
* the parameter string. The created ECB will be initialized with *
* this string starting in EBW000. *
* *
* 5. The SWISC macro specifies that the new ECB will be added to the *
* CPU Ready list for the selected I-stream. *
***********************************************************************
LA R5,NEWPGM Use PROGRAM=R5 interface to specify
* the first program segment that the
* created ECB will enter.
*
SLR R3,R3 Use IS=R3 interface to select load
* balancing.
*
GETCC D5,L0 Get core block to pass via SWISC.
MVC 0(MSGSIZ,R14),MSG Move message into core block.
LA R4,CE1CR5 Use LEV=R4 interface to pass block.
*
LA R14,PARMSIZ Length of parameter.
LA R15,PARM Address of parameter.
*
SWISC TYPE=CREATE, \
PROGRAM=(R5), \
IS=R3, \
LEV=R4, \
LIST=#CLHRDY, \
BYPASS=NO
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
NEWPGM DC C'WXYZ'
MSG DC C'HELLO TO WXYZ FROM ABCD'
MSGSIZ EQU *-MSG
PARM DC C'THIS ECB WAS CREATED BY SWISC'
PARMSIZ EQU *-PARM