Module Name: src
Committed By: jmcneill
Date: Thu Aug 11 23:04:44 UTC 2011
Modified Files:
src/sys/arch/usermode/conf: GENERIC
src/sys/arch/usermode/dev: cpu.c
src/sys/arch/usermode/include: cpu.h
Log Message:
initialize lwp0 l_addr so we can switch back to it
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/usermode/conf/GENERIC
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/usermode/dev/cpu.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/usermode/include/cpu.h
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/conf/GENERIC
diff -u src/sys/arch/usermode/conf/GENERIC:1.7 src/sys/arch/usermode/conf/GENERIC:1.8
--- src/sys/arch/usermode/conf/GENERIC:1.7 Thu Aug 11 22:30:41 2011
+++ src/sys/arch/usermode/conf/GENERIC Thu Aug 11 23:04:43 2011
@@ -1,11 +1,13 @@
-# $NetBSD: GENERIC,v 1.7 2011/08/11 22:30:41 jmcneill Exp $
+# $NetBSD: GENERIC,v 1.8 2011/08/11 23:04:43 jmcneill Exp $
include "arch/usermode/conf/std.usermode"
options INCLUDE_CONFIG_FILE
-#ident "GENERIC-$Revision: 1.7 $"
+#ident "GENERIC-$Revision: 1.8 $"
maxusers 32
+makeoptions DEBUG="-g3"
+
#options MEMSIZE=65536 # amount of memory to allocate (in KB)
options MEMSIZE=131072
@@ -23,9 +25,6 @@
options NKMEMPAGES=256
-#options DDB
-#options DDB_HISTORY_SIZE=512
-
options COMPAT_BSDPTY
options COMPAT_50
Index: src/sys/arch/usermode/dev/cpu.c
diff -u src/sys/arch/usermode/dev/cpu.c:1.8 src/sys/arch/usermode/dev/cpu.c:1.9
--- src/sys/arch/usermode/dev/cpu.c:1.8 Wed Aug 10 01:32:44 2011
+++ src/sys/arch/usermode/dev/cpu.c Thu Aug 11 23:04:44 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.8 2011/08/10 01:32:44 jmcneill Exp $ */
+/* $NetBSD: cpu.c,v 1.9 2011/08/11 23:04:44 jmcneill Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <[email protected]>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.8 2011/08/10 01:32:44 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.9 2011/08/11 23:04:44 jmcneill Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -61,6 +61,8 @@
struct cpu_info *sc_ci;
} cpu_softc_t;
+static ucontext_t lwp0pcb;
+
CFATTACH_DECL_NEW(cpu, sizeof(cpu_softc_t), cpu_match, cpu_attach, NULL, NULL);
static int
@@ -86,9 +88,11 @@
sc->sc_ci = &cpu_info_primary;
sc->sc_ci->ci_dev = 0;
sc->sc_ci->ci_self = &cpu_info_primary;
-#if notyet
sc->sc_ci->ci_curlwp = &lwp0;
-#endif
+
+ if (getcontext(&lwp0pcb))
+ panic("getcontext failed");
+ uvm_lwp_setuarea(&lwp0, (vaddr_t)&lwp0pcb);
}
void
@@ -133,7 +137,7 @@
void
cpu_need_resched(struct cpu_info *ci, int flags)
{
- ci->ci_want_resched = 1;
+ ci->ci_want_resched |= flags;
}
void
Index: src/sys/arch/usermode/include/cpu.h
diff -u src/sys/arch/usermode/include/cpu.h:1.3 src/sys/arch/usermode/include/cpu.h:1.4
--- src/sys/arch/usermode/include/cpu.h:1.3 Wed Oct 21 21:12:04 2009
+++ src/sys/arch/usermode/include/cpu.h Thu Aug 11 23:04:44 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.3 2009/10/21 21:12:04 rmind Exp $ */
+/* $NetBSD: cpu.h,v 1.4 2011/08/11 23:04:44 jmcneill Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <[email protected]>
@@ -46,9 +46,7 @@
int ci_want_resched;
volatile int ci_mtx_count;
volatile int ci_mtx_oldspl;
-#if notyet
lwp_t *ci_curlwp;
-#endif
lwp_t *ci_stash;
};