Module Name:    src
Committed By:   reinoud
Date:           Thu Sep  8 12:37:28 UTC 2011

Modified Files:
        src/sys/arch/usermode/dev: cpu.c

Log Message:
Cleanup syscall context creation


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/usermode/dev/cpu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/usermode/dev/cpu.c
diff -u src/sys/arch/usermode/dev/cpu.c:1.37 src/sys/arch/usermode/dev/cpu.c:1.38
--- src/sys/arch/usermode/dev/cpu.c:1.37	Thu Sep  8 12:10:13 2011
+++ src/sys/arch/usermode/dev/cpu.c	Thu Sep  8 12:37:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.37 2011/09/08 12:10:13 jmcneill Exp $ */
+/* $NetBSD: cpu.c,v 1.38 2011/09/08 12:37:28 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <[email protected]>
@@ -30,7 +30,7 @@
 #include "opt_hz.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.37 2011/09/08 12:10:13 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.38 2011/09/08 12:37:28 reinoud Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -335,11 +335,9 @@
 	    2, func, arg);
 
 	/* set up the ucontext for the syscall */
-	pcb2->pcb_ucp.uc_flags = _UC_CPU;
-	/* hack for it sets the stack anyway!! */
-	pcb2->pcb_syscall_ucp.uc_stack.ss_sp =
-		((uint8_t *) pcb2->pcb_syscall_ucp.uc_stack.ss_sp) - 4;
-	pcb2->pcb_syscall_ucp.uc_stack.ss_size = 0;
+	pcb2->pcb_syscall_ucp.uc_flags = _UC_CPU;
+	pcb2->pcb_syscall_ucp.uc_link = NULL;
+	pcb2->pcb_syscall_ucp.uc_stack.ss_size = 0;	/* no stack move */
 	thunk_makecontext_1(&pcb2->pcb_syscall_ucp, (void (*)(void)) syscall,
 	    l2);
 }

Reply via email to