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 Refactor for easier debug...



details:   https://anonhg.NetBSD.org/src/rev/bb45c0b4f036
branches:  trunk
changeset: 319120:bb45c0b4f036
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Thu May 17 19:00:39 2018 +0000

description:
Refactor for easier debugging and while here add some more signals

diffstat:

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

diffs (52 lines):

diff -r 970d971a2d12 -r bb45c0b4f036 sys/arch/usermode/dev/cpu.c
--- a/sys/arch/usermode/dev/cpu.c       Thu May 17 12:07:48 2018 +0000
+++ b/sys/arch/usermode/dev/cpu.c       Thu May 17 19:00:39 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.74 2017/06/01 02:45:08 chs Exp $ */
+/* $NetBSD: cpu.c,v 1.75 2018/05/17 19:00:39 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
 #include "opt_hz.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.74 2017/06/01 02:45:08 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.75 2018/05/17 19:00:39 reinoud Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -119,6 +119,8 @@
        sc->sc_ucp.uc_flags = _UC_STACK | _UC_CPU | _UC_SIGMASK;
        thunk_sigaddset(&sc->sc_ucp.uc_sigmask, SIGALRM);
        thunk_sigaddset(&sc->sc_ucp.uc_sigmask, SIGIO);
+       thunk_sigaddset(&sc->sc_ucp.uc_sigmask, SIGINT);
+       thunk_sigaddset(&sc->sc_ucp.uc_sigmask, SIGTSTP);
 }
 
 void
@@ -191,9 +193,13 @@
 void
 cpu_switchto_atomic(lwp_t *oldlwp, lwp_t *newlwp)
 {
-       struct pcb *oldpcb = oldlwp ? lwp_getpcb(oldlwp) : NULL;
-       struct pcb *newpcb = lwp_getpcb(newlwp);
-       struct cpu_info *ci = curcpu();
+       struct pcb *oldpcb;
+       struct pcb *newpcb;
+       struct cpu_info *ci;
+
+       oldpcb = oldlwp ? lwp_getpcb(oldlwp) : NULL;
+       newpcb = lwp_getpcb(newlwp);
+       ci = curcpu();
 
        ci->ci_stash = oldlwp;
 
@@ -241,6 +247,7 @@
 #endif /* !CPU_DEBUG */
 
        /* create atomic switcher */
+       KASSERT(newlwp);
        thunk_makecontext(&sc->sc_ucp, (void (*)(void)) cpu_switchto_atomic,
                        2, oldlwp, newlwp, NULL, NULL);
 



Home | Main Index | Thread Index | Old Index