Deleted Added
full compact
acpi_pcib.c (81093) acpi_pcib.c (82372)
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.c 81093 2001-08-03 08:38:49Z msmith $
27 * $FreeBSD: head/sys/dev/acpica/acpi_pcib.c 82372 2001-08-26 22:50:15Z msmith $
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"

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

287 ACPI_DEVICE_INFO devinfo;
288 ACPI_STATUS status;
289 u_int8_t *prtp;
290 device_t *devlist;
291 int devcount;
292 int bus;
293 int interrupt;
294 int i;
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"

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

287 ACPI_DEVICE_INFO devinfo;
288 ACPI_STATUS status;
289 u_int8_t *prtp;
290 device_t *devlist;
291 int devcount;
292 int bus;
293 int interrupt;
294 int i;
295
296 FUNCTION_TRACE(__func__);
295
296 crsbuf.Pointer = NULL;
297 prsbuf.Pointer = NULL;
298 devlist = NULL;
299 interrupt = 255;
300
301 /* ACPI numbers pins 0-3, not 1-4 like the BIOS */
302 pin--;

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

388 AcpiFormatException(status));
389 goto out; /* this is fatal */
390 }
391 if ((status = acpi_GetIntoBuffer(lnkdev, AcpiGetPossibleResources, &prsbuf)) != AE_OK) {
392 device_printf(sc->ap_dev, "couldn't get PCI interrupt link device _PRS data - %s\n",
393 AcpiFormatException(status));
394 /* this is not fatal, since it may be hardwired */
395 }
297
298 crsbuf.Pointer = NULL;
299 prsbuf.Pointer = NULL;
300 devlist = NULL;
301 interrupt = 255;
302
303 /* ACPI numbers pins 0-3, not 1-4 like the BIOS */
304 pin--;

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

390 AcpiFormatException(status));
391 goto out; /* this is fatal */
392 }
393 if ((status = acpi_GetIntoBuffer(lnkdev, AcpiGetPossibleResources, &prsbuf)) != AE_OK) {
394 device_printf(sc->ap_dev, "couldn't get PCI interrupt link device _PRS data - %s\n",
395 AcpiFormatException(status));
396 /* this is not fatal, since it may be hardwired */
397 }
396 DEBUG_PRINT(TRACE_RESOURCES, ("got %d bytes for %s._CRS\n", crsbuf.Length, acpi_name(lnkdev)));
397 DEBUG_PRINT(TRACE_RESOURCES, ("got %d bytes for %s._PRS\n", prsbuf.Length, acpi_name(lnkdev)));
398 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "got %d bytes for %s._CRS\n", crsbuf.Length, acpi_name(lnkdev)));
399 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "got %d bytes for %s._PRS\n", prsbuf.Length, acpi_name(lnkdev)));
398
399 /*
400 * The interrupt may already be routed, so check _CRS first. We don't check the
401 * 'decoding' bit in the _STA result, since there's nothing in the spec that
402 * mandates it be set, however some BIOS' will set it if the decode is active.
403 *
404 * The Source Index points to the particular resource entry we're interested in.
405 */

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

503 if (devlist != NULL)
504 free(devlist, M_TEMP);
505 if (crsbuf.Pointer != NULL)
506 AcpiOsFree(crsbuf.Pointer);
507 if (prsbuf.Pointer != NULL)
508 AcpiOsFree(prsbuf.Pointer);
509
510 /* XXX APIC_IO interrupt mapping? */
400
401 /*
402 * The interrupt may already be routed, so check _CRS first. We don't check the
403 * 'decoding' bit in the _STA result, since there's nothing in the spec that
404 * mandates it be set, however some BIOS' will set it if the decode is active.
405 *
406 * The Source Index points to the particular resource entry we're interested in.
407 */

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

505 if (devlist != NULL)
506 free(devlist, M_TEMP);
507 if (crsbuf.Pointer != NULL)
508 AcpiOsFree(crsbuf.Pointer);
509 if (prsbuf.Pointer != NULL)
510 AcpiOsFree(prsbuf.Pointer);
511
512 /* XXX APIC_IO interrupt mapping? */
511 return(interrupt);
513 return_VALUE(interrupt);
512}
513
514}
515