Merge ACPICA 20091112.

This commit is contained in:
jkim 2009-11-16 21:47:12 +00:00
commit e91f3d64cb
46 changed files with 1386 additions and 360 deletions

View File

@ -171,107 +171,108 @@ contrib/dev/acpica/dispatcher/dswexec.c optional acpi
contrib/dev/acpica/dispatcher/dswload.c optional acpi
contrib/dev/acpica/dispatcher/dswscope.c optional acpi
contrib/dev/acpica/dispatcher/dswstate.c optional acpi
contrib/dev/acpica/events/evevent.c optional acpi
contrib/dev/acpica/events/evgpe.c optional acpi
contrib/dev/acpica/events/evgpeblk.c optional acpi
contrib/dev/acpica/events/evmisc.c optional acpi
contrib/dev/acpica/events/evregion.c optional acpi
contrib/dev/acpica/events/evrgnini.c optional acpi
contrib/dev/acpica/events/evsci.c optional acpi
contrib/dev/acpica/events/evxface.c optional acpi
contrib/dev/acpica/events/evxfevnt.c optional acpi
contrib/dev/acpica/events/evxfregn.c optional acpi
contrib/dev/acpica/executer/exconfig.c optional acpi
contrib/dev/acpica/executer/exconvrt.c optional acpi
contrib/dev/acpica/executer/excreate.c optional acpi
contrib/dev/acpica/executer/exdump.c optional acpi
contrib/dev/acpica/executer/exfield.c optional acpi
contrib/dev/acpica/executer/exfldio.c optional acpi
contrib/dev/acpica/executer/exmisc.c optional acpi
contrib/dev/acpica/executer/exmutex.c optional acpi
contrib/dev/acpica/executer/exnames.c optional acpi
contrib/dev/acpica/executer/exoparg1.c optional acpi
contrib/dev/acpica/executer/exoparg2.c optional acpi
contrib/dev/acpica/executer/exoparg3.c optional acpi
contrib/dev/acpica/executer/exoparg6.c optional acpi
contrib/dev/acpica/executer/exprep.c optional acpi
contrib/dev/acpica/executer/exregion.c optional acpi
contrib/dev/acpica/executer/exresnte.c optional acpi
contrib/dev/acpica/executer/exresolv.c optional acpi
contrib/dev/acpica/executer/exresop.c optional acpi
contrib/dev/acpica/executer/exstore.c optional acpi
contrib/dev/acpica/executer/exstoren.c optional acpi
contrib/dev/acpica/executer/exstorob.c optional acpi
contrib/dev/acpica/executer/exsystem.c optional acpi
contrib/dev/acpica/executer/exutils.c optional acpi
contrib/dev/acpica/hardware/hwacpi.c optional acpi
contrib/dev/acpica/hardware/hwgpe.c optional acpi
contrib/dev/acpica/hardware/hwregs.c optional acpi
contrib/dev/acpica/hardware/hwsleep.c optional acpi
contrib/dev/acpica/hardware/hwtimer.c optional acpi
contrib/dev/acpica/hardware/hwvalid.c optional acpi
contrib/dev/acpica/hardware/hwxface.c optional acpi
contrib/dev/acpica/namespace/nsaccess.c optional acpi
contrib/dev/acpica/namespace/nsalloc.c optional acpi
contrib/dev/acpica/namespace/nsdump.c optional acpi
contrib/dev/acpica/namespace/nseval.c optional acpi
contrib/dev/acpica/namespace/nsinit.c optional acpi
contrib/dev/acpica/namespace/nsload.c optional acpi
contrib/dev/acpica/namespace/nsnames.c optional acpi
contrib/dev/acpica/namespace/nsobject.c optional acpi
contrib/dev/acpica/namespace/nsparse.c optional acpi
contrib/dev/acpica/namespace/nspredef.c optional acpi
contrib/dev/acpica/namespace/nsrepair.c optional acpi
contrib/dev/acpica/namespace/nssearch.c optional acpi
contrib/dev/acpica/namespace/nsutils.c optional acpi
contrib/dev/acpica/namespace/nswalk.c optional acpi
contrib/dev/acpica/namespace/nsxfeval.c optional acpi
contrib/dev/acpica/namespace/nsxfname.c optional acpi
contrib/dev/acpica/namespace/nsxfobj.c optional acpi
contrib/dev/acpica/parser/psargs.c optional acpi
contrib/dev/acpica/parser/psloop.c optional acpi
contrib/dev/acpica/parser/psopcode.c optional acpi
contrib/dev/acpica/parser/psparse.c optional acpi
contrib/dev/acpica/parser/psscope.c optional acpi
contrib/dev/acpica/parser/pstree.c optional acpi
contrib/dev/acpica/parser/psutils.c optional acpi
contrib/dev/acpica/parser/pswalk.c optional acpi
contrib/dev/acpica/parser/psxface.c optional acpi
contrib/dev/acpica/resources/rsaddr.c optional acpi
contrib/dev/acpica/resources/rscalc.c optional acpi
contrib/dev/acpica/resources/rscreate.c optional acpi
contrib/dev/acpica/resources/rsdump.c optional acpi
contrib/dev/acpica/resources/rsinfo.c optional acpi
contrib/dev/acpica/resources/rsio.c optional acpi
contrib/dev/acpica/resources/rsirq.c optional acpi
contrib/dev/acpica/resources/rslist.c optional acpi
contrib/dev/acpica/resources/rsmemory.c optional acpi
contrib/dev/acpica/resources/rsmisc.c optional acpi
contrib/dev/acpica/resources/rsutils.c optional acpi
contrib/dev/acpica/resources/rsxface.c optional acpi
contrib/dev/acpica/tables/tbfadt.c optional acpi
contrib/dev/acpica/tables/tbfind.c optional acpi
contrib/dev/acpica/tables/tbinstal.c optional acpi
contrib/dev/acpica/tables/tbutils.c optional acpi
contrib/dev/acpica/tables/tbxface.c optional acpi
contrib/dev/acpica/tables/tbxfroot.c optional acpi
contrib/dev/acpica/utilities/utalloc.c optional acpi
contrib/dev/acpica/utilities/utcache.c optional acpi
contrib/dev/acpica/utilities/utcopy.c optional acpi
contrib/dev/acpica/utilities/utdebug.c optional acpi
contrib/dev/acpica/utilities/utdelete.c optional acpi
contrib/dev/acpica/utilities/uteval.c optional acpi
contrib/dev/acpica/utilities/utglobal.c optional acpi
contrib/dev/acpica/utilities/utids.c optional acpi
contrib/dev/acpica/utilities/utinit.c optional acpi
contrib/dev/acpica/utilities/utlock.c optional acpi
contrib/dev/acpica/utilities/utmath.c optional acpi
contrib/dev/acpica/utilities/utmisc.c optional acpi
contrib/dev/acpica/utilities/utmutex.c optional acpi
contrib/dev/acpica/utilities/utobject.c optional acpi
contrib/dev/acpica/utilities/utresrc.c optional acpi
contrib/dev/acpica/utilities/utstate.c optional acpi
contrib/dev/acpica/utilities/utxface.c optional acpi
contrib/dev/acpica/events/evevent.c optional acpi
contrib/dev/acpica/events/evgpe.c optional acpi
contrib/dev/acpica/events/evgpeblk.c optional acpi
contrib/dev/acpica/events/evmisc.c optional acpi
contrib/dev/acpica/events/evregion.c optional acpi
contrib/dev/acpica/events/evrgnini.c optional acpi
contrib/dev/acpica/events/evsci.c optional acpi
contrib/dev/acpica/events/evxface.c optional acpi
contrib/dev/acpica/events/evxfevnt.c optional acpi
contrib/dev/acpica/events/evxfregn.c optional acpi
contrib/dev/acpica/executer/exconfig.c optional acpi
contrib/dev/acpica/executer/exconvrt.c optional acpi
contrib/dev/acpica/executer/excreate.c optional acpi
contrib/dev/acpica/executer/exdump.c optional acpi
contrib/dev/acpica/executer/exfield.c optional acpi
contrib/dev/acpica/executer/exfldio.c optional acpi
contrib/dev/acpica/executer/exmisc.c optional acpi
contrib/dev/acpica/executer/exmutex.c optional acpi
contrib/dev/acpica/executer/exnames.c optional acpi
contrib/dev/acpica/executer/exoparg1.c optional acpi
contrib/dev/acpica/executer/exoparg2.c optional acpi
contrib/dev/acpica/executer/exoparg3.c optional acpi
contrib/dev/acpica/executer/exoparg6.c optional acpi
contrib/dev/acpica/executer/exprep.c optional acpi
contrib/dev/acpica/executer/exregion.c optional acpi
contrib/dev/acpica/executer/exresnte.c optional acpi
contrib/dev/acpica/executer/exresolv.c optional acpi
contrib/dev/acpica/executer/exresop.c optional acpi
contrib/dev/acpica/executer/exstore.c optional acpi
contrib/dev/acpica/executer/exstoren.c optional acpi
contrib/dev/acpica/executer/exstorob.c optional acpi
contrib/dev/acpica/executer/exsystem.c optional acpi
contrib/dev/acpica/executer/exutils.c optional acpi
contrib/dev/acpica/hardware/hwacpi.c optional acpi
contrib/dev/acpica/hardware/hwgpe.c optional acpi
contrib/dev/acpica/hardware/hwregs.c optional acpi
contrib/dev/acpica/hardware/hwsleep.c optional acpi
contrib/dev/acpica/hardware/hwtimer.c optional acpi
contrib/dev/acpica/hardware/hwvalid.c optional acpi
contrib/dev/acpica/hardware/hwxface.c optional acpi
contrib/dev/acpica/namespace/nsaccess.c optional acpi
contrib/dev/acpica/namespace/nsalloc.c optional acpi
contrib/dev/acpica/namespace/nsdump.c optional acpi
contrib/dev/acpica/namespace/nseval.c optional acpi
contrib/dev/acpica/namespace/nsinit.c optional acpi
contrib/dev/acpica/namespace/nsload.c optional acpi
contrib/dev/acpica/namespace/nsnames.c optional acpi
contrib/dev/acpica/namespace/nsobject.c optional acpi
contrib/dev/acpica/namespace/nsparse.c optional acpi
contrib/dev/acpica/namespace/nspredef.c optional acpi
contrib/dev/acpica/namespace/nsrepair.c optional acpi
contrib/dev/acpica/namespace/nsrepair2.c optional acpi
contrib/dev/acpica/namespace/nssearch.c optional acpi
contrib/dev/acpica/namespace/nsutils.c optional acpi
contrib/dev/acpica/namespace/nswalk.c optional acpi
contrib/dev/acpica/namespace/nsxfeval.c optional acpi
contrib/dev/acpica/namespace/nsxfname.c optional acpi
contrib/dev/acpica/namespace/nsxfobj.c optional acpi
contrib/dev/acpica/parser/psargs.c optional acpi
contrib/dev/acpica/parser/psloop.c optional acpi
contrib/dev/acpica/parser/psopcode.c optional acpi
contrib/dev/acpica/parser/psparse.c optional acpi
contrib/dev/acpica/parser/psscope.c optional acpi
contrib/dev/acpica/parser/pstree.c optional acpi
contrib/dev/acpica/parser/psutils.c optional acpi
contrib/dev/acpica/parser/pswalk.c optional acpi
contrib/dev/acpica/parser/psxface.c optional acpi
contrib/dev/acpica/resources/rsaddr.c optional acpi
contrib/dev/acpica/resources/rscalc.c optional acpi
contrib/dev/acpica/resources/rscreate.c optional acpi
contrib/dev/acpica/resources/rsdump.c optional acpi
contrib/dev/acpica/resources/rsinfo.c optional acpi
contrib/dev/acpica/resources/rsio.c optional acpi
contrib/dev/acpica/resources/rsirq.c optional acpi
contrib/dev/acpica/resources/rslist.c optional acpi
contrib/dev/acpica/resources/rsmemory.c optional acpi
contrib/dev/acpica/resources/rsmisc.c optional acpi
contrib/dev/acpica/resources/rsutils.c optional acpi
contrib/dev/acpica/resources/rsxface.c optional acpi
contrib/dev/acpica/tables/tbfadt.c optional acpi
contrib/dev/acpica/tables/tbfind.c optional acpi
contrib/dev/acpica/tables/tbinstal.c optional acpi
contrib/dev/acpica/tables/tbutils.c optional acpi
contrib/dev/acpica/tables/tbxface.c optional acpi
contrib/dev/acpica/tables/tbxfroot.c optional acpi
contrib/dev/acpica/utilities/utalloc.c optional acpi
contrib/dev/acpica/utilities/utcache.c optional acpi
contrib/dev/acpica/utilities/utcopy.c optional acpi
contrib/dev/acpica/utilities/utdebug.c optional acpi
contrib/dev/acpica/utilities/utdelete.c optional acpi
contrib/dev/acpica/utilities/uteval.c optional acpi
contrib/dev/acpica/utilities/utglobal.c optional acpi
contrib/dev/acpica/utilities/utids.c optional acpi
contrib/dev/acpica/utilities/utinit.c optional acpi
contrib/dev/acpica/utilities/utlock.c optional acpi
contrib/dev/acpica/utilities/utmath.c optional acpi
contrib/dev/acpica/utilities/utmisc.c optional acpi
contrib/dev/acpica/utilities/utmutex.c optional acpi
contrib/dev/acpica/utilities/utobject.c optional acpi
contrib/dev/acpica/utilities/utresrc.c optional acpi
contrib/dev/acpica/utilities/utstate.c optional acpi
contrib/dev/acpica/utilities/utxface.c optional acpi
contrib/ipfilter/netinet/fil.c optional ipfilter inet \
compile-with "${NORMAL_C} -I$S/contrib/ipfilter"
contrib/ipfilter/netinet/ip_auth.c optional ipfilter inet \

View File

@ -1,3 +1,76 @@
----------------------------------------
12 November 2009. Summary of changes for version 20091112:
This release is available at www.acpica.org/downloads
1) ACPI CA Core Subsystem:
Implemented a post-order callback to AcpiWalkNamespace. The existing
interface only has a pre-order callback. This change adds an additional
parameter for a post-order callback which will be more useful for bus scans.
ACPICA BZ 779. Lin Ming. Updated the ACPICA Programmer Reference.
Modified the behavior of the operation region memory mapping cache for
SystemMemory. Ensure that the memory mappings created for operation regions
do not cross 4K page boundaries. Crossing a page boundary while mapping
regions can cause kernel warnings on some hosts if the pages have different
attributes. Such regions are probably BIOS bugs, and this is the workaround.
Linux BZ 14445. Lin Ming.
Implemented an automatic repair for predefined methods that must return
sorted lists. This change will repair (by sorting) packages returned by _ALR,
_PSS, and _TSS. Drivers can now assume that the packages are correctly sorted
and do not contain NULL package elements. Adds one new file,
namespace/nsrepair2.c. ACPICA BZ 784. Lin Ming, Bob Moore.
Fixed a possible fault during predefined name validation if a return Package
object contains NULL elements. Also adds a warning if a NULL element is
followed by any non-null elements. ACPICA BZ 813, 814. Future enhancement may
include repair or removal of all such NULL elements where possible.
Implemented additional module-level executable AML code support. This change
will execute module-level code that is not at the root of the namespace
(under a Device object, etc.) at table load time. Module-level executable AML
code has been illegal since ACPI 2.0. ACPICA BZ 762. Lin Ming.
Implemented a new internal function to create Integer objects. This function
simplifies miscellaneous object creation code. ACPICA BZ 823.
Reduced the severity of predefined repair messages, Warning to Info. Since
the object was successfully repaired, a warning is too severe. Reduced to an
info message for now. These messages may eventually be changed to debug-only.
ACPICA BZ 812.
Example Code and Data Size: These are the sizes for the OS-independent
acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The
debug version of the code includes the debug output trace mechanism and has a
much larger code and data size.
Previous Release:
Non-Debug Version: 85.8K Code, 18.0K Data, 103.8K Total
Debug Version: 161.8K Code, 50.6K Data, 212.4K Total
Current Release:
Non-Debug Version: 86.6K Code, 18.2K Data, 104.8K Total
Debug Version: 162.7K Code, 50.8K Data, 213.5K Total
2) iASL Compiler/Disassembler and Tools:
iASL: Implemented Switch() with While(1) so that Break works correctly. This
change correctly implements the Switch operator with a surrounding While(1)
so that the Break operator works as expected. ACPICA BZ 461. Lin Ming.
iASL: Added a message if a package initializer list is shorter than package
length. Adds a new remark for a Package() declaration if an initializer list
exists, but is shorter than the declared length of the package. Although
technically legal, this is probably a coding error and it is seen in the
field. ACPICA BZ 815. Lin Ming, Bob Moore.
iASL: Fixed a problem where the compiler could fault after the maximum number
of errors was reached (200).
acpixtract: Fixed a possible warning for pointer cast if the compiler warning
level set very high.
----------------------------------------
13 October 2009. Summary of changes for version 20091013:

View File

@ -895,13 +895,6 @@ CmCleanupAndExit (
10) / Gbl_NsLookupCount);
}
/* Close all open files */
for (i = 2; i < ASL_MAX_FILE_TYPE; i++)
{
FlCloseFile (i);
}
/*
* TBD: SourceOutput should be .TMP, then rename if we want to keep it?
*/
@ -923,6 +916,13 @@ CmCleanupAndExit (
}
UtDisplaySummary (ASL_FILE_STDOUT);
/* Close all open files */
for (i = 2; i < ASL_MAX_FILE_TYPE; i++)
{
FlCloseFile (i);
}
}

View File

@ -535,6 +535,7 @@ AslCommonError (
Gbl_NextError = Gbl_ErrorLog;
CmDoOutputFiles ();
CmCleanupAndExit ();
exit(1);
}
return;

View File

@ -526,7 +526,7 @@ LsDisplayNamespace (
/* Walk entire namespace from the root */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, LsDoOneNamespaceObject,
ACPI_UINT32_MAX, FALSE, LsDoOneNamespaceObject, NULL,
NULL, NULL);
/* Print the full pathname for each namespace node */
@ -534,7 +534,7 @@ LsDisplayNamespace (
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\nNamespace pathnames\n\n");
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, LsDoOnePathname,
ACPI_UINT32_MAX, FALSE, LsDoOnePathname, NULL,
NULL, NULL);
return (Status);
@ -598,7 +598,7 @@ LkObjectExists (
/* Walk entire namespace from the supplied root */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, LsCompareOneNamespaceObject,
ACPI_UINT32_MAX, FALSE, LsCompareOneNamespaceObject, NULL,
Name, NULL);
if (Status == AE_CTRL_TRUE)
{
@ -753,7 +753,7 @@ LkFindUnreferencedObjects (
/* Walk entire namespace from the supplied root */
(void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, LkIsObjectUsed,
ACPI_UINT32_MAX, FALSE, LkIsObjectUsed, NULL,
NULL, NULL);
}

View File

@ -788,20 +788,30 @@ OpnDoPackage (
if ((PackageLengthOp->Asl.ParseOpcode == PARSEOP_INTEGER) ||
(PackageLengthOp->Asl.ParseOpcode == PARSEOP_QWORDCONST))
{
if (PackageLengthOp->Asl.Value.Integer >= PackageLength)
if (PackageLengthOp->Asl.Value.Integer > PackageLength)
{
/* Allow package to be longer than the initializer list */
/*
* Allow package length to be longer than the initializer
* list -- but if the length of initializer list is nonzero,
* issue a message since this is probably a coding error,
* even though technically legal.
*/
if (PackageLength > 0)
{
AslError (ASL_REMARK, ASL_MSG_LIST_LENGTH_SHORT,
PackageLengthOp, NULL);
}
PackageLength = (UINT32) PackageLengthOp->Asl.Value.Integer;
}
else
else if (PackageLengthOp->Asl.Value.Integer < PackageLength)
{
/*
* Initializer list is longer than the package length. This
* is an error as per the ACPI spec.
* The package length is smaller than the length of the
* initializer list. This is an error as per the ACPI spec.
*/
AslError (ASL_ERROR, ASL_MSG_LIST_LENGTH,
PackageLengthOp->Asl.Next, NULL);
AslError (ASL_ERROR, ASL_MSG_LIST_LENGTH_LONG,
PackageLengthOp, NULL);
}
}

View File

@ -468,6 +468,8 @@ TrDoSwitch (
ACPI_PARSE_OBJECT *NewOp;
ACPI_PARSE_OBJECT *NewOp2;
ACPI_PARSE_OBJECT *MethodOp;
ACPI_PARSE_OBJECT *StoreOp;
ACPI_PARSE_OBJECT *BreakOp;
char *PredicateValueName;
UINT16 Index;
UINT32 Btype;
@ -638,11 +640,7 @@ TrDoSwitch (
*/
if (CurrentParentNode == StartNode)
{
Conditional->Asl.Parent = CurrentParentNode->Asl.Parent;
/* Link IF into the peer list */
TrAmlInsertPeer (CurrentParentNode, Conditional);
Conditional->Asl.Next = NULL;
}
else
{
@ -695,6 +693,7 @@ TrDoSwitch (
{
return;
}
TrAmlInitNode (DefaultOp, PARSEOP_ELSE);
DefaultOp->Asl.Parent = Conditional->Asl.Parent;
@ -799,22 +798,44 @@ TrDoSwitch (
TrAmlSetSubtreeParent (NewOp2, NewOp);
/*
* Transform the Switch() into a Store() node which will be used to save the
* Transform the Switch() into a While(One)-Break node.
* And create a Store() node which will be used to save the
* Switch() value. The store is of the form: Store (Value, _T_x)
* where _T_x is the temp variable.
*/
TrAmlInitNode (StartNode, PARSEOP_STORE);
StartNode->Asl.Child = NULL;
TrAmlInitNode (StartNode, PARSEOP_WHILE);
NewOp = TrCreateLeafNode (PARSEOP_ONE);
NewOp->Asl.Next = Predicate->Asl.Next;
NewOp->Asl.Parent = StartNode;
StartNode->Asl.Child = NewOp;
/* Create a Store() node */
StoreOp = TrCreateLeafNode (PARSEOP_STORE);
StoreOp->Asl.Parent = StartNode;
TrAmlInsertPeer (NewOp, StoreOp);
/* Complete the Store subtree */
StartNode->Asl.Child = Predicate;
Predicate->Asl.Parent = StartNode;
StoreOp->Asl.Child = Predicate;
Predicate->Asl.Parent = StoreOp;
NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
(ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName));
NewOp->Asl.Parent = StartNode;
NewOp->Asl.Parent = StoreOp;
Predicate->Asl.Next = NewOp;
/* Create a Break() node and insert it into the end of While() */
Conditional = StartNode->Asl.Child;
while (Conditional->Asl.Next)
{
Conditional = Conditional->Asl.Next;
}
BreakOp = TrCreateLeafNode (PARSEOP_BREAK);
BreakOp->Asl.Parent = StartNode;
TrAmlInsertPeer (Conditional, BreakOp);
}

View File

@ -369,7 +369,8 @@ typedef enum
ASL_MSG_INVALID_TIME,
ASL_MSG_INVALID_TYPE,
ASL_MSG_INVALID_UUID,
ASL_MSG_LIST_LENGTH,
ASL_MSG_LIST_LENGTH_LONG,
ASL_MSG_LIST_LENGTH_SHORT,
ASL_MSG_LISTING_FILE_OPEN,
ASL_MSG_LISTING_FILENAME,
ASL_MSG_LOCAL_INIT,
@ -488,7 +489,8 @@ char *AslMessages [] = {
/* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)",
/* ASL_MSG_INVALID_TYPE */ "Invalid type",
/* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"",
/* ASL_MSG_LIST_LENGTH */ "Initializer list too long",
/* ASL_MSG_LIST_LENGTH_LONG */ "Initializer list longer than declared package length",
/* ASL_MSG_LIST_LENGTH_SHORT */ "Initializer list shorter than declared package length",
/* ASL_MSG_LISTING_FILE_OPEN */ "Could not open listing file",
/* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename",
/* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized",

View File

@ -383,7 +383,7 @@ AcpiDbFindReferences (
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForReferences, (void *) ObjDesc, NULL);
AcpiDbWalkForReferences, NULL, (void *) ObjDesc, NULL);
}
@ -475,7 +475,7 @@ AcpiDbCheckPredefinedNames (
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForPredefinedNames, (void *) &Count, NULL);
AcpiDbWalkForPredefinedNames, NULL, (void *) &Count, NULL);
AcpiOsPrintf ("Found %d predefined names in the namespace\n", Count);
}
@ -617,7 +617,7 @@ AcpiDbBatchExecute (
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForExecute, (void *) &Info, NULL);
AcpiDbWalkForExecute, NULL, (void *) &Info, NULL);
AcpiOsPrintf ("Executed %d predefined names in the namespace\n", Info.Count);
}
@ -1165,15 +1165,13 @@ AcpiDbSetMethodData (
/* Create and initialize the new object */
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
ObjDesc = AcpiUtCreateIntegerObject ((UINT64) Value);
if (!ObjDesc)
{
AcpiOsPrintf ("Could not create an internal object\n");
return;
}
ObjDesc->Integer.Value = Value;
/* Store the new object into the target */
switch (Type)
@ -1325,7 +1323,7 @@ AcpiDbDisplayObjects (
/* Walk the namespace from the root */
(void) AcpiWalkNamespace (Type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForSpecificObjects, (void *) &Info, NULL);
AcpiDbWalkForSpecificObjects, NULL, (void *) &Info, NULL);
AcpiOsPrintf (
"\nFound %u objects of type [%s] in the current ACPI Namespace\n",
@ -1441,7 +1439,7 @@ AcpiDbFindNameInNamespace (
/* Walk the namespace from the root */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkAndMatchName, AcpiName, NULL);
AcpiDbWalkAndMatchName, NULL, AcpiName, NULL);
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
return (AE_OK);
@ -1942,7 +1940,7 @@ AcpiDbCheckIntegrity (
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbIntegrityWalk, (void *) &Info, NULL);
AcpiDbIntegrityWalk, NULL, (void *) &Info, NULL);
AcpiOsPrintf ("Verified %d namespace nodes with %d Objects\n",
Info.Nodes, Info.Objects);
@ -2129,7 +2127,7 @@ AcpiDbGetBusInfo (
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbBusWalk, NULL, NULL);
AcpiDbBusWalk, NULL, NULL, NULL);
}
#endif /* ACPI_DEBUGGER */

View File

@ -453,7 +453,7 @@ AcpiDbExecute (
if (*Name == '*')
{
(void) AcpiWalkNamespace (ACPI_TYPE_METHOD, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, AcpiDbExecutionWalk, NULL, NULL);
ACPI_UINT32_MAX, AcpiDbExecutionWalk, NULL, NULL, NULL);
return;
}
else

View File

@ -446,7 +446,7 @@ AcpiDbCountNamespaceObjects (
}
(void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, AcpiDbClassifyOneObject, NULL, NULL);
ACPI_UINT32_MAX, FALSE, AcpiDbClassifyOneObject, NULL, NULL, NULL);
}

View File

@ -283,7 +283,7 @@ AcpiDsInitializeObjects (
* the namespace reader lock.
*/
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, StartNode, ACPI_UINT32_MAX,
ACPI_NS_WALK_UNLOCK, AcpiDsInitOneObject, &Info, NULL);
ACPI_NS_WALK_UNLOCK, AcpiDsInitOneObject, NULL, &Info, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));

View File

@ -524,13 +524,12 @@ AcpiDsMethodDataGetValue (
if (AcpiGbl_EnableInterpreterSlack)
{
Object = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
Object = AcpiUtCreateIntegerObject ((UINT64) 0);
if (!Object)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Object->Integer.Value = 0;
Node->Object = Object;
}

View File

@ -574,7 +574,7 @@ AcpiDsBuildInternalPackageObj (
*
* Note: technically, this is an error, from ACPI spec: "It is an error
* for NumElements to be less than the number of elements in the
* PackageList". However, we just print an error message and
* PackageList". However, we just print a message and
* no exception is returned. This provides Windows compatibility. Some
* BIOSs will alter the NumElements on the fly, creating this type
* of ill-formed package object.
@ -598,8 +598,8 @@ AcpiDsBuildInternalPackageObj (
Arg = Arg->Common.Next;
}
ACPI_ERROR ((AE_INFO,
"Package List length (0x%X) larger than NumElements count (0x%X), truncated\n",
ACPI_INFO ((AE_INFO,
"Actual Package length (0x%X) is larger than NumElements field (0x%X), truncated\n",
i, ElementCount));
}
else if (i < ElementCount)

View File

@ -1110,7 +1110,7 @@ AcpiEvCreateGpeBlock (
Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD, GpeDevice,
ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
AcpiEvSaveMethodInfo, GpeBlock, NULL);
AcpiEvSaveMethodInfo, NULL, GpeBlock, NULL);
/* Return the new block */
@ -1192,7 +1192,7 @@ AcpiEvInitializeGpeBlock (
Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK,
AcpiEvMatchPrwAndGpe, &GpeInfo, NULL);
AcpiEvMatchPrwAndGpe, NULL, &GpeInfo, NULL);
}
/*

View File

@ -400,25 +400,21 @@ AcpiEvExecuteRegMethod (
* connection status 1 for connecting the handler, 0 for disconnecting
* the handler (Passed as a parameter)
*/
Args[0] = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
Args[0] = AcpiUtCreateIntegerObject ((UINT64) RegionObj->Region.SpaceId);
if (!Args[0])
{
Status = AE_NO_MEMORY;
goto Cleanup1;
}
Args[1] = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
Args[1] = AcpiUtCreateIntegerObject ((UINT64) Function);
if (!Args[1])
{
Status = AE_NO_MEMORY;
goto Cleanup2;
}
/* Setup the parameter objects */
Args[0]->Integer.Value = RegionObj->Region.SpaceId;
Args[1]->Integer.Value = Function;
Args[2] = NULL;
Args[2] = NULL; /* Terminate list */
/* Execute the method, no return value */
@ -1173,7 +1169,7 @@ AcpiEvInstallSpaceHandler (
* of the branch
*/
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
ACPI_NS_WALK_UNLOCK, AcpiEvInstallHandler,
ACPI_NS_WALK_UNLOCK, AcpiEvInstallHandler, NULL,
HandlerObj, NULL);
UnlockAndExit:
@ -1213,7 +1209,7 @@ AcpiEvExecuteRegMethods (
* regions of this Space ID before we can run any _REG methods)
*/
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
ACPI_NS_WALK_UNLOCK, AcpiEvRegRun,
ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL,
&SpaceId, NULL);
return_ACPI_STATUS (Status);

View File

@ -263,15 +263,13 @@ AcpiExLoadTableOp (
/* Table not found, return an Integer=0 and AE_OK */
DdbHandle = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
DdbHandle = AcpiUtCreateIntegerObject ((UINT64) 0);
if (!DdbHandle)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
DdbHandle->Integer.Value = 0;
*ReturnDesc = DdbHandle;
return_ACPI_STATUS (AE_OK);
}

View File

@ -260,7 +260,7 @@ AcpiExConvertToInteger (
/* Create a new integer */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
ReturnDesc = AcpiUtCreateIntegerObject (Result);
if (!ReturnDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@ -271,7 +271,6 @@ AcpiExConvertToInteger (
/* Save the Result */
ReturnDesc->Integer.Value = Result;
AcpiExTruncateFor32bitTable (ReturnDesc);
*ResultDesc = ReturnDesc;
return_ACPI_STATUS (AE_OK);

View File

@ -249,14 +249,13 @@ AcpiExReadDataFromField (
{
/* Field will fit within an Integer (normal case) */
BufferDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
BufferDesc = AcpiUtCreateIntegerObject ((UINT64) 0);
if (!BufferDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Length = AcpiGbl_IntegerByteWidth;
BufferDesc->Integer.Value = 0;
Buffer = &BufferDesc->Integer.Value;
}

View File

@ -183,13 +183,12 @@ AcpiExOpcode_0A_0T_1R (
/* Create a return object of type Integer */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
ReturnDesc = AcpiUtCreateIntegerObject (AcpiOsGetTimer ());
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
ReturnDesc->Integer.Value = AcpiOsGetTimer ();
break;
default: /* Unknown opcode */
@ -733,7 +732,7 @@ AcpiExOpcode_1A_0T_1R (
{
case AML_LNOT_OP: /* LNot (Operand) */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
ReturnDesc = AcpiUtCreateIntegerObject ((UINT64) 0);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
@ -838,14 +837,12 @@ AcpiExOpcode_1A_0T_1R (
/* Allocate a descriptor to hold the type. */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
ReturnDesc = AcpiUtCreateIntegerObject ((UINT64) Type);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
ReturnDesc->Integer.Value = Type;
break;
@ -917,14 +914,12 @@ AcpiExOpcode_1A_0T_1R (
* Now that we have the size of the object, create a result
* object to hold the value
*/
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
ReturnDesc = AcpiUtCreateIntegerObject (Value);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
ReturnDesc->Integer.Value = Value;
break;
@ -1089,21 +1084,18 @@ AcpiExOpcode_1A_0T_1R (
* NOTE: index into a buffer is NOT a pointer to a
* sub-buffer of the main buffer, it is only a pointer to a
* single element (byte) of the buffer!
*
* Since we are returning the value of the buffer at the
* indexed location, we don't need to add an additional
* reference to the buffer itself.
*/
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
ReturnDesc = AcpiUtCreateIntegerObject ((UINT64)
TempDesc->Buffer.Pointer[Operand[0]->Reference.Value]);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
/*
* Since we are returning the value of the buffer at the
* indexed location, we don't need to add an additional
* reference to the buffer itself.
*/
ReturnDesc->Integer.Value =
TempDesc->Buffer.Pointer[Operand[0]->Reference.Value];
break;

View File

@ -344,8 +344,9 @@ AcpiExOpcode_6A_0T_1R (
}
/* Create an integer for the return value */
/* Default return value is ACPI_INTEGER_MAX if no match found */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
ReturnDesc = AcpiUtCreateIntegerObject (ACPI_INTEGER_MAX);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
@ -353,10 +354,6 @@ AcpiExOpcode_6A_0T_1R (
}
/* Default return value if no match found */
ReturnDesc->Integer.Value = ACPI_INTEGER_MAX;
/*
* Examine each element until a match is found. Both match conditions
* must be satisfied for a match to occur. Within the loop,

View File

@ -157,7 +157,8 @@ AcpiExSystemMemorySpaceHandler (
void *LogicalAddrPtr = NULL;
ACPI_MEM_SPACE_CONTEXT *MemInfo = RegionContext;
UINT32 Length;
ACPI_SIZE WindowSize;
ACPI_SIZE MapLength;
ACPI_SIZE PageBoundaryMapLength;
#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
UINT32 Remainder;
#endif
@ -227,26 +228,45 @@ AcpiExSystemMemorySpaceHandler (
}
/*
* Don't attempt to map memory beyond the end of the region, and
* constrain the maximum mapping size to something reasonable.
* October 2009: Attempt to map from the requested address to the
* end of the region. However, we will never map more than one
* page, nor will we cross a page boundary.
*/
WindowSize = (ACPI_SIZE)
MapLength = (ACPI_SIZE)
((MemInfo->Address + MemInfo->Length) - Address);
if (WindowSize > ACPI_SYSMEM_REGION_WINDOW_SIZE)
/*
* If mapping the entire remaining portion of the region will cross
* a page boundary, just map up to the page boundary, do not cross.
* On some systems, crossing a page boundary while mapping regions
* can cause warnings if the pages have different attributes
* due to resource management.
*
* This has the added benefit of constraining a single mapping to
* one page, which is similar to the original code that used a 4k
* maximum window.
*/
PageBoundaryMapLength =
ACPI_ROUND_UP (Address, ACPI_DEFAULT_PAGE_SIZE) - Address;
if (PageBoundaryMapLength == 0)
{
WindowSize = ACPI_SYSMEM_REGION_WINDOW_SIZE;
PageBoundaryMapLength = ACPI_DEFAULT_PAGE_SIZE;
}
if (MapLength > PageBoundaryMapLength)
{
MapLength = PageBoundaryMapLength;
}
/* Create a new mapping starting at the address given */
MemInfo->MappedLogicalAddress = AcpiOsMapMemory (
(ACPI_PHYSICAL_ADDRESS) Address, WindowSize);
(ACPI_PHYSICAL_ADDRESS) Address, MapLength);
if (!MemInfo->MappedLogicalAddress)
{
ACPI_ERROR ((AE_INFO,
"Could not map memory at %8.8X%8.8X, size %X",
ACPI_FORMAT_NATIVE_UINT (Address), (UINT32) WindowSize));
ACPI_FORMAT_NATIVE_UINT (Address), (UINT32) MapLength));
MemInfo->MappedLength = 0;
return_ACPI_STATUS (AE_NO_MEMORY);
}
@ -254,7 +274,7 @@ AcpiExSystemMemorySpaceHandler (
/* Save the physical address and mapping size */
MemInfo->MappedPhysicalAddress = Address;
MemInfo->MappedLength = WindowSize;
MemInfo->MappedLength = MapLength;
}
/*

View File

@ -177,9 +177,9 @@
#define ACPI_MAX_REFERENCE_COUNT 0x800
/* Size of cached memory mapping for system memory operation region */
/* Default page size for use in mapping memory for operation regions */
#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096
#define ACPI_DEFAULT_PAGE_SIZE 4096 /* Must be power of 2 */
/* OwnerId tracking. 8 entries allows for 255 OwnerIds */

View File

@ -403,6 +403,7 @@
#define ACPI_ERROR_NAMESPACE(s, e) AcpiNsReportError (AE_INFO, s, e);
#define ACPI_ERROR_METHOD(s, n, p, e) AcpiNsReportMethodError (AE_INFO, s, n, p, e);
#define ACPI_WARN_PREDEFINED(plist) AcpiUtPredefinedWarning plist
#define ACPI_INFO_PREDEFINED(plist) AcpiUtPredefinedInfo plist
#else
@ -411,6 +412,7 @@
#define ACPI_ERROR_NAMESPACE(s, e)
#define ACPI_ERROR_METHOD(s, n, p, e)
#define ACPI_WARN_PREDEFINED(plist)
#define ACPI_INFO_PREDEFINED(plist)
#endif /* ACPI_NO_ERROR_MESSAGES */

View File

@ -189,7 +189,8 @@ AcpiNsWalkNamespace (
ACPI_HANDLE StartObject,
UINT32 MaxDepth,
UINT32 Flags,
ACPI_WALK_CALLBACK UserFunction,
ACPI_WALK_CALLBACK PreOrderVisit,
ACPI_WALK_CALLBACK PostOrderVisit,
void *Context,
void **ReturnValue);
@ -428,7 +429,8 @@ AcpiNsGetAttachedData (
/*
* nsrepair - return object repair for predefined methods/objects
* nsrepair - General return object repair for all
* predefined methods/objects
*/
ACPI_STATUS
AcpiNsRepairObject (
@ -443,6 +445,18 @@ AcpiNsRepairPackageList (
ACPI_OPERAND_OBJECT **ObjDescPtr);
/*
* nsrepair2 - Return object repair for specific
* predefined methods/objects
*/
ACPI_STATUS
AcpiNsComplexRepairs (
ACPI_PREDEFINED_DATA *Data,
ACPI_NAMESPACE_NODE *Node,
ACPI_STATUS ValidateStatus,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
/*
* nssearch - Namespace searching and entry
*/

View File

@ -120,7 +120,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20091013
#define ACPI_CA_VERSION 0x20091112
#include <contrib/dev/acpica/include/actypes.h>
#include <contrib/dev/acpica/include/actbl.h>
@ -267,7 +267,8 @@ AcpiWalkNamespace (
ACPI_OBJECT_TYPE Type,
ACPI_HANDLE StartObject,
UINT32 MaxDepth,
ACPI_WALK_CALLBACK UserFunction,
ACPI_WALK_CALLBACK PreOrderVisit,
ACPI_WALK_CALLBACK PostOrderVisit,
void *Context,
void **ReturnValue);

View File

@ -643,6 +643,10 @@ ACPI_OPERAND_OBJECT *
AcpiUtCreatePackageObject (
UINT32 Count);
ACPI_OPERAND_OBJECT *
AcpiUtCreateIntegerObject (
UINT64 Value);
ACPI_OPERAND_OBJECT *
AcpiUtCreateBufferObject (
ACPI_SIZE BufferSize);
@ -795,6 +799,15 @@ AcpiUtPredefinedWarning (
const char *Format,
...);
void ACPI_INTERNAL_VAR_XFACE
AcpiUtPredefinedInfo (
const char *ModuleName,
UINT32 LineNumber,
char *Pathname,
UINT8 NodeFlags,
const char *Format,
...);
/* Values for Base above (16=Hex, 10=Decimal) */
#define ACPI_ANY_BASE 0

View File

@ -736,7 +736,7 @@ AcpiNsDumpObjects (
(void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
AcpiNsDumpOneObject, (void *) &Info, NULL);
AcpiNsDumpOneObject, NULL, (void *) &Info, NULL);
}

View File

@ -225,7 +225,7 @@ AcpiNsDumpRootDevices (
Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, SysBusHandle,
ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
AcpiNsDumpOneDevice, NULL, NULL);
AcpiNsDumpOneDevice, NULL, NULL, NULL);
}
#endif

View File

@ -460,36 +460,53 @@ AcpiNsExecModuleCode (
ACPI_OPERAND_OBJECT *MethodObj,
ACPI_EVALUATE_INFO *Info)
{
ACPI_OPERAND_OBJECT *RootObj;
ACPI_OPERAND_OBJECT *ParentObj;
ACPI_NAMESPACE_NODE *ParentNode;
ACPI_OBJECT_TYPE Type;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (NsExecModuleCode);
/*
* Get the parent node. We cheat by using the NextObject field
* of the method object descriptor.
*/
ParentNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
MethodObj->Method.NextObject);
Type = AcpiNsGetType (ParentNode);
/* Must clear NextObject (AcpiNsAttachObject needs the field) */
MethodObj->Method.NextObject = NULL;
/* Initialize the evaluation information block */
ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO));
Info->PrefixNode = AcpiGbl_RootNode;
Info->PrefixNode = ParentNode;
/*
* Get the currently attached root object. Add a reference, because the
* Get the currently attached parent object. Add a reference, because the
* ref count will be decreased when the method object is installed to
* the root node.
* the parent node.
*/
RootObj = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
AcpiUtAddReference (RootObj);
ParentObj = AcpiNsGetAttachedObject (ParentNode);
if (ParentObj)
{
AcpiUtAddReference (ParentObj);
}
/* Install the method (module-level code) in the root node */
/* Install the method (module-level code) in the parent node */
Status = AcpiNsAttachObject (AcpiGbl_RootNode, MethodObj,
Status = AcpiNsAttachObject (ParentNode, MethodObj,
ACPI_TYPE_METHOD);
if (ACPI_FAILURE (Status))
{
goto Exit;
}
/* Execute the root node as a control method */
/* Execute the parent node as a control method */
Status = AcpiNsEvaluate (Info);
@ -498,14 +515,24 @@ AcpiNsExecModuleCode (
/* Detach the temporary method object */
AcpiNsDetachObject (AcpiGbl_RootNode);
AcpiNsDetachObject (ParentNode);
/* Restore the original root object */
/* Restore the original parent object */
Status = AcpiNsAttachObject (AcpiGbl_RootNode, RootObj, ACPI_TYPE_DEVICE);
if (ParentObj)
{
Status = AcpiNsAttachObject (ParentNode, ParentObj, Type);
}
else
{
ParentNode->Type = (UINT8) Type;
}
Exit:
AcpiUtRemoveReference (RootObj);
if (ParentObj)
{
AcpiUtRemoveReference (ParentObj);
}
return_VOID;
}

View File

@ -185,7 +185,7 @@ AcpiNsInitializeObjects (
/* Walk entire namespace from the supplied root */
Status = AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, AcpiNsInitOneObject,
ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL,
&Info, NULL);
if (ACPI_FAILURE (Status))
{
@ -249,7 +249,7 @@ AcpiNsInitializeDevices (
/* Tree analysis: find all subtrees that contain _INI methods */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, AcpiNsFindIniMethods, &Info, NULL);
ACPI_UINT32_MAX, FALSE, AcpiNsFindIniMethods, NULL, &Info, NULL);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
@ -283,7 +283,7 @@ AcpiNsInitializeDevices (
/* Walk namespace to execute all _INIs on present devices */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, &Info, NULL);
ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, NULL, &Info, NULL);
ACPI_FREE (Info.EvaluateInfo);
if (ACPI_FAILURE (Status))

View File

@ -330,6 +330,12 @@ AcpiNsCheckPredefinedNames (
Status = AcpiNsCheckPackage (Data, ReturnObjectPtr);
}
/*
* Perform additional, more complicated repairs on a per-name
* basis.
*/
Status = AcpiNsComplexRepairs (Data, Node, Status, ReturnObjectPtr);
CheckValidationStatus:
/*
@ -719,7 +725,7 @@ AcpiNsCheckPackage (
* there is only one entry). We may be able to repair this by
* wrapping the returned Package with a new outer Package.
*/
if ((*Elements)->Common.Type != ACPI_TYPE_PACKAGE)
if (*Elements && ((*Elements)->Common.Type != ACPI_TYPE_PACKAGE))
{
/* Create the new outer package and populate it */
@ -794,6 +800,7 @@ AcpiNsCheckPackageList (
ACPI_OPERAND_OBJECT *SubPackage;
ACPI_OPERAND_OBJECT **SubElements;
ACPI_STATUS Status;
BOOLEAN NonTrailingNull = FALSE;
UINT32 ExpectedCount;
UINT32 i;
UINT32 j;
@ -803,6 +810,46 @@ AcpiNsCheckPackageList (
for (i = 0; i < Count; i++)
{
/*
* Handling for NULL package elements. For now, we will simply allow
* a parent package with trailing NULL elements. This can happen if
* the package was defined to be longer than the initializer list.
* This is legal as per the ACPI specification. It is often used
* to allow for dynamic initialization of a Package.
*
* A future enhancement may be to simply truncate the package to
* remove the trailing NULL elements.
*/
if (!(*Elements))
{
if (!NonTrailingNull)
{
/* Ensure the remaining elements are all NULL */
for (j = 1; j < (Count - i + 1); j++)
{
if (Elements[j])
{
NonTrailingNull = TRUE;
}
}
if (!NonTrailingNull)
{
/* Ignore the trailing NULL elements */
return (AE_OK);
}
}
/* There are trailing non-null elements, issue warning */
ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
"Found NULL element at package index %u", i));
Elements++;
continue;
}
SubPackage = *Elements;
SubElements = SubPackage->Package.Elements;

View File

@ -276,14 +276,14 @@ AcpiNsRepairObject (
ReturnObject->Common.ReferenceCount--;
}
ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
ACPI_INFO_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
"Converted %s to expected %s at index %u",
AcpiUtGetObjectTypeName (ReturnObject),
AcpiUtGetObjectTypeName (NewObject), PackageIndex));
}
else
{
ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
ACPI_INFO_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
"Converted %s to expected %s",
AcpiUtGetObjectTypeName (ReturnObject),
AcpiUtGetObjectTypeName (NewObject)));
@ -347,8 +347,8 @@ AcpiNsRepairPackageList (
*ObjDescPtr = PkgObjDesc;
Data->Flags |= ACPI_OBJECT_REPAIRED;
ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
"Incorrectly formed Package, attempting repair"));
ACPI_INFO_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
"Repaired Incorrectly formed Package"));
return (AE_OK);
}

View File

@ -0,0 +1,669 @@
/******************************************************************************
*
* Module Name: nsrepair2 - Repair for objects returned by specific
* predefined methods
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
* All rights reserved.
*
* 2. License
*
* 2.1. This is your license from Intel Corp. under its intellectual property
* rights. You may have additional license terms from the party that provided
* you this software, covering your right to use that party's intellectual
* property rights.
*
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
* copy of the source code appearing in this file ("Covered Code") an
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
* base code distributed originally by Intel ("Original Intel Code") to copy,
* make derivatives, distribute, use and display any portion of the Covered
* Code in any form, with the right to sublicense such rights; and
*
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
* license (with the right to sublicense), under only those claims of Intel
* patents that are infringed by the Original Intel Code, to make, use, sell,
* offer to sell, and import the Covered Code and derivative works thereof
* solely to the minimum extent necessary to exercise the above copyright
* license, and in no event shall the patent license extend to any additions
* to or modifications of the Original Intel Code. No other license or right
* is granted directly or by implication, estoppel or otherwise;
*
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
* and the following Disclaimer and Export Compliance provision. In addition,
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
* documentation and/or other materials provided with distribution. In
* addition, Licensee may not authorize further sublicense of source of any
* portion of the Covered Code, and must include terms to the effect that the
* license from Licensee to its licensee is limited to the intellectual
* property embodied in the software Licensee provides to its licensee, and
* not to intellectual property embodied in modifications its licensee may
* make.
*
* 3.3. Redistribution of Executable. Redistribution in executable form of any
* substantial portion of the Covered Code or modification must reproduce the
* above Copyright Notice, and the following Disclaimer and Export Compliance
* provision in the documentation and/or other materials provided with the
* distribution.
*
* 3.4. Intel retains all right, title, and interest in and to the Original
* Intel Code.
*
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
* Intel shall be used in advertising or otherwise to promote the sale, use or
* other dealings in products derived from or relating to the Covered Code
* without prior written authorization from Intel.
*
* 4. Disclaimer and Export Compliance
*
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
* LIMITED REMEDY.
*
* 4.3. Licensee shall not export, either directly or indirectly, any of this
* software or system incorporating such software without first obtaining any
* required license or other approval from the U. S. Department of Commerce or
* any other agency or department of the United States Government. In the
* event Licensee exports any such software from the United States or
* re-exports any such software from a foreign destination, Licensee shall
* ensure that the distribution and export/re-export of the software is in
* compliance with all laws, regulations, orders, or other restrictions of the
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
* any of its subsidiaries will export/re-export any technical data, process,
* software, or service, directly or indirectly, to any country for which the
* United States government or any agency thereof requires an export license,
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************/
#define __NSREPAIR2_C__
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME ("nsrepair2")
/*
* Information structure and handler for ACPI predefined names that can
* be repaired on a per-name basis.
*/
typedef
ACPI_STATUS (*ACPI_REPAIR_FUNCTION) (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
typedef struct acpi_repair_info
{
char Name[ACPI_NAME_SIZE];
ACPI_REPAIR_FUNCTION RepairFunction;
} ACPI_REPAIR_INFO;
/* Local prototypes */
static const ACPI_REPAIR_INFO *
AcpiNsMatchRepairableName (
ACPI_NAMESPACE_NODE *Node);
static ACPI_STATUS
AcpiNsRepair_ALR (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
static ACPI_STATUS
AcpiNsRepair_PSS (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
static ACPI_STATUS
AcpiNsRepair_TSS (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
static ACPI_STATUS
AcpiNsCheckSortedList (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT *ReturnObject,
UINT32 ExpectedCount,
UINT32 SortIndex,
UINT8 SortDirection,
char *SortKeyName);
static ACPI_STATUS
AcpiNsRemoveNullElements (
ACPI_OPERAND_OBJECT *Package);
static ACPI_STATUS
AcpiNsSortList (
ACPI_OPERAND_OBJECT **Elements,
UINT32 Count,
UINT32 Index,
UINT8 SortDirection);
/* Values for SortDirection above */
#define ACPI_SORT_ASCENDING 0
#define ACPI_SORT_DESCENDING 1
/*
* This table contains the names of the predefined methods for which we can
* perform more complex repairs.
*
* _ALR: Sort the list ascending by AmbientIlluminance if necessary
* _PSS: Sort the list descending by Power if necessary
* _TSS: Sort the list descending by Power if necessary
*/
static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] =
{
{"_ALR", AcpiNsRepair_ALR},
{"_PSS", AcpiNsRepair_PSS},
{"_TSS", AcpiNsRepair_TSS},
{{0,0,0,0}, NULL} /* Table terminator */
};
/******************************************************************************
*
* FUNCTION: AcpiNsComplexRepairs
*
* PARAMETERS: Data - Pointer to validation data structure
* Node - Namespace node for the method/object
* ValidateStatus - Original status of earlier validation
* ReturnObjectPtr - Pointer to the object returned from the
* evaluation of a method or object
*
* RETURN: Status. AE_OK if repair was successful. If name is not
* matched, ValidateStatus is returned.
*
* DESCRIPTION: Attempt to repair/convert a return object of a type that was
* not expected.
*
*****************************************************************************/
ACPI_STATUS
AcpiNsComplexRepairs (
ACPI_PREDEFINED_DATA *Data,
ACPI_NAMESPACE_NODE *Node,
ACPI_STATUS ValidateStatus,
ACPI_OPERAND_OBJECT **ReturnObjectPtr)
{
const ACPI_REPAIR_INFO *Predefined;
ACPI_STATUS Status;
/* Check if this name is in the list of repairable names */
Predefined = AcpiNsMatchRepairableName (Node);
if (!Predefined)
{
return (ValidateStatus);
}
Status = Predefined->RepairFunction (Data, ReturnObjectPtr);
return (Status);
}
/******************************************************************************
*
* FUNCTION: AcpiNsMatchRepairableName
*
* PARAMETERS: Node - Namespace node for the method/object
*
* RETURN: Pointer to entry in repair table. NULL indicates not found.
*
* DESCRIPTION: Check an object name against the repairable object list.
*
*****************************************************************************/
static const ACPI_REPAIR_INFO *
AcpiNsMatchRepairableName (
ACPI_NAMESPACE_NODE *Node)
{
const ACPI_REPAIR_INFO *ThisName;
/* Search info table for a repairable predefined method/object name */
ThisName = AcpiNsRepairableNames;
while (ThisName->RepairFunction)
{
if (ACPI_COMPARE_NAME (Node->Name.Ascii, ThisName->Name))
{
return (ThisName);
}
ThisName++;
}
return (NULL); /* Not found */
}
/******************************************************************************
*
* FUNCTION: AcpiNsRepair_ALR
*
* PARAMETERS: Data - Pointer to validation data structure
* ReturnObjectPtr - Pointer to the object returned from the
* evaluation of a method or object
*
* RETURN: Status. AE_OK if object is OK or was repaired successfully
*
* DESCRIPTION: Repair for the _ALR object. If necessary, sort the object list
* ascending by the ambient illuminance values.
*
*****************************************************************************/
static ACPI_STATUS
AcpiNsRepair_ALR (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr)
{
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
ACPI_STATUS Status;
Status = AcpiNsCheckSortedList (Data, ReturnObject, 2, 1,
ACPI_SORT_ASCENDING, "AmbientIlluminance");
return (Status);
}
/******************************************************************************
*
* FUNCTION: AcpiNsRepair_TSS
*
* PARAMETERS: Data - Pointer to validation data structure
* ReturnObjectPtr - Pointer to the object returned from the
* evaluation of a method or object
*
* RETURN: Status. AE_OK if object is OK or was repaired successfully
*
* DESCRIPTION: Repair for the _TSS object. If necessary, sort the object list
* descending by the power dissipation values.
*
*****************************************************************************/
static ACPI_STATUS
AcpiNsRepair_TSS (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr)
{
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
ACPI_STATUS Status;
Status = AcpiNsCheckSortedList (Data, ReturnObject, 5, 1,
ACPI_SORT_DESCENDING, "PowerDissipation");
return (Status);
}
/******************************************************************************
*
* FUNCTION: AcpiNsRepair_PSS
*
* PARAMETERS: Data - Pointer to validation data structure
* ReturnObjectPtr - Pointer to the object returned from the
* evaluation of a method or object
*
* RETURN: Status. AE_OK if object is OK or was repaired successfully
*
* DESCRIPTION: Repair for the _PSS object. If necessary, sort the object list
* by the CPU frequencies. Check that the power dissipation values
* are all proportional to CPU frequency (i.e., sorting by
* frequency should be the same as sorting by power.)
*
*****************************************************************************/
static ACPI_STATUS
AcpiNsRepair_PSS (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr)
{
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
ACPI_OPERAND_OBJECT **OuterElements;
UINT32 OuterElementCount;
ACPI_OPERAND_OBJECT **Elements;
ACPI_OPERAND_OBJECT *ObjDesc;
UINT32 PreviousValue;
ACPI_STATUS Status;
UINT32 i;
/*
* Entries (sub-packages) in the _PSS Package must be sorted by power
* dissipation, in descending order. If it appears that the list is
* incorrectly sorted, sort it. We sort by CpuFrequency, since this
* should be proportional to the power.
*/
Status =AcpiNsCheckSortedList (Data, ReturnObject, 6, 0,
ACPI_SORT_DESCENDING, "CpuFrequency");
if (ACPI_FAILURE (Status))
{
return (Status);
}
/*
* We now know the list is correctly sorted by CPU frequency. Check if
* the power dissipation values are proportional.
*/
PreviousValue = ACPI_UINT32_MAX;
OuterElements = ReturnObject->Package.Elements;
OuterElementCount = ReturnObject->Package.Count;
for (i = 0; i < OuterElementCount; i++)
{
Elements = (*OuterElements)->Package.Elements;
ObjDesc = Elements[1]; /* Index1 = PowerDissipation */
if ((UINT32) ObjDesc->Integer.Value > PreviousValue)
{
ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
"SubPackage[%u,%u] - suspicious power dissipation values",
i-1, i));
}
PreviousValue = (UINT32) ObjDesc->Integer.Value;
OuterElements++;
}
return (AE_OK);
}
/******************************************************************************
*
* FUNCTION: AcpiNsCheckSortedList
*
* PARAMETERS: Data - Pointer to validation data structure
* ReturnObject - Pointer to the top-level returned object
* ExpectedCount - Minimum length of each sub-package
* SortIndex - Sub-package entry to sort on
* SortDirection - Ascending or descending
* SortKeyName - Name of the SortIndex field
*
* RETURN: Status. AE_OK if the list is valid and is sorted correctly or
* has been repaired by sorting the list.
*
* DESCRIPTION: Check if the package list is valid and sorted correctly by the
* SortIndex. If not, then sort the list.
*
*****************************************************************************/
static ACPI_STATUS
AcpiNsCheckSortedList (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT *ReturnObject,
UINT32 ExpectedCount,
UINT32 SortIndex,
UINT8 SortDirection,
char *SortKeyName)
{
UINT32 OuterElementCount;
ACPI_OPERAND_OBJECT **OuterElements;
ACPI_OPERAND_OBJECT **Elements;
ACPI_OPERAND_OBJECT *ObjDesc;
UINT32 i;
UINT32 PreviousValue;
ACPI_STATUS Status;
/* The top-level object must be a package */
if (ReturnObject->Common.Type != ACPI_TYPE_PACKAGE)
{
return (AE_AML_OPERAND_TYPE);
}
/*
* Detect any NULL package elements and remove them from the
* package.
*
* TBD: We may want to do this for all predefined names that
* return a variable-length package of packages.
*/
Status = AcpiNsRemoveNullElements (ReturnObject);
if (Status == AE_NULL_ENTRY)
{
ACPI_INFO_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
"NULL elements removed from package"));
/* Exit if package is now zero length */
if (!ReturnObject->Package.Count)
{
return (AE_NULL_ENTRY);
}
}
OuterElements = ReturnObject->Package.Elements;
OuterElementCount = ReturnObject->Package.Count;
if (!OuterElementCount)
{
return (AE_AML_PACKAGE_LIMIT);
}
PreviousValue = 0;
if (SortDirection == ACPI_SORT_DESCENDING)
{
PreviousValue = ACPI_UINT32_MAX;
}
/* Examine each subpackage */
for (i = 0; i < OuterElementCount; i++)
{
/* Each element of the top-level package must also be a package */
if ((*OuterElements)->Common.Type != ACPI_TYPE_PACKAGE)
{
return (AE_AML_OPERAND_TYPE);
}
/* Each sub-package must have the minimum length */
if ((*OuterElements)->Package.Count < ExpectedCount)
{
return (AE_AML_PACKAGE_LIMIT);
}
Elements = (*OuterElements)->Package.Elements;
ObjDesc = Elements[SortIndex];
if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
{
return (AE_AML_OPERAND_TYPE);
}
/*
* The list must be sorted in the specified order. If we detect a
* discrepancy, issue a warning and sort the entire list
*/
if (((SortDirection == ACPI_SORT_ASCENDING) &&
(ObjDesc->Integer.Value < PreviousValue)) ||
((SortDirection == ACPI_SORT_DESCENDING) &&
(ObjDesc->Integer.Value > PreviousValue)))
{
Status = AcpiNsSortList (ReturnObject->Package.Elements,
OuterElementCount, SortIndex, SortDirection);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Data->Flags |= ACPI_OBJECT_REPAIRED;
ACPI_INFO_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
"Repaired unsorted list - now sorted by %s", SortKeyName));
return (AE_OK);
}
PreviousValue = (UINT32) ObjDesc->Integer.Value;
OuterElements++;
}
return (AE_OK);
}
/******************************************************************************
*
* FUNCTION: AcpiNsRemoveNullElements
*
* PARAMETERS: ObjDesc - A Package object
*
* RETURN: Status. AE_NULL_ENTRY means that one or more elements were
* removed.
*
* DESCRIPTION: Remove all NULL package elements and update the package count.
*
*****************************************************************************/
static ACPI_STATUS
AcpiNsRemoveNullElements (
ACPI_OPERAND_OBJECT *ObjDesc)
{
ACPI_OPERAND_OBJECT **Source;
ACPI_OPERAND_OBJECT **Dest;
ACPI_STATUS Status = AE_OK;
UINT32 Count;
UINT32 NewCount;
UINT32 i;
Count = ObjDesc->Package.Count;
NewCount = Count;
Source = ObjDesc->Package.Elements;
Dest = Source;
/* Examine all elements of the package object */
for (i = 0; i < Count; i++)
{
if (!*Source)
{
Status = AE_NULL_ENTRY;
NewCount--;
}
else
{
*Dest = *Source;
Dest++;
}
Source++;
}
if (Status == AE_NULL_ENTRY)
{
/* NULL terminate list and update the package count */
*Dest = NULL;
ObjDesc->Package.Count = NewCount;
}
return (Status);
}
/******************************************************************************
*
* FUNCTION: AcpiNsSortList
*
* PARAMETERS: Elements - Package object element list
* Count - Element count for above
* Index - Sort by which package element
* SortDirection - Ascending or Descending sort
*
* RETURN: Status
*
* DESCRIPTION: Sort the objects that are in a package element list.
*
* NOTE: Assumes that all NULL elements have been removed from the package.
*
*****************************************************************************/
static ACPI_STATUS
AcpiNsSortList (
ACPI_OPERAND_OBJECT **Elements,
UINT32 Count,
UINT32 Index,
UINT8 SortDirection)
{
ACPI_OPERAND_OBJECT *ObjDesc1;
ACPI_OPERAND_OBJECT *ObjDesc2;
ACPI_OPERAND_OBJECT *TempObj;
UINT32 i;
UINT32 j;
/* Simple bubble sort */
for (i = 1; i < Count; i++)
{
for (j = (Count - 1); j >= i; j--)
{
ObjDesc1 = Elements[j-1]->Package.Elements[Index];
ObjDesc2 = Elements[j]->Package.Elements[Index];
if (((SortDirection == ACPI_SORT_ASCENDING) &&
(ObjDesc1->Integer.Value > ObjDesc2->Integer.Value)) ||
((SortDirection == ACPI_SORT_DESCENDING) &&
(ObjDesc1->Integer.Value < ObjDesc2->Integer.Value)))
{
TempObj = Elements[j-1];
Elements[j-1] = Elements[j];
Elements[j] = TempObj;
}
}
}
return (AE_OK);
}

View File

@ -247,24 +247,27 @@ AcpiNsGetNextNodeTyped (
* MaxDepth - Depth to which search is to reach
* Flags - Whether to unlock the NS before invoking
* the callback routine
* UserFunction - Called when an object of "Type" is found
* Context - Passed to user function
* ReturnValue - from the UserFunction if terminated early.
* Otherwise, returns NULL.
* PreOrderVisit - Called during tree pre-order visit
* when an object of "Type" is found
* PostOrderVisit - Called during tree post-order visit
* when an object of "Type" is found
* Context - Passed to user function(s) above
* ReturnValue - from the UserFunction if terminated
* early. Otherwise, returns NULL.
* RETURNS: Status
*
* DESCRIPTION: Performs a modified depth-first walk of the namespace tree,
* starting (and ending) at the node specified by StartHandle.
* The UserFunction is called whenever a node that matches
* the type parameter is found. If the user function returns
* The callback function is called whenever a node that matches
* the type parameter is found. If the callback function returns
* a non-zero value, the search is terminated immediately and
* this value is returned to the caller.
*
* The point of this procedure is to provide a generic namespace
* walk routine that can be called from multiple places to
* provide multiple services; the User Function can be tailored
* to each task, whether it is a print function, a compare
* function, etc.
* provide multiple services; the callback function(s) can be
* tailored to each task, whether it is a print function,
* a compare function, etc.
*
******************************************************************************/
@ -274,7 +277,8 @@ AcpiNsWalkNamespace (
ACPI_HANDLE StartNode,
UINT32 MaxDepth,
UINT32 Flags,
ACPI_WALK_CALLBACK UserFunction,
ACPI_WALK_CALLBACK PreOrderVisit,
ACPI_WALK_CALLBACK PostOrderVisit,
void *Context,
void **ReturnValue)
{
@ -284,6 +288,7 @@ AcpiNsWalkNamespace (
ACPI_NAMESPACE_NODE *ParentNode;
ACPI_OBJECT_TYPE ChildType;
UINT32 Level;
BOOLEAN NodePreviouslyVisited = FALSE;
ACPI_FUNCTION_TRACE (NsWalkNamespace);
@ -299,7 +304,7 @@ AcpiNsWalkNamespace (
/* Null child means "get first node" */
ParentNode = StartNode;
ChildNode = NULL;
ChildNode = AcpiNsGetNextNode (ParentNode, NULL);
ChildType = ACPI_TYPE_ANY;
Level = 1;
@ -308,103 +313,139 @@ AcpiNsWalkNamespace (
* started. When Level is zero, the loop is done because we have
* bubbled up to (and passed) the original parent handle (StartEntry)
*/
while (Level > 0)
while (Level > 0 && ChildNode)
{
/* Get the next node in this scope. Null if not found */
Status = AE_OK;
/* Found next child, get the type if we are not searching for ANY */
if (Type != ACPI_TYPE_ANY)
{
ChildType = ChildNode->Type;
}
/*
* Ignore all temporary namespace nodes (created during control
* method execution) unless told otherwise. These temporary nodes
* can cause a race condition because they can be deleted during
* the execution of the user function (if the namespace is
* unlocked before invocation of the user function.) Only the
* debugger namespace dump will examine the temporary nodes.
*/
if ((ChildNode->Flags & ANOBJ_TEMPORARY) &&
!(Flags & ACPI_NS_WALK_TEMP_NODES))
{
Status = AE_CTRL_DEPTH;
}
/* Type must match requested type */
else if (ChildType == Type)
{
/*
* Found a matching node, invoke the user callback function.
* Unlock the namespace if flag is set.
*/
if (Flags & ACPI_NS_WALK_UNLOCK)
{
MutexStatus = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (MutexStatus))
{
return_ACPI_STATUS (MutexStatus);
}
}
/*
* Invoke the user function, either pre-order or post-order
* or both.
*/
if (!NodePreviouslyVisited)
{
if (PreOrderVisit)
{
Status = PreOrderVisit (ChildNode, Level,
Context, ReturnValue);
}
}
else
{
if (PostOrderVisit)
{
Status = PostOrderVisit (ChildNode, Level,
Context, ReturnValue);
}
}
if (Flags & ACPI_NS_WALK_UNLOCK)
{
MutexStatus = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (MutexStatus))
{
return_ACPI_STATUS (MutexStatus);
}
}
switch (Status)
{
case AE_OK:
case AE_CTRL_DEPTH:
/* Just keep going */
break;
case AE_CTRL_TERMINATE:
/* Exit now, with OK status */
return_ACPI_STATUS (AE_OK);
default:
/* All others are valid exceptions */
return_ACPI_STATUS (Status);
}
}
/*
* Depth first search: Attempt to go down another level in the
* namespace if we are allowed to. Don't go any further if we have
* reached the caller specified maximum depth or if the user
* function has specified that the maximum depth has been reached.
*/
if (!NodePreviouslyVisited &&
(Level < MaxDepth) &&
(Status != AE_CTRL_DEPTH))
{
if (ChildNode->Child)
{
/* There is at least one child of this node, visit it */
Level++;
ParentNode = ChildNode;
ChildNode = AcpiNsGetNextNode (ParentNode, NULL);
continue;
}
}
/* No more children, re-visit this node */
if (!NodePreviouslyVisited)
{
NodePreviouslyVisited = TRUE;
continue;
}
/* No more children, visit peers */
ChildNode = AcpiNsGetNextNode (ParentNode, ChildNode);
if (ChildNode)
{
/* Found next child, get the type if we are not searching for ANY */
if (Type != ACPI_TYPE_ANY)
{
ChildType = ChildNode->Type;
}
/*
* Ignore all temporary namespace nodes (created during control
* method execution) unless told otherwise. These temporary nodes
* can cause a race condition because they can be deleted during
* the execution of the user function (if the namespace is
* unlocked before invocation of the user function.) Only the
* debugger namespace dump will examine the temporary nodes.
*/
if ((ChildNode->Flags & ANOBJ_TEMPORARY) &&
!(Flags & ACPI_NS_WALK_TEMP_NODES))
{
Status = AE_CTRL_DEPTH;
}
/* Type must match requested type */
else if (ChildType == Type)
{
/*
* Found a matching node, invoke the user callback function.
* Unlock the namespace if flag is set.
*/
if (Flags & ACPI_NS_WALK_UNLOCK)
{
MutexStatus = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (MutexStatus))
{
return_ACPI_STATUS (MutexStatus);
}
}
Status = UserFunction (ChildNode, Level, Context, ReturnValue);
if (Flags & ACPI_NS_WALK_UNLOCK)
{
MutexStatus = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (MutexStatus))
{
return_ACPI_STATUS (MutexStatus);
}
}
switch (Status)
{
case AE_OK:
case AE_CTRL_DEPTH:
/* Just keep going */
break;
case AE_CTRL_TERMINATE:
/* Exit now, with OK status */
return_ACPI_STATUS (AE_OK);
default:
/* All others are valid exceptions */
return_ACPI_STATUS (Status);
}
}
/*
* Depth first search: Attempt to go down another level in the
* namespace if we are allowed to. Don't go any further if we have
* reached the caller specified maximum depth or if the user
* function has specified that the maximum depth has been reached.
*/
if ((Level < MaxDepth) && (Status != AE_CTRL_DEPTH))
{
if (ChildNode->Child)
{
/* There is at least one child of this node, visit it */
Level++;
ParentNode = ChildNode;
ChildNode = NULL;
}
}
NodePreviouslyVisited = FALSE;
}
/* No peers, re-visit parent */
else
{
/*
@ -414,6 +455,8 @@ AcpiNsWalkNamespace (
Level--;
ChildNode = ParentNode;
ParentNode = AcpiNsGetParentNode (ParentNode);
NodePreviouslyVisited = TRUE;
}
}

View File

@ -544,8 +544,11 @@ AcpiNsResolveReferences (
* PARAMETERS: Type - ACPI_OBJECT_TYPE to search for
* StartObject - Handle in namespace where search begins
* MaxDepth - Depth to which search is to reach
* UserFunction - Called when an object of "Type" is found
* Context - Passed to user function
* PreOrderVisit - Called during tree pre-order visit
* when an object of "Type" is found
* PostOrderVisit - Called during tree post-order visit
* when an object of "Type" is found
* Context - Passed to user function(s) above
* ReturnValue - Location where return value of
* UserFunction is put if terminated early
*
@ -554,16 +557,16 @@ AcpiNsResolveReferences (
*
* DESCRIPTION: Performs a modified depth-first walk of the namespace tree,
* starting (and ending) at the object specified by StartHandle.
* The UserFunction is called whenever an object that matches
* the type parameter is found. If the user function returns
* The callback function is called whenever an object that matches
* the type parameter is found. If the callback function returns
* a non-zero value, the search is terminated immediately and this
* value is returned to the caller.
*
* The point of this procedure is to provide a generic namespace
* walk routine that can be called from multiple places to
* provide multiple services; the User Function can be tailored
* to each task, whether it is a print function, a compare
* function, etc.
* provide multiple services; the callback function(s) can be
* tailored to each task, whether it is a print function,
* a compare function, etc.
*
******************************************************************************/
@ -572,7 +575,8 @@ AcpiWalkNamespace (
ACPI_OBJECT_TYPE Type,
ACPI_HANDLE StartObject,
UINT32 MaxDepth,
ACPI_WALK_CALLBACK UserFunction,
ACPI_WALK_CALLBACK PreOrderVisit,
ACPI_WALK_CALLBACK PostOrderVisit,
void *Context,
void **ReturnValue)
{
@ -586,7 +590,7 @@ AcpiWalkNamespace (
if ((Type > ACPI_TYPE_LOCAL_MAX) ||
(!MaxDepth) ||
(!UserFunction))
(!PreOrderVisit && !PostOrderVisit))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
@ -621,7 +625,8 @@ AcpiWalkNamespace (
}
Status = AcpiNsWalkNamespace (Type, StartObject, MaxDepth,
ACPI_NS_WALK_UNLOCK, UserFunction, Context, ReturnValue);
ACPI_NS_WALK_UNLOCK, PreOrderVisit,
PostOrderVisit, Context, ReturnValue);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
@ -833,7 +838,7 @@ AcpiGetDevices (
Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK,
AcpiNsGetDeviceCallback, &Info, ReturnValue);
AcpiNsGetDeviceCallback, NULL, &Info, ReturnValue);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);

View File

@ -173,6 +173,7 @@ AcpiPsCompleteFinalOp (
static void
AcpiPsLinkModuleCode (
ACPI_PARSE_OBJECT *ParentOp,
UINT8 *AmlStart,
UINT32 AmlLength,
ACPI_OWNER_ID OwnerId);
@ -593,7 +594,7 @@ AcpiPsGetArguments (
*/
if (WalkState->PassNumber == ACPI_IMODE_LOAD_PASS1)
{
AcpiPsLinkModuleCode (AmlOpStart,
AcpiPsLinkModuleCode (Op->Common.Parent, AmlOpStart,
(UINT32) (WalkState->ParserState.PkgEnd - AmlOpStart),
WalkState->OwnerId);
}
@ -704,7 +705,8 @@ AcpiPsGetArguments (
*
* FUNCTION: AcpiPsLinkModuleCode
*
* PARAMETERS: AmlStart - Pointer to the AML
* PARAMETERS: ParentOp - Parent parser op
* AmlStart - Pointer to the AML
* AmlLength - Length of executable AML
* OwnerId - OwnerId of module level code
*
@ -718,6 +720,7 @@ AcpiPsGetArguments (
static void
AcpiPsLinkModuleCode (
ACPI_PARSE_OBJECT *ParentOp,
UINT8 *AmlStart,
UINT32 AmlLength,
ACPI_OWNER_ID OwnerId)
@ -725,6 +728,7 @@ AcpiPsLinkModuleCode (
ACPI_OPERAND_OBJECT *Prev;
ACPI_OPERAND_OBJECT *Next;
ACPI_OPERAND_OBJECT *MethodObj;
ACPI_NAMESPACE_NODE *ParentNode;
/* Get the tail of the list */
@ -751,11 +755,27 @@ AcpiPsLinkModuleCode (
return;
}
if (ParentOp->Common.Node)
{
ParentNode = ParentOp->Common.Node;
}
else
{
ParentNode = AcpiGbl_RootNode;
}
MethodObj->Method.AmlStart = AmlStart;
MethodObj->Method.AmlLength = AmlLength;
MethodObj->Method.OwnerId = OwnerId;
MethodObj->Method.Flags |= AOPOBJ_MODULE_LEVEL;
/*
* Save the parent node in NextObject. This is cheating, but we
* don't want to expand the method object.
*/
MethodObj->Method.NextObject =
ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, ParentNode);
if (!Prev)
{
AcpiGbl_ModuleCodeList = MethodObj;

View File

@ -705,13 +705,11 @@ AcpiPsParseAml (
!PreviousWalkState->ImplicitReturnObj)
{
PreviousWalkState->ImplicitReturnObj =
AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
AcpiUtCreateIntegerObject ((UINT64) 0);
if (!PreviousWalkState->ImplicitReturnObj)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
PreviousWalkState->ImplicitReturnObj->Integer.Value = 0;
}
/* Restart the calling control method */

View File

@ -422,15 +422,13 @@ AcpiPsExecuteMethod (
if (AcpiGbl_EnableInterpreterSlack)
{
WalkState->ImplicitReturnObj =
AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
AcpiUtCreateIntegerObject ((UINT64) 0);
if (!WalkState->ImplicitReturnObj)
{
Status = AE_NO_MEMORY;
AcpiDsDeleteWalkState (WalkState);
goto Cleanup;
}
WalkState->ImplicitReturnObj->Integer.Value = 0;
}
/* Parse the AML */

View File

@ -1440,3 +1440,51 @@ AcpiUtPredefinedWarning (
ACPI_COMMON_MSG_SUFFIX;
va_end (args);
}
/*******************************************************************************
*
* FUNCTION: AcpiUtPredefinedInfo
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* Pathname - Full pathname to the node
* NodeFlags - From Namespace node for the method/object
* Format - Printf format string + additional args
*
* RETURN: None
*
* DESCRIPTION: Info messages for the predefined validation module. Messages
* are only emitted the first time a problem with a particular
* method/object is detected. This prevents a flood of
* messages for methods that are repeatedly evaluated.
*
******************************************************************************/
void ACPI_INTERNAL_VAR_XFACE
AcpiUtPredefinedInfo (
const char *ModuleName,
UINT32 LineNumber,
char *Pathname,
UINT8 NodeFlags,
const char *Format,
...)
{
va_list args;
/*
* Warning messages for this method/object will be disabled after the
* first time a validation fails or an object is successfully repaired.
*/
if (NodeFlags & ANOBJ_EVALUATED)
{
return;
}
AcpiOsPrintf ("ACPI Info for %s: ", Pathname);
va_start (args, Format);
AcpiOsVprintf (Format, args);
ACPI_COMMON_MSG_SUFFIX;
va_end (args);
}

View File

@ -279,6 +279,41 @@ AcpiUtCreatePackageObject (
}
/*******************************************************************************
*
* FUNCTION: AcpiUtCreateIntegerObject
*
* PARAMETERS: InitialValue - Initial value for the integer
*
* RETURN: Pointer to a new Integer object, null on failure
*
* DESCRIPTION: Create an initialized integer object
*
******************************************************************************/
ACPI_OPERAND_OBJECT *
AcpiUtCreateIntegerObject (
UINT64 InitialValue)
{
ACPI_OPERAND_OBJECT *IntegerDesc;
ACPI_FUNCTION_TRACE (UtCreateIntegerObject);
/* Create and initialize a new integer object */
IntegerDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
if (!IntegerDesc)
{
return_PTR (NULL);
}
IntegerDesc->Integer.Value = InitialValue;
return_PTR (IntegerDesc);
}
/*******************************************************************************
*
* FUNCTION: AcpiUtCreateBufferObject

View File

@ -1517,7 +1517,7 @@ acpi_device_scan_children(device_t bus, device_t dev, int max_depth,
ctx.arg = arg;
ctx.parent = h;
return (AcpiWalkNamespace(ACPI_TYPE_ANY, h, max_depth,
acpi_device_scan_cb, &ctx, NULL));
acpi_device_scan_cb, NULL, &ctx, NULL));
}
/*
@ -1643,7 +1643,7 @@ acpi_probe_children(device_t bus)
*/
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "namespace scan\n"));
AcpiWalkNamespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, 100, acpi_probe_child,
bus, NULL);
NULL, bus, NULL);
/* Pre-allocate resources for our rman from any sysresource devices. */
acpi_sysres_alloc(bus);
@ -2767,7 +2767,7 @@ acpi_wake_prep_walk(int sstate)
if (ACPI_SUCCESS(AcpiGetHandle(ACPI_ROOT_OBJECT, "\\_SB_", &sb_handle)))
AcpiWalkNamespace(ACPI_TYPE_DEVICE, sb_handle, 100,
acpi_wake_prep, &sstate, NULL);
acpi_wake_prep, NULL, &sstate, NULL);
return (0);
}

View File

@ -224,7 +224,7 @@ acpi_dock_insert_child(ACPI_HANDLE handle, UINT32 level, void *context,
ACPI_INIT_WALK_INFO Info;
AcpiNsWalkNamespace(ACPI_TYPE_ANY, handle,
100, TRUE, AcpiNsInitOneDevice, &Info, NULL);
100, TRUE, AcpiNsInitOneDevice, NULL, &Info, NULL);
#endif
dev = acpi_get_device(handle);
@ -249,7 +249,7 @@ acpi_dock_insert_children(device_t dev)
status = AcpiGetHandle(ACPI_ROOT_OBJECT, "\\_SB_", &sb_handle);
if (ACPI_SUCCESS(status)) {
AcpiWalkNamespace(ACPI_TYPE_DEVICE, sb_handle,
100, acpi_dock_insert_child, dev, NULL);
100, acpi_dock_insert_child, NULL, dev, NULL);
}
}
@ -319,7 +319,7 @@ acpi_dock_eject_children(device_t dev)
status = AcpiGetHandle(ACPI_ROOT_OBJECT, "\\_SB_", &sb_handle);
if (ACPI_SUCCESS(status)) {
AcpiWalkNamespace(ACPI_TYPE_DEVICE, sb_handle,
100, acpi_dock_eject_child, &dev, NULL);
100, acpi_dock_eject_child, NULL, &dev, NULL);
}
}

View File

@ -314,7 +314,7 @@ acpi_pci_attach(device_t dev)
*/
pci_add_children(dev, domain, busno, sizeof(struct acpi_pci_devinfo));
AcpiWalkNamespace(ACPI_TYPE_DEVICE, acpi_get_handle(dev), 1,
acpi_pci_save_handle, dev, NULL);
acpi_pci_save_handle, NULL, dev, NULL);
return (bus_generic_attach(dev));
}

View File

@ -839,7 +839,7 @@ vid_enum_outputs(ACPI_HANDLE handle,
argset.dod_pkg = res;
argset.count = 0;
status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, handle, 1,
vid_enum_outputs_subr, &argset, NULL);
vid_enum_outputs_subr, NULL, &argset, NULL);
if (ACPI_FAILURE(status))
printf("failed walking down %s - %s\n",
acpi_name(handle), AcpiFormatException(status));

View File

@ -38,8 +38,8 @@ SRCS+= psargs.c psloop.c psopcode.c psparse.c psscope.c \
# namespace
SRCS+= nsaccess.c nsalloc.c nsdump.c nseval.c nsinit.c \
nsload.c nsnames.c nsobject.c nsparse.c nspredef.c \
nsrepair.c nssearch.c nsutils.c nswalk.c nsxfeval.c \
nsxfname.c nsxfobj.c
nsrepair.c nsrepair2.c nssearch.c nsutils.c nswalk.c \
nsxfeval.c nsxfname.c nsxfobj.c
# resources
SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsinfo.c \