drv_callback(D3) drv_callback(D3)
NAME
drv_callback - call a function when an event happens
SYNOPSIS
#include <sys/f_ddi.h>
void drv_callback(int event, void (*func)(), void *arg)
Arguments
event The event for which the handler is to be registered or
unregistered. The existing set of events are:
NMI_ATTACH
Register an NMI interrupt handler.
NMI_DETACH
Unregister an NMI interrupt handler.
func Function or driver routine to be called when the event
happens.
arg Argument to the function to be called when an event
happens.
DESCRIPTION
When a driver has an event handler that needs to be called
when either an external hardware or software event happens it
can register the event handler with the base kernel. The base
kernel on reception of the event does the necessary
preprocessing and calls the handler to service the event.
There can be multiple handlers for the same event. Since the
base kernel does not know what caused the event, it simply
calls all the handlers that are registered and processes their
return values. The only event that the interface currently
handles are the non-maskable interrupt (NMI) event. The
driver can attach (NMI_ATTACH) or detach (NMI_DETACH) a
handler for the NMI event.
Event handlers are called with a single argument, which is the
arg value passed to drv_callback.
Return Values
The driver should return one of the following values:
Copyright 1994 Novell, Inc. Page 1
drv_callback(D3) drv_callback(D3)
NMI_UNKNOWN
The driver could not recognize the NMI interrupt.
That is, the driver has checked its device's status
registers, and no NMI condition is indicated.
NMI_FATAL A fatal NMI interrupt has occurred. The base kernel
panics the system on reception of this return value
from the driver.
NMI_BENIGN
A non-fatal NMI interrupt has occurred. The base
kernel continues after the reception of this return
value.
NMI_BUS_TIMEOUT
The driver has detected a bus timeout or bus fault
condition. This typically results from an attempt
to access non-existent physical memory.
USAGE
drv_callback is most commonly called during driver init(D2)
and halt(D2) routines to register and unregister,
respectively, handlers for NMI events.
Level
Base.
Synchronization Constraints
Can sleep.
Driver-defined basic locks and read/write locks may not be
held across calls to this function.
NOTICES
Portability
Intel386, Intel486, Pentium
Applicability
ddi: 6, 6mp, 7, 7mp
Copyright 1994 Novell, Inc. Page 2