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 128058 2004-04-09 15:44:34Z imp $ |
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" --- 29 unchanged lines hidden (view full) --- 65static int acpi_pcib_acpi_resume(device_t bus); 66static int acpi_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); 67static int acpi_pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value); 68static u_int32_t acpi_pcib_read_config(device_t dev, int bus, int slot, int func, int reg, int bytes); 69static void acpi_pcib_write_config(device_t dev, int bus, int slot, int func, int reg, 70 u_int32_t data, int bytes); 71static int acpi_pcib_acpi_route_interrupt(device_t pcib, 72 device_t dev, int pin); |
73static struct resource *acpi_pcib_acpi_alloc_resource(device_t dev, 74 device_t child, int type, int *rid, 75 u_long start, u_long end, u_long count, 76 u_int flags); |
77 78static device_method_t acpi_pcib_acpi_methods[] = { 79 /* Device interface */ 80 DEVMETHOD(device_probe, acpi_pcib_acpi_probe), 81 DEVMETHOD(device_attach, acpi_pcib_acpi_attach), 82 DEVMETHOD(device_shutdown, bus_generic_shutdown), 83 DEVMETHOD(device_suspend, bus_generic_suspend), 84 DEVMETHOD(device_resume, acpi_pcib_acpi_resume), 85 86 /* Bus interface */ 87 DEVMETHOD(bus_print_child, bus_generic_print_child), 88 DEVMETHOD(bus_read_ivar, acpi_pcib_read_ivar), 89 DEVMETHOD(bus_write_ivar, acpi_pcib_write_ivar), |
90 DEVMETHOD(bus_alloc_resource, acpi_pcib_acpi_alloc_resource), |
91 DEVMETHOD(bus_release_resource, bus_generic_release_resource), 92 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), 93 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), 94 DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), 95 DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), 96 97 /* pcib interface */ 98 DEVMETHOD(pcib_maxslots, pcib_maxslots), --- 189 unchanged lines hidden (view full) --- 288acpi_pcib_acpi_route_interrupt(device_t pcib, device_t dev, int pin) 289{ 290 struct acpi_hpcib_softc *sc; 291 292 /* find the bridge softc */ 293 sc = device_get_softc(pcib); 294 return (acpi_pcib_route_interrupt(pcib, dev, pin, &sc->ap_prt)); 295} |
296 297struct resource * 298acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid, 299 u_long start, u_long end, u_long count, u_int flags) 300{ 301 /* 302 * If no memory preference is given, use upper 256MB slot most 303 * bioses use for their memory window. Typically other bridges 304 * before us get in the way to assert their preferences on memory. 305 * Hardcoding like this sucks, so a more MD/MI way needs to be 306 * found to do it. 307 */ 308 if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL) 309 start = 0xf0000000; 310 return (bus_generic_alloc_resource(dev, child, type, rid, start, end, 311 count, flags)); 312} |