Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/acpica/acpi_pcib_acpi.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
static int acpi_pcib_alloc_msi(device_t pcib, device_t dev, | static int acpi_pcib_alloc_msi(device_t pcib, device_t dev, | ||||
int count, int maxcount, int *irqs); | int count, int maxcount, int *irqs); | ||||
static int acpi_pcib_map_msi(device_t pcib, device_t dev, | static int acpi_pcib_map_msi(device_t pcib, device_t dev, | ||||
int irq, uint64_t *addr, uint32_t *data); | int irq, uint64_t *addr, uint32_t *data); | ||||
static int acpi_pcib_alloc_msix(device_t pcib, device_t dev, | static int acpi_pcib_alloc_msix(device_t pcib, device_t dev, | ||||
int *irq); | int *irq); | ||||
static struct resource *acpi_pcib_acpi_alloc_resource(device_t dev, | static struct resource *acpi_pcib_acpi_alloc_resource(device_t dev, | ||||
device_t child, int type, int *rid, | device_t child, int type, int *rid, | ||||
u_long start, u_long end, u_long count, | rman_res_t start, rman_res_t end, rman_res_t count, | ||||
u_int flags); | u_int flags); | ||||
#ifdef NEW_PCIB | #ifdef NEW_PCIB | ||||
static int acpi_pcib_acpi_adjust_resource(device_t dev, | static int acpi_pcib_acpi_adjust_resource(device_t dev, | ||||
device_t child, int type, struct resource *r, | device_t child, int type, struct resource *r, | ||||
u_long start, u_long end); | rman_res_t start, rman_res_t end); | ||||
#ifdef PCI_RES_BUS | #ifdef PCI_RES_BUS | ||||
static int acpi_pcib_acpi_release_resource(device_t dev, | static int acpi_pcib_acpi_release_resource(device_t dev, | ||||
device_t child, int type, int rid, | device_t child, int type, int rid, | ||||
struct resource *r); | struct resource *r); | ||||
#endif | #endif | ||||
#endif | #endif | ||||
static device_method_t acpi_pcib_acpi_methods[] = { | static device_method_t acpi_pcib_acpi_methods[] = { | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
break; | break; | ||||
} | } | ||||
return (AE_OK); | return (AE_OK); | ||||
} | } | ||||
#endif | #endif | ||||
#if defined(NEW_PCIB) && defined(PCI_RES_BUS) | #if defined(NEW_PCIB) && defined(PCI_RES_BUS) | ||||
static int | static int | ||||
first_decoded_bus(struct acpi_hpcib_softc *sc, u_long *startp) | first_decoded_bus(struct acpi_hpcib_softc *sc, rman_res_t *startp) | ||||
{ | { | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
rle = resource_list_find(&sc->ap_host_res.hr_rl, PCI_RES_BUS, 0); | rle = resource_list_find(&sc->ap_host_res.hr_rl, PCI_RES_BUS, 0); | ||||
if (rle == NULL) | if (rle == NULL) | ||||
return (ENXIO); | return (ENXIO); | ||||
*startp = rle->start; | *startp = rle->start; | ||||
return (0); | return (0); | ||||
} | } | ||||
#endif | #endif | ||||
static int | static int | ||||
acpi_pcib_acpi_attach(device_t dev) | acpi_pcib_acpi_attach(device_t dev) | ||||
{ | { | ||||
struct acpi_hpcib_softc *sc; | struct acpi_hpcib_softc *sc; | ||||
ACPI_STATUS status; | ACPI_STATUS status; | ||||
static int bus0_seen = 0; | static int bus0_seen = 0; | ||||
u_int slot, func, busok; | u_int slot, func, busok; | ||||
#if defined(NEW_PCIB) && defined(PCI_RES_BUS) | #if defined(NEW_PCIB) && defined(PCI_RES_BUS) | ||||
struct resource *bus_res; | struct resource *bus_res; | ||||
u_long start; | rman_res_t start; | ||||
int rid; | int rid; | ||||
#endif | #endif | ||||
uint8_t busno; | uint8_t busno; | ||||
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); | ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
sc->ap_dev = dev; | sc->ap_dev = dev; | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
ACPI_ADR_PCI_FUNC(sc->ap_addr)); | ACPI_ADR_PCI_FUNC(sc->ap_addr)); | ||||
if (hostb != NULL) | if (hostb != NULL) | ||||
pci_ht_map_msi(hostb, *addr); | pci_ht_map_msi(hostb, *addr); | ||||
return (0); | return (0); | ||||
} | } | ||||
struct resource * | struct resource * | ||||
acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid, | acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid, | ||||
u_long start, u_long end, u_long count, u_int flags) | rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) | ||||
{ | { | ||||
#ifdef NEW_PCIB | #ifdef NEW_PCIB | ||||
struct acpi_hpcib_softc *sc; | struct acpi_hpcib_softc *sc; | ||||
struct resource *res; | struct resource *res; | ||||
#endif | #endif | ||||
#if defined(__i386__) || defined(__amd64__) | #if defined(__i386__) || defined(__amd64__) | ||||
start = hostb_alloc_start(type, start, end, count); | start = hostb_alloc_start(type, start, end, count); | ||||
Show All 24 Lines | |||||
return (bus_generic_alloc_resource(dev, child, type, rid, start, end, | return (bus_generic_alloc_resource(dev, child, type, rid, start, end, | ||||
count, flags)); | count, flags)); | ||||
#endif | #endif | ||||
} | } | ||||
#ifdef NEW_PCIB | #ifdef NEW_PCIB | ||||
int | int | ||||
acpi_pcib_acpi_adjust_resource(device_t dev, device_t child, int type, | acpi_pcib_acpi_adjust_resource(device_t dev, device_t child, int type, | ||||
struct resource *r, u_long start, u_long end) | struct resource *r, rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
struct acpi_hpcib_softc *sc; | struct acpi_hpcib_softc *sc; | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
#ifdef PCI_RES_BUS | #ifdef PCI_RES_BUS | ||||
if (type == PCI_RES_BUS) | if (type == PCI_RES_BUS) | ||||
return (pci_domain_adjust_bus(sc->ap_segment, child, r, start, | return (pci_domain_adjust_bus(sc->ap_segment, child, r, start, | ||||
end)); | end)); | ||||
Show All 19 Lines |