Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/usermode initialize lwp0 l_addr so we can switch ba...
details: https://anonhg.NetBSD.org/src/rev/5cfdef36a691
branches: trunk
changeset: 768212:5cfdef36a691
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Thu Aug 11 23:04:43 2011 +0000
description:
initialize lwp0 l_addr so we can switch back to it
diffstat:
sys/arch/usermode/conf/GENERIC | 9 ++++-----
sys/arch/usermode/dev/cpu.c | 14 +++++++++-----
sys/arch/usermode/include/cpu.h | 4 +---
3 files changed, 14 insertions(+), 13 deletions(-)
diffs (98 lines):
diff -r d7d25b35621d -r 5cfdef36a691 sys/arch/usermode/conf/GENERIC
--- a/sys/arch/usermode/conf/GENERIC Thu Aug 11 22:52:46 2011 +0000
+++ b/sys/arch/usermode/conf/GENERIC Thu Aug 11 23:04:43 2011 +0000
@@ -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
diff -r d7d25b35621d -r 5cfdef36a691 sys/arch/usermode/dev/cpu.c
--- a/sys/arch/usermode/dev/cpu.c Thu Aug 11 22:52:46 2011 +0000
+++ b/sys/arch/usermode/dev/cpu.c Thu Aug 11 23:04:43 2011 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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
diff -r d7d25b35621d -r 5cfdef36a691 sys/arch/usermode/include/cpu.h
--- a/sys/arch/usermode/include/cpu.h Thu Aug 11 22:52:46 2011 +0000
+++ b/sys/arch/usermode/include/cpu.h Thu Aug 11 23:04:43 2011 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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;
};
Home |
Main Index |
Thread Index |
Old Index