Index Index for
Section 9
Index Alphabetical
listing for R
Index Bottom of
page

register_callback(9r)

NAME

register_callback - General: Registers a configuration callback routine

SYNOPSIS

int register_callback( void (*function) (), int point, int order, ulong argument );

ARGUMENTS

function Specifies the name of the routine that you want called at a later time. point 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. order 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. 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.

DESCRIPTION

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: CFG_PT_PRECONFIG The dispatch point is hardware preconfiguration. Tasks that do not require completion of hardware configuration can be performed at this dispatch point. CFG_PT_POSTCONFIG The dispatch point is hardware postconfiguration. Tasks that require completion of hardware configuration can be performed at this dispatch point. CFG_PT_ROOTFS_AVAIL 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: CFG_ORD_NOMINAL 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. CFG_ORD_MAXIMUM 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.

NOTES

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.

RETURN VALUES

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: ENOMEM 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. EINVAL The value you passed to the point argument is outside the minimum and maximum range.

FILES

<sysconfig.h>

SEE ALSO

Kernel routines: cfgmgr_get_state(9r), unregister_callback(9r)

Index Index for
Section 9
Index Alphabetical
listing for R
Index Top of
page