|
register_callback(9r)
Contents
|
register_callback - General: Registers a configuration
callback routine
int register_callback(
void (*function) (),
int point,
int order,
ulong argument );
Specifies the name of the routine that you want called at
a later time. Specifies the dispatch point at which the
kernel calls this callback routine. The kernel passes the
value associated with this dispatch point to the kernel
module's callback routine when it calls it. Specifies the
order in which you want callback routines registered for
the same dispatch point to be executed. The kernel passes
the value associated with this order to the kernel module's
callback routine when it calls it. You use this
argument to control the order of execution of multiple
callback routine within each dispatch point. The register_callback
routine executes a kernel module's callback
routine for the same dispatch point in increasing numerical
order of the value specified in the order argument.
Specifies an argument that you want the kernel to pass to
the kernel module'scallback routine when the kernel calls
it. You pass the integer constant 0L to indicate that you
do not want to pass an argument.
The register_callback routine registers a kernel module's
callback routine. The kernel calls a kernel module's callback
routine when execution reaches the point specified in
the point and order arguments. The kernel passes the values
specified in the point and argument arguments to the
kernel module's callback routine. Kernel modules implement
one or more callback routines to handle the different dispatch
points in the boot path.
The dispatch point constants you can pass to the point
argument are defined in the /usr/sys/include/sys/sysconfig.h
file. The following table lists the dispatch point
constants that kernel modules can use: The dispatch point
is hardware preconfiguration. Tasks that do not require
completion of hardware configuration can be performed at
this dispatch point. The dispatch point is hardware postconfiguration.
Tasks that require completion of hardware
configuration can be performed at this dispatch point.
The dispatch point is root file system available. Tasks
that require completion of the root file system mount
operation can be performed at this dispatch point.
The order constants you can pass to the order argument are
defined in the /usr/sys/include/sys/sysconfig.h file. The
following table lists the order constants that kernel modules
can use: This callback routine is registered at the
lowest priority. Typically, you pass this constant with
an appropriate offset. The kernel executes callback routines
registered at this priority last. This callback
routine is registered at the highest priority. Typically,
you pass this constant with an appropriate offset. The
kernel executes callback routines registered at this priority
first.
The kernel maintains an internal callback list that stores
the values you pass to the register_callback routine.
These callbacks remain registered until the user removes
them.
Only statically configured kernel modules need to implement
callback routines. Thus, only statically configured
kernel modules need to call the register_callback routine.
You typically call the cfgmgr_get_state routine to determine
if the kernel module is in the dynamic configuration
state or the static configuration state.
Upon successful completion, the register_callback routine
returns the value ESUCCESS.
Otherwise, register_callback returns one of the following
error constants defined in /usr/sys/include/sys/errno.h:
The system limit on the maximum number of callback
requests was exceeded. To change the maximum number of
callback requests, set the new value for the boot-time
tunable parameter max_callbacks in the cm subsystem
(located in the /etc/sysconfigtab database) and reboot the
system. You can use the sysconfigdb utility to accomplish
this task. The value you passed to the point argument is
outside the minimum and maximum range.
SEE ALSO
Kernel routines: cfgmgr_get_state(9r), unregister_callback(9r)
register_callback(9r)
[ Back ] |