// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 /****************************************************************************** * * Module Name: nsprepkg - Validation of package objects for predefined names * * Copyright (C) 2000 - 2023, Intel Corp. * *****************************************************************************/ #include <acpi/acpi.h> #include "accommon.h" #include "acnamesp.h" #include "acpredef.h" #define _COMPONENT … ACPI_MODULE_NAME("nsprepkg") /* Local prototypes */ static acpi_status acpi_ns_check_package_list(struct acpi_evaluate_info *info, const union acpi_predefined_info *package, union acpi_operand_object **elements, u32 count); static acpi_status acpi_ns_check_package_elements(struct acpi_evaluate_info *info, union acpi_operand_object **elements, u8 type1, u32 count1, u8 type2, u32 count2, u32 start_index); static acpi_status acpi_ns_custom_package(struct acpi_evaluate_info *info, union acpi_operand_object **elements, u32 count); /******************************************************************************* * * FUNCTION: acpi_ns_check_package * * PARAMETERS: info - Method execution information block * return_object_ptr - Pointer to the object returned from the * evaluation of a method or object * * RETURN: Status * * DESCRIPTION: Check a returned package object for the correct count and * correct type of all sub-objects. * ******************************************************************************/ acpi_status acpi_ns_check_package(struct acpi_evaluate_info *info, union acpi_operand_object **return_object_ptr) { … } /******************************************************************************* * * FUNCTION: acpi_ns_check_package_list * * PARAMETERS: info - Method execution information block * package - Pointer to package-specific info for method * elements - Element list of parent package. All elements * of this list should be of type Package. * count - Count of subpackages * * RETURN: Status * * DESCRIPTION: Examine a list of subpackages * ******************************************************************************/ static acpi_status acpi_ns_check_package_list(struct acpi_evaluate_info *info, const union acpi_predefined_info *package, union acpi_operand_object **elements, u32 count) { … } /******************************************************************************* * * FUNCTION: acpi_ns_custom_package * * PARAMETERS: info - Method execution information block * elements - Pointer to the package elements array * count - Element count for the package * * RETURN: Status * * DESCRIPTION: Check a returned package object for the correct count and * correct type of all sub-objects. * * NOTE: Currently used for the _BIX method only. When needed for two or more * methods, probably a detect/dispatch mechanism will be required. * ******************************************************************************/ static acpi_status acpi_ns_custom_package(struct acpi_evaluate_info *info, union acpi_operand_object **elements, u32 count) { … } /******************************************************************************* * * FUNCTION: acpi_ns_check_package_elements * * PARAMETERS: info - Method execution information block * elements - Pointer to the package elements array * type1 - Object type for first group * count1 - Count for first group * type2 - Object type for second group * count2 - Count for second group * start_index - Start of the first group of elements * * RETURN: Status * * DESCRIPTION: Check that all elements of a package are of the correct object * type. Supports up to two groups of different object types. * ******************************************************************************/ static acpi_status acpi_ns_check_package_elements(struct acpi_evaluate_info *info, union acpi_operand_object **elements, u8 type1, u32 count1, u8 type2, u32 count2, u32 start_index) { … }