case ACPI_PTYPE1_VAR: /* *Thepackagecountisvariable,therearenosubpackages,andall *elementsmustbeofthesametype
*/ for (i = 0; i < count; i++) {
status = acpi_ns_check_object_type(info, elements,
package->ret_info.
object_type1, i); if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
elements++;
} break;
case ACPI_PTYPE1_OPTION: /* *Thepackagecountisvariable,therearenosubpackages.Thereare *afixednumberofrequiredelements,andavariablenumberof *optionalelements. * *Checkifpackageisatleastaslargeastheminimumrequired
*/
expected_count = package->ret_info3.count; if (count < expected_count) { goto package_too_small;
}
/* Variable number of sub-objects */
for (i = 0; i < count; i++) { if (i < package->ret_info3.count) {
/* These are the required package elements (0, 1, or 2) */
status =
acpi_ns_check_object_type(info, elements,
package->
ret_info3.
object_type[i],
i); if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
} else { /* These are the optional package elements */
status =
acpi_ns_check_object_type(info, elements,
package->
ret_info3.
tail_object_type,
i); if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
}
elements++;
} break;
case ACPI_PTYPE2_REV_FIXED:
/* First element is the (Integer) revision */
status =
acpi_ns_check_object_type(info, elements,
ACPI_RTYPE_INTEGER, 0); if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
elements++;
count--;
/* Examine the subpackages */
status =
acpi_ns_check_package_list(info, package, elements, count); break;
case ACPI_PTYPE2_PKG_COUNT:
/* First element is the (Integer) count of subpackages to follow */
status =
acpi_ns_check_object_type(info, elements,
ACPI_RTYPE_INTEGER, 0); if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
status =
acpi_ns_check_package_list(info, package, elements, count); break;
case ACPI_PTYPE2: case ACPI_PTYPE2_FIXED: case ACPI_PTYPE2_MIN: case ACPI_PTYPE2_COUNT: case ACPI_PTYPE2_FIX_VAR: /* *ThesetypesallreturnasinglePackagethatconsistsofa *variablenumberofsubpackages. * *First,ensurethatthefirstelementisasubpackage.Ifnot, *theBIOSmayhaveincorrectlyreturnedtheobjectasasingle *packageinsteadofaPackageofPackages(acommonerrorif *thereisonlyoneentry).Wemaybeabletorepairthisby *wrappingthereturnedPackagewithanewouterPackage.
*/ if (*elements
&& ((*elements)->common.type != ACPI_TYPE_PACKAGE)) {
/* Create the new outer package and populate it */
status =
acpi_ns_wrap_with_package(info, return_object,
return_object_ptr); if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* Update locals to point to the new package (of 1 element) */
return_object = *return_object_ptr;
elements = return_object->package.elements;
count = 1;
}
/* Examine the subpackages */
status =
acpi_ns_check_package_list(info, package, elements, count); break;
case ACPI_PTYPE2_VAR_VAR: /* *Returnsavariablelistofpackages,eachwithavariablelist *ofobjects.
*/ break;
case ACPI_PTYPE2_UUID_PAIR:
/* The package must contain pairs of (UUID + type) */
while (count > 0) {
status = acpi_ns_check_object_type(info, elements,
package->ret_info.
object_type1, 0); if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* Validate length of the UUID buffer */
if ((*elements)->buffer.length != 16) {
ACPI_WARN_PREDEFINED((AE_INFO,
info->full_pathname,
info->node_flags, "Invalid length for UUID Buffer"));
return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
}
status = acpi_ns_check_object_type(info, elements + 1,
package->ret_info.
object_type2, 0); if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
elements += 2;
count -= 2;
} break;
default:
/* Should not get here if predefined info table is correct */
ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
info->node_flags, "Invalid internal return type in table entry: %X",
package->ret_info.type));
return_ACPI_STATUS(AE_AML_INTERNAL);
}
return_ACPI_STATUS(status);
package_too_small:
/* Error exit for the case with an incorrect package count */
ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, info->node_flags, "Return Package is too small - found %u elements, expected %u",
count, expected_count));
/* The subpackage count was smaller than required */
ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, info->node_flags, "Return SubPackage[%u] is too small - found %u elements, expected %u",
i, sub_package->package.count, expected_count));
static acpi_status
acpi_ns_custom_package(struct acpi_evaluate_info *info, union acpi_operand_object **elements, u32 count)
{
u32 expected_count;
u32 version;
acpi_status status = AE_OK;
ACPI_FUNCTION_NAME(ns_custom_package);
/* Get version number, must be Integer */
if ((*elements)->common.type != ACPI_TYPE_INTEGER) {
ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
info->node_flags, "Return Package has invalid object type for version number"));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
version = (u32)(*elements)->integer.value;
expected_count = 21; /* Version 1 */
if (version == 0) {
expected_count = 20; /* Version 0 */
}
if (count < expected_count) {
ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
info->node_flags, "Return Package is too small - found %u elements, expected %u",
count, expected_count));
return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
} elseif (count > expected_count) {
ACPI_DEBUG_PRINT((ACPI_DB_REPAIR, "%s: Return Package is larger than needed - " "found %u, expected %u\n",
info->full_pathname, count, expected_count));
}
/* Validate all elements of the returned package */
status = acpi_ns_check_package_elements(info, elements,
ACPI_RTYPE_INTEGER, 16,
ACPI_RTYPE_STRING, 4, 0); if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* Version 1 has a single trailing integer */
if (version > 0) {
status = acpi_ns_check_package_elements(info, elements + 20,
ACPI_RTYPE_INTEGER, 1, 0, 0, 20);
}
/* *Uptotwogroupsofpackageelementsaresupportedbythedata *structure.Allelementsineachgroupmustbeofthesametype. *Thesecondgroupcanhaveacountofzero.
*/ for (i = 0; i < count1; i++) {
status = acpi_ns_check_object_type(info, this_element,
type1, i + start_index); if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
this_element++;
}
for (i = 0; i < count2; i++) {
status = acpi_ns_check_object_type(info, this_element,
type2,
(i + count1 + start_index)); if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
this_element++;
}
return_ACPI_STATUS(AE_OK);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.3 Sekunden
(vorverarbeitet am 2026-10-11)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.