Module Name:    src
Committed By:   reinoud
Date:           Mon Sep  5 12:40:38 UTC 2011

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

Log Message:
Move kpreempt_enable/disable to splsched()


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 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.30 src/sys/arch/usermode/dev/cpu.c:1.31
--- src/sys/arch/usermode/dev/cpu.c:1.30	Mon Sep  5 12:22:19 2011
+++ src/sys/arch/usermode/dev/cpu.c	Mon Sep  5 12:40:38 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.30 2011/09/05 12:22:19 reinoud Exp $ */
+/* $NetBSD: cpu.c,v 1.31 2011/09/05 12:40:38 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <[email protected]>
@@ -29,7 +29,7 @@
 #include "opt_cpu.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.30 2011/09/05 12:22:19 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.31 2011/09/05 12:40:38 reinoud Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -159,6 +159,7 @@
 	struct pcb *oldpcb = oldlwp ? lwp_getpcb(oldlwp) : NULL;
 	struct pcb *newpcb = lwp_getpcb(newlwp);
 	struct cpu_info *ci = curcpu();
+	int s;
 
 #ifdef CPU_DEBUG
 	printf("cpu_switchto [%s,pid=%d,lid=%d] -> [%s,pid=%d,lid=%d]\n",
@@ -184,7 +185,7 @@
 	}
 #endif /* !CPU_DEBUG */
 
-	kpreempt_disable();
+	s = splsched();
 
 	ci->ci_stash = oldlwp;
 	curlwp = newlwp;
@@ -199,7 +200,7 @@
 	}
 	thunk_seterrno(newpcb->pcb_errno);
 
-	kpreempt_enable();
+	splx(s);
 
 #ifdef CPU_DEBUG
 	printf("cpu_switchto: returning %p (was %p)\n", ci->ci_stash, oldlwp);

Reply via email to