Specifications

OpenVMS System Routines Called by OpenVMS AXP Device Drivers
IOC$WRITE_IO
IOC$WRITE_IO
Writes a value to a previously mapped location in I/O address space.
IOC$WRITE_IO requires that the I/O space to be accessed has been previously
mapped by a call to IOC$MAP_IO.
Description
The routine prototype is as follows:
int ioc$write_io (ADP *adp,
uint64 *iohandle,
int offset,
int length,
void *write_data)
Inputs
adp Address of bus ADP. Driver can get this from
IDB$PS_ADP.
iohandle Pointer to a 64 bit IOHANDLE. The 64 bit IOHANDLE
is obtained by calling the platform independent
mapping routine IOC$MAP_IO.
offset Offset in device space of field to be read or written.
This should be specified as an offset from the base of
the space that was previously mapped by the call to
IOC$MAP_IO. The offset is specified in terms of the
device or bus without regard to any hardware address
trickery.
length Length of field to be read or written. Should be 1
(byte), 2 (word), 3 (tribyte), 4 (longword) or 8
(quadword). Note that not all of these lengths are
supported on all buses.
read_data Pointer to a data cell. For ioc$read_io, the
data read from the device will be returned in this cell.
If the requested data length was 1, 2, 3, or 4, a
longword is written to the data cell with valid data
in the byte lane(s) corresponding to the requested
length and offset. If the requested data length was 8,
a quadword is written to the data cell.
write_data Pointer to a data cell. The data cell should
contain the data to be written to the device. For
lengths of 1, 2, 3 or 4, the ioc$write_io routine
reads a longword from the data cell and writes this
longword to the bus with the proper byte enables set
according to the length and offset. The actual
data to be written must be positioned in the proper
byte lane(s) according to the requested length and
offset. For a length 8 transfer, the ioc$write_io
routine reads a quadword from the data cell.
Outputs
SS$_NORMAL Success. If ioc$read_io, data is returned in the
callers buffer. If ioc$write_io, data is written to
device.
SS$_BADPARAM Bad input argument, such as an illegal length.
SS$_UNSUPPORTED A transaction length not supported by this bus
or platform.
A–33