Deleted Added
full compact
acpi_pcib_acpi.c (225736) acpi_pcib_acpi.c (227397)
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:

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

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
28#include <sys/cdefs.h>
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:

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

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
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: stable/9/sys/dev/acpica/acpi_pcib_acpi.c 224254 2011-07-21 20:43:43Z jhb $");
29__FBSDID("$FreeBSD: stable/9/sys/dev/acpica/acpi_pcib_acpi.c 227397 2011-11-09 18:12:42Z jhb $");
30
31#include "opt_acpi.h"
32#include <sys/param.h>
33#include <sys/bus.h>
34#include <sys/kernel.h>
35#include <sys/limits.h>
36#include <sys/malloc.h>
37#include <sys/module.h>

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

496}
497
498struct resource *
499acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid,
500 u_long start, u_long end, u_long count, u_int flags)
501{
502#ifdef NEW_PCIB
503 struct acpi_hpcib_softc *sc;
30
31#include "opt_acpi.h"
32#include <sys/param.h>
33#include <sys/bus.h>
34#include <sys/kernel.h>
35#include <sys/limits.h>
36#include <sys/malloc.h>
37#include <sys/module.h>

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

496}
497
498struct resource *
499acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid,
500 u_long start, u_long end, u_long count, u_int flags)
501{
502#ifdef NEW_PCIB
503 struct acpi_hpcib_softc *sc;
504 struct resource *res;
504#endif
505
506#if defined(__i386__) || defined(__amd64__)
507 start = hostb_alloc_start(type, start, end, count);
508#endif
509
510#ifdef NEW_PCIB
511 sc = device_get_softc(dev);
505#endif
506
507#if defined(__i386__) || defined(__amd64__)
508 start = hostb_alloc_start(type, start, end, count);
509#endif
510
511#ifdef NEW_PCIB
512 sc = device_get_softc(dev);
512 return (pcib_host_res_alloc(&sc->ap_host_res, child, type, rid, start, end,
513 count, flags));
513 res = pcib_host_res_alloc(&sc->ap_host_res, child, type, rid, start, end,
514 count, flags);
515 if (res == NULL && start + count - 1 == end)
516 res = acpi_alloc_sysres(child, type, rid, start, end, count, flags);
517 return (res);
514#else
515 return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
516 count, flags));
517#endif
518}
519
520#ifdef NEW_PCIB
521int
522acpi_pcib_acpi_adjust_resource(device_t dev, device_t child, int type,
523 struct resource *r, u_long start, u_long end)
524{
525 struct acpi_hpcib_softc *sc;
526
527 sc = device_get_softc(dev);
528 return (pcib_host_res_adjust(&sc->ap_host_res, child, type, r, start,
529 end));
530}
531#endif
518#else
519 return (bus_generic_alloc_resource(dev, child, type, rid, start, end,
520 count, flags));
521#endif
522}
523
524#ifdef NEW_PCIB
525int
526acpi_pcib_acpi_adjust_resource(device_t dev, device_t child, int type,
527 struct resource *r, u_long start, u_long end)
528{
529 struct acpi_hpcib_softc *sc;
530
531 sc = device_get_softc(dev);
532 return (pcib_host_res_adjust(&sc->ap_host_res, child, type, r, start,
533 end));
534}
535#endif