Deleted Added
sdiff udiff text old ( 199337 ) new ( 200553 )
full compact
1/******************************************************************************
2 *
3 * Module Name: nspredef - Validation of ACPI predefined methods and objects
4 *
5 *****************************************************************************/
6
7/******************************************************************************
8 *

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

308 {
309 goto Cleanup;
310 }
311 Data->Predefined = Predefined;
312 Data->NodeFlags = Node->Flags;
313 Data->Pathname = Pathname;
314
315 /*
316 * Check that the type of the main return object is what is expected
317 * for this predefined name
318 */
319 Status = AcpiNsCheckObjectType (Data, ReturnObjectPtr,
320 Predefined->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT);
321 if (ACPI_FAILURE (Status))
322 {
323 goto Exit;
324 }
325
326 /*
327 * For returned Package objects, check the type of all sub-objects.
328 * Note: Package may have been newly created by call above.
329 */
330 if ((*ReturnObjectPtr)->Common.Type == ACPI_TYPE_PACKAGE)
331 {
332 Status = AcpiNsCheckPackage (Data, ReturnObjectPtr);
333 if (ACPI_FAILURE (Status))
334 {
335 goto Exit;
336 }
337 }
338
339 /*
340 * The return object was OK, or it was successfully repaired above.
341 * Now make some additional checks such as verifying that package
342 * objects are sorted correctly (if required) or buffer objects have
343 * the correct data width (bytes vs. dwords). These repairs are
344 * performed on a per-name basis, i.e., the code is specific to
345 * particular predefined names.
346 */
347 Status = AcpiNsComplexRepairs (Data, Node, Status, ReturnObjectPtr);
348
349Exit:
350 /*
351 * If the object validation failed or if we successfully repaired one
352 * or more objects, mark the parent node to suppress further warning
353 * messages during the next evaluation of the same method/object.
354 */
355 if (ACPI_FAILURE (Status) || (Data->Flags & ACPI_OBJECT_REPAIRED))
356 {
357 Node->Flags |= ANOBJ_EVALUATED;
358 }
359 ACPI_FREE (Data);
360
361Cleanup:
362 ACPI_FREE (Pathname);
363 return (Status);
364}
365
366
367/*******************************************************************************
368 *

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

547 /* The package info for this name is in the next table entry */
548
549 Package = Data->Predefined + 1;
550
551 ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
552 "%s Validating return Package of Type %X, Count %X\n",
553 Data->Pathname, Package->RetInfo.Type, ReturnObject->Package.Count));
554
555 /*
556 * For variable-length Packages, we can safely remove all embedded
557 * and trailing NULL package elements
558 */
559 AcpiNsRemoveNullElements (Data, Package->RetInfo.Type, ReturnObject);
560
561 /* Extract package count and elements array */
562
563 Elements = ReturnObject->Package.Elements;
564 Count = ReturnObject->Package.Count;
565
566 /* The package must have at least one element, else invalid */
567
568 if (!Count)

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

591 */
592 ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2;
593 if (Count < ExpectedCount)
594 {
595 goto PackageTooSmall;
596 }
597 else if (Count > ExpectedCount)
598 {
599 ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR,
600 "%s: Return Package is larger than needed - "
601 "found %u, expected %u\n",
602 Data->Pathname, Count, ExpectedCount));
603 }
604
605 /* Validate all elements of the returned package */
606
607 Status = AcpiNsCheckPackageElements (Data, Elements,
608 Package->RetInfo.ObjectType1, Package->RetInfo.Count1,
609 Package->RetInfo.ObjectType2, Package->RetInfo.Count2, 0);
610 break;

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

810 ACPI_PREDEFINED_DATA *Data,
811 const ACPI_PREDEFINED_INFO *Package,
812 ACPI_OPERAND_OBJECT **Elements,
813 UINT32 Count)
814{
815 ACPI_OPERAND_OBJECT *SubPackage;
816 ACPI_OPERAND_OBJECT **SubElements;
817 ACPI_STATUS Status;
818 UINT32 ExpectedCount;
819 UINT32 i;
820 UINT32 j;
821
822
823 /*
824 * Validate each sub-Package in the parent Package
825 *
826 * NOTE: assumes list of sub-packages contains no NULL elements.
827 * Any NULL elements should have been removed by earlier call
828 * to AcpiNsRemoveNullElements.
829 */
830 for (i = 0; i < Count; i++)
831 {
832 SubPackage = *Elements;
833 SubElements = SubPackage->Package.Elements;
834
835 /* Each sub-object must be of type Package */
836
837 Status = AcpiNsCheckObjectType (Data, &SubPackage,
838 ACPI_RTYPE_PACKAGE, i);
839 if (ACPI_FAILURE (Status))

--- 424 unchanged lines hidden ---