Thomas Veerman fe45ee7ed0 ARM: disable __minix_init for now
On ARM we can't yet globally map pages into every process. So now that
we correctly receive the pointer to the globally mapped kern_info
struct, we have to ignore it on ARM because attempting to dereference
the pointer yields a segfault.
2013-01-25 17:07:02 +00:00

35 lines
862 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)
{
#ifdef __arm__
_minix_kerninfo = NULL;
#else
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;
}
#endif /* __arm__ */
}