April 1, 1981
If you have user-defined areas that used by more than one virtual
machine, you will need to define your own locking conventions. You can
use the LOCK macro to obtain and release a PRIVATE lock. The format of
the LOCK macro is: r- I I (label] I I i
label OBTAIN RELEASE LOCK {
OBTAIN
},TYPE=PRIVATE,[SPIN={YES}][,SAVE] RELEASE NO is any desired use label.
is a required positional operand indicating whether the lock
is to be obtained or released. TY PE=PRI VATE is a required operand that indicates that the lock is a user
lock. SPIN=YESINO SAVE specifies whether control is to be without the lock
being held. The default is SPIN=YES. is an optional keyword that indicates 1, 14 and
15 are to be saved before the rest of the macro expansion.
These are saved in the PSA of the processor that is executinq
this macro. The registers are restored before exit from the
macro expansion.
The condition code (cc) is set as a result of the invocation of the LOCK macro. cc=O OBTAIN - lock obtained RELEASE - lock released
cc=l OBTAIN,SPIN=NO - lock owned by another processor.
A failure to release a lock results in a LOK003 abend.
The address of the lockword must be specified in register 1 and the lockword must be a fullword aligned on a fullword boundary. Spin time
for private locks is kept in the DMKLOKSI timer value for all non-DMKLOK locks. AFFINITY If one processor has a feature that the other processor does not
have, you can tell the system that you always want to execute on that processor. This is done by requesting affi-ni-t-y ,-ei-ther in the d-ireGtory or with a SET AFFINITY command. See the !2£ Q§g[§ for details on the SET AFFINITY command. Part 2. Control Program (CP) 181
Page of GC20-1807-7 As Updated April 1, 1981 by TNL GN25-0829 DIAGNOSE Instruction In a Virtual Machine
The DIAGNOSE instruction cannot be used in a virtual machine for its
normal function. If a virtual machine attempts to execute a DIAGNOSE instruction, a program interrupt returns control to CP. Since a DIAGNOSE instruction issued 1n a virtual machine results only in
returning control to CP and not in performing normal DIAGNOSE functions,
the instruction is used for communication between a virtual machine and CP. The machine language format of DIAGNOSE is:
83
Rx, Ry CODE <------- 4 bytes ------->
83 I Rx I Ry I CODE is X'83' and interpreted by the assembler as the DIAGNOSE instruction. There is no mnemonic for DIAGNOSE. are general purpose registers that contain operand storage
addresses or return codes passed to the DIAGNOSE interface.
If the registers contain addresses, those addresses must be
real to the virtual machine issuing the DIAGNOSE. is a two-byte hexadecimal value that CP uses to determine what DIAGNOSE function to perform. The codes defined for the
general VM/SP user are described in this section. The code
must be multiple of four. Codes X'OO' through X'FC' are
reserved for IBM use, and X'100' through X'1FC' are reserved
for users.
Because DIAGNOSE operates differently in a virtual machine than it
does in a real machine, a program should determine that it is operating
in a virtual machine before issuing a diagnose instruction, and prevent
execution of a DIAGNOSE when in a real machine. The Store Processor 10 (STIDP) instruction provides a program with information about the
processor in which it is executing, including the processor version
number. If STIDP is issued from a virtual machine, the version number
will be X'FF' in the first byte of the CPUID field.
A virtual machine issuing a diagnose instruction should run with interrupts disabled. This prevents loss of status information
pertaining to the diagnose operation such as condition codes and sense
data.
182 IBM VM/370 System programmer's Guide
Previous Page Next Page