Module Name:    src
Committed By:   reinoud
Date:           Mon Sep  5 12:22:19 UTC 2011

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

Log Message:
Disable kernel preemption in the critical section of cpu_switchto()


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 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.29 src/sys/arch/usermode/dev/cpu.c:1.30
--- src/sys/arch/usermode/dev/cpu.c:1.29	Sun Sep  4 21:01:39 2011
+++ src/sys/arch/usermode/dev/cpu.c	Mon Sep  5 12:22:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.29 2011/09/04 21:01:39 reinoud Exp $ */
+/* $NetBSD: cpu.c,v 1.30 2011/09/05 12:22:19 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcne...@invisible.ca>
@@ -29,7 +29,7 @@
 #include "opt_cpu.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.29 2011/09/04 21:01:39 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.30 2011/09/05 12:22:19 reinoud Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -184,6 +184,8 @@
 	}
 #endif /* !CPU_DEBUG */
 
+	kpreempt_disable();
+
 	ci->ci_stash = oldlwp;
 	curlwp = newlwp;
 
@@ -197,6 +199,8 @@
 	}
 	thunk_seterrno(newpcb->pcb_errno);
 
+	kpreempt_enable();
+
 #ifdef CPU_DEBUG
 	printf("cpu_switchto: returning %p (was %p)\n", ci->ci_stash, oldlwp);
 #endif

Reply via email to