minix/kernel/arch/i386/usermapped_data_arch.c
Ben Gras 2d72cbec41 SYSENTER/SYSCALL support
. add cpufeature detection of both
	. use it for both ipc and kernelcall traps, using a register
	  for call number
	. SYSENTER/SYSCALL does not save any context, therefore userland
	  has to save it
	. to accomodate multiple kernel entry/exit types, the entry
	  type is recorded in the process struct. hitherto all types
	  were interrupt (soft int, exception, hard int); now SYSENTER/SYSCALL
	  is new, with the difference that context is not fully restored
	  from proc struct when running the process again. this can't be
	  done as some information is missing.
	. complication: cases in which the kernel has to fully change
	  process context (i.e. sigreturn). in that case the exit type
	  is changed from SYSENTER/SYSEXIT to soft-int (i.e. iret) and
	  context is fully restored from the proc struct. this does mean
	  the PC and SP must change, as the sysenter/sysexit userland code
	  will otherwise try to restore its own context. this is true in the
	  sigreturn case.
	. override all usage by setting libc_ipc=1
2012-09-24 15:53:43 +02:00

34 lines
1.1 KiB
C

#include "kernel.h"
#include "arch_proto.h"
struct minix_ipcvecs minix_ipcvecs_softint = {
.send_ptr = usermapped_send_softint,
.receive_ptr = usermapped_receive_softint,
.sendrec_ptr = usermapped_sendrec_softint,
.sendnb_ptr = usermapped_sendnb_softint,
.notify_ptr = usermapped_notify_softint,
.do_kernel_call_ptr = usermapped_do_kernel_call_softint,
.senda_ptr = usermapped_senda_softint
};
struct minix_ipcvecs minix_ipcvecs_sysenter = {
.send_ptr = usermapped_send_sysenter,
.receive_ptr = usermapped_receive_sysenter,
.sendrec_ptr = usermapped_sendrec_sysenter,
.sendnb_ptr = usermapped_sendnb_sysenter,
.notify_ptr = usermapped_notify_sysenter,
.do_kernel_call_ptr = usermapped_do_kernel_call_sysenter,
.senda_ptr = usermapped_senda_sysenter
};
struct minix_ipcvecs minix_ipcvecs_syscall = {
.send_ptr = usermapped_send_syscall,
.receive_ptr = usermapped_receive_syscall,
.sendrec_ptr = usermapped_sendrec_syscall,
.sendnb_ptr = usermapped_sendnb_syscall,
.notify_ptr = usermapped_notify_syscall,
.do_kernel_call_ptr = usermapped_do_kernel_call_syscall,
.senda_ptr = usermapped_senda_syscall
};