Fri Oct 10 20:13:58 2008 UTC ()
fix brainfart: kthread_create() sets curlwp


(pooka)
diff -r1.6 -r1.7 src/sys/rump/librump/rumpkern/intr.c

cvs diff -r1.6 -r1.7 src/sys/rump/librump/rumpkern/intr.c (expand / switch to unified diff)

--- src/sys/rump/librump/rumpkern/intr.c 2008/10/10 13:14:41 1.6
+++ src/sys/rump/librump/rumpkern/intr.c 2008/10/10 20:13:58 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: intr.c,v 1.6 2008/10/10 13:14:41 pooka Exp $ */ 1/* $NetBSD: intr.c,v 1.7 2008/10/10 20:13:58 pooka Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2008 Antti Kantee. All Rights Reserved. 4 * Copyright (c) 2008 Antti Kantee. All Rights Reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -48,28 +48,26 @@ struct softint { @@ -48,28 +48,26 @@ struct softint {
48}; 48};
49static LIST_HEAD(, softint) si_pending = LIST_HEAD_INITIALIZER(si_pending); 49static LIST_HEAD(, softint) si_pending = LIST_HEAD_INITIALIZER(si_pending);
50static kmutex_t si_mtx; 50static kmutex_t si_mtx;
51static kcondvar_t si_cv; 51static kcondvar_t si_cv;
52 52
53static void 53static void
54intr_worker(void *arg) 54intr_worker(void *arg)
55{ 55{
56 struct softint *si; 56 struct softint *si;
57 void (*func)(void *) = NULL; 57 void (*func)(void *) = NULL;
58 void *funarg = NULL; /* XXX gcc */ 58 void *funarg = NULL; /* XXX gcc */
59 bool mpsafe = false; /* XXX gcc */ 59 bool mpsafe = false; /* XXX gcc */
60 60
61 rump_setup_curlwp(0, rump_nextlid(), 1); 
62 
63 for (;;) { 61 for (;;) {
64 /* 62 /*
65 * XXX: not exactly executed once per tick, but without 63 * XXX: not exactly executed once per tick, but without
66 * a proper timer ticktocking we don't really care. 64 * a proper timer ticktocking we don't really care.
67 */ 65 */
68 callout_hardclock(); 66 callout_hardclock();
69 67
70 mutex_enter(&si_mtx); 68 mutex_enter(&si_mtx);
71 if (LIST_EMPTY(&si_pending)) { 69 if (LIST_EMPTY(&si_pending)) {
72 cv_timedwait(&si_cv, &si_mtx, 1); 70 cv_timedwait(&si_cv, &si_mtx, 1);
73 } else { 71 } else {
74 si = LIST_FIRST(&si_pending); 72 si = LIST_FIRST(&si_pending);
75 func = si->si_func; 73 func = si->si_func;