acpi_pcib_acpi.c (166176) | acpi_pcib_acpi.c (169221) |
---|---|
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: head/sys/dev/acpica/acpi_pcib_acpi.c 166176 2007-01-22 21:48:44Z jhb $"); | 29__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_pcib_acpi.c 169221 2007-05-02 17:50:36Z 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/malloc.h> 36#include <sys/module.h> 37#include <sys/sysctl.h> --- 33 unchanged lines hidden (view full) --- 71static uint32_t acpi_pcib_read_config(device_t dev, int bus, int slot, 72 int func, int reg, int bytes); 73static void acpi_pcib_write_config(device_t dev, int bus, int slot, 74 int func, int reg, uint32_t data, int bytes); 75static int acpi_pcib_acpi_route_interrupt(device_t pcib, 76 device_t dev, int pin); 77static int acpi_pcib_alloc_msi(device_t pcib, device_t dev, 78 int count, int maxcount, int *irqs); | 30 31#include "opt_acpi.h" 32#include <sys/param.h> 33#include <sys/bus.h> 34#include <sys/kernel.h> 35#include <sys/malloc.h> 36#include <sys/module.h> 37#include <sys/sysctl.h> --- 33 unchanged lines hidden (view full) --- 71static uint32_t acpi_pcib_read_config(device_t dev, int bus, int slot, 72 int func, int reg, int bytes); 73static void acpi_pcib_write_config(device_t dev, int bus, int slot, 74 int func, int reg, uint32_t data, int bytes); 75static int acpi_pcib_acpi_route_interrupt(device_t pcib, 76 device_t dev, int pin); 77static int acpi_pcib_alloc_msi(device_t pcib, device_t dev, 78 int count, int maxcount, int *irqs); |
79static int acpi_pcib_map_msi(device_t pcib, device_t dev, 80 int irq, uint64_t *addr, uint32_t *data); |
|
79static int acpi_pcib_alloc_msix(device_t pcib, device_t dev, | 81static int acpi_pcib_alloc_msix(device_t pcib, device_t dev, |
80 int index, int *irq); | 82 int *irq); |
81static struct resource *acpi_pcib_acpi_alloc_resource(device_t dev, 82 device_t child, int type, int *rid, 83 u_long start, u_long end, u_long count, 84 u_int flags); 85 86static device_method_t acpi_pcib_acpi_methods[] = { 87 /* Device interface */ 88 DEVMETHOD(device_probe, acpi_pcib_acpi_probe), --- 16 unchanged lines hidden (view full) --- 105 /* pcib interface */ 106 DEVMETHOD(pcib_maxslots, pcib_maxslots), 107 DEVMETHOD(pcib_read_config, acpi_pcib_read_config), 108 DEVMETHOD(pcib_write_config, acpi_pcib_write_config), 109 DEVMETHOD(pcib_route_interrupt, acpi_pcib_acpi_route_interrupt), 110 DEVMETHOD(pcib_alloc_msi, acpi_pcib_alloc_msi), 111 DEVMETHOD(pcib_release_msi, pcib_release_msi), 112 DEVMETHOD(pcib_alloc_msix, acpi_pcib_alloc_msix), | 83static struct resource *acpi_pcib_acpi_alloc_resource(device_t dev, 84 device_t child, int type, int *rid, 85 u_long start, u_long end, u_long count, 86 u_int flags); 87 88static device_method_t acpi_pcib_acpi_methods[] = { 89 /* Device interface */ 90 DEVMETHOD(device_probe, acpi_pcib_acpi_probe), --- 16 unchanged lines hidden (view full) --- 107 /* pcib interface */ 108 DEVMETHOD(pcib_maxslots, pcib_maxslots), 109 DEVMETHOD(pcib_read_config, acpi_pcib_read_config), 110 DEVMETHOD(pcib_write_config, acpi_pcib_write_config), 111 DEVMETHOD(pcib_route_interrupt, acpi_pcib_acpi_route_interrupt), 112 DEVMETHOD(pcib_alloc_msi, acpi_pcib_alloc_msi), 113 DEVMETHOD(pcib_release_msi, pcib_release_msi), 114 DEVMETHOD(pcib_alloc_msix, acpi_pcib_alloc_msix), |
113 DEVMETHOD(pcib_remap_msix, pcib_remap_msix), | |
114 DEVMETHOD(pcib_release_msix, pcib_release_msix), | 115 DEVMETHOD(pcib_release_msix, pcib_release_msix), |
116 DEVMETHOD(pcib_map_msi, acpi_pcib_map_msi), |
|
115 116 {0, 0} 117}; 118 119static devclass_t pcib_devclass; 120 121DEFINE_CLASS_0(pcib, acpi_pcib_acpi_driver, acpi_pcib_acpi_methods, 122 sizeof(struct acpi_hpcib_softc)); --- 195 unchanged lines hidden (view full) --- 318 device_t bus; 319 320 bus = device_get_parent(pcib); 321 return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount, 322 irqs)); 323} 324 325static int | 117 118 {0, 0} 119}; 120 121static devclass_t pcib_devclass; 122 123DEFINE_CLASS_0(pcib, acpi_pcib_acpi_driver, acpi_pcib_acpi_methods, 124 sizeof(struct acpi_hpcib_softc)); --- 195 unchanged lines hidden (view full) --- 320 device_t bus; 321 322 bus = device_get_parent(pcib); 323 return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount, 324 irqs)); 325} 326 327static int |
326acpi_pcib_alloc_msix(device_t pcib, device_t dev, int index, int *irq) | 328acpi_pcib_alloc_msix(device_t pcib, device_t dev, int *irq) |
327{ 328 device_t bus; 329 330 bus = device_get_parent(pcib); | 329{ 330 device_t bus; 331 332 bus = device_get_parent(pcib); |
331 return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, index, irq)); | 333 return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq)); |
332} 333 | 334} 335 |
336static int 337acpi_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, 338 uint32_t *data) 339{ 340 device_t bus; 341 342 bus = device_get_parent(pcib); 343 return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data)); 344} 345 |
|
334static u_long acpi_host_mem_start = 0x80000000; 335TUNABLE_ULONG("hw.acpi.host_mem_start", &acpi_host_mem_start); 336 337struct resource * 338acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid, 339 u_long start, u_long end, u_long count, u_int flags) 340{ 341 /* --- 15 unchanged lines hidden --- | 346static u_long acpi_host_mem_start = 0x80000000; 347TUNABLE_ULONG("hw.acpi.host_mem_start", &acpi_host_mem_start); 348 349struct resource * 350acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid, 351 u_long start, u_long end, u_long count, u_int flags) 352{ 353 /* --- 15 unchanged lines hidden --- |