Module Name:    src
Committed By:   reinoud
Date:           Fri Sep  9 20:06:04 UTC 2011

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

Log Message:
Use the new thunk_makecontext() scheme with function and upto 3 aguments


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/usermode/dev/cpu.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/usermode/usermode/machdep.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.42 src/sys/arch/usermode/dev/cpu.c:1.43
--- src/sys/arch/usermode/dev/cpu.c:1.42	Fri Sep  9 18:41:16 2011
+++ src/sys/arch/usermode/dev/cpu.c	Fri Sep  9 20:06:04 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.42 2011/09/09 18:41:16 reinoud Exp $ */
+/* $NetBSD: cpu.c,v 1.43 2011/09/09 20:06:04 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcne...@invisible.ca>
@@ -30,7 +30,7 @@
 #include "opt_hz.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.42 2011/09/09 18:41:16 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.43 2011/09/09 20:06:04 reinoud Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -315,20 +315,20 @@
 	if (thunk_getcontext(&pcb2->pcb_ucp))
 		panic("getcontext failed");
 
-	/* set up the ucontext for the userland */
+	/* set up the ucontext for the userland switch */
 	pcb2->pcb_ucp.uc_stack.ss_sp = stack;
 	pcb2->pcb_ucp.uc_stack.ss_size = stacksize;
 	pcb2->pcb_ucp.uc_link = &pcb2->pcb_userland_ucp;
 	pcb2->pcb_ucp.uc_flags = _UC_STACK | _UC_CPU;
-	thunk_makecontext(&pcb2->pcb_ucp, (void (*)(void))cpu_lwp_trampoline,
-	    2, func, arg);
+	thunk_makecontext(&pcb2->pcb_ucp, (void (*)(void)) cpu_lwp_trampoline,
+	    2, func, arg, NULL);
 
 	/* set up the ucontext for the syscall */
 	pcb2->pcb_syscall_ucp.uc_flags = _UC_CPU;
 	pcb2->pcb_syscall_ucp.uc_link = &pcb2->pcb_userland_ucp;
 	pcb2->pcb_syscall_ucp.uc_stack.ss_size = 0;	/* no stack move */
 	thunk_makecontext(&pcb2->pcb_syscall_ucp, (void (*)(void)) syscall,
-	    0, NULL, NULL);
+	    0, NULL, NULL, NULL);
 }
 
 void

Index: src/sys/arch/usermode/usermode/machdep.c
diff -u src/sys/arch/usermode/usermode/machdep.c:1.28 src/sys/arch/usermode/usermode/machdep.c:1.29
--- src/sys/arch/usermode/usermode/machdep.c:1.28	Fri Sep  9 12:44:27 2011
+++ src/sys/arch/usermode/usermode/machdep.c	Fri Sep  9 20:06:04 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.28 2011/09/09 12:44:27 reinoud Exp $ */
+/* $NetBSD: machdep.c,v 1.29 2011/09/09 20:06:04 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk <rein...@netbsd.org>
@@ -32,7 +32,7 @@
 #include "opt_urkelvisor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.28 2011/09/09 12:44:27 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.29 2011/09/09 20:06:04 reinoud Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -200,7 +200,7 @@
 
 	ucp->uc_stack.ss_sp = (void *) (stack-4);	/* to prevent clearing */
 	ucp->uc_stack.ss_size = 0; //pack->ep_ssize;
-	thunk_makecontext(ucp, (void *) pack->ep_entry, 0, NULL, NULL);
+	thunk_makecontext(ucp, (void *) pack->ep_entry, 0, NULL, NULL, NULL);
 
 	/* patch up */
 	reg[ 8] = l->l_proc->p_psstrp;	/* _REG_EBX */

Reply via email to