3 #include "call-notifier.h"
5 static struct event_head call_notifier
;
7 void init_call_notifier(void)
9 call_notifier
.head
= NULL
;
10 mutexlock_init(&call_notifier
.lock
);
13 int register_call_notifier(struct event_block
*block
)
17 mutexlock_lock(&call_notifier
.lock
);
18 ret
= register_event_hook(&call_notifier
.head
, block
);
19 mutexlock_unlock(&call_notifier
.lock
);
24 int register_call_notifier_once(struct event_block
*block
)
28 mutexlock_lock(&call_notifier
.lock
);
29 ret
= register_event_hook_once(&call_notifier
.head
, block
);
30 mutexlock_unlock(&call_notifier
.lock
);
35 int unregister_call_notifier(struct event_block
*block
)
39 mutexlock_lock(&call_notifier
.lock
);
40 ret
= unregister_event_hook(&call_notifier
.head
, block
);
41 mutexlock_unlock(&call_notifier
.lock
);
46 int call_notifier_exec(unsigned long event
, const void *arg
)
50 mutexlock_lock(&call_notifier
.lock
);
51 ret
= call_event_hooks(&call_notifier
.head
, event
, arg
, NULL
);
52 mutexlock_unlock(&call_notifier
.lock
);