Explicit IST Extension
By the time the PCI devices built into the Macintosh system are initialized, an
IST has been constructed and populated with nodes for every interrupt source within the system, including all PCI expansion cards and PCI-to-PCI bridges that use the default PCI bridge IST extensions.
However, PCI expansion devices that cannot use the default PCI bridge IST extensions or that have special requirements will not automatically receive nodes in the IST. Examples of such devices are multifunction cards with non-PCI controller devices and PCI-to-NuBus expansion chassis. Because these devices still represent additions to the system hardware, the third-party driver writer needs to provide software that extends both the Name Registry and the Apple-provided IST.
Note
PCI-to-NuBus expansion bus cards are a special case. NuBus devices are controlled by 68K drivers and so require the Macintosh facilities normally provided for NuBus devices. The interrupt handler for the PCI-to-NuBus bridge must use or provide Slot Manager dispatching and interrupt registration for NuBus device drivers. The initialization of a PCI-to-NuBus bridge does not need to extend the Registry or the IST.
If you are extending the system by means of PCI bus slots or a multifunction device, the work to be done includes several basic steps:
-
When the device initialization code is first invoked, it will be passed the
RegEntryID
value of the Registry node that represents the PCI expansion slot that the device occupies. Use the
RegistryPropertyGet
function to get the
driver-ist
property for the PCI expansion slot, which will have the
InterruptSetMember
value for the slot's interrupts.
-
Pay particular attention to the fact that the parent (or bridge or multifunction) initialization code must be marked as initialize and open upon discovery. This is a requirement because extension devices must be available in the Name Registry before family experts are run. If this requirement is not met, extension devices may not be made available to the system because their child devices will not be found. Initialize and open upon discovery is described in
Driver Run-Time Structure.
-
Use the
GetInterruptFunctions
function with the slot's
InterruptSetMember
value to get the default IDR registered with the parent member. Call the IDR to disable the parent member's interrupt propagation. This keeps spurious interrupts from occurring before the IST extension is complete.
-
The device initialization code must extend the IST. Use the
CreateInterruptSet
function to create a new interrupt set with the slot's
InterruptSetMember
value as the parent member. Make the interrupt set size the same as the number of new PCI bus slots or the number of functions (in a multifunction device).
-
Register a transversal ISR with the parent member, using the slot's
InterruptSetMember
value. When invoked, this transversal ISR should further route the slot interrupt to one of the interrupt members in the newly created interrupt set.
-
If the device's interrupt controller hardware can enable and disable interrupts for each of the interrupt members in the new interrupt set, register tailored IERs and IDRs with each of the interrupt members. Otherwise, the IER and IDR that the interrupt members inherited from the parent member will moderate interrupts transparently to the caller.
-
For each additional device or function, a node must also be added to the Name Registry. Adding nodes to the Registry is described in
Name Creation and Deletion.
-
Each new child entry in the Registry requires a complete set of properties to allow the device to be located by its family experts. A complete set of properties is the set of properties described by and installed by Open Firmware. For details, see the Open Firmware standard and
Table 10-1.
-
In addition to the Open Firmware requirements, each new child entry in the Registry must also have a
driver-ist
property installed. This lets subsequent drivers that want to register an ISR with one of the newly created interrupt members find the correct
InterruptSetMember
value.
-
Create properties using the rules described in the previous section and in
Property Management. For each new child entry in the Registry, create a
driver-ist
property with the corresponding new interrupt members that were used to extend the IST.
-
Call the IDR for each of the newly created interrupt members to keep spurious interrupts from occurring.
-
Call the IER for the parent member to enable interrupts for the system extension as a whole.
Note
There will always be at least one new interrupt member created for each new child entry in the Name Registry. However, keep in mind that the
driver-ist
property is a logical grouping of interrupt members for a device or function. Because of this grouping, you might end up creating more interrupt members than child entries in the Registry.
Native drivers can now be loaded against any of the new devices, as created by the extension to the IST and the Name Registry, just like other native drivers.
© 1999 Apple Computer, Inc. (Last Updated 26 March 99)