| CALLBACK(9) | Kernel Developer's Manual | CALLBACK(9) |
callback — generic
callback interface
#include
<sys/callback.h>
void
callback_head_init(struct
callback_head *ch, int
ipl);
void
callback_head_destroy(struct
callback_head *ch);
void
callback_register(struct
callback_head *ch, struct
callback_entry *ce, void
*obj, int (*fn)(struct
callback_entry *, void *, void *));
void
callback_unregister(struct
callback_head *ch, struct
callback_entry *ce);
int
callback_run_roundrobin(struct
callback_head *ch, void
*arg);
The generic callback interface allows
lower-level layer code to execute a registered function, or set of
functions, from the higher-level layer.
Registered functions must return one of these constants:
CALLBACK_CHAIN_CONTINUECALLBACK_CHAIN_ABORTThe callback structure callback_head should be initialized and destroyed using the functions described below. This structure contains the list of callback entries and other internal data.
The callback_entry structure is an entry, normally associated with the higher-level object. It contains the internal data of the callback interface.
callback_head_init(ch,
ipl)callback_head_destroy(ch)callback_register(ch,
ce, obj,
fn)callback_unregister(ch,
ce)callback_run_roundrobin(ch,
arg)The callback interface is implemented
within the file sys/kern/subr_callback.c.
| October 28, 2009 | NetBSD 11.0 |