gtps1m17System Macros

$SWSPC-Switch Address Space

Use this system macro to change the address space control information in the program status word (PSW). The TPF system supports 2 types of address spaces:

Before using this macro, be sure you understand the effects of switching address spaces on register 9 (the ECB pointer) and control register 1 (the ECB segment and page table pointer). This macro can be run to set up these registers (with a dependency on R9) or to switch the address mode without updating the registers.

Format




GOTO
This parameter identifies the address space in which the TPF system is to resume operation. There are three options:

EVM
The address space being switched to is the EVM. The input and return conditions vary, dependent on the ECBINR9 parameter.

If ECBINR9=YES then R9 must contain the virtual address of the ECB for the address space the ECB is executing in. On return, R9 contains the EVM address of the ECB, and control register 1 is loaded with a pointer to the ECB segment and page tables.

If ECBINR9=NO then the $SWSPC macro will issue only the SAC instruction to switch the address space. The set-up of R9 and control register 1 would be left to the caller. This combination of parameters (GOTO=EVM and ECBINR9=NO) is essentially illogical, and is not recommended.

SVM
The address space being switched to is the SVM. The input and return conditions vary, dependent on the ECBINR9 parameter.

If ECBINR9=YES then R9 must contain the virtual address of the ECB for the address space the ECB is executing in. On return, R9 contains the SVM address of the ECB.

If ECBINR9=NO then the $SWSPC macro will issue only the SAC instruction to switch the address space. If the caller plans to access the ECB or issue a $SWSPC to the EVM, then R9 would need to be set up by the user.

Rx
Rx is a register that has been previously set by the OLD option of the $SWSPC macro. The contents of Rx cannot be modified by the user. When GOTO=Rx is specified, R9 must contain the address of the ECB for the address space the ECB is executing in, unless ECBINR9=NO is coded.
Note:
There can be no loss of control between the invocation of the $SWSPC macro that saved the OLD register and the invocation of the $SWSPC macro with the GOTO parameter, nor should R9 be changed.

OLD=Ry
This is an optional parameter. If specified, the TPF system saves the information necessary to return to the addressing mode in effect at the time the $SWSPC macro is issued.

This parameter can be used in a subroutine to allow entry in either mode, with return to the correct addressing mode.

Ry
Specify the register that will contain the return information.

ECBINR9
This is an optional parameter. The default is ECBINR9=YES. This parameter indicates if the macro call should use and update R9, which implies R9 is a valid ECB pointer.

YES
R9 will be referenced as the ECB pointer and updated to point to the ECB in the proper addressing mode. If the switch is to the EVM, then control register 1 will be loaded with the segment and page tables.

NO
R9 will neither be referenced nor updated. Control register 1 will not be updated when switching to the EVM.

Entry Requirements

Return Conditions

Programming Considerations

Examples