Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/acpica/acpi.c
Show First 20 Lines • Show All 789 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
acpi_print_child(device_t bus, device_t child) | acpi_print_child(device_t bus, device_t child) | ||||
{ | { | ||||
struct acpi_device *adev = device_get_ivars(child); | struct acpi_device *adev = device_get_ivars(child); | ||||
struct resource_list *rl = &adev->ad_rl; | struct resource_list *rl = &adev->ad_rl; | ||||
int retval = 0; | int retval = 0; | ||||
retval += bus_print_child_header(bus, child); | retval += bus_print_child_header(bus, child); | ||||
retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); | retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#jx"); | ||||
retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx"); | retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#jx"); | ||||
retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); | retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd"); | ||||
retval += resource_list_print_type(rl, "drq", SYS_RES_DRQ, "%ld"); | retval += resource_list_print_type(rl, "drq", SYS_RES_DRQ, "%jd"); | ||||
if (device_get_flags(child)) | if (device_get_flags(child)) | ||||
retval += printf(" flags %#x", device_get_flags(child)); | retval += printf(" flags %#x", device_get_flags(child)); | ||||
retval += bus_print_child_domain(bus, child); | retval += bus_print_child_domain(bus, child); | ||||
retval += bus_print_child_footer(bus, child); | retval += bus_print_child_footer(bus, child); | ||||
return (retval); | return (retval); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 341 Lines • ▼ Show 20 Lines | acpi_sysres_alloc(device_t dev) | ||||
if (ACPI_ID_PROBE(dev, children[i], sysres_ids) != NULL) | if (ACPI_ID_PROBE(dev, children[i], sysres_ids) != NULL) | ||||
device_probe_and_attach(children[i]); | device_probe_and_attach(children[i]); | ||||
} | } | ||||
free(children, M_TEMP); | free(children, M_TEMP); | ||||
rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev); | rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev); | ||||
STAILQ_FOREACH(rle, rl, link) { | STAILQ_FOREACH(rle, rl, link) { | ||||
if (rle->res != NULL) { | if (rle->res != NULL) { | ||||
device_printf(dev, "duplicate resource for %lx\n", rle->start); | device_printf(dev, "duplicate resource for %jx\n", rle->start); | ||||
continue; | continue; | ||||
} | } | ||||
/* Only memory and IO resources are valid here. */ | /* Only memory and IO resources are valid here. */ | ||||
switch (rle->type) { | switch (rle->type) { | ||||
case SYS_RES_IOPORT: | case SYS_RES_IOPORT: | ||||
rm = &acpi_rman_io; | rm = &acpi_rman_io; | ||||
break; | break; | ||||
case SYS_RES_MEMORY: | case SYS_RES_MEMORY: | ||||
rm = &acpi_rman_mem; | rm = &acpi_rman_mem; | ||||
break; | break; | ||||
default: | default: | ||||
continue; | continue; | ||||
} | } | ||||
/* Pre-allocate resource and add to our rman pool. */ | /* Pre-allocate resource and add to our rman pool. */ | ||||
res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, rle->type, | res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, rle->type, | ||||
&rle->rid, rle->start, rle->start + rle->count - 1, rle->count, 0); | &rle->rid, rle->start, rle->start + rle->count - 1, rle->count, 0); | ||||
if (res != NULL) { | if (res != NULL) { | ||||
rman_manage_region(rm, rman_get_start(res), rman_get_end(res)); | rman_manage_region(rm, rman_get_start(res), rman_get_end(res)); | ||||
rle->res = res; | rle->res = res; | ||||
} else if (bootverbose) | } else if (bootverbose) | ||||
device_printf(dev, "reservation of %lx, %lx (%d) failed\n", | device_printf(dev, "reservation of %jx, %jx (%d) failed\n", | ||||
rle->start, rle->count, rle->type); | rle->start, rle->count, rle->type); | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
static char *pcilink_ids[] = { "PNP0C0F", NULL }; | static char *pcilink_ids[] = { "PNP0C0F", NULL }; | ||||
static char *sysres_ids[] = { "PNP0C01", "PNP0C02", NULL }; | static char *sysres_ids[] = { "PNP0C01", "PNP0C02", NULL }; | ||||
▲ Show 20 Lines • Show All 2,867 Lines • Show Last 20 Lines |