Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/usermode/dev Move kpreempt_enable/disable to splsch...



details:   https://anonhg.NetBSD.org/src/rev/97dfcccc8ad7
branches:  trunk
changeset: 769275:97dfcccc8ad7
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Mon Sep 05 12:40:38 2011 +0000

description:
Move kpreempt_enable/disable to splsched()

diffstat:

 sys/arch/usermode/dev/cpu.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (44 lines):

diff -r 6e9f5bef5c15 -r 97dfcccc8ad7 sys/arch/usermode/dev/cpu.c
--- a/sys/arch/usermode/dev/cpu.c       Mon Sep 05 12:22:19 2011 +0000
+++ b/sys/arch/usermode/dev/cpu.c       Mon Sep 05 12:40:38 2011 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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);



Home | Main Index | Thread Index | Old Index