1 2 #include <stdio.h> 3 #include <minix/ipc.h> 4 5 /* Minix kernel info, IPC functions pointers */ 6 struct minix_kerninfo *_minix_kerninfo = NULL; 7 8 void __minix_init(void) __attribute__((__constructor__, __used__)); 9 10 struct minix_ipcvecs _minix_ipcvecs = { 11 .sendrec = _ipc_sendrec_intr, 12 .send = _ipc_send_intr, 13 .notify = _ipc_notify_intr, 14 .senda = _ipc_senda_intr, 15 .sendnb = _ipc_sendnb_intr, 16 .receive = _ipc_receive_intr, 17 .do_kernel_call = _do_kernel_call_intr, 18 }; 19 __minix_init(void)20void __minix_init(void) 21 { 22 if((ipc_minix_kerninfo(&_minix_kerninfo) != 0) || 23 (_minix_kerninfo->kerninfo_magic != KERNINFO_MAGIC)) 24 { 25 _minix_kerninfo = NULL; 26 } 27 else if((_minix_kerninfo->ki_flags & MINIX_KIF_IPCVECS) && 28 (_minix_kerninfo->minix_ipcvecs != NULL)) 29 { 30 _minix_ipcvecs = *_minix_kerninfo->minix_ipcvecs; 31 } 32 } 33