Add acpi_intr_mask() and acpi_intr_unmask() which, following the pre-existing ACPI software layering model, are wrappers around acpi_md_intr_mask() and acpi_md_intr_unmask(), which in turn are wrappers around intr_mask() and intr_unmask(). XXX ARM and IA64 implementations of acpi_md_intr_mask() and acpi_md_intr_unmask() are just stubs for now.diff -r1.10 -r1.11 src/sys/arch/arm/acpi/acpi_machdep.c
(thorpej)
--- src/sys/arch/arm/acpi/acpi_machdep.c 2019/08/12 15:37:26 1.10
+++ src/sys/arch/arm/acpi/acpi_machdep.c 2019/12/22 15:57:06 1.11
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: acpi_machdep.c,v 1.10 2019/08/12 15:37:26 skrll Exp $ */ | 1 | /* $NetBSD: acpi_machdep.c,v 1.11 2019/12/22 15:57:06 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2018 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2018 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jared McNeill <jmcneill@invisible.ca>. | 8 | * by Jared McNeill <jmcneill@invisible.ca>. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -22,27 +22,27 @@ | @@ -22,27 +22,27 @@ | |||
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include "pci.h" | 32 | #include "pci.h" | |
33 | 33 | |||
34 | #include <sys/cdefs.h> | 34 | #include <sys/cdefs.h> | |
35 | __KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.10 2019/08/12 15:37:26 skrll Exp $"); | 35 | __KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.11 2019/12/22 15:57:06 thorpej Exp $"); | |
36 | 36 | |||
37 | #include <sys/param.h> | 37 | #include <sys/param.h> | |
38 | #include <sys/systm.h> | 38 | #include <sys/systm.h> | |
39 | #include <sys/bus.h> | 39 | #include <sys/bus.h> | |
40 | #include <sys/cpu.h> | 40 | #include <sys/cpu.h> | |
41 | #include <sys/device.h> | 41 | #include <sys/device.h> | |
42 | 42 | |||
43 | #include <uvm/uvm_extern.h> | 43 | #include <uvm/uvm_extern.h> | |
44 | 44 | |||
45 | #include <dev/fdt/fdtvar.h> | 45 | #include <dev/fdt/fdtvar.h> | |
46 | 46 | |||
47 | #include <dev/acpi/acpica.h> | 47 | #include <dev/acpi/acpica.h> | |
48 | #include <dev/acpi/acpivar.h> | 48 | #include <dev/acpi/acpivar.h> | |
@@ -247,26 +247,40 @@ acpi_md_OsEnableInterrupt(void) | @@ -247,26 +247,40 @@ acpi_md_OsEnableInterrupt(void) | |||
247 | void | 247 | void | |
248 | acpi_md_OsDisableInterrupt(void) | 248 | acpi_md_OsDisableInterrupt(void) | |
249 | { | 249 | { | |
250 | cpsid(I32_bit); | 250 | cpsid(I32_bit); | |
251 | } | 251 | } | |
252 | 252 | |||
253 | void * | 253 | void * | |
254 | acpi_md_intr_establish(uint32_t irq, int ipl, int type, int (*handler)(void *), void *arg, bool mpsafe, const char *xname) | 254 | acpi_md_intr_establish(uint32_t irq, int ipl, int type, int (*handler)(void *), void *arg, bool mpsafe, const char *xname) | |
255 | { | 255 | { | |
256 | return intr_establish_xname(irq, ipl, type | (mpsafe ? IST_MPSAFE : 0), handler, arg, xname); | 256 | return intr_establish_xname(irq, ipl, type | (mpsafe ? IST_MPSAFE : 0), handler, arg, xname); | |
257 | } | 257 | } | |
258 | 258 | |||
259 | void | 259 | void | |
260 | acpi_md_intr_mask(void *ih) | |||
261 | { | |||
262 | /* XXX */ | |||
263 | panic("acpi_md_intr_mask(%p): not implemented", ih); | |||
264 | } | |||
265 | ||||
266 | void | |||
267 | acpi_md_intr_unmask(void *ih) | |||
268 | { | |||
269 | /* XXX */ | |||
270 | panic("acpi_md_intr_unmask(%p): not implemented", ih); | |||
271 | } | |||
272 | ||||
273 | void | |||
260 | acpi_md_intr_disestablish(void *ih) | 274 | acpi_md_intr_disestablish(void *ih) | |
261 | { | 275 | { | |
262 | intr_disestablish(ih); | 276 | intr_disestablish(ih); | |
263 | } | 277 | } | |
264 | 278 | |||
265 | int | 279 | int | |
266 | acpi_md_sleep(int state) | 280 | acpi_md_sleep(int state) | |
267 | { | 281 | { | |
268 | printf("ERROR: ACPI sleep not implemented on this platform\n"); | 282 | printf("ERROR: ACPI sleep not implemented on this platform\n"); | |
269 | return -1; | 283 | return -1; | |
270 | } | 284 | } | |
271 | 285 | |||
272 | uint32_t | 286 | uint32_t |
--- src/sys/arch/arm/include/acpi_machdep.h 2018/11/16 23:03:55 1.2
+++ src/sys/arch/arm/include/acpi_machdep.h 2019/12/22 15:57:06 1.3
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: acpi_machdep.h,v 1.2 2018/11/16 23:03:55 jmcneill Exp $ */ | 1 | /* $NetBSD: acpi_machdep.h,v 1.3 2019/12/22 15:57:06 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2018 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2018 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jared McNeill <jmcneill@invisible.ca>. | 8 | * by Jared McNeill <jmcneill@invisible.ca>. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -38,26 +38,28 @@ ACPI_STATUS acpi_md_OsInitialize(void); | @@ -38,26 +38,28 @@ ACPI_STATUS acpi_md_OsInitialize(void); | |||
38 | ACPI_PHYSICAL_ADDRESS acpi_md_OsGetRootPointer(void); | 38 | ACPI_PHYSICAL_ADDRESS acpi_md_OsGetRootPointer(void); | |
39 | ACPI_STATUS acpi_md_OsInstallInterruptHandler(UINT32, ACPI_OSD_HANDLER, | 39 | ACPI_STATUS acpi_md_OsInstallInterruptHandler(UINT32, ACPI_OSD_HANDLER, | |
40 | void *, void **, const char *); | 40 | void *, void **, const char *); | |
41 | void acpi_md_OsRemoveInterruptHandler(void *); | 41 | void acpi_md_OsRemoveInterruptHandler(void *); | |
42 | ACPI_STATUS acpi_md_OsMapMemory(ACPI_PHYSICAL_ADDRESS, UINT32, void **); | 42 | ACPI_STATUS acpi_md_OsMapMemory(ACPI_PHYSICAL_ADDRESS, UINT32, void **); | |
43 | void acpi_md_OsUnmapMemory(void *, UINT32); | 43 | void acpi_md_OsUnmapMemory(void *, UINT32); | |
44 | ACPI_STATUS acpi_md_OsGetPhysicalAddress(void *, ACPI_PHYSICAL_ADDRESS *); | 44 | ACPI_STATUS acpi_md_OsGetPhysicalAddress(void *, ACPI_PHYSICAL_ADDRESS *); | |
45 | BOOLEAN acpi_md_OsReadable(void *, UINT32); | 45 | BOOLEAN acpi_md_OsReadable(void *, UINT32); | |
46 | BOOLEAN acpi_md_OsWritable(void *, UINT32); | 46 | BOOLEAN acpi_md_OsWritable(void *, UINT32); | |
47 | void acpi_md_OsEnableInterrupt(void); | 47 | void acpi_md_OsEnableInterrupt(void); | |
48 | void acpi_md_OsDisableInterrupt(void); | 48 | void acpi_md_OsDisableInterrupt(void); | |
49 | void * acpi_md_intr_establish(uint32_t, int, int, int (*)(void *), | 49 | void * acpi_md_intr_establish(uint32_t, int, int, int (*)(void *), | |
50 | void *, bool, const char *); | 50 | void *, bool, const char *); | |
51 | void acpi_md_intr_mask(void *); | |||
52 | void acpi_md_intr_unmask(void *); | |||
51 | void acpi_md_intr_disestablish(void *); | 53 | void acpi_md_intr_disestablish(void *); | |
52 | int acpi_md_sleep(int); | 54 | int acpi_md_sleep(int); | |
53 | uint32_t acpi_md_pdc(void); | 55 | uint32_t acpi_md_pdc(void); | |
54 | uint32_t acpi_md_ncpus(void); | 56 | uint32_t acpi_md_ncpus(void); | |
55 | void acpi_md_callback(struct acpi_softc *); | 57 | void acpi_md_callback(struct acpi_softc *); | |
56 | 58 | |||
57 | static inline int | 59 | static inline int | |
58 | _acpi_notimpl(const char *fn) | 60 | _acpi_notimpl(const char *fn) | |
59 | { | 61 | { | |
60 | printf("WARNING: ACPI function %s not implemented on this platform\n", fn); | 62 | printf("WARNING: ACPI function %s not implemented on this platform\n", fn); | |
61 | return 0; | 63 | return 0; | |
62 | } | 64 | } | |
63 | 65 |
--- src/sys/arch/ia64/acpi/acpi_machdep.c 2018/11/17 20:53:35 1.9
+++ src/sys/arch/ia64/acpi/acpi_machdep.c 2019/12/22 15:57:06 1.10
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: acpi_machdep.c,v 1.9 2018/11/17 20:53:35 scole Exp $ */ | 1 | /* $NetBSD: acpi_machdep.c,v 1.10 2019/12/22 15:57:06 thorpej Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 2009 KIYOHARA Takashi | 3 | * Copyright (c) 2009 KIYOHARA Takashi | |
4 | * All rights reserved. | 4 | * 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 | * | |
@@ -18,27 +18,27 @@ | @@ -18,27 +18,27 @@ | |||
18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, | 18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, | |
19 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 19 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 20 | * (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, | 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
23 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | 23 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | |
24 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 24 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
25 | * POSSIBILITY OF SUCH DAMAGE. | 25 | * POSSIBILITY OF SUCH DAMAGE. | |
26 | */ | 26 | */ | |
27 | /* | 27 | /* | |
28 | * Machine-dependent routines for ACPICA. | 28 | * Machine-dependent routines for ACPICA. | |
29 | */ | 29 | */ | |
30 | #include <sys/cdefs.h> | 30 | #include <sys/cdefs.h> | |
31 | __KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.9 2018/11/17 20:53:35 scole Exp $"); | 31 | __KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.10 2019/12/22 15:57:06 thorpej Exp $"); | |
32 | 32 | |||
33 | #include <sys/param.h> | 33 | #include <sys/param.h> | |
34 | 34 | |||
35 | #include <uvm/uvm_extern.h> | 35 | #include <uvm/uvm_extern.h> | |
36 | 36 | |||
37 | #include <machine/bus.h> | 37 | #include <machine/bus.h> | |
38 | #include <machine/efi.h> | 38 | #include <machine/efi.h> | |
39 | #include <machine/intrdefs.h> | 39 | #include <machine/intrdefs.h> | |
40 | 40 | |||
41 | #include <dev/acpi/acpica.h> | 41 | #include <dev/acpi/acpica.h> | |
42 | #include <dev/acpi/acpivar.h> | 42 | #include <dev/acpi/acpivar.h> | |
43 | 43 | |||
44 | #include <machine/acpi_machdep.h> | 44 | #include <machine/acpi_machdep.h> | |
@@ -116,26 +116,40 @@ acpi_md_OsRemoveInterruptHandler(void *c | @@ -116,26 +116,40 @@ acpi_md_OsRemoveInterruptHandler(void *c | |||
116 | intr_disestablish(cookie); | 116 | intr_disestablish(cookie); | |
117 | } | 117 | } | |
118 | 118 | |||
119 | void * | 119 | void * | |
120 | acpi_md_intr_establish(uint32_t irq, int ipl, int type, int (*handler)(void *), | 120 | acpi_md_intr_establish(uint32_t irq, int ipl, int type, int (*handler)(void *), | |
121 | void *arg, bool mpsafe, const char *xname) | 121 | void *arg, bool mpsafe, const char *xname) | |
122 | { | 122 | { | |
123 | const int vec = acpi_isa_irq_to_vector(irq); | 123 | const int vec = acpi_isa_irq_to_vector(irq); | |
124 | 124 | |||
125 | return intr_establish(vec, type, ipl, handler, arg); | 125 | return intr_establish(vec, type, ipl, handler, arg); | |
126 | } | 126 | } | |
127 | 127 | |||
128 | void | 128 | void | |
129 | acpi_md_intr_mask(void *ih) | |||
130 | { | |||
131 | /* XXX */ | |||
132 | panic("acpi_md_intr_mask(%p): not implemented", ih); | |||
133 | } | |||
134 | ||||
135 | void | |||
136 | acpi_md_intr_unmask(void *ih) | |||
137 | { | |||
138 | /* XXX */ | |||
139 | panic("acpi_md_intr_unmask(%p): not implemented", ih); | |||
140 | } | |||
141 | ||||
142 | void | |||
129 | acpi_md_intr_disestablish(void *ih) | 143 | acpi_md_intr_disestablish(void *ih) | |
130 | { | 144 | { | |
131 | intr_disestablish(ih); | 145 | intr_disestablish(ih); | |
132 | } | 146 | } | |
133 | 147 | |||
134 | ACPI_STATUS | 148 | ACPI_STATUS | |
135 | acpi_md_OsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, UINT32 Length, | 149 | acpi_md_OsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, UINT32 Length, | |
136 | void **LogicalAddress) | 150 | void **LogicalAddress) | |
137 | { | 151 | { | |
138 | 152 | |||
139 | if (bus_space_map(IA64_BUS_SPACE_MEM, PhysicalAddress, Length, | 153 | if (bus_space_map(IA64_BUS_SPACE_MEM, PhysicalAddress, Length, | |
140 | 0, (bus_space_handle_t *) LogicalAddress) == 0) | 154 | 0, (bus_space_handle_t *) LogicalAddress) == 0) | |
141 | return AE_OK; | 155 | return AE_OK; |
--- src/sys/arch/ia64/include/acpi_machdep.h 2018/11/16 23:03:55 1.8
+++ src/sys/arch/ia64/include/acpi_machdep.h 2019/12/22 15:57:07 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: acpi_machdep.h,v 1.8 2018/11/16 23:03:55 jmcneill Exp $ */ | 1 | /* $NetBSD: acpi_machdep.h,v 1.9 2019/12/22 15:57:07 thorpej Exp $ */ | |
2 | 2 | |||
3 | ACPI_STATUS acpi_md_OsInitialize(void); | 3 | ACPI_STATUS acpi_md_OsInitialize(void); | |
4 | ACPI_PHYSICAL_ADDRESS acpi_md_OsGetRootPointer(void); | 4 | ACPI_PHYSICAL_ADDRESS acpi_md_OsGetRootPointer(void); | |
5 | 5 | |||
6 | #define acpi_md_OsIn8(x) inb((x)) | 6 | #define acpi_md_OsIn8(x) inb((x)) | |
7 | #define acpi_md_OsIn16(x) inw((x)) | 7 | #define acpi_md_OsIn16(x) inw((x)) | |
8 | #define acpi_md_OsIn32(x) inl((x)) | 8 | #define acpi_md_OsIn32(x) inl((x)) | |
9 | 9 | |||
10 | #define acpi_md_OsOut8(x, v) outb((x), (v)) | 10 | #define acpi_md_OsOut8(x, v) outb((x), (v)) | |
11 | #define acpi_md_OsOut16(x, v) outw((x), (v)) | 11 | #define acpi_md_OsOut16(x, v) outw((x), (v)) | |
12 | #define acpi_md_OsOut32(x, v) outl((x), (v)) | 12 | #define acpi_md_OsOut32(x, v) outl((x), (v)) | |
13 | 13 | |||
14 | ACPI_STATUS acpi_md_OsInstallInterruptHandler(UINT32, ACPI_OSD_HANDLER, | 14 | ACPI_STATUS acpi_md_OsInstallInterruptHandler(UINT32, ACPI_OSD_HANDLER, | |
@@ -17,20 +17,22 @@ void acpi_md_OsRemoveInterruptHandler(vo | @@ -17,20 +17,22 @@ void acpi_md_OsRemoveInterruptHandler(vo | |||
17 | 17 | |||
18 | ACPI_STATUS acpi_md_OsMapMemory(ACPI_PHYSICAL_ADDRESS, UINT32, void **); | 18 | ACPI_STATUS acpi_md_OsMapMemory(ACPI_PHYSICAL_ADDRESS, UINT32, void **); | |
19 | void acpi_md_OsUnmapMemory(void *, UINT32); | 19 | void acpi_md_OsUnmapMemory(void *, UINT32); | |
20 | ACPI_STATUS acpi_md_OsGetPhysicalAddress(void *LogicalAddress, | 20 | ACPI_STATUS acpi_md_OsGetPhysicalAddress(void *LogicalAddress, | |
21 | ACPI_PHYSICAL_ADDRESS *PhysicalAddress); | 21 | ACPI_PHYSICAL_ADDRESS *PhysicalAddress); | |
22 | 22 | |||
23 | BOOLEAN acpi_md_OsReadable(void *, UINT32); | 23 | BOOLEAN acpi_md_OsReadable(void *, UINT32); | |
24 | BOOLEAN acpi_md_OsWritable(void *, UINT32); | 24 | BOOLEAN acpi_md_OsWritable(void *, UINT32); | |
25 | void acpi_md_OsEnableInterrupt(void); | 25 | void acpi_md_OsEnableInterrupt(void); | |
26 | void acpi_md_OsDisableInterrupt(void); | 26 | void acpi_md_OsDisableInterrupt(void); | |
27 | 27 | |||
28 | void * acpi_md_intr_establish(uint32_t, int, int, int (*)(void *), | 28 | void * acpi_md_intr_establish(uint32_t, int, int, int (*)(void *), | |
29 | void *, bool, const char *); | 29 | void *, bool, const char *); | |
30 | void acpi_md_intr_mask(void *); | |||
31 | void acpi_md_intr_unmask(void *); | |||
30 | void acpi_md_intr_disestablish(void *); | 32 | void acpi_md_intr_disestablish(void *); | |
31 | 33 | |||
32 | int acpi_md_sleep(int); | 34 | int acpi_md_sleep(int); | |
33 | uint32_t acpi_md_pdc(void); | 35 | uint32_t acpi_md_pdc(void); | |
34 | uint32_t acpi_md_ncpus(void); | 36 | uint32_t acpi_md_ncpus(void); | |
35 | struct acpi_softc; | 37 | struct acpi_softc; | |
36 | void acpi_md_callback(struct acpi_softc *); | 38 | void acpi_md_callback(struct acpi_softc *); |
--- src/sys/arch/x86/acpi/acpi_machdep.c 2019/09/12 14:28:08 1.28
+++ src/sys/arch/x86/acpi/acpi_machdep.c 2019/12/22 15:57:07 1.29
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: acpi_machdep.c,v 1.28 2019/09/12 14:28:08 martin Exp $ */ | 1 | /* $NetBSD: acpi_machdep.c,v 1.29 2019/12/22 15:57:07 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright 2001 Wasabi Systems, Inc. | 4 | * Copyright 2001 Wasabi Systems, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Written by Jason R. Thorpe for Wasabi Systems, Inc. | 7 | * Written by Jason R. Thorpe 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 | |
@@ -30,27 +30,27 @@ | @@ -30,27 +30,27 @@ | |||
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 | /* | 38 | /* | |
39 | * Machine-dependent routines for ACPICA. | 39 | * Machine-dependent routines for ACPICA. | |
40 | */ | 40 | */ | |
41 | 41 | |||
42 | #include <sys/cdefs.h> | 42 | #include <sys/cdefs.h> | |
43 | __KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.28 2019/09/12 14:28:08 martin Exp $"); | 43 | __KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.29 2019/12/22 15:57:07 thorpej Exp $"); | |
44 | 44 | |||
45 | #include <sys/param.h> | 45 | #include <sys/param.h> | |
46 | #include <sys/systm.h> | 46 | #include <sys/systm.h> | |
47 | #include <sys/bus.h> | 47 | #include <sys/bus.h> | |
48 | #include <sys/cpu.h> | 48 | #include <sys/cpu.h> | |
49 | #include <sys/device.h> | 49 | #include <sys/device.h> | |
50 | 50 | |||
51 | #include <uvm/uvm_extern.h> | 51 | #include <uvm/uvm_extern.h> | |
52 | 52 | |||
53 | #include <machine/cpufunc.h> | 53 | #include <machine/cpufunc.h> | |
54 | #include <machine/bootinfo.h> | 54 | #include <machine/bootinfo.h> | |
55 | #include <machine/autoconf.h> | 55 | #include <machine/autoconf.h> | |
56 | 56 | |||
@@ -343,26 +343,38 @@ acpi_md_intr_establish(uint32_t Interrup | @@ -343,26 +343,38 @@ acpi_md_intr_establish(uint32_t Interrup | |||
343 | ih = intr_establish_xname(irq, pic, pin, type, ipl, | 343 | ih = intr_establish_xname(irq, pic, pin, type, ipl, | |
344 | handler, arg, mpsafe, xname); | 344 | handler, arg, mpsafe, xname); | |
345 | 345 | |||
346 | #if NIOAPIC > 0 | 346 | #if NIOAPIC > 0 | |
347 | if (mipp) { | 347 | if (mipp) { | |
348 | *mipp = NULL; | 348 | *mipp = NULL; | |
349 | } | 349 | } | |
350 | #endif | 350 | #endif | |
351 | 351 | |||
352 | return ih; | 352 | return ih; | |
353 | } | 353 | } | |
354 | 354 | |||
355 | void | 355 | void | |
356 | acpi_md_intr_mask(void *ih) | |||
357 | { | |||
358 | intr_mask(ih); | |||
359 | } | |||
360 | ||||
361 | void | |||
362 | acpi_md_intr_unmask(void *ih) | |||
363 | { | |||
364 | intr_unmask(ih); | |||
365 | } | |||
366 | ||||
367 | void | |||
356 | acpi_md_intr_disestablish(void *ih) | 368 | acpi_md_intr_disestablish(void *ih) | |
357 | { | 369 | { | |
358 | intr_disestablish(ih); | 370 | intr_disestablish(ih); | |
359 | } | 371 | } | |
360 | 372 | |||
361 | ACPI_STATUS | 373 | ACPI_STATUS | |
362 | acpi_md_OsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, | 374 | acpi_md_OsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, | |
363 | uint32_t Length, void **LogicalAddress) | 375 | uint32_t Length, void **LogicalAddress) | |
364 | { | 376 | { | |
365 | int rv; | 377 | int rv; | |
366 | 378 | |||
367 | rv = _x86_memio_map(x86_bus_space_mem, PhysicalAddress, | 379 | rv = _x86_memio_map(x86_bus_space_mem, PhysicalAddress, | |
368 | Length, 0, (bus_space_handle_t *)LogicalAddress); | 380 | Length, 0, (bus_space_handle_t *)LogicalAddress); |
--- src/sys/arch/x86/include/acpi_machdep.h 2018/11/16 23:03:55 1.13
+++ src/sys/arch/x86/include/acpi_machdep.h 2019/12/22 15:57:07 1.14
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: acpi_machdep.h,v 1.13 2018/11/16 23:03:55 jmcneill Exp $ */ | 1 | /* $NetBSD: acpi_machdep.h,v 1.14 2019/12/22 15:57:07 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright 2001 Wasabi Systems, Inc. | 4 | * Copyright 2001 Wasabi Systems, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Written by Jason R. Thorpe for Wasabi Systems, Inc. | 7 | * Written by Jason R. Thorpe 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 | |
@@ -62,24 +62,26 @@ void acpi_md_OsRemoveInterruptHandler(v | @@ -62,24 +62,26 @@ void acpi_md_OsRemoveInterruptHandler(v | |||
62 | 62 | |||
63 | ACPI_STATUS acpi_md_OsMapMemory(ACPI_PHYSICAL_ADDRESS, UINT32, void **); | 63 | ACPI_STATUS acpi_md_OsMapMemory(ACPI_PHYSICAL_ADDRESS, UINT32, void **); | |
64 | void acpi_md_OsUnmapMemory(void *, UINT32); | 64 | void acpi_md_OsUnmapMemory(void *, UINT32); | |
65 | ACPI_STATUS acpi_md_OsGetPhysicalAddress(void *LogicalAddress, | 65 | ACPI_STATUS acpi_md_OsGetPhysicalAddress(void *LogicalAddress, | |
66 | ACPI_PHYSICAL_ADDRESS *PhysicalAddress); | 66 | ACPI_PHYSICAL_ADDRESS *PhysicalAddress); | |
67 | 67 | |||
68 | BOOLEAN acpi_md_OsReadable(void *, UINT32); | 68 | BOOLEAN acpi_md_OsReadable(void *, UINT32); | |
69 | BOOLEAN acpi_md_OsWritable(void *, UINT32); | 69 | BOOLEAN acpi_md_OsWritable(void *, UINT32); | |
70 | void acpi_md_OsDisableInterrupt(void); | 70 | void acpi_md_OsDisableInterrupt(void); | |
71 | void acpi_md_OsEnableInterrupt(void); | 71 | void acpi_md_OsEnableInterrupt(void); | |
72 | 72 | |||
73 | void * acpi_md_intr_establish(uint32_t, int, int, int (*)(void *), | 73 | void * acpi_md_intr_establish(uint32_t, int, int, int (*)(void *), | |
74 | void *, bool, const char *); | 74 | void *, bool, const char *); | |
75 | void acpi_md_intr_mask(void *); | |||
76 | void acpi_md_intr_unmask(void *); | |||
75 | void acpi_md_intr_disestablish(void *); | 77 | void acpi_md_intr_disestablish(void *); | |
76 | 78 | |||
77 | int acpi_md_sleep(int); | 79 | int acpi_md_sleep(int); | |
78 | void acpi_md_sleep_init(void); | 80 | void acpi_md_sleep_init(void); | |
79 | 81 | |||
80 | uint32_t acpi_md_pdc(void); | 82 | uint32_t acpi_md_pdc(void); | |
81 | uint32_t acpi_md_ncpus(void); | 83 | uint32_t acpi_md_ncpus(void); | |
82 | struct acpi_softc; | 84 | struct acpi_softc; | |
83 | void acpi_md_callback(struct acpi_softc *); | 85 | void acpi_md_callback(struct acpi_softc *); | |
84 | 86 | |||
85 | #endif /* !_X86_ACPI_MACHDEP_H_ */ | 87 | #endif /* !_X86_ACPI_MACHDEP_H_ */ |
--- src/sys/dev/acpi/acpi_intr.h 2018/11/16 23:05:50 1.3
+++ src/sys/dev/acpi/acpi_intr.h 2019/12/22 15:57:07 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: acpi_intr.h,v 1.3 2018/11/16 23:05:50 jmcneill Exp $ */ | 1 | /* $NetBSD: acpi_intr.h,v 1.4 2019/12/22 15:57:07 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2017 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2017 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Manuel Bouyer. | 8 | * by Manuel Bouyer. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -18,17 +18,25 @@ | @@ -18,17 +18,25 @@ | |||
18 | * | 18 | * | |
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | ||||
32 | #ifndef _DEV_ACPI_ACPI_INTR_H_ | |||
33 | #define _DEV_ACPI_ACPI_INTR_H_ | |||
34 | ||||
31 | void * acpi_intr_establish(device_t, uint64_t, int, bool, | 35 | void * acpi_intr_establish(device_t, uint64_t, int, bool, | |
32 | int (*intr)(void *), void *, const char *); | 36 | int (*intr)(void *), void *, const char *); | |
37 | void acpi_intr_mask(void *); | |||
38 | void acpi_intr_unmask(void *); | |||
33 | void acpi_intr_disestablish(void *); | 39 | void acpi_intr_disestablish(void *); | |
34 | const char * acpi_intr_string(void *, char *, size_t len); | 40 | const char * acpi_intr_string(void *, char *, size_t len); | |
41 | ||||
42 | #endif /* _DEV_ACPI_ACPI_INTR_H_ */ |
--- src/sys/dev/acpi/acpi_util.c 2018/12/21 14:51:12 1.15
+++ src/sys/dev/acpi/acpi_util.c 2019/12/22 15:57:07 1.16
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: acpi_util.c,v 1.15 2018/12/21 14:51:12 jmcneill Exp $ */ | 1 | /* $NetBSD: acpi_util.c,v 1.16 2019/12/22 15:57:07 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Charles M. Hannum of By Noon Software, Inc. | 8 | * by Charles M. Hannum of By Noon Software, Inc. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -55,27 +55,27 @@ | @@ -55,27 +55,27 @@ | |||
55 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 55 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
56 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 56 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
57 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC | 57 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC | |
58 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 58 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
59 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 59 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
60 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 60 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
61 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 61 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
62 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 62 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
63 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 63 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
64 | * POSSIBILITY OF SUCH DAMAGE. | 64 | * POSSIBILITY OF SUCH DAMAGE. | |
65 | */ | 65 | */ | |
66 | 66 | |||
67 | #include <sys/cdefs.h> | 67 | #include <sys/cdefs.h> | |
68 | __KERNEL_RCSID(0, "$NetBSD: acpi_util.c,v 1.15 2018/12/21 14:51:12 jmcneill Exp $"); | 68 | __KERNEL_RCSID(0, "$NetBSD: acpi_util.c,v 1.16 2019/12/22 15:57:07 thorpej Exp $"); | |
69 | 69 | |||
70 | #include <sys/param.h> | 70 | #include <sys/param.h> | |
71 | #include <sys/kmem.h> | 71 | #include <sys/kmem.h> | |
72 | #include <sys/cpu.h> | 72 | #include <sys/cpu.h> | |
73 | 73 | |||
74 | #include <dev/acpi/acpireg.h> | 74 | #include <dev/acpi/acpireg.h> | |
75 | #include <dev/acpi/acpivar.h> | 75 | #include <dev/acpi/acpivar.h> | |
76 | #include <dev/acpi/acpi_intr.h> | 76 | #include <dev/acpi/acpi_intr.h> | |
77 | 77 | |||
78 | #include <machine/acpi_machdep.h> | 78 | #include <machine/acpi_machdep.h> | |
79 | 79 | |||
80 | #define _COMPONENT ACPI_BUS_COMPONENT | 80 | #define _COMPONENT ACPI_BUS_COMPONENT | |
81 | ACPI_MODULE_NAME ("acpi_util") | 81 | ACPI_MODULE_NAME ("acpi_util") | |
@@ -581,26 +581,42 @@ acpi_intr_establish(device_t dev, uint64 | @@ -581,26 +581,42 @@ acpi_intr_establish(device_t dev, uint64 | |||
581 | goto end; | 581 | goto end; | |
582 | 582 | |||
583 | aih = kmem_alloc(sizeof(struct acpi_irq_handler), KM_SLEEP); | 583 | aih = kmem_alloc(sizeof(struct acpi_irq_handler), KM_SLEEP); | |
584 | aih->aih_hdl = hdl; | 584 | aih->aih_hdl = hdl; | |
585 | aih->aih_irq = irq->ar_irq; | 585 | aih->aih_irq = irq->ar_irq; | |
586 | aih->aih_ih = ih; | 586 | aih->aih_ih = ih; | |
587 | 587 | |||
588 | end: | 588 | end: | |
589 | acpi_resource_cleanup(&res); | 589 | acpi_resource_cleanup(&res); | |
590 | return aih; | 590 | return aih; | |
591 | } | 591 | } | |
592 | 592 | |||
593 | void | 593 | void | |
594 | acpi_intr_mask(void *c) | |||
595 | { | |||
596 | struct acpi_irq_handler * const aih = c; | |||
597 | ||||
598 | acpi_md_intr_mask(aih->aih_ih); | |||
599 | } | |||
600 | ||||
601 | void | |||
602 | acpi_intr_unmask(void *c) | |||
603 | { | |||
604 | struct acpi_irq_handler * const aih = c; | |||
605 | ||||
606 | acpi_md_intr_unmask(aih->aih_ih); | |||
607 | } | |||
608 | ||||
609 | void | |||
594 | acpi_intr_disestablish(void *c) | 610 | acpi_intr_disestablish(void *c) | |
595 | { | 611 | { | |
596 | struct acpi_irq_handler *aih = c; | 612 | struct acpi_irq_handler *aih = c; | |
597 | 613 | |||
598 | acpi_md_intr_disestablish(aih->aih_ih); | 614 | acpi_md_intr_disestablish(aih->aih_ih); | |
599 | kmem_free(aih, sizeof(struct acpi_irq_handler)); | 615 | kmem_free(aih, sizeof(struct acpi_irq_handler)); | |
600 | } | 616 | } | |
601 | 617 | |||
602 | const char * | 618 | const char * | |
603 | acpi_intr_string(void *c, char *buf, size_t size) | 619 | acpi_intr_string(void *c, char *buf, size_t size) | |
604 | { | 620 | { | |
605 | struct acpi_irq_handler *aih = c; | 621 | struct acpi_irq_handler *aih = c; | |
606 | intr_handle_t ih = aih->aih_irq; | 622 | intr_handle_t ih = aih->aih_irq; |