Deleted Added
full compact
nspredef.c (197104) nspredef.c (199337)
1/******************************************************************************
2 *
3 * Module Name: nspredef - Validation of ACPI predefined methods and objects
4 *
5 *****************************************************************************/
6
7/******************************************************************************
8 *

--- 316 unchanged lines hidden (view full) ---

325
326 /* For returned Package objects, check the type of all sub-objects */
327
328 if (ReturnObject->Common.Type == ACPI_TYPE_PACKAGE)
329 {
330 Status = AcpiNsCheckPackage (Data, ReturnObjectPtr);
331 }
332
1/******************************************************************************
2 *
3 * Module Name: nspredef - Validation of ACPI predefined methods and objects
4 *
5 *****************************************************************************/
6
7/******************************************************************************
8 *

--- 316 unchanged lines hidden (view full) ---

325
326 /* For returned Package objects, check the type of all sub-objects */
327
328 if (ReturnObject->Common.Type == ACPI_TYPE_PACKAGE)
329 {
330 Status = AcpiNsCheckPackage (Data, ReturnObjectPtr);
331 }
332
333 /*
334 * Perform additional, more complicated repairs on a per-name
335 * basis.
336 */
337 Status = AcpiNsComplexRepairs (Data, Node, Status, ReturnObjectPtr);
333
338
339
334CheckValidationStatus:
335 /*
336 * If the object validation failed or if we successfully repaired one
337 * or more objects, mark the parent node to suppress further warning
338 * messages during the next evaluation of the same method/object.
339 */
340 if (ACPI_FAILURE (Status) || (Data->Flags & ACPI_OBJECT_REPAIRED))
341 {

--- 372 unchanged lines hidden (view full) ---

714 * variable number of sub-Packages.
715 *
716 * First, ensure that the first element is a sub-Package. If not,
717 * the BIOS may have incorrectly returned the object as a single
718 * package instead of a Package of Packages (a common error if
719 * there is only one entry). We may be able to repair this by
720 * wrapping the returned Package with a new outer Package.
721 */
340CheckValidationStatus:
341 /*
342 * If the object validation failed or if we successfully repaired one
343 * or more objects, mark the parent node to suppress further warning
344 * messages during the next evaluation of the same method/object.
345 */
346 if (ACPI_FAILURE (Status) || (Data->Flags & ACPI_OBJECT_REPAIRED))
347 {

--- 372 unchanged lines hidden (view full) ---

720 * variable number of sub-Packages.
721 *
722 * First, ensure that the first element is a sub-Package. If not,
723 * the BIOS may have incorrectly returned the object as a single
724 * package instead of a Package of Packages (a common error if
725 * there is only one entry). We may be able to repair this by
726 * wrapping the returned Package with a new outer Package.
727 */
722 if ((*Elements)->Common.Type != ACPI_TYPE_PACKAGE)
728 if (*Elements && ((*Elements)->Common.Type != ACPI_TYPE_PACKAGE))
723 {
724 /* Create the new outer package and populate it */
725
726 Status = AcpiNsRepairPackageList (Data, ReturnObjectPtr);
727 if (ACPI_FAILURE (Status))
728 {
729 return (Status);
730 }

--- 58 unchanged lines hidden (view full) ---

789 ACPI_PREDEFINED_DATA *Data,
790 const ACPI_PREDEFINED_INFO *Package,
791 ACPI_OPERAND_OBJECT **Elements,
792 UINT32 Count)
793{
794 ACPI_OPERAND_OBJECT *SubPackage;
795 ACPI_OPERAND_OBJECT **SubElements;
796 ACPI_STATUS Status;
729 {
730 /* Create the new outer package and populate it */
731
732 Status = AcpiNsRepairPackageList (Data, ReturnObjectPtr);
733 if (ACPI_FAILURE (Status))
734 {
735 return (Status);
736 }

--- 58 unchanged lines hidden (view full) ---

795 ACPI_PREDEFINED_DATA *Data,
796 const ACPI_PREDEFINED_INFO *Package,
797 ACPI_OPERAND_OBJECT **Elements,
798 UINT32 Count)
799{
800 ACPI_OPERAND_OBJECT *SubPackage;
801 ACPI_OPERAND_OBJECT **SubElements;
802 ACPI_STATUS Status;
803 BOOLEAN NonTrailingNull = FALSE;
797 UINT32 ExpectedCount;
798 UINT32 i;
799 UINT32 j;
800
801
802 /* Validate each sub-Package in the parent Package */
803
804 for (i = 0; i < Count; i++)
805 {
804 UINT32 ExpectedCount;
805 UINT32 i;
806 UINT32 j;
807
808
809 /* Validate each sub-Package in the parent Package */
810
811 for (i = 0; i < Count; i++)
812 {
813 /*
814 * Handling for NULL package elements. For now, we will simply allow
815 * a parent package with trailing NULL elements. This can happen if
816 * the package was defined to be longer than the initializer list.
817 * This is legal as per the ACPI specification. It is often used
818 * to allow for dynamic initialization of a Package.
819 *
820 * A future enhancement may be to simply truncate the package to
821 * remove the trailing NULL elements.
822 */
823 if (!(*Elements))
824 {
825 if (!NonTrailingNull)
826 {
827 /* Ensure the remaining elements are all NULL */
828
829 for (j = 1; j < (Count - i + 1); j++)
830 {
831 if (Elements[j])
832 {
833 NonTrailingNull = TRUE;
834 }
835 }
836
837 if (!NonTrailingNull)
838 {
839 /* Ignore the trailing NULL elements */
840
841 return (AE_OK);
842 }
843 }
844
845 /* There are trailing non-null elements, issue warning */
846
847 ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
848 "Found NULL element at package index %u", i));
849 Elements++;
850 continue;
851 }
852
806 SubPackage = *Elements;
807 SubElements = SubPackage->Package.Elements;
808
809 /* Each sub-object must be of type Package */
810
811 Status = AcpiNsCheckObjectType (Data, &SubPackage,
812 ACPI_RTYPE_PACKAGE, i);
813 if (ACPI_FAILURE (Status))

--- 424 unchanged lines hidden ---
853 SubPackage = *Elements;
854 SubElements = SubPackage->Package.Elements;
855
856 /* Each sub-object must be of type Package */
857
858 Status = AcpiNsCheckObjectType (Data, &SubPackage,
859 ACPI_RTYPE_PACKAGE, i);
860 if (ACPI_FAILURE (Status))

--- 424 unchanged lines hidden ---