minix/lib/libc/sys-minix/init.c
Ben Gras 08cb986d3f vm: fix kernel-requested mappings for arm
. make vm tell kernel virtual locations of mappings
	. makes _minix_kerninfo feature work
	. fix for mappings being larger than what 1 pde can address
	  (e.g. devices memory requested on arm)
	. still requires a special case for devices memory for the
	  kernel, which has to switch to virtual addressing

Change-Id: I2e94090aa432346fa4da0edeba72f0b7406c2ad7
2013-01-29 17:57:04 +00:00

30 lines
795 B
C

#include <stdio.h>
#include <minix/ipc.h>
/* Minix kernel info, IPC functions pointers */
struct minix_kerninfo *_minix_kerninfo = NULL;
void __minix_init(void) __attribute__((__constructor__, __used__));
struct minix_ipcvecs _minix_ipcvecs = {
.sendrec = _sendrec_orig,
.send = _send_orig,
.notify = _notify_orig,
.senda = _senda_orig,
.sendnb = _sendnb_orig,
.receive = _receive_orig,
.do_kernel_call = _do_kernel_call_orig,
};
void __minix_init(void)
{
if((_minix_kernel_info_struct(&_minix_kerninfo)) != 0
|| _minix_kerninfo->kerninfo_magic != KERNINFO_MAGIC) {
_minix_kerninfo = NULL;
} else if((_minix_kerninfo->ki_flags & MINIX_KIF_IPCVECS) &&
_minix_kerninfo->minix_ipcvecs) {
_minix_ipcvecs = *_minix_kerninfo->minix_ipcvecs;
}
}