Specifications

Operating System Routines
EXE$SETCHAR, EXE$SETMODE
Description
A driver uses EXE$SETCHAR or EXE$SETMODE as an FDT routine to process
the set-device-mode (IO$_SETMODE) and set-device-characteristics (IO$_
SETCHAR) functions. If setting device characteristics requires device activity
or synchronization with fork processing, the drivers FDT entry must specify
EXE$SETMODE. Otherwise, it can specify EXE$SETCHAR.
EXE$SETCHAR and EXE$SETMODE examine the current value of UCB$B_
DEVCLASS to determine whether the device permits the specified function. If
the device class is disk (DC$_DISK), the routines place SS$_ILLIOFUNC status
in R0 and transfer control to EXE$ABORTIO to terminate the request.
EXE$SETCHAR and EXE$SETMODE then ensure that the process has read
access to the quadword containing the new device characteristics. If it does
not, the routines place SS$_ACCVIO status in R0 and transfer control to
EXE$ABORTIO to terminate the request.
If the request passes these checks, EXE$SETCHAR and EXE$SETMODE proceed
as follows:
EXE$SETCHAR stores the specified characteristics in the UCB. For an IO$_
SETCHAR function, the device type and class fields (UCB$B_DEVCLASS
and UCB$B_DEVTYPE, respectively) receive the first word of data. For both
IO$_SETCHAR and IO$_SETMODE functions, EXE$SETCHAR writes the
second word into the default-buffer-size field (UCB$W_DEVBUFSIZ) and
the third and fourth words into the device-dependent-characteristics field
(UCB$Q_DEVDEPEND).
Finally, EXE$SETCHAR stores normal completion status (SS$_NORMAL)
in R0 and transfers control to EXE$FINISHIO to insert the IRP in the
systemwide I/O postprocessing queue.
EXE$SETMODE stores the specified quadword of characteristics in IRP$L_
MEDIA, places normal completion status (SS$_NORMAL) in R0, and
transfers control to EXE$QIODRVPKT to deliver the IRP to the drivers
start-I/O routine.
The drivers start-I/O routine copies data from IRP$L_MEDIA and the following
longword into UCB$W_DEVBUFSIZ, UCB$Q_DEVDEPEND, and, if the I/O
function is IO$_SETCHAR, UCB$B_DEVCLASS and UCB$B_DEVTYPE as well.
3–58