Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

config_intrhook(9) [freebsd man page]

CONFIG_INTRHOOK(9)					   BSD Kernel Developer's Manual					CONFIG_INTRHOOK(9)

config_intrhook -- schedule a function to be run after interrupts have been enabled, but before root is mounted SYNOPSIS
#include <sys/kernel.h> int config_intrhook_establish(struct intr_config_hook *hook); void config_intrhook_disestablish(struct intr_config_hook *hook); DESCRIPTION
The config_intrhook_establish() function schedules a function to be run after interrupts have been enabled, but before root is mounted. If the system has already passed this point in its initialization, the function is called immediately. The config_intrhook_disestablish() function removes the entry from the hook queue. Before root is mounted, all the previously established hooks are run. The boot process is then stalled until all handlers remove their hook from the hook queue with config_intrhook_disestablish(). The boot process then proceeds to attempt to mount the root file system. Any driver that can potentially provide devices they wish to be mounted as root must use either this hook, or probe all these devices in the ini- tial probe. Since interrupts are disabled during the probe process, many drivers need a method to probe for devices with interrupts enabled. The requests are made with the intr_config_hook structure. This structure is defined as follows: struct intr_config_hook { TAILQ_ENTRY(intr_config_hook) ich_links;/* Private */ void (*ich_func)(void *arg); /* function to call */ void *ich_arg; /* Argument to call */ }; Storage for the intr_config_hook structure must be provided by the driver. It must be stable from just before the hook is established until after the hook is disestablished. Specifically, hooks are run at SI_SUB_INT_CONFIG_HOOKS(), which is immediately after the scheduler is started, and just before the root file system device is discovered. RETURN VALUES
A zero return value means the hook was successfully added to the queue (with either deferred or immediate execution). A non-zero return value means the hook could not be added to the queue because it was already on the queue. SEE ALSO
These functions were introduced in FreeBSD 3.0 with the CAM subsystem, but are available for any driver to use. AUTHORS
The functions were written by Justin Gibbs <>. This manual page was written by M. Warner Losh <>. BSD
September 24, 2006 BSD

Check Out this Related Man Page

hook_t(9S)						    Data Structures for Drivers 						hook_t(9S)

hook_t - callback structure for subscribing to netinfo events SYNOPSIS
#include <sys/hook.h> INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). DESCRIPTION
The hook_t data structure defines a callback that is to be inserted into a networking event. This data structure must be allocated with a call to hook_alloc() and released with a call to hook_free(). STRUCTURE MEMBERS
hook_func_t h_func; /* callback function to invoke */ char *h_name; /* unique name given to the hook */ int h_flags; hook_hint_t h_hint; /* insertion hint type */ uintptr_t h_hintvalue; /* used with h_hint */ void *h_arg; /* value to pass into h_func */ typedef int (*hook_func_t)(net_event_t token, hook_data_t info, void *); HINT TYPES Hook hints are hints that are used at the time of insertion and are not rules that enforce where a hook lives for its entire lifetime on an event. The valid values for the h_hint field are: HH_NONE Insert the hook wherever convenient. HH_FIRST Place the hook first on the list of hooks. HH_LAST Place the hook last on the list of hooks. HH_BEFORE Place the hook before another hook on the list of hooks. The value in h_hintvalue must be a pointer to the name of another hook. HH_AFTER Place the hook after another hook on the list of hooks. The value in h_hintvalue must be a pointer to the name of another hook. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
netinfo(9F) SunOS 5.11 1 May 2008 hook_t(9S)
Man Page