Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/acpica/acpi_spmc.c
| Show First 20 Lines • Show All 316 Lines • ▼ Show 20 Lines | for (size_t i = 0; i < object->Package.Count; i++) { | ||||
| name_obj = &constraint_obj->Package.Elements[0]; | name_obj = &constraint_obj->Package.Elements[0]; | ||||
| constraint->name = strdup(name_obj->String.Pointer, M_TEMP); | constraint->name = strdup(name_obj->String.Pointer, M_TEMP); | ||||
| if (constraint->name == NULL) { | if (constraint->name == NULL) { | ||||
| acpi_spmc_free_constraints(sc); | acpi_spmc_free_constraints(sc); | ||||
| return (ENOMEM); | return (ENOMEM); | ||||
| } | } | ||||
| detail = &constraint_obj->Package.Elements[2]; | |||||
| /* | /* | ||||
| * The first element in the device constraint detail package is | * The first element in the device constraint detail package is | ||||
| * the revision, and should always be zero. | * the revision, and should always be zero. | ||||
| */ | */ | ||||
| revision = constraint_obj->Package.Elements[0].Integer.Value; | revision = detail->Package.Elements[0].Integer.Value; | ||||
| if (revision != 0) { | if (revision != 0) { | ||||
| device_printf(sc->dev, "Unknown revision %d for " | device_printf(sc->dev, "Unknown revision %d for " | ||||
| "device constraint detail package\n", revision); | "device constraint detail package\n", revision); | ||||
| sc->constraint_count--; | sc->constraint_count--; | ||||
| continue; | continue; | ||||
| } | } | ||||
| detail = &constraint_obj->Package.Elements[2]; | |||||
| constraint_package = &detail->Package.Elements[1]; | constraint_package = &detail->Package.Elements[1]; | ||||
| constraint->lpi_uid = | constraint->lpi_uid = | ||||
| constraint_package->Package.Elements[0].Integer.Value; | constraint_package->Package.Elements[0].Integer.Value; | ||||
| constraint->min_d_state = | constraint->min_d_state = | ||||
| constraint_package->Package.Elements[1].Integer.Value; | constraint_package->Package.Elements[1].Integer.Value; | ||||
| constraint->min_dev_specific_state = | constraint->min_dev_specific_state = | ||||
| constraint_package->Package.Elements[2].Integer.Value; | constraint_package->Package.Elements[2].Integer.Value; | ||||
| ▲ Show 20 Lines • Show All 293 Lines • Show Last 20 Lines | |||||