Specifications
PCI Bus Support
13.9 Mapping a PCI Physical Address
Inputs
adp Address of bus ADP. Available to driver from
IDB$PS_ADP.
node Bus node number of device. Bus specific
interpretation. Available to driver from CRB$L_NODE
(driver must be loaded with /NODE qualifier).
physical_offset Address of a quadword cell. For EISA,
PCI, and Futurebus, the quadword cell should contain
the starting bus physical address to be mapped. For
Turbochannel, the quadword cell should contain the
physical offset from the Turbochannel slot base
address.
num_bytes Number of bytes to be mapped. Expressed in
terms of the device without regard to the
platform hardware addressing tricks. You should
figure out this value from your device spec. You
should request enough bytes to map all of the address
space that you need to touch all of your registers.
attributes Specifies desired attributes of space to be
mapped. From [lib]iocdef. One of the following:
IOC$K_BUS_IO_BYTE_GRAN
This attribute means that you want mapping in a
platform address space which corresponds to bus I/O
space and provides byte granularity access. In general,
if you are mapping device control registers that exist
in bus I/O space, you should specify this attribute.
For example, drivers for PCI devices with registers in
PCI I/O space or EISA devices with EISA I/O port
addresses should request mapping with this attribute.
IOC$K_BUS_MEM_BYTE_GRAN
This attribute means that you want mapping in a
platform address space which corresponds to bus memory
space and provides byte granularity access. In general,
if you are mapping device registers that exist in bus
memory space, you should specify this attribute. For
example, drivers for PCI devices with registers in PCI
memory space should request mapping with this attribute.
IOC$K_BUS_DENSE_SPACE
This attribute means that you want mapping in a
platform address space that corresponds to bus memory
space and provides coarse access granularity.
IOC$K_BUS_DENSE_SPACE is suitable for mapping device
memory buffers such as graphics frame buffers. In
IOC$K_BUS_DENSE_SPACE, there must be no side effects on
reads and it may be possible for the processor to merge
writes. Thus you should not map device registers in
dense space.
iohandle Pointer to a 64 bit cell. A 64 bit
number is written to this cell by IOC$MAP_IO when the
mapping request is successful. The caller must save
the iohandle, as it is an input to the platform
independent access routines IOC$READ_IO and
IOC$WRITE_IO, and the CRAM initialization routine
IOC$CRAM_CMD.
Outputs
SS$_NORMAL Success. The address space is mapped. A 64 bit
IOHANDLE is written to the caller’s buffer.
13–7