#define HELLO_EVENT 0x62U extern int hello_register_notfiy_raw(struct notifier_block *n); extern int hello_raw_notifiy_call(unsigned long val, void *v); extern int hello_raw_notifier_chain_unregister(struct notifier_block *n);
//对接收到的消息进行处理 static int hello_receive_call(struct notifier_block *nb, unsigned long event, void *v) { switch(event) { case HELLO_EVENT: printk("notify1 receive a event\n"); break; default: break; } return 0; }
#define HELLO_EVENT 0x62U extern int hello_register_notfiy_raw(struct notifier_block *n); extern int hello_raw_notifiy_call(unsigned long val, void *v);
static int __init notify2_init(void) { //向其他模块发送消息 hello_raw_notifiy_call(TESTCHAIN_EVENT,"not_use"); return 0; }