Specifications
System Macros Invoked by Drivers
WRITE_CSR
WRITE_CSR
Writes data to a device control and status register.
Format
WRITE_CSR src, dest [,length=LONGWORD] [,error=BUGCHECK]
[,environ=GENERIC] [,vme=pio_reg]
Parameters
src
Location containing the data to be written to the register.
dest
System virtual address or pseudo CSR address of the register in I/O space.
[length=LONGWORD]
Size of the CSR access: BYTE, WORD, or LONGWORD. Default is LONGWORD.
[error=BUGCHECK]
Proper disposition on error. Default is BUGCHECK.
BUGCHECK Register access failure should result in an UNEXPIOINT bug
check.
CONTINUE A status indication should be returned in the low bit of R0: set
for success, clear for failure.
[environ=GENERIC]
Specifies how the environment is to be determined. Default is GENERIC.
DRIVER Test for CRAM access to CSRs is based on bit DEV$M_CRAMIO
in location UCB$L_DEVCHAR2. (UCB address must be stored
in R5.) This bit is set when the driver is loaded.
GENERIC Test for CRAM access to CSRs is based on bit ARC$M_CRAMIO
in location EXE$GL_ARCHFLAGS. This bit is set during system
initialization.
SPECIFIC CRAM access to CSRs is assumed.
[vme=pio_reg]
Specifies the number of the programmed I/O (PIO) register. If the targeted device
resides on a VMEbus, this argument is required.
Description
The WRITE_CSR macro determines what type of I/O is required for the access,
either memory mapped or CRAM (mailbox) I/O, and writes the control register
using the appropriate method.
Example
10$: WRITE_CSR #XMI$M_NRESET, XMI$L_XBE(R5)
This invocation of the WRITE_CSR macro writes the reset bit to the XBE register
of the XMI.
2–110