| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: evtchn.c,v 1.62 2012/02/12 14:24:08 jym Exp $ */ | | 1 | /* $NetBSD: evtchn.c,v 1.62.8.1 2013/12/17 22:39:49 riz Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2006 Manuel Bouyer. | | 4 | * Copyright (c) 2006 Manuel Bouyer. |
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 | * |
| @@ -44,27 +44,27 @@ | | | @@ -44,27 +44,27 @@ |
44 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 44 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
45 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 45 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
46 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 46 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
47 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 47 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
48 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 48 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
49 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 49 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
50 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 50 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
51 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 51 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
52 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 52 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
53 | */ | | 53 | */ |
54 | | | 54 | |
55 | | | 55 | |
56 | #include <sys/cdefs.h> | | 56 | #include <sys/cdefs.h> |
57 | __KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.62 2012/02/12 14:24:08 jym Exp $"); | | 57 | __KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.62.8.1 2013/12/17 22:39:49 riz Exp $"); |
58 | | | 58 | |
59 | #include "opt_xen.h" | | 59 | #include "opt_xen.h" |
60 | #include "isa.h" | | 60 | #include "isa.h" |
61 | #include "pci.h" | | 61 | #include "pci.h" |
62 | | | 62 | |
63 | #include <sys/param.h> | | 63 | #include <sys/param.h> |
64 | #include <sys/cpu.h> | | 64 | #include <sys/cpu.h> |
65 | #include <sys/kernel.h> | | 65 | #include <sys/kernel.h> |
66 | #include <sys/systm.h> | | 66 | #include <sys/systm.h> |
67 | #include <sys/device.h> | | 67 | #include <sys/device.h> |
68 | #include <sys/proc.h> | | 68 | #include <sys/proc.h> |
69 | #include <sys/kmem.h> | | 69 | #include <sys/kmem.h> |
70 | #include <sys/reboot.h> | | 70 | #include <sys/reboot.h> |
| @@ -337,33 +337,26 @@ splx: | | | @@ -337,33 +337,26 @@ splx: |
337 | iplbit = 1 << (NIPL - 1); | | 337 | iplbit = 1 << (NIPL - 1); |
338 | i = (NIPL - 1); | | 338 | i = (NIPL - 1); |
339 | while (iplmask != 0 && i > ilevel) { | | 339 | while (iplmask != 0 && i > ilevel) { |
340 | while (iplmask & iplbit) { | | 340 | while (iplmask & iplbit) { |
341 | ci->ci_ipending &= ~iplbit; | | 341 | ci->ci_ipending &= ~iplbit; |
342 | ci->ci_ilevel = i; | | 342 | ci->ci_ilevel = i; |
343 | for (ih = ci->ci_isources[i]->ipl_handlers; | | 343 | for (ih = ci->ci_isources[i]->ipl_handlers; |
344 | ih != NULL; ih = ih->ih_ipl_next) { | | 344 | ih != NULL; ih = ih->ih_ipl_next) { |
345 | KASSERT(ih->ih_cpu == ci); | | 345 | KASSERT(ih->ih_cpu == ci); |
346 | sti(); | | 346 | sti(); |
347 | ih_fun = (void *)ih->ih_fun; | | 347 | ih_fun = (void *)ih->ih_fun; |
348 | ih_fun(ih->ih_arg, regs); | | 348 | ih_fun(ih->ih_arg, regs); |
349 | cli(); | | 349 | cli(); |
350 | if (ci->ci_ilevel != i) { | | | |
351 | printf("evtchn_do_event: " | | | |
352 | "handler %p didn't lower " | | | |
353 | "ipl %d %d\n", | | | |
354 | ih_fun, ci->ci_ilevel, i); | | | |
355 | ci->ci_ilevel = i; | | | |
356 | } | | | |
357 | } | | 350 | } |
358 | hypervisor_enable_ipl(i); | | 351 | hypervisor_enable_ipl(i); |
359 | /* more pending IPLs may have been registered */ | | 352 | /* more pending IPLs may have been registered */ |
360 | iplmask = | | 353 | iplmask = |
361 | (IUNMASK(ci, ilevel) & ci->ci_ipending); | | 354 | (IUNMASK(ci, ilevel) & ci->ci_ipending); |
362 | } | | 355 | } |
363 | i--; | | 356 | i--; |
364 | iplbit >>= 1; | | 357 | iplbit >>= 1; |
365 | } | | 358 | } |
366 | } | | 359 | } |
367 | ci->ci_ilevel = ilevel; | | 360 | ci->ci_ilevel = ilevel; |
368 | return 0; | | 361 | return 0; |
369 | } | | 362 | } |