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 lwp0pcb should be struct pcb not ucont...



details:   https://anonhg.NetBSD.org/src/rev/34b310ee32a8
branches:  trunk
changeset: 768266:34b310ee32a8
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Aug 13 14:06:54 2011 +0000

description:
lwp0pcb should be struct pcb not ucontext_t, and initialize it in cpu_startup
instead of cpu_attach

diffstat:

 sys/arch/usermode/dev/cpu.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (50 lines):

diff -r 374d48f20390 -r 34b310ee32a8 sys/arch/usermode/dev/cpu.c
--- a/sys/arch/usermode/dev/cpu.c       Sat Aug 13 14:02:48 2011 +0000
+++ b/sys/arch/usermode/dev/cpu.c       Sat Aug 13 14:06:54 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.14 2011/08/13 12:18:54 jmcneill Exp $ */
+/* $NetBSD: cpu.c,v 1.15 2011/08/13 14:06:54 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.14 2011/08/13 12:18:54 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.15 2011/08/13 14:06:54 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -68,7 +68,7 @@
        struct cpu_info *sc_ci;
 } cpu_softc_t;
 
-static ucontext_t lwp0pcb;
+static struct pcb lwp0pcb;
 
 CFATTACH_DECL_NEW(cpu, sizeof(cpu_softc_t), cpu_match, cpu_attach, NULL, NULL);
 
@@ -93,10 +93,6 @@
 
        sc->sc_dev = self;
        sc->sc_ci = &cpu_info_primary;
-
-       if (thunk_getcontext(&lwp0pcb))
-               panic("getcontext failed");
-       uvm_lwp_setuarea(&lwp0, (vaddr_t)&lwp0pcb);
 }
 
 void
@@ -316,6 +312,11 @@
 cpu_startup(void)
 {
        banner();
+
+       memset(&lwp0pcb, 0, sizeof(lwp0pcb));
+       if (thunk_getcontext(&lwp0pcb.pcb_ucp))
+               panic("getcontext failed");
+       uvm_lwp_setuarea(&lwp0, (vaddr_t)&lwp0pcb);
 }
 
 void



Home | Main Index | Thread Index | Old Index