Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/acpica/acpi.c
Context not available. | |||||
static void acpi_reserve_resources(device_t dev); | static void acpi_reserve_resources(device_t dev); | ||||
static int acpi_sysres_alloc(device_t dev); | static int acpi_sysres_alloc(device_t dev); | ||||
static int acpi_set_resource(device_t dev, device_t child, int type, | static int acpi_set_resource(device_t dev, device_t child, int type, | ||||
int rid, u_long start, u_long count); | int rid, rman_res_t start, rman_res_t count); | ||||
static struct resource *acpi_alloc_resource(device_t bus, device_t child, | static struct resource *acpi_alloc_resource(device_t bus, device_t child, | ||||
int type, int *rid, u_long start, u_long end, | int type, int *rid, rman_res_t start, rman_res_t end, | ||||
u_long count, u_int flags); | rman_res_t count, u_int flags); | ||||
static int acpi_adjust_resource(device_t bus, device_t child, int type, | static int acpi_adjust_resource(device_t bus, 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); | ||||
static int acpi_release_resource(device_t bus, device_t child, int type, | static int acpi_release_resource(device_t bus, device_t child, int type, | ||||
int rid, struct resource *r); | int rid, struct resource *r); | ||||
static void acpi_delete_resource(device_t bus, device_t child, int type, | static void acpi_delete_resource(device_t bus, device_t child, int type, | ||||
Context not available. | |||||
panic("acpi rman_init IO ports failed"); | panic("acpi rman_init IO ports failed"); | ||||
acpi_rman_mem.rm_type = RMAN_ARRAY; | acpi_rman_mem.rm_type = RMAN_ARRAY; | ||||
acpi_rman_mem.rm_start = 0; | acpi_rman_mem.rm_start = 0; | ||||
acpi_rman_mem.rm_end = ~0ul; | acpi_rman_mem.rm_end = ~0; | ||||
acpi_rman_mem.rm_descr = "ACPI I/O memory addresses"; | acpi_rman_mem.rm_descr = "ACPI I/O memory addresses"; | ||||
if (rman_init(&acpi_rman_mem) != 0) | if (rman_init(&acpi_rman_mem) != 0) | ||||
panic("acpi rman_init memory failed"); | panic("acpi rman_init memory failed"); | ||||
Context not available. | |||||
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); | ||||
Context not available. | |||||
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; | ||||
} | } | ||||
Context not available. | |||||
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); | ||||
Context not available. | |||||
static int | static int | ||||
acpi_set_resource(device_t dev, device_t child, int type, int rid, | acpi_set_resource(device_t dev, device_t child, int type, int rid, | ||||
u_long start, u_long count) | rman_res_t start, rman_res_t count) | ||||
{ | { | ||||
struct acpi_softc *sc = device_get_softc(dev); | struct acpi_softc *sc = device_get_softc(dev); | ||||
struct acpi_device *ad = device_get_ivars(child); | struct acpi_device *ad = device_get_ivars(child); | ||||
struct resource_list *rl = &ad->ad_rl; | struct resource_list *rl = &ad->ad_rl; | ||||
ACPI_DEVICE_INFO *devinfo; | ACPI_DEVICE_INFO *devinfo; | ||||
u_long end; | rman_res_t end; | ||||
/* Ignore IRQ resources for PCI link devices. */ | /* Ignore IRQ resources for PCI link devices. */ | ||||
if (type == SYS_RES_IRQ && ACPI_ID_PROBE(dev, child, pcilink_ids) != NULL) | if (type == SYS_RES_IRQ && ACPI_ID_PROBE(dev, child, pcilink_ids) != NULL) | ||||
Context not available. | |||||
static struct resource * | static struct resource * | ||||
acpi_alloc_resource(device_t bus, device_t child, int type, int *rid, | acpi_alloc_resource(device_t bus, 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) | ||||
{ | { | ||||
ACPI_RESOURCE ares; | ACPI_RESOURCE ares; | ||||
struct acpi_device *ad; | struct acpi_device *ad; | ||||
Context not available. | |||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
struct resource_list *rl; | struct resource_list *rl; | ||||
struct resource *res; | struct resource *res; | ||||
int isdefault = (start == 0UL && end == ~0UL); | int isdefault = (start == 0 && end == ~0); | ||||
/* | /* | ||||
* First attempt at allocating the resource. For direct children, | * First attempt at allocating the resource. For direct children, | ||||
Context not available. | |||||
* system resources. | * system resources. | ||||
*/ | */ | ||||
struct resource * | struct resource * | ||||
acpi_alloc_sysres(device_t child, int type, int *rid, u_long start, u_long end, | acpi_alloc_sysres(device_t child, int type, int *rid, rman_res_t start, | ||||
u_long count, u_int flags) | rman_res_t end, rman_res_t count, u_int flags) | ||||
{ | { | ||||
struct rman *rm; | struct rman *rm; | ||||
struct resource *res; | struct resource *res; | ||||
Context not available. | |||||
static int | static int | ||||
acpi_adjust_resource(device_t bus, device_t child, int type, struct resource *r, | acpi_adjust_resource(device_t bus, device_t child, int type, struct resource *r, | ||||
u_long start, u_long end) | rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
if (acpi_is_resource_managed(type, r)) | if (acpi_is_resource_managed(type, r)) | ||||
Context not available. |