Important: The information in this document is obsolete and should not be used for new development.
OpenSlot
You can use theOpenSlot
function to open a device driver that serves a slot device.
pascal OSErr OpenSlot(ParmBlkPtr paramBlock, Boolean async);
paramBlock
- A pointer to a
SlotDevParam
orMultiDevParam
structure of theParamBlockRec
union.async
- A Boolean value that indicates whether the request is asynchronous. You must set this field to
false
because device drivers cannot be opened asynchronously.
<-- ioResult OSErr The device driver's result code. --> ioNamePtr StringPtr A pointer to the driver name. <-- ioRefNum short The driver reference number. --> ioPermssn char Read/write permission. Additional fields for a single device
--> ioMix Ptr Reserved for use by the driver open routine. --> ioFlags short Determines the number of additional fields. --> ioSlot char The slot number. --> ioId char The slot resource ID. Additional fields for multiple devices
--> ioMMix Ptr Reserved for use by the driver open routine. --> ioMFlags short The number of additional fields. --> ioSEBlkPtr Ptr A pointer to an external parameter block. DESCRIPTION
TheOpenSlot
function is equivalent to thePBOpen
function, except that it sets bit 9 of the trap word, which signals the_Open
routine that the parameter block includes additional fields.If the sResource serves a single device, you should clear all the bits of the
ioFlags
field and include the slot number and slot resource ID in theioSlot
andioID
fields.If the sResource serves multiple devices, you should set the
fMulti
bit (bit 0) of theioFlags
field (clearing all other bits to 0), and specify, in theioSEBlkPtr
field, an external parameter block that is customized for the devices installed in the slot.SPECIAL CONSIDERATIONS
TheOpenSlot
function may move memory; you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro for theOpenSlot
function is_Open
(0xA200). Bit 9 of the trap word is set to signal that the parameter block contains additional fields for slot devices.You must set up register A0 with the address of the parameter block. When
_Open
returns, register D0 contains the result code. Register D0 is the only register affected by this function.
Registers on entry A0 Address of the parameter block
Registers on exit D0 Result code RESULT CODES
noErr 0 No error badUnitErr -21 Driver reference number does not match unit table unitEmptyErr -22 Driver reference number specifies a nil
handle in unit tableopenErr -23 Requested read/write permission does not match driver's open permission dInstErr -26 Driver resource not found SEE ALSO
For information about the low-level function for opening other device drivers, see the description of thePBOpen
function on page 1-61. For an example of opening a device driver, see Listing 1-1 on page 1-18. Refer to the chapter "Slot Manager" in this book for more information about slot device drivers.