Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Devices /
Chapter 2 - Slot Manager / Slot Manager Reference
Slot Manager Routines / Getting Information About Expansion Cards and Declaration ROMs


SFindDevBase

You can use the SFindDevBase function to determine the base address of a slot device.

FUNCTION SFindDevBase (spBlkPtr: SpBlockPtr): OSErr;
spBlkPtr
A pointer to a Slot Manager parameter block.
-->spSlotSignedByteThe slot number.
-->spIdSignedByteThe sResource ID.
<--spResultLongIntThe device base address.

DESCRIPTION
The SFindDevBase function returns the base address of a device, using information contained in the sResource. Use of the base address is optional (except for video cards) and device-specific. For a video card this must be the base address for the pixel map in the card's GDevice record (which is described in Inside Macintosh: Imaging With QuickDraw.) For other types of cards, the base address is defined by the card designer. The Slot Manager makes no use of this information.

The base address consists of the card's slot address plus an optional offset that the card designer can specify using the MinorBaseOS or MajorBaseOS entries of the sResource. See Table 2-4 on page 2-55 for a description of how the Slot Manager calculates the base address.

You specify the slot in the spSlot field of the Slot Manager parameter block you point to in the spBlkPtr parameter, and the sResource ID with the spId field.
The SFindDevBase function returns the base address in the spResult field of the parameter block.

Note
The base address of a slot device is also stored in the dCtlDevBase field of the device control entry. The InsertSRTRec function automatically updates the dCtlDevBase field when a new record is added to the slot resource table. You need to call SFindDevBase only if you used the SUpdateSRTRec function to update the slot resource table.
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the SFindDevBase function are
Trap macroSelector
_SlotManager$001B

You must set up register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
Registers on entry
A0Address of the parameter block
D0$001B
Registers on exit
D0Result code

RESULT CODES
noErr0No error
smEmptySlot-300No card in this slot
SEE ALSO
For more information about how the device base address is calculated, see the description of the InsertSRTRec function on page 2-54.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996