Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/acpica/acpi.c
Show First 20 Lines • Show All 203 Lines • ▼ Show 20 Lines | static device_method_t acpi_methods[] = { | ||||
DEVMETHOD(bus_delete_resource, acpi_delete_resource), | DEVMETHOD(bus_delete_resource, acpi_delete_resource), | ||||
DEVMETHOD(bus_child_pnpinfo_str, acpi_child_pnpinfo_str_method), | DEVMETHOD(bus_child_pnpinfo_str, acpi_child_pnpinfo_str_method), | ||||
DEVMETHOD(bus_child_location_str, acpi_child_location_str_method), | DEVMETHOD(bus_child_location_str, acpi_child_location_str_method), | ||||
DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), | DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), | ||||
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), | DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), | ||||
DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), | DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), | ||||
DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), | DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), | ||||
DEVMETHOD(bus_hint_device_unit, acpi_hint_device_unit), | DEVMETHOD(bus_hint_device_unit, acpi_hint_device_unit), | ||||
DEVMETHOD(bus_get_cpus, acpi_get_cpus), | |||||
DEVMETHOD(bus_get_domain, acpi_get_domain), | DEVMETHOD(bus_get_domain, acpi_get_domain), | ||||
/* ACPI bus */ | /* ACPI bus */ | ||||
DEVMETHOD(acpi_id_probe, acpi_device_id_probe), | DEVMETHOD(acpi_id_probe, acpi_device_id_probe), | ||||
DEVMETHOD(acpi_evaluate_object, acpi_device_eval_obj), | DEVMETHOD(acpi_evaluate_object, acpi_device_eval_obj), | ||||
DEVMETHOD(acpi_pwr_for_sleep, acpi_device_pwr_for_sleep), | DEVMETHOD(acpi_pwr_for_sleep, acpi_device_pwr_for_sleep), | ||||
DEVMETHOD(acpi_scan_children, acpi_device_scan_children), | DEVMETHOD(acpi_scan_children, acpi_device_scan_children), | ||||
▲ Show 20 Lines • Show All 847 Lines • ▼ Show 20 Lines | acpi_hint_device_unit(device_t acdev, device_t child, const char *name, | ||||
if (matches > 0) { | if (matches > 0) { | ||||
/* We have a winner! */ | /* We have a winner! */ | ||||
*unitp = unit; | *unitp = unit; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
int | |||||
acpi_get_cpus(device_t dev, device_t child, enum cpu_sets op, cpuset_t *cpuset, int size) | |||||
{ | |||||
int rc, d, error; | |||||
if ((rc = acpi_get_domain(dev, child, &d)) != 0) | |||||
return (rc); | |||||
switch (op) { | |||||
case LOCAL_CPUS: | |||||
*cpuset = cpuset_domain[d]; | |||||
return (0); | |||||
case INTR_CPUS: | |||||
if ((error = bus_generic_get_cpus(dev, child, op, cpuset, size))) | |||||
return (error); | |||||
CPU_AND(cpuset, &cpuset_domain[d]); | |||||
return (0); | |||||
default: | |||||
return (bus_generic_get_cpus(dev, child, op, cpuset, size)); | |||||
} | |||||
} | |||||
/* | /* | ||||
* Fetch the VM domain for the given device 'dev'. | * Fetch the VM domain for the given device 'dev'. | ||||
gallatin: This hunk seems to be extranious | |||||
jhbUnsubmitted Not Done Inline ActionsActually, it's a bit of a mismerge. Let me check my git branch which I've merged more recently than the patches posted to arch@. However, the idea is to treat non-ACPI devices (no handle) differently than what get_domain() does. Maybe the mis-merge is related to the fact that I also changed get_domain to work with the updated acpi_parse_pxm() and this patch tries to not do that? Hmm, my branch is quite different here actually. Let me rebase that (and drop the Intel NIC driver diffs for now) and post that as an alternative. jhb: Actually, it's a bit of a mismerge. Let me check my git branch which I've merged more recently… | |||||
kmacyUnsubmitted Not Done Inline ActionsPlease do. I have no attachment to this patch. I'd just like to see this interface go in. kmacy: Please do. I have no attachment to this patch. I'd just like to see this interface go in. | |||||
* | * | ||||
* Return 1 + domain if there's a domain, 0 if not found; | * Return 1 + domain if there's a domain, 0 if not found; | ||||
* -1 upon an error. | * -1 upon an error. | ||||
*/ | */ | ||||
int | int | ||||
acpi_parse_pxm(device_t dev, int *domain) | acpi_parse_pxm(device_t dev, int *domain) | ||||
{ | { | ||||
#if MAXMEMDOM > 1 | #if MAXMEMDOM > 1 | ||||
ACPI_HANDLE h; | ACPI_HANDLE h; | ||||
int d, pxm; | int d, pxm; | ||||
h = acpi_get_handle(dev); | if ((h = acpi_get_handle(dev)) == NULL) | ||||
if ((h != NULL) && | return (ENOENT); | ||||
ACPI_SUCCESS(acpi_GetInteger(h, "_PXM", &pxm))) { | |||||
if (ACPI_SUCCESS(acpi_GetInteger(h, "_PXM", &pxm))) { | |||||
d = acpi_map_pxm_to_vm_domainid(pxm); | d = acpi_map_pxm_to_vm_domainid(pxm); | ||||
if (d < 0) | if (d < 0) | ||||
return (-1); | return (-1); | ||||
*domain = d; | *domain = d; | ||||
return (1); | return (1); | ||||
} | } | ||||
#endif | #endif | ||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Fetch the NUMA domain for the given device. | * Fetch the NUMA domain for the given device. | ||||
* | * | ||||
* If a device has a _PXM method, map that to a NUMA domain. | * If a device has a _PXM method, map that to a NUMA domain. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 2,949 Lines • Show Last 20 Lines |
This hunk seems to be extranious