Deleted Added
full compact
acpi_pcib_acpi.c (119281) acpi_pcib_acpi.c (126560)
1/*-
2 * Copyright (c) 2000 Michael Smith
3 * Copyright (c) 2000 BSDi
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
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
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
1/*-
2 * Copyright (c) 2000 Michael Smith
3 * Copyright (c) 2000 BSDi
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
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
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sys/dev/acpica/acpi_pcib_acpi.c 119281 2003-08-22 06:06:16Z imp $
27 * $FreeBSD: head/sys/dev/acpica/acpi_pcib_acpi.c 126560 2004-03-03 18:34:42Z njl $
28 */
29#include "opt_acpi.h"
30#include <sys/param.h>
31#include <sys/bus.h>
32#include <sys/malloc.h>
33#include <sys/kernel.h>
34
35#include "acpi.h"

--- 117 unchanged lines hidden (view full) ---

153 * default PCI configuration space handlers can deal with this bus,
154 * we should attach our own handler.
155 * XXX invoke _REG on this for the PCI config space address space?
156 * XXX It seems many BIOS's with multiple Host-PCI bridges do not set
157 * _BBN correctly. They set _BBN to zero for all bridges. Thus,
158 * if _BBN is zero and pcib0 already exists, we try to read our
159 * bus number from the configuration registers at address _ADR.
160 */
28 */
29#include "opt_acpi.h"
30#include <sys/param.h>
31#include <sys/bus.h>
32#include <sys/malloc.h>
33#include <sys/kernel.h>
34
35#include "acpi.h"

--- 117 unchanged lines hidden (view full) ---

153 * default PCI configuration space handlers can deal with this bus,
154 * we should attach our own handler.
155 * XXX invoke _REG on this for the PCI config space address space?
156 * XXX It seems many BIOS's with multiple Host-PCI bridges do not set
157 * _BBN correctly. They set _BBN to zero for all bridges. Thus,
158 * if _BBN is zero and pcib0 already exists, we try to read our
159 * bus number from the configuration registers at address _ADR.
160 */
161 status = acpi_EvaluateInteger(sc->ap_handle, "_BBN", &sc->ap_bus);
161 status = acpi_GetInteger(sc->ap_handle, "_BBN", &sc->ap_bus);
162 if (ACPI_FAILURE(status)) {
163 if (status != AE_NOT_FOUND) {
164 device_printf(dev, "could not evaluate _BBN - %s\n",
165 AcpiFormatException(status));
166 return_VALUE(ENXIO);
167 } else {
168 /* if it's not found, assume 0 */
169 sc->ap_bus = 0;
170 }
171 }
172
173 /*
174 * If the bus is zero and pcib0 already exists, read the bus number
175 * via PCI config space.
176 */
177 busok = 1;
178 if (sc->ap_bus == 0 && devclass_get_device(pcib_devclass, 0) != dev) {
179 busok = 0;
162 if (ACPI_FAILURE(status)) {
163 if (status != AE_NOT_FOUND) {
164 device_printf(dev, "could not evaluate _BBN - %s\n",
165 AcpiFormatException(status));
166 return_VALUE(ENXIO);
167 } else {
168 /* if it's not found, assume 0 */
169 sc->ap_bus = 0;
170 }
171 }
172
173 /*
174 * If the bus is zero and pcib0 already exists, read the bus number
175 * via PCI config space.
176 */
177 busok = 1;
178 if (sc->ap_bus == 0 && devclass_get_device(pcib_devclass, 0) != dev) {
179 busok = 0;
180 status = acpi_EvaluateInteger(sc->ap_handle, "_ADR", &addr);
180 status = acpi_GetInteger(sc->ap_handle, "_ADR", &addr);
181 if (ACPI_FAILURE(status)) {
182 if (status != AE_NOT_FOUND) {
183 device_printf(dev, "could not evaluate _ADR - %s\n",
184 AcpiFormatException(status));
185 return_VALUE(ENXIO);
186 } else
187 device_printf(dev, "could not determine config space address\n");
188 } else {

--- 22 unchanged lines hidden (view full) ---

211 sc->ap_bus = device_get_unit(dev);
212 device_printf(dev, "trying bus number %d\n", sc->ap_bus);
213 }
214
215 /*
216 * Get our segment number by evaluating _SEG
217 * It's OK for this to not exist.
218 */
181 if (ACPI_FAILURE(status)) {
182 if (status != AE_NOT_FOUND) {
183 device_printf(dev, "could not evaluate _ADR - %s\n",
184 AcpiFormatException(status));
185 return_VALUE(ENXIO);
186 } else
187 device_printf(dev, "could not determine config space address\n");
188 } else {

--- 22 unchanged lines hidden (view full) ---

211 sc->ap_bus = device_get_unit(dev);
212 device_printf(dev, "trying bus number %d\n", sc->ap_bus);
213 }
214
215 /*
216 * Get our segment number by evaluating _SEG
217 * It's OK for this to not exist.
218 */
219 if (ACPI_FAILURE(status = acpi_EvaluateInteger(sc->ap_handle, "_SEG", &sc->ap_segment))) {
219 if (ACPI_FAILURE(status = acpi_GetInteger(sc->ap_handle, "_SEG", &sc->ap_segment))) {
220 if (status != AE_NOT_FOUND) {
221 device_printf(dev, "could not evaluate _SEG - %s\n", AcpiFormatException(status));
222 return_VALUE(ENXIO);
223 }
224 /* if it's not found, assume 0 */
225 sc->ap_segment = 0;
226 }
227

--- 64 unchanged lines hidden ---
220 if (status != AE_NOT_FOUND) {
221 device_printf(dev, "could not evaluate _SEG - %s\n", AcpiFormatException(status));
222 return_VALUE(ENXIO);
223 }
224 /* if it's not found, assume 0 */
225 sc->ap_segment = 0;
226 }
227

--- 64 unchanged lines hidden ---