graphically as follows. See "States of the
Input/Output System" for a detailed definition of
the A, I, W, and N states. Channel A W N
o 2 3
A Available I Intenruption pending
W Working
N
Not ()perational Condition Codes Set by TEST CHANNEL Test I/O TIO [S] IB2 31 9000 The state of the addressed channel, subchannel, and
device is indicated by setting the condition code in
the PSW and, under certain conditions, by storing
the CSW. Pending interruption conditions may be
cleared. Bits 8-14 of the instruction are ignored.
The instruction TEST I/O is executed only when
the CPU is in the supervisor state.
Bits 16-31 of the second-operand address identify
the channel, subchannel, and I/O device to which
the instruction applies.
The TIO function is performed by the instruction TEST I/O and, on some channels and under certain
circumstances, by CLEAR I/O. When the channel is operating in burst mode and
the addressed sub channel contains a pending inter­
ruption condition, the TIO function causes condition
code 1 or 2 to be set, depending on the channel type
and system model. If condition code 1 is set, the CSW is stored at location 64 to identify the interrup­
tion condition, and the interruption condition is
cleared.
When the condition in the following paragraph
occurs with the channel either available or in the
interruption pending state, or, on some channels, in
the working state, the TIO function causes the CSW to be stored. The contents of the entire CSW pertain
to the I/O device addressed by the instruction.
The sub channel contains a pending interrup­
tion condition due to a terminated operation at
the addressed device. The CSW identifies the
interruption condition, and the interruption
condition is cleared. The protection key, com­
mand address, and count fields contain the fi- 208 System/370 Principles of Operation nal values for the I/O operation, and the status
may include other bits provided by the channel
and the device. The interruption condition in
the sub channel is not cleared, and the CSW is
not stored if the channel is in the working state
and has not yet accepted the interruption con­
dition from the device.
When any of the following conditions occurs with
the channel either available or in the interruption­
pending state, the TIO function causes the CSW to
be stored. The contents of the entire CSW pertain to
the I/O device addressed by the instruction.
1. The sub channel is available, and the I/O device
contains a pending interruption condition or the control unit contains a pending control unit
end for the addressed device. The CSW unit­ status field identifies the interruption condition
and may contain other bits provided by the
device or control unit. The interruption condi­
tion is cleared. The busy bit in the CSW is off.
The other fields of the CSW contain zeros un­
less an equipment error is detected.
2. The sub channel is available, and the I/O device
or the control unit is executing a previously
initiated operation or the control unit has a
pending interruption condition associated with
a device other than the one addressed. The CSW unit-status field contains the busy bit or,
if the control unit is busy, the busy and status
modifier bits. Other fields of the CSW contain
zeros unless an equipment error is detected.
3. The subchannel is available, and the I/O device
or channel detected an equipment error during
execution of the instruction or the addressed
device is in the not-ready state and does not
have any pending interruption condition. The CSW identifies the error conditions. If the de­
vice is not ready, unit check is indicated. No
interruption conditions are generated at the I/O device or the sub channel.
When TEST I/O cannot be executed because of a
pending logout condition which affects the opera­
tional capability of the channel or subchannel, a full CSW is stored. The fields in the CSW are all set to
zeros, with the exception of the logout-pending bit
and the channel-control-check bit, which are set to
ones. No channel logout is associated with this sta­
tus.
When the TIO function is used to clear an inter­
ruption condition from the sub channel and the chan­
nel has not yet accepted the condition from the de­
vice, the function causes the device to be selected
and the interruption condition in the device to be
cleared. During certain I/O operations, some types
of devices cannot provide their current status in re-
sponse to TEST I/O. Some tape control units, for
example, are in such a state when they have provid­
ed the channel end condition and are executing the
backspace-file operation. When TEST I/O is issued
to a control unit in such a state, the unit-status field
of the CSW contains the busy and status modifier
bits, with zeros in the other CSW fields. The inter­
ruption condition in the device and in the subchan­
nel is not cleared. On some types of devices, such as the 2702 Transmission Control, the device never provides its
current status in response to TEST I/O, and an in­
terruption condition can be cleared only by permit­
ting an I/O interruption. When TEST. I/O is issued
to such a device, the unit-status field contains the
status modifier bit, with zeros in the other CSW
fields. The interruption condition in the device and
in the subchannel, if any, is not cleared.
However, at the time the channel assigns the
highest priority for interruptions to a condition asso­
ciated with an operation at the subchannel, the chan­
nel accepts the status from the device and clears the
corresponding condition at the device. When the 'flO function is addressed to a device for which the
channel has already accepted the interruption condi­
tion, the device is not selected, and the condition in
the sub channel is cleared regardless of the type of
device and its present state. The CSW contains unit
status and other information associated with the
interruption condition. On the byte-multiplexer channel, the TIO func­
tion causes the addressed device to be selected only
after the channel has serviced all outstanding re-
A Channel A ,Ii: 11# , W , N, Subchannel 2 1* 2 3 Control Unit ,A I I ,W, N AI or Device 0 1 * 1 * 3 0 A Available I nterru ption pendi ng
A
quests for data transfer for previously initiated opera­
tions.
Program Exceptions: Privileged operation
Resulting Condition Code:
o Available
1 CSW stored
2 Channel or sub channel busy
3 Not operational
The condition code set by the TIO function for all
possible states of the I/O system is shown graphical­
ly as follows. See "States of the Input/Output Sys­ tem" for a detailed definition of the A, I, W, and N
states.
Programming Notes
Disabling the CPU for I/O interruptions provides
the program a means of controlling the priority of I/O interruptions selectively by channels. The priori­
ty of devices attached on a channel is fixed and can­
not be controlled by the program. The instruction
TEST I/O permits the program to clear interruption
conditions selectively by I/O device.
When a CSW is stored by the TIO function, the
interface-control-check and channel-control-check
indications may be due to a condition already exist­
ing in the channel or due to a condition created by
the TIO function. Similarly, presence of the unit
check bit in the absence of channel end, control unit
end, or device end bits may be due to a condition
created by the preceding operation, the not-ready Wi: I
W
#,
N
2 3 ,Ii: ,1# , W
N
A 13 2 1* 2 2 2 @ 2 2 I I W ,N , 1 * 1 * 3 Ii: Interruption pending for a device other than the one addressed 1# I nterruption pending for the addressed device
W Working Wi: Working with a device other than the one addressed
W# Working with the addressed device
N
Not operational CSW stored
@ In the Wi: I #X state, either condition code 1 may be set with the CSW stored, or condition
code 2 may be set, depending on the channel and the conditions in the channel. Note: Underscored condition codes pertain to conditions that can occur only on the multiplexer channel. Condition Codes Set by TEST I/O Input/Output Ope.rations 209
Previous Page Next Page