| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: intr.c,v 1.30 2010/08/10 19:16:04 pooka Exp $ */ | | 1 | /* $NetBSD: intr.c,v 1.31 2010/08/10 21:32:38 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 | * |
| @@ -16,27 +16,27 @@ | | | @@ -16,27 +16,27 @@ |
16 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | | 16 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | | 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | | 18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | | 20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
25 | * SUCH DAMAGE. | | 25 | * SUCH DAMAGE. |
26 | */ | | 26 | */ |
27 | | | 27 | |
28 | #include <sys/cdefs.h> | | 28 | #include <sys/cdefs.h> |
29 | __KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.30 2010/08/10 19:16:04 pooka Exp $"); | | 29 | __KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.31 2010/08/10 21:32:38 pooka Exp $"); |
30 | | | 30 | |
31 | #include <sys/param.h> | | 31 | #include <sys/param.h> |
32 | #include <sys/atomic.h> | | 32 | #include <sys/atomic.h> |
33 | #include <sys/cpu.h> | | 33 | #include <sys/cpu.h> |
34 | #include <sys/kernel.h> | | 34 | #include <sys/kernel.h> |
35 | #include <sys/kmem.h> | | 35 | #include <sys/kmem.h> |
36 | #include <sys/kthread.h> | | 36 | #include <sys/kthread.h> |
37 | #include <sys/malloc.h> | | 37 | #include <sys/malloc.h> |
38 | #include <sys/intr.h> | | 38 | #include <sys/intr.h> |
39 | #include <sys/timetc.h> | | 39 | #include <sys/timetc.h> |
40 | | | 40 | |
41 | #include <rump/rumpuser.h> | | 41 | #include <rump/rumpuser.h> |
42 | | | 42 | |
| @@ -217,27 +217,27 @@ softint_init(struct cpu_info *ci) | | | @@ -217,27 +217,27 @@ softint_init(struct cpu_info *ci) |
217 | } | | 217 | } |
218 | cd->cpu_softcpu = slev; | | 218 | cd->cpu_softcpu = slev; |
219 | | | 219 | |
220 | /* softint might run on different physical CPU */ | | 220 | /* softint might run on different physical CPU */ |
221 | membar_sync(); | | 221 | membar_sync(); |
222 | | | 222 | |
223 | for (i = 0; i < SOFTINT_COUNT; i++) { | | 223 | for (i = 0; i < SOFTINT_COUNT; i++) { |
224 | rv = kthread_create(PRI_NONE, | | 224 | rv = kthread_create(PRI_NONE, |
225 | KTHREAD_MPSAFE | KTHREAD_INTR, ci, | | 225 | KTHREAD_MPSAFE | KTHREAD_INTR, ci, |
226 | sithread, (void *)(uintptr_t)i, | | 226 | sithread, (void *)(uintptr_t)i, |
227 | NULL, "rsi%d/%d", ci->ci_index, i); | | 227 | NULL, "rsi%d/%d", ci->ci_index, i); |
228 | } | | 228 | } |
229 | | | 229 | |
230 | rv = kthread_create(PRI_NONE, KTHREAD_MPSAFE | KTHREAD_INTR, | | 230 | rv = kthread_create(PRI_NONE, KTHREAD_MPSAFE, |
231 | ci, doclock, NULL, NULL, "rumpclk%d", ci->ci_index); | | 231 | ci, doclock, NULL, NULL, "rumpclk%d", ci->ci_index); |
232 | if (rv) | | 232 | if (rv) |
233 | panic("clock thread creation failed: %d", rv); | | 233 | panic("clock thread creation failed: %d", rv); |
234 | } | | 234 | } |
235 | | | 235 | |
236 | /* | | 236 | /* |
237 | * Soft interrupts bring two choices. If we are running with thread | | 237 | * Soft interrupts bring two choices. If we are running with thread |
238 | * support enabled, defer execution, otherwise execute in place. | | 238 | * support enabled, defer execution, otherwise execute in place. |
239 | * See softint_schedule(). | | 239 | * See softint_schedule(). |
240 | * | | 240 | * |
241 | * As there is currently no clear concept of when a thread finishes | | 241 | * As there is currently no clear concept of when a thread finishes |
242 | * work (although rump_clear_curlwp() is close), simply execute all | | 242 | * work (although rump_clear_curlwp() is close), simply execute all |
243 | * softints in the timer thread. This is probably not the most | | 243 | * softints in the timer thread. This is probably not the most |