1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef KERN_BULLETIN_H
- #define KERN_BULLETIN_H
- #include <stdint.h>
- #include <kern/list_types.h>
- #include <kern/macros.h>
- #include <kern/spinlock_types.h>
- #include <kern/work.h>
- typedef void (*bulletin_notif_fn_t) (uintptr_t, void *);
- struct bulletin_sub
- {
- struct list node;
- bulletin_notif_fn_t notif_fn;
- void *arg;
- };
- struct bulletin
- {
- struct spinlock lock;
- struct list subs;
- };
- void bulletin_init (struct bulletin *bulletin);
- void bulletin_subscribe (struct bulletin *bulletin, struct bulletin_sub *sub,
- bulletin_notif_fn_t notif_fn, void *arg);
- void bulletin_unsubscribe (struct bulletin *bulletin, struct bulletin_sub *sub);
- void bulletin_publish (struct bulletin *bulletin, uintptr_t value);
- #endif
|