vkernel64: Fix the way syscalls are passed to the vkernel.
authorJordan Gordeev <jgordeev@dir.bg>
Fri, 22 Jan 2010 20:29:03 +0000 (22:29 +0200)
committerSascha Wildner <saw@online.de>
Sun, 21 Mar 2010 08:16:45 +0000 (09:16 +0100)
sys/cpu/x86_64/include/trap.h
sys/platform/pc64/x86_64/exception.S
sys/platform/vkernel64/amd64/trap.c

index c2a49d0..728f355 100644 (file)
@@ -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_ */
index b9ca27e..4efea94 100644 (file)
@@ -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 */
index 95a3a01..2d266a2 100644 (file)
@@ -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.
                 *