Module Name: src Committed By: jmcneill Date: Sat Aug 13 14:06:54 UTC 2011
Modified Files: src/sys/arch/usermode/dev: cpu.c Log Message: lwp0pcb should be struct pcb not ucontext_t, and initialize it in cpu_startup instead of cpu_attach To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 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.14 src/sys/arch/usermode/dev/cpu.c:1.15 --- src/sys/arch/usermode/dev/cpu.c:1.14 Sat Aug 13 12:18:54 2011 +++ src/sys/arch/usermode/dev/cpu.c Sat Aug 13 14:06:54 2011 @@ -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 <jmcne...@invisible.ca> @@ -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