| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: mpacpi.c,v 1.74 2009/01/12 08:36:36 sborrill Exp $ */ | | 1 | /* $NetBSD: mpacpi.c,v 1.75 2009/01/14 19:31:25 cegger Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2003 Wasabi Systems, Inc. | | 4 | * Copyright (c) 2003 Wasabi Systems, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Written by Frank van der Linden for Wasabi Systems, Inc. | | 7 | * Written by Frank van der Linden for Wasabi Systems, Inc. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -26,27 +26,27 @@ | | | @@ -26,27 +26,27 @@ |
26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
27 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 27 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC | | 28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC |
29 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 29 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
35 | * POSSIBILITY OF SUCH DAMAGE. | | 35 | * POSSIBILITY OF SUCH DAMAGE. |
36 | */ | | 36 | */ |
37 | | | 37 | |
38 | #include <sys/cdefs.h> | | 38 | #include <sys/cdefs.h> |
39 | __KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.74 2009/01/12 08:36:36 sborrill Exp $"); | | 39 | __KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.75 2009/01/14 19:31:25 cegger Exp $"); |
40 | | | 40 | |
41 | #include "acpi.h" | | 41 | #include "acpi.h" |
42 | #include "opt_acpi.h" | | 42 | #include "opt_acpi.h" |
43 | #include "opt_mpbios.h" | | 43 | #include "opt_mpbios.h" |
44 | #include "opt_multiprocessor.h" | | 44 | #include "opt_multiprocessor.h" |
45 | #include "pchb.h" | | 45 | #include "pchb.h" |
46 | | | 46 | |
47 | #include <sys/param.h> | | 47 | #include <sys/param.h> |
48 | #include <sys/systm.h> | | 48 | #include <sys/systm.h> |
49 | #include <sys/kernel.h> | | 49 | #include <sys/kernel.h> |
50 | #include <sys/device.h> | | 50 | #include <sys/device.h> |
51 | #include <sys/kmem.h> | | 51 | #include <sys/kmem.h> |
52 | #include <sys/queue.h> | | 52 | #include <sys/queue.h> |
| @@ -882,32 +882,31 @@ mpacpi_config_irouting(struct acpi_softc | | | @@ -882,32 +882,31 @@ mpacpi_config_irouting(struct acpi_softc |
882 | nintr = mpacpi_nintsrc + NUM_LEGACY_IRQS - 1; | | 882 | nintr = mpacpi_nintsrc + NUM_LEGACY_IRQS - 1; |
883 | #if NPCI > 0 | | 883 | #if NPCI > 0 |
884 | TAILQ_FOREACH(mpr, &mpacpi_pcibusses, mpr_list) { | | 884 | TAILQ_FOREACH(mpr, &mpacpi_pcibusses, mpr_list) { |
885 | nintr += mpacpi_pcircount(mpr); | | 885 | nintr += mpacpi_pcircount(mpr); |
886 | } | | 886 | } |
887 | | | 887 | |
888 | mp_isa_bus = mpacpi_maxpci + BUS_BUFFER; /* XXX */ | | 888 | mp_isa_bus = mpacpi_maxpci + BUS_BUFFER; /* XXX */ |
889 | #else | | 889 | #else |
890 | mp_isa_bus = 0; | | 890 | mp_isa_bus = 0; |
891 | #endif | | 891 | #endif |
892 | mp_nbus = mp_isa_bus + 1; | | 892 | mp_nbus = mp_isa_bus + 1; |
893 | mp_nintr = nintr; | | 893 | mp_nintr = nintr; |
894 | | | 894 | |
895 | mp_busses = kmem_zalloc(sizeof(struct mp_bus) * mp_nbus, KM_NOSLEEP); | | 895 | mp_busses = kmem_zalloc(sizeof(struct mp_bus) * mp_nbus, KM_SLEEP); |
896 | if (mp_busses == NULL) | | 896 | if (mp_busses == NULL) |
897 | panic("can't allocate mp_busses"); | | 897 | panic("can't allocate mp_busses"); |
898 | | | 898 | |
899 | mp_intrs = kmem_zalloc(sizeof(struct mp_intr_map) * mp_nintr, | | 899 | mp_intrs = kmem_zalloc(sizeof(struct mp_intr_map) * mp_nintr, KM_SLEEP); |
900 | KM_NOSLEEP); | | | |
901 | if (mp_intrs == NULL) | | 900 | if (mp_intrs == NULL) |
902 | panic("can't allocate mp_intrs"); | | 901 | panic("can't allocate mp_intrs"); |
903 | | | 902 | |
904 | mbp = &mp_busses[mp_isa_bus]; | | 903 | mbp = &mp_busses[mp_isa_bus]; |
905 | mbp->mb_name = "isa"; | | 904 | mbp->mb_name = "isa"; |
906 | mbp->mb_idx = 0; | | 905 | mbp->mb_idx = 0; |
907 | mbp->mb_intr_print = mpacpi_print_isa_intr; | | 906 | mbp->mb_intr_print = mpacpi_print_isa_intr; |
908 | mbp->mb_intr_cfg = NULL; | | 907 | mbp->mb_intr_cfg = NULL; |
909 | mbp->mb_intrs = &mp_intrs[0]; | | 908 | mbp->mb_intrs = &mp_intrs[0]; |
910 | mbp->mb_data = 0; | | 909 | mbp->mb_data = 0; |
911 | | | 910 | |
912 | pic = intr_findpic(0); | | 911 | pic = intr_findpic(0); |
913 | if (pic == NULL) | | 912 | if (pic == NULL) |