Mon Apr 13 18:32:50 2015 UTC ()
sync with new acpica struct shuffling.


(christos)
diff -r1.18 -r1.19 src/sys/dev/acpi/acpi_pci.c
diff -r1.35 -r1.36 src/sys/dev/acpi/acpi_resource.c

cvs diff -r1.18 -r1.19 src/sys/dev/acpi/acpi_pci.c (expand / switch to unified diff)

--- src/sys/dev/acpi/acpi_pci.c 2010/12/31 10:56:39 1.18
+++ src/sys/dev/acpi/acpi_pci.c 2015/04/13 18:32:50 1.19
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: acpi_pci.c,v 1.18 2010/12/31 10:56:39 jruoho Exp $ */ 1/* $NetBSD: acpi_pci.c,v 1.19 2015/04/13 18:32:50 christos Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc. 4 * Copyright (c) 2009, 2010 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 Christoph Egger and Gregoire Sutre. 8 * by Christoph Egger and Gregoire Sutre.
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.
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE. 28 * SUCH DAMAGE.
29 */ 29 */
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: acpi_pci.c,v 1.18 2010/12/31 10:56:39 jruoho Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: acpi_pci.c,v 1.19 2015/04/13 18:32:50 christos Exp $");
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/device.h> 35#include <sys/device.h>
36#include <sys/kmem.h> 36#include <sys/kmem.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38 38
39#include <dev/pci/pcireg.h> 39#include <dev/pci/pcireg.h>
40#include <dev/pci/pcivar.h> 40#include <dev/pci/pcivar.h>
41#include <dev/pci/pcidevs.h> 41#include <dev/pci/pcidevs.h>
42#include <dev/pci/ppbreg.h> 42#include <dev/pci/ppbreg.h>
43 43
44#include <dev/acpi/acpireg.h> 44#include <dev/acpi/acpireg.h>
45#include <dev/acpi/acpivar.h> 45#include <dev/acpi/acpivar.h>
@@ -136,30 +136,30 @@ acpi_pcidev_pciroot_bus_callback(ACPI_RE @@ -136,30 +136,30 @@ acpi_pcidev_pciroot_bus_callback(ACPI_RE
136 (res->Type != ACPI_RESOURCE_TYPE_ADDRESS32) && 136 (res->Type != ACPI_RESOURCE_TYPE_ADDRESS32) &&
137 (res->Type != ACPI_RESOURCE_TYPE_ADDRESS64)) 137 (res->Type != ACPI_RESOURCE_TYPE_ADDRESS64))
138 return AE_OK; 138 return AE_OK;
139 139
140 if (ACPI_FAILURE(AcpiResourceToAddress64(res, &addr64))) 140 if (ACPI_FAILURE(AcpiResourceToAddress64(res, &addr64)))
141 return AE_OK; 141 return AE_OK;
142 142
143 if (addr64.ResourceType != ACPI_BUS_NUMBER_RANGE) 143 if (addr64.ResourceType != ACPI_BUS_NUMBER_RANGE)
144 return AE_OK; 144 return AE_OK;
145 145
146 if (*bus != -1) 146 if (*bus != -1)
147 return AE_ALREADY_EXISTS; 147 return AE_ALREADY_EXISTS;
148 148
149 if (addr64.Minimum > 0xFFFF) 149 if (addr64.Address.Minimum > 0xFFFF)
150 return AE_BAD_DATA; 150 return AE_BAD_DATA;
151 151
152 *bus = (int32_t)addr64.Minimum; 152 *bus = (int32_t)addr64.Address.Minimum;
153 153
154 return AE_OK; 154 return AE_OK;
155} 155}
156 156
157/* 157/*
158 * acpi_pcidev_scan: 158 * acpi_pcidev_scan:
159 * 159 *
160 * Scan the ACPI device tree for PCI devices. A node is detected as a 160 * Scan the ACPI device tree for PCI devices. A node is detected as a
161 * PCI device if it has an ancestor that is a PCI root bridge and such 161 * PCI device if it has an ancestor that is a PCI root bridge and such
162 * that all intermediate nodes are PCI-to-PCI bridges. Depth-first 162 * that all intermediate nodes are PCI-to-PCI bridges. Depth-first
163 * recursive implementation. 163 * recursive implementation.
164 * 164 *
165 * PCI root bridges do not necessarily contain an _ADR, since they already 165 * PCI root bridges do not necessarily contain an _ADR, since they already

cvs diff -r1.35 -r1.36 src/sys/dev/acpi/acpi_resource.c (expand / switch to unified diff)

--- src/sys/dev/acpi/acpi_resource.c 2011/06/30 20:09:39 1.35
+++ src/sys/dev/acpi/acpi_resource.c 2015/04/13 18:32:50 1.36
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: acpi_resource.c,v 1.35 2011/06/30 20:09:39 wiz Exp $ */ 1/* $NetBSD: acpi_resource.c,v 1.36 2015/04/13 18:32:50 christos 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
@@ -57,27 +57,27 @@ @@ -57,27 +57,27 @@
57 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 57 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
58 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 58 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
59 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 59 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
60 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 60 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
61 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 61 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62 * SUCH DAMAGE. 62 * SUCH DAMAGE.
63 */ 63 */
64 64
65/* 65/*
66 * ACPI resource parsing. 66 * ACPI resource parsing.
67 */ 67 */
68 68
69#include <sys/cdefs.h> 69#include <sys/cdefs.h>
70__KERNEL_RCSID(0, "$NetBSD: acpi_resource.c,v 1.35 2011/06/30 20:09:39 wiz Exp $"); 70__KERNEL_RCSID(0, "$NetBSD: acpi_resource.c,v 1.36 2015/04/13 18:32:50 christos Exp $");
71 71
72#include <sys/param.h> 72#include <sys/param.h>
73#include <sys/device.h> 73#include <sys/device.h>
74#include <sys/systm.h> 74#include <sys/systm.h>
75 75
76#include <dev/acpi/acpireg.h> 76#include <dev/acpi/acpireg.h>
77#include <dev/acpi/acpivar.h> 77#include <dev/acpi/acpivar.h>
78 78
79#define _COMPONENT ACPI_RESOURCE_COMPONENT 79#define _COMPONENT ACPI_RESOURCE_COMPONENT
80ACPI_MODULE_NAME("RESOURCE") 80ACPI_MODULE_NAME("RESOURCE")
81 81
82static ACPI_STATUS acpi_resource_parse_callback(ACPI_RESOURCE *, void *); 82static ACPI_STATUS acpi_resource_parse_callback(ACPI_RESOURCE *, void *);
83 83
@@ -230,61 +230,61 @@ acpi_resource_parse_callback(ACPI_RESOUR @@ -230,61 +230,61 @@ acpi_resource_parse_callback(ACPI_RESOUR
230 (*ops->start_dep)(arg->dev, arg->context, 230 (*ops->start_dep)(arg->dev, arg->context,
231 res->Data.StartDpf.CompatibilityPriority); 231 res->Data.StartDpf.CompatibilityPriority);
232 break; 232 break;
233 233
234 case ACPI_RESOURCE_TYPE_END_DEPENDENT: 234 case ACPI_RESOURCE_TYPE_END_DEPENDENT:
235 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, 235 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
236 "End dependent functions\n")); 236 "End dependent functions\n"));
237 if (ops->end_dep) 237 if (ops->end_dep)
238 (*ops->end_dep)(arg->dev, arg->context); 238 (*ops->end_dep)(arg->dev, arg->context);
239 break; 239 break;
240 240
241 case ACPI_RESOURCE_TYPE_ADDRESS32: 241 case ACPI_RESOURCE_TYPE_ADDRESS32:
242 /* XXX Only fixed size supported for now */ 242 /* XXX Only fixed size supported for now */
243 if (res->Data.Address32.AddressLength == 0 || 243 if (res->Data.Address32.Address.AddressLength == 0 ||
244 res->Data.Address32.ProducerConsumer != ACPI_CONSUMER) 244 res->Data.Address32.ProducerConsumer != ACPI_CONSUMER)
245 break; 245 break;
246#define ADRRESS32_FIXED2(r) \ 246#define ADRRESS32_FIXED2(r) \
247 ((r)->Data.Address32.MinAddressFixed == ACPI_ADDRESS_FIXED && \ 247 ((r)->Data.Address32.MinAddressFixed == ACPI_ADDRESS_FIXED && \
248 (r)->Data.Address32.MaxAddressFixed == ACPI_ADDRESS_FIXED) 248 (r)->Data.Address32.MaxAddressFixed == ACPI_ADDRESS_FIXED)
249 switch (res->Data.Address32.ResourceType) { 249 switch (res->Data.Address32.ResourceType) {
250 case ACPI_MEMORY_RANGE: 250 case ACPI_MEMORY_RANGE:
251 if (ADRRESS32_FIXED2(res)) { 251 if (ADRRESS32_FIXED2(res)) {
252 if (ops->memory) 252 if (ops->memory)
253 (*ops->memory)(arg->dev, arg->context, 253 (*ops->memory)(arg->dev, arg->context,
254 res->Data.Address32.Minimum, 254 res->Data.Address32.Address.Minimum,
255 res->Data.Address32.AddressLength); 255 res->Data.Address32.Address.AddressLength);
256 } else { 256 } else {
257 if (ops->memrange) 257 if (ops->memrange)
258 (*ops->memrange)(arg->dev, arg->context, 258 (*ops->memrange)(arg->dev, arg->context,
259 res->Data.Address32.Minimum, 259 res->Data.Address32.Address.Minimum,
260 res->Data.Address32.Maximum, 260 res->Data.Address32.Address.Maximum,
261 res->Data.Address32.AddressLength, 261 res->Data.Address32.Address.AddressLength,
262 res->Data.Address32.Granularity); 262 res->Data.Address32.Address.Granularity);
263 } 263 }
264 break; 264 break;
265 case ACPI_IO_RANGE: 265 case ACPI_IO_RANGE:
266 if (ADRRESS32_FIXED2(res)) { 266 if (ADRRESS32_FIXED2(res)) {
267 if (ops->ioport) 267 if (ops->ioport)
268 (*ops->ioport)(arg->dev, arg->context, 268 (*ops->ioport)(arg->dev, arg->context,
269 res->Data.Address32.Minimum, 269 res->Data.Address32.Address.Minimum,
270 res->Data.Address32.AddressLength); 270 res->Data.Address32.Address.AddressLength);
271 } else { 271 } else {
272 if (ops->iorange) 272 if (ops->iorange)
273 (*ops->iorange)(arg->dev, arg->context, 273 (*ops->iorange)(arg->dev, arg->context,
274 res->Data.Address32.Minimum, 274 res->Data.Address32.Address.Minimum,
275 res->Data.Address32.Maximum, 275 res->Data.Address32.Address.Maximum,
276 res->Data.Address32.AddressLength, 276 res->Data.Address32.Address.AddressLength,
277 res->Data.Address32.Granularity); 277 res->Data.Address32.Address.Granularity);
278 } 278 }
279 break; 279 break;
280 case ACPI_BUS_NUMBER_RANGE: 280 case ACPI_BUS_NUMBER_RANGE:
281 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, 281 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
282 "Address32/BusNumber unimplemented\n")); 282 "Address32/BusNumber unimplemented\n"));
283 break; 283 break;
284 } 284 }
285#undef ADRRESS32_FIXED2 285#undef ADRRESS32_FIXED2
286 break; 286 break;
287 287
288 case ACPI_RESOURCE_TYPE_ADDRESS16: 288 case ACPI_RESOURCE_TYPE_ADDRESS16:
289 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, 289 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
290 "Address16 unimplemented\n")); 290 "Address16 unimplemented\n"));