Plug and Play BIOS Specification

Plug and Play BIOS Specification 1.0A Page 34
0 if successful - SUCCESS
!0 if an error (Bit 7 set) or a warning occurred - error code (The function return codes are described in
Appendix C)
The FLAGS and registers will be preserved, except for AX which contains the return code.
Example:
The following example illustrates how the 'C' style call interface could be made from an assembly
language module:
.
.
.
push Bios Selector
push Control ; Control flag
push segment/selector of devNodeBuffer ; pointer to devNodeBuffer
push offset of devNodeBuffer
push Node ; node number - only low 8-bits used
push SET_DEVICE_NODE ; Function 2
call FAR PTR entryPoint
add sp,12 ; Clean up stack
cmp ax,SUCCESS ; Function completed successfully?
jne error ; No-handle error condition
.
.
.
4.6 Event Notification Interface
Certain classes of systems may provide the capability for the addition or removal of system devices while
the system unit is powered on, such as inserting a Notebook unit into a Docking Station. System BIOS
support is necessary for providing Event Notification accessible to system software so that when devices
are added or removed the system software will comprehend the use or release of system resources by those
devices. Event Notification can be implemented as either a polled method or as asynchronous events.
System software can check the Control Word, which is located in the BIOS Plug and Play Header
structure, to determine the Event Notification method supported on the system. Refer to the Plug and
Play Installation Check section for more information on the BIOS Plug and Play Header and the Control
Word. The Control Word has bits defined that indicate the type of Event Notification. The BIOS Plug
and Play Header structure also contains the Event notification flag address, which specifies the physical
location of the Event Flag for polling. The Event Flag is the event polling location. When a system event
occurs bit 0 of the Event Flag will be set to indicate a pending event. Therefore, if the method for Event
Notification is through polling, system software should monitor the Event Flag to determine when a
configuration event has occurred.
The asynchronous method of Event Notification allows system software to install an interrupt handler as a
means for notification. The system BIOS will specify a system device node, which can be obtained from
the Get Node runtime function, that will specify the requirements for handling asynchronous events. The
system device node for asynchronous event management will be identified through the device identifier
field in the device node data structure, and will specify the interrupt number and an I/O port address.
This event system device node can be defined in one of two ways. First, the device node can follow the
generic implementation in which the device identifier is PNP0C03 and the interrupt number and I/O
address assigned are system specific. The only requirement with the generic implementation is that the
I/O address bit used for detecting the source of the interrupt and clearing the interrupt line is bit 0. If bit 0
of this I/O address is set to 1, then the interrupt was generated due to a system event. The interrupt
service routine should reset the interrupt line by clearing bit 0 at the specified I/O address. All other bits
read from the I/O address should not be modified. The second way the event system device node can be
defined is implementation specific where the system vendor must supply their own device identifier and
whatever resources are required for servicing the event interrupt. This method will require a specific
device driver associated with the device node identifier to support the event notification interface.