Specifications

System Macros Invoked by Drivers
SPI$MAP_BUFFER
SPI$MAP_BUFFER
Makes the process buffer involved in a data transfer available to the port driver.
Format
SPI$MAP_BUFFER [prio=HIGH]
Parameters
prio=HIGH
If prio=HIGH is specified, deadlocks (that can be incurred when several devices
are mapping buffers) are avoided. If the argument is not specified, the macro
defaults to LOW priority.
Description
The SPI$MAP_BUFFER macro makes the process buffer involved in a data
transfer accessible to the port driver. Typically, the I/O buffer is specified in the
$QIO call, is in process space (P0 space), and is mapped by process page-table
entries. Because a port driver executes in system context, it cannot access a
process’s page table.
The means by which the SPI$MAP_BUFFER macro makes a process buffer
available to the port driver depends upon the port hardware. For certain
implementations, it allocates a segment of the port’s DMA buffer and a set
of system page-table entries that double-map the process buffer. In others, it
obtains a set of port map registers and loads them with the page-frame numbers
of the process buffer pages.
Table 2–6 lists the inputs to the SPI$MAP_BUFFER macro.
Table 2–6 Inputs to the SPI$MAP_BUFFER Macro
Location Contents
R4 Address of the SPDT.
R5 Address of the SCDRP. The class driver must provide values
in the following fields:
SCDRP$L_BCNT Size in bytes of the buffer to
be mapped. The largest single
transfer that can be mapped is
determined by the port driver in
the call to SPI$CONNECT. The
SPI$CONNECT macro returns this
value to the class driver in R1. If
the class driver must accomplish
transfers larger than this value, it
must segment them.
SCDRP$W_BOFF Byte offset into the first page of the
buffer.
(continued on next page)
2–79