From 571cdd8317ef64c2937f3a7f97fb233e21b3c823 Mon Sep 17 00:00:00 2001 From: Jordan Gordeev Date: Fri, 22 Jan 2010 22:29:03 +0200 Subject: [PATCH] vkernel64: Fix the way syscalls are passed to the vkernel. --- sys/cpu/x86_64/include/trap.h | 1 + sys/platform/pc64/x86_64/exception.S | 1 + sys/platform/vkernel64/amd64/trap.c | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/cpu/x86_64/include/trap.h b/sys/cpu/x86_64/include/trap.h index c2a49d0b51..728f355349 100644 --- a/sys/cpu/x86_64/include/trap.h +++ b/sys/cpu/x86_64/include/trap.h @@ -95,6 +95,7 @@ /* Trap's coming from user mode */ #define T_SYSCALL80 0x080 +#define T_FAST_SYSCALL 0x081 #define T_USER 0x100 #endif /* !_CPU_TRAP_H_ */ diff --git a/sys/platform/pc64/x86_64/exception.S b/sys/platform/pc64/x86_64/exception.S index b9ca27e7f5..4efea946ae 100644 --- a/sys/platform/pc64/x86_64/exception.S +++ b/sys/platform/pc64/x86_64/exception.S @@ -285,6 +285,7 @@ IDTVEC(fast_syscall) movq $KUDSEL,TF_SS(%rsp) movq $KUCSEL,TF_CS(%rsp) movq $2,TF_ERR(%rsp) + movq $T_FAST_SYSCALL,TF_TRAPNO(%rsp) /* for the vkernel */ movq $0,TF_XFLAGS(%rsp) /* note: used in signal frame */ movq %rdi,TF_RDI(%rsp) /* arg 1 */ movq %rsi,TF_RSI(%rsp) /* arg 2 */ diff --git a/sys/platform/vkernel64/amd64/trap.c b/sys/platform/vkernel64/amd64/trap.c index 95a3a01b4b..2d266a26b5 100644 --- a/sys/platform/vkernel64/amd64/trap.c +++ b/sys/platform/vkernel64/amd64/trap.c @@ -385,7 +385,7 @@ user_trap(struct trapframe *frame) * Everything coming from user mode runs through user_trap, * including system calls. */ - if (frame->tf_trapno == T_SYSCALL80) { + if (frame->tf_trapno == T_FAST_SYSCALL) { syscall2(frame); return; } @@ -792,7 +792,7 @@ kernel_trap: MAKEMPSAFE(have_mplock); trap_fatal(frame, FALSE, eva); goto out2; - case T_SYSCALL80: + case T_SYSCALL80: /* JG T_FAST_SYSCALL? */ /* * Ignore this trap generated from a spurious SIGTRAP. * -- 2.41.0