New: Validation for predefined ACPI methods/objects.

Validates predefined ACPI objects that appear in the namespace, at the
time they are evaluated. The argument count and the type of the returned
object are validated. The purpose of this validation is to detect problems
with the BIOS-exposed predefined ACPI objects before the results are
returned to the ACPI-related drivers.
This commit is contained in:
Robert Moore 2008-09-24 13:34:08 -07:00
parent ab557ef061
commit 1ff11b4819
11 changed files with 1837 additions and 3 deletions

View File

@ -86,6 +86,7 @@ SRCS= aeexec.c aemain.c \
../../namespace/nsnames.c \
../../namespace/nsobject.c \
../../namespace/nsparse.c \
../../namespace/nspredef.c \
../../namespace/nssearch.c \
../../namespace/nsutils.c \
../../namespace/nswalk.c \

View File

@ -386,6 +386,228 @@ AcpiDbFindReferences (
}
/*******************************************************************************
*
* FUNCTION: AcpiDbWalkForPredefinedNames
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Detect and display predefined ACPI names (names that start with
* an underscore)
*
******************************************************************************/
static ACPI_STATUS
AcpiDbWalkForPredefinedNames (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
UINT32 *Count = (UINT32 *) Context;
const ACPI_PREDEFINED_INFO *Predefined;
const ACPI_PREDEFINED_INFO *Package = NULL;
char *Pathname;
Predefined = AcpiNsCheckForPredefinedName (Node);
if (!Predefined)
{
return (AE_OK);
}
Pathname = AcpiNsGetExternalPathname (Node);
if (!Pathname)
{
return (AE_OK);
}
/* If method returns a package, the info is in the next table entry */
if (Predefined->Info.ExpectedBtypes & ACPI_BTYPE_PACKAGE)
{
Package = Predefined + 1;
}
AcpiOsPrintf ("%-32s arg %X ret %2.2X", Pathname,
Predefined->Info.ParamCount, Predefined->Info.ExpectedBtypes);
if (Package)
{
AcpiOsPrintf (" PkgType %2.2X ObjType %2.2X Count %2.2X",
Package->RetInfo.Type, Package->RetInfo.ObjectType1,
Package->RetInfo.Count1);
}
AcpiOsPrintf("\n");
AcpiNsCheckParameterCount (Pathname, Node, Predefined);
ACPI_FREE (Pathname);
(*Count)++;
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiDbCheckPredefinedNames
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Validate all predefined names in the namespace
*
******************************************************************************/
void
AcpiDbCheckPredefinedNames (
void)
{
UINT32 Count = 0;
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForPredefinedNames, (void *) &Count, NULL);
AcpiOsPrintf ("Found %d predefined names in the namespace\n", Count);
}
/*******************************************************************************
*
* FUNCTION: AcpiDbWalkForExecute
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Batch execution module. Currently only executes predefined
* ACPI names.
*
******************************************************************************/
static ACPI_STATUS
AcpiDbWalkForExecute (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
UINT32 *Count = (UINT32 *) Context;
const ACPI_PREDEFINED_INFO *Predefined;
ACPI_BUFFER ReturnObj;
ACPI_STATUS Status;
char *Pathname;
ACPI_BUFFER Buffer;
UINT32 i;
ACPI_DEVICE_INFO *ObjInfo;
ACPI_OBJECT_LIST ParamObjects;
ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
Predefined = AcpiNsCheckForPredefinedName (Node);
if (!Predefined)
{
return (AE_OK);
}
if (Node->Type == ACPI_TYPE_LOCAL_SCOPE)
{
return (AE_OK);
}
Pathname = AcpiNsGetExternalPathname (Node);
if (!Pathname)
{
return (AE_OK);
}
/* Get the object info for number of method parameters */
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiGetObjectInfo (ObjHandle, &Buffer);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParamObjects.Pointer = NULL;
ParamObjects.Count = 0;
ObjInfo = Buffer.Pointer;
if (ObjInfo->Type == ACPI_TYPE_METHOD)
{
/* Setup default parameters */
for (i = 0; i < ObjInfo->ParamCount; i++)
{
Params[i].Type = ACPI_TYPE_INTEGER;
Params[i].Integer.Value = 1;
}
ParamObjects.Pointer = Params;
ParamObjects.Count = ObjInfo->ParamCount;
}
ACPI_FREE (Buffer.Pointer);
ReturnObj.Pointer = NULL;
ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
/* Do the actual method execution */
AcpiGbl_MethodExecuting = TRUE;
Status = AcpiEvaluateObject (Node, NULL, &ParamObjects, &ReturnObj);
AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status));
AcpiGbl_MethodExecuting = FALSE;
ACPI_FREE (Pathname);
(*Count)++;
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiDbBatchExecute
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Namespace batch execution.
*
******************************************************************************/
void
AcpiDbBatchExecute (
void)
{
UINT32 Count = 0;
/* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForExecute, (void *) &Count, NULL);
AcpiOsPrintf ("Executed %d predefined names in the namespace\n", Count);
}
/*******************************************************************************
*
* FUNCTION: AcpiDbDisplayLocks

View File

@ -160,6 +160,7 @@ enum AcpiExDebuggerCommands
CMD_ALLOCATIONS,
CMD_ARGS,
CMD_ARGUMENTS,
CMD_BATCH,
CMD_BREAKPOINT,
CMD_BUSINFO,
CMD_CALL,
@ -194,6 +195,7 @@ enum AcpiExDebuggerCommands
CMD_OBJECT,
CMD_OPEN,
CMD_OWNER,
CMD_PREDEFINED,
CMD_PREFIX,
CMD_QUIT,
CMD_REFERENCES,
@ -214,6 +216,9 @@ enum AcpiExDebuggerCommands
#define CMD_FIRST_VALID 2
/* Second parameter is the required argument count */
static const COMMAND_INFO AcpiGbl_DbCommands[] =
{
{"<NOT FOUND>", 0},
@ -221,6 +226,7 @@ static const COMMAND_INFO AcpiGbl_DbCommands[] =
{"ALLOCATIONS", 0},
{"ARGS", 0},
{"ARGUMENTS", 0},
{"BATCH", 0},
{"BREAKPOINT", 1},
{"BUSINFO", 0},
{"CALL", 0},
@ -255,6 +261,7 @@ static const COMMAND_INFO AcpiGbl_DbCommands[] =
{"OBJECT", 1},
{"OPEN", 1},
{"OWNER", 1},
{"PREDEFINED", 0},
{"PREFIX", 0},
{"QUIT", 0},
{"REFERENCES", 1},
@ -360,6 +367,7 @@ AcpiDbDisplayHelp (
AcpiOsPrintf ("Notify <Object> <Value> Send a notification on Object\n");
AcpiOsPrintf ("Objects <ObjectType> Display all objects of the given type\n");
AcpiOsPrintf ("Owner <OwnerId> [Depth] Display loaded namespace by object owner\n");
AcpiOsPrintf ("Predefined Check all predefined names\n");
AcpiOsPrintf ("Prefix [<NamePath>] Set or Get current execution prefix\n");
AcpiOsPrintf ("References <Addr> Find all references to object at addr\n");
AcpiOsPrintf ("Resources <Device> Get and display Device resources\n");
@ -635,6 +643,10 @@ AcpiDbCommandDispatch (
AcpiDbDisplayArguments ();
break;
case CMD_BATCH:
AcpiDbBatchExecute ();
break;
case CMD_BREAKPOINT:
AcpiDbSetMethodBreakpoint (AcpiGbl_DbArgs[1], WalkState, Op);
break;
@ -812,6 +824,10 @@ AcpiDbCommandDispatch (
AcpiDbDumpNamespaceByOwner (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
break;
case CMD_PREDEFINED:
AcpiDbCheckPredefinedNames ();
break;
case CMD_PREFIX:
AcpiDbSetScope (AcpiGbl_DbArgs[1]);
break;

View File

@ -159,6 +159,7 @@ AcpiNsEvaluate (
ACPI_EVALUATE_INFO *Info)
{
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
ACPI_FUNCTION_TRACE (NsEvaluate);
@ -200,6 +201,8 @@ AcpiNsEvaluate (
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s [%p] Value %p\n", Info->Pathname,
Info->ResolvedNode, AcpiNsGetAttachedObject (Info->ResolvedNode)));
Node = Info->ResolvedNode;
/*
* Two major cases here:
*
@ -340,9 +343,35 @@ AcpiNsEvaluate (
}
}
/*
* Check if there is a return value that must be dealt with
*/
/* Validation of return values for ACPI-predefined methods and objects */
if ((Status == AE_OK) || (Status == AE_CTRL_RETURN_VALUE))
{
/*
* If this is the first evaluation, check the return value. This
* ensures that any warnings will only be emitted during the very
* first evaluation of the object.
*/
if (!(Node->Flags & ANOBJ_EVALUATED))
{
/*
* Check for a predefined ACPI name. If found, validate the
* returned object.
*
* Note: Ignore return status for now, emit warnings if there are
* problems with the returned object. May change later to abort
* the method on invalid return object.
*/
(void) AcpiNsCheckPredefinedNames (Node, Info->ReturnObject);
}
/* Mark the node as having been evaluated */
Node->Flags |= ANOBJ_EVALUATED;
}
/* Check if there is a return value that must be dealt with */
if (Status == AE_CTRL_RETURN_VALUE)
{
/* If caller does not want the return value, delete it */

File diff suppressed because it is too large Load Diff

0
source/include/acconfig.h Executable file → Normal file
View File

View File

@ -314,6 +314,13 @@ AcpiDbDisplayArgumentObject (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState);
void
AcpiDbCheckPredefinedNames (
void);
void
AcpiDbBatchExecute (
void);
/*
* dbexec - debugger control method execution

View File

@ -301,6 +301,7 @@ typedef struct acpi_namespace_node
#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */
#define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */
#define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */
#define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */
@ -458,6 +459,93 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
/*
* Information structure for ACPI predefined names.
* Each entry in the table contains the following items:
*
* Name - The ACPI reserved name
* ParamCount - Number of arguments to the method
* ExpectedReturnBtypes - Allowed type(s) for the return value
*/
typedef struct acpi_name_info
{
char Name[ACPI_NAME_SIZE];
UINT8 ParamCount;
UINT8 ExpectedBtypes;
} ACPI_NAME_INFO;
/*
* Secondary information structures for ACPI predefined objects that return
* package objects. This structure appears as the next entry in the table
* after the NAME_INFO structure above.
*
* The reason for this is to minimize the size of the predefined name table.
*/
/*
* Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
* ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT
*/
typedef struct acpi_package_info
{
UINT8 Type;
UINT8 ObjectType1;
UINT8 Count1;
UINT8 ObjectType2;
UINT8 Count2;
UINT8 Reserved;
} ACPI_PACKAGE_INFO;
/* Used for ACPI_PTYPE2_FIXED */
typedef struct acpi_package_info2
{
UINT8 Type;
UINT8 Count;
UINT8 ObjectType[4];
} ACPI_PACKAGE_INFO2;
/* Used for ACPI_PTYPE1_OPTION */
typedef struct acpi_package_info3
{
UINT8 Type;
UINT8 Count;
UINT8 ObjectType[2];
UINT8 TailObjectType;
UINT8 Reserved;
} ACPI_PACKAGE_INFO3;
typedef union acpi_predefined_info
{
ACPI_NAME_INFO Info;
ACPI_PACKAGE_INFO RetInfo;
ACPI_PACKAGE_INFO2 RetInfo2;
ACPI_PACKAGE_INFO3 RetInfo3;
} ACPI_PREDEFINED_INFO;
/*
* Bitmapped return value types
* Note: the actual data types must be contiguous, a loop in nspredef.c
* depends on this.
*/
#define ACPI_RTYPE_ANY 0x00
#define ACPI_RTYPE_NONE 0x01
#define ACPI_RTYPE_INTEGER 0x02
#define ACPI_RTYPE_STRING 0x04
#define ACPI_RTYPE_BUFFER 0x08
#define ACPI_RTYPE_PACKAGE 0x10
#define ACPI_RTYPE_REFERENCE 0x20
#define ACPI_RTYPE_ALL 0x3F
#define ACPI_NUM_RTYPES 5 /* Number of actual object types */
/*****************************************************************************
*
* Event typedefs and structs

View File

@ -308,6 +308,25 @@ AcpiNsEvaluate (
ACPI_EVALUATE_INFO *Info);
/*
* nspredef - Support for predefined/reserved names
*/
ACPI_STATUS
AcpiNsCheckPredefinedNames (
ACPI_NAMESPACE_NODE *Node,
ACPI_OPERAND_OBJECT *ReturnObject);
const ACPI_PREDEFINED_INFO *
AcpiNsCheckForPredefinedName (
ACPI_NAMESPACE_NODE *Node);
void
AcpiNsCheckParameterCount (
char *Pathname,
ACPI_NAMESPACE_NODE *Node,
const ACPI_PREDEFINED_INFO *Info);
/*
* nsnames - Name and Scope manipulation
*/

439
source/include/acpredef.h Normal file
View File

@ -0,0 +1,439 @@
/******************************************************************************
*
* Name: acpredef - Information table for ACPI predefined methods and objects
* $Revision: 1.1 $
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2008, 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.
*
*****************************************************************************/
#ifndef __ACPREDEF_H__
#define __ACPREDEF_H__
/******************************************************************************
*
* Return Package types
*
* 1) PTYPE1 packages do not contain sub-packages.
*
* ACPI_PTYPE1_FIXED: Fixed length, 1 or 2 object types:
* object type
* count
* object type
* count
*
* ACPI_PTYPE1_VAR: Variable length:
* object type (Int/Buf/Ref)
*
* ACPI_PTYPE1_OPTION: Package has some required and some optional elements:
* Used for _PRW
*
*
* 2) PTYPE2 packages contain a variable number of sub-packages. Each of the
* different types describe the contents of each of the sub-packages.
*
* ACPI_PTYPE2: Each subpackage contains 1 or 2 object types:
* object type
* count
* object type
* count
*
* ACPI_PTYPE2_COUNT: Each subpackage has a count as first element:
* object type
*
* ACPI_PTYPE2_PKG_COUNT: Count of subpackages at start, 1 or 2 object types:
* object type
* count
* object type
* count
*
* ACPI_PTYPE2_FIXED: Each subpackage is of fixed length:
* Used for _PRT
*
* ACPI_PTYPE2_MIN: Each subpackage has a variable but minimum length
* Used for _HPX
*
*****************************************************************************/
enum AcpiReturnPackageTypes
{
ACPI_PTYPE1_FIXED = 1,
ACPI_PTYPE1_VAR = 2,
ACPI_PTYPE1_OPTION = 3,
ACPI_PTYPE2 = 4,
ACPI_PTYPE2_COUNT = 5,
ACPI_PTYPE2_PKG_COUNT = 6,
ACPI_PTYPE2_FIXED = 7,
ACPI_PTYPE2_MIN = 8
};
/*
* Predefined method/object information table.
*
* These are the names that can actually be evaluated via AcpiEvaluateObject.
* Not present in this table are the following:
*
* 1) Predefined/Reserved names that are never evaluated via AcpiEvaluateObject:
* _Lxx and _Exx GPE methods
* _Qxx EC methods
* _T_x compiler temporary variables
*
* 2) Predefined names that never actually exist within the AML code:
* Predefined resource descriptor field names
*
* 3) Predefined names that are implemented within ACPICA:
* _OSI
*
* 4) Some predefined names that are not documented within the ACPI spec.
* _WDG, _WED
*
* The main entries in the table each contain the following items:
*
* Name - The ACPI reserved name
* ParamCount - Number of arguments to the method
* ExpectedBtypes - Allowed type(s) for the return value.
* 0 means that no return value is expected.
*
* For methods that return packages, the next entry in the table contains
* information about the expected structure of the package. This information
* is saved here (rather than in a separate table) in order to minimize the
* overall size of the stored data.
*/
static const ACPI_PREDEFINED_INFO PredefinedNames[] =
{
{"_AC0", 0, ACPI_RTYPE_INTEGER},
{"_AC1", 0, ACPI_RTYPE_INTEGER},
{"_AC2", 0, ACPI_RTYPE_INTEGER},
{"_AC3", 0, ACPI_RTYPE_INTEGER},
{"_AC4", 0, ACPI_RTYPE_INTEGER},
{"_AC5", 0, ACPI_RTYPE_INTEGER},
{"_AC6", 0, ACPI_RTYPE_INTEGER},
{"_AC7", 0, ACPI_RTYPE_INTEGER},
{"_AC8", 0, ACPI_RTYPE_INTEGER},
{"_AC9", 0, ACPI_RTYPE_INTEGER},
{"_ADR", 0, ACPI_RTYPE_INTEGER},
{"_AL0", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_AL1", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_AL2", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_AL3", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_AL4", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_AL5", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_AL6", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_AL7", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_AL8", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_AL9", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_ALC", 0, ACPI_RTYPE_INTEGER},
{"_ALI", 0, ACPI_RTYPE_INTEGER},
{"_ALP", 0, ACPI_RTYPE_INTEGER},
{"_ALR", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 2,0,0,0}, /* variable (Pkgs) each 2 (Ints) */
{"_ALT", 0, ACPI_RTYPE_INTEGER},
{"_BBN", 0, ACPI_RTYPE_INTEGER},
{"_BCL", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0,0,0}, /* variable (Ints) */
{"_BCM", 1, 0},
{"_BDN", 0, ACPI_RTYPE_INTEGER},
{"_BFS", 1, 0},
{"_BIF", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 9,
ACPI_RTYPE_STRING, 4,0}, /* fixed (9 Int),(4 Str) */
{"_BLT", 3, 0},
{"_BMC", 1, 0},
{"_BMD", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 5,0,0,0}, /* fixed (5 Int) */
{"_BQC", 0, ACPI_RTYPE_INTEGER},
{"_BST", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0,0,0}, /* fixed (4 Int) */
{"_BTM", 1, ACPI_RTYPE_INTEGER},
{"_BTP", 1, 0},
{"_CBA", 0, ACPI_RTYPE_INTEGER}, /* see PCI firmware spec 3.0 */
{"_CID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_PACKAGE},
{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER |
ACPI_RTYPE_STRING, 0,0,0,0}, /* variable (Ints/Strs) */
{"_CRS", 0, ACPI_RTYPE_BUFFER},
{"_CRT", 0, ACPI_RTYPE_INTEGER},
{"_CSD", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE2_COUNT, ACPI_RTYPE_INTEGER, 0,0,0,0}, /* variable (1 Int(n), n-1 Int) */
{"_CST", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE2_PKG_COUNT,ACPI_RTYPE_BUFFER, 1,
ACPI_RTYPE_INTEGER,3,0}, /* variable (1 Int(n), n Pkg (1 Buf/3 Int) */
{"_DCK", 1, ACPI_RTYPE_INTEGER},
{"_DCS", 0, ACPI_RTYPE_INTEGER},
{"_DDC", 1, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER},
{"_DDN", 0, ACPI_RTYPE_STRING},
{"_DGS", 0, ACPI_RTYPE_INTEGER},
{"_DIS", 0, 0},
{"_DMA", 0, ACPI_RTYPE_BUFFER},
{"_DOD", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0,0,0}, /* variable (Ints) */
{"_DOS", 1, 0},
{"_DSM", 4, ACPI_RTYPE_ALL}, /* Must return a type, but it can be of any type */
{"_DSS", 1, 0},
{"_DSW", 3, 0},
{"_EC_", 0, ACPI_RTYPE_INTEGER},
{"_EDL", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs)*/
{"_EJ0", 1, 0},
{"_EJ1", 1, 0},
{"_EJ2", 1, 0},
{"_EJ3", 1, 0},
{"_EJ4", 1, 0},
{"_EJD", 0, ACPI_RTYPE_STRING},
{"_FDE", 0, ACPI_RTYPE_BUFFER},
{"_FDI", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16,0,0,0}, /* fixed (16 Int) */
{"_FDM", 1, 0},
{"_FIX", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0,0,0}, /* variable (Ints) */
{"_GLK", 0, ACPI_RTYPE_INTEGER},
{"_GPD", 0, ACPI_RTYPE_INTEGER},
{"_GPE", 0, ACPI_RTYPE_INTEGER}, /* _GPE method, not _GPE scope */
{"_GSB", 0, ACPI_RTYPE_INTEGER},
{"_GTF", 0, ACPI_RTYPE_BUFFER},
{"_GTM", 0, ACPI_RTYPE_BUFFER},
{"_GTS", 1, 0},
{"_HID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING},
{"_HOT", 0, ACPI_RTYPE_INTEGER},
{"_HPP", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0,0,0}, /* fixed (4 Int) */
/*
* For _HPX, a single package is returned, containing a variable number of sub-packages.
* Each sub-package contains a PCI record setting. There are several different type of
* record settings, of different lengths, but all elements of all settings are Integers.
*/
{"_HPX", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE2_MIN, ACPI_RTYPE_INTEGER, 5,0,0,0}, /* variable (Pkgs) each (var Ints) */
{"_IFT", 0, ACPI_RTYPE_INTEGER}, /* see IPMI spec */
{"_INI", 0, 0},
{"_IRC", 0, 0},
{"_LCK", 1, 0},
{"_LID", 0, ACPI_RTYPE_INTEGER},
{"_MAT", 0, ACPI_RTYPE_BUFFER},
{"_MLS", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE2, ACPI_RTYPE_STRING, 2,0,0,0}, /* variable (Pkgs) each (2 Str) */
{"_MSG", 1, 0},
{"_OFF", 0, 0},
{"_ON_", 0, 0},
{"_OS_", 0, ACPI_RTYPE_STRING},
{"_OSC", 4, ACPI_RTYPE_BUFFER},
{"_OST", 3, 0},
{"_PCL", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_PCT", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_FIXED, ACPI_RTYPE_BUFFER, 2,0,0,0}, /* fixed (2 Buf) */
{"_PDC", 1, 0},
{"_PIC", 1, 0},
{"_PLD", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_BUFFER, 0,0,0,0}, /* variable (Bufs) */
{"_PPC", 0, ACPI_RTYPE_INTEGER},
{"_PPE", 0, ACPI_RTYPE_INTEGER}, /* see dig64 spec */
{"_PR0", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_PR1", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_PR2", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_PRS", 0, ACPI_RTYPE_BUFFER},
/*
* For _PRT, many BIOSs reverse the 2nd and 3rd Package elements. This bug is so prevalent that there
* is code in the ACPICA Resource Manager to detect this and switch them back. For now, do not allow
* and issue a warning. To allow this and eliminate the warning, add the ACPI_RTYPE_REFERENCE
* type to the 2nd element (index 1) in the statement below.
*/
{"_PRT", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE2_FIXED, 4,ACPI_RTYPE_INTEGER,ACPI_RTYPE_INTEGER,
ACPI_RTYPE_INTEGER | ACPI_RTYPE_REFERENCE,ACPI_RTYPE_INTEGER}, /* variable (Pkgs) each (4): Int,Int,Int/Ref,Int */
{"_PRW", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_OPTION,2,ACPI_RTYPE_INTEGER | ACPI_RTYPE_PACKAGE,
ACPI_RTYPE_INTEGER,ACPI_RTYPE_REFERENCE,0}, /* variable (Pkgs) each: Pkg/Int,Int,[variable Refs] (Pkg is Ref/Int) */
{"_PS0", 0, 0},
{"_PS1", 0, 0},
{"_PS2", 0, 0},
{"_PS3", 0, 0},
{"_PSC", 0, ACPI_RTYPE_INTEGER},
{"_PSD", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE2_COUNT, ACPI_RTYPE_INTEGER,0,0,0,0}, /* variable (Pkgs) each (5 Int) with count */
{"_PSL", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_PSR", 0, ACPI_RTYPE_INTEGER},
{"_PSS", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 6,0,0,0}, /* variable (Pkgs) each (6 Int) */
{"_PSV", 0, ACPI_RTYPE_INTEGER},
{"_PSW", 1, 0},
{"_PTC", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_FIXED, ACPI_RTYPE_BUFFER, 2,0,0,0}, /* fixed (2 Buf) */
{"_PTS", 1, 0},
{"_PXM", 0, ACPI_RTYPE_INTEGER},
{"_REG", 2, 0},
{"_REV", 0, ACPI_RTYPE_INTEGER},
{"_RMV", 0, ACPI_RTYPE_INTEGER},
{"_ROM", 2, ACPI_RTYPE_BUFFER},
{"_RTV", 0, ACPI_RTYPE_INTEGER},
/*
* For _S0_ through _S5_, the ACPI spec defines a return Package containing 1 Integer,
* but most DSDTs have it wrong - 2,3, or 4 integers. Allow this by making the objects "variable length",
* but all elements must be Integers.
*/
{"_S0_", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0,0,0}, /* fixed (1 Int) */
{"_S1_", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0,0,0}, /* fixed (1 Int) */
{"_S2_", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0,0,0}, /* fixed (1 Int) */
{"_S3_", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0,0,0}, /* fixed (1 Int) */
{"_S4_", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0,0,0}, /* fixed (1 Int) */
{"_S5_", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0,0,0}, /* fixed (1 Int) */
{"_S1D", 0, ACPI_RTYPE_INTEGER},
{"_S2D", 0, ACPI_RTYPE_INTEGER},
{"_S3D", 0, ACPI_RTYPE_INTEGER},
{"_S4D", 0, ACPI_RTYPE_INTEGER},
{"_S0W", 0, ACPI_RTYPE_INTEGER},
{"_S1W", 0, ACPI_RTYPE_INTEGER},
{"_S2W", 0, ACPI_RTYPE_INTEGER},
{"_S3W", 0, ACPI_RTYPE_INTEGER},
{"_S4W", 0, ACPI_RTYPE_INTEGER},
{"_SBS", 0, ACPI_RTYPE_INTEGER},
{"_SCP", 0x13, 0}, /* Acpi 1.0 allowed 1 arg. Acpi 3.0 expanded to 3 args. Allow both. */
/* Note: the 3-arg definition may be removed for ACPI 4.0 */
{"_SDD", 1, 0},
{"_SEG", 0, ACPI_RTYPE_INTEGER},
{"_SLI", 0, ACPI_RTYPE_BUFFER},
{"_SPD", 1, ACPI_RTYPE_INTEGER},
{"_SRS", 1, 0},
{"_SRV", 0, ACPI_RTYPE_INTEGER}, /* see IPMI spec */
{"_SST", 1, 0},
{"_STA", 0, ACPI_RTYPE_INTEGER},
{"_STM", 3, 0},
{"_STR", 0, ACPI_RTYPE_BUFFER},
{"_SUN", 0, ACPI_RTYPE_INTEGER},
{"_SWS", 0, ACPI_RTYPE_INTEGER},
{"_TC1", 0, ACPI_RTYPE_INTEGER},
{"_TC2", 0, ACPI_RTYPE_INTEGER},
{"_TMP", 0, ACPI_RTYPE_INTEGER},
{"_TPC", 0, ACPI_RTYPE_INTEGER},
{"_TPT", 1, 0},
{"_TRT", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE2, ACPI_RTYPE_REFERENCE, 2,
ACPI_RTYPE_INTEGER, 6, 0}, /* variable (Pkgs) each 2Ref/6Int */
{"_TSD", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE2_COUNT,ACPI_RTYPE_INTEGER, 5,0,0,0}, /* variable (Pkgs) each 5Int with count */
{"_TSP", 0, ACPI_RTYPE_INTEGER},
{"_TSS", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 5,0,0,0}, /* variable (Pkgs) each 5Int */
{"_TST", 0, ACPI_RTYPE_INTEGER},
{"_TTS", 1, 0},
{"_TZD", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0}, /* variable (Refs) */
{"_TZM", 0, ACPI_RTYPE_REFERENCE},
{"_TZP", 0, ACPI_RTYPE_INTEGER},
{"_UID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING},
{"_UPC", 0, ACPI_RTYPE_PACKAGE}, {ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0,0,0}, /* fixed (4 Int) */
{"_UPD", 0, ACPI_RTYPE_INTEGER},
{"_UPP", 0, ACPI_RTYPE_INTEGER},
{"_VPO", 0, ACPI_RTYPE_INTEGER},
/* Acpi 1.0 defined _WAK with no return value. Later, it was changed to return a package */
{"_WAK", 1, ACPI_RTYPE_NONE | ACPI_RTYPE_PACKAGE},
{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2,0,0,0}, /* fixed (2 Int), but is optional */
{0,0,0,0,0,0} /* Table terminator */
};
#if 0
/* Not implemented */
{"_WDG", 0, ACPI_RTYPE_BUFFER}, /* MS Extension */
{"_WED", 1, ACPI_RTYPE_PACKAGE}, /* MS Extension */
/* This is an internally implemented control method, no need to check */
{"_OSI", 1, ACPI_RTYPE_INTEGER},
/* TBD: */
_PRT - currently ignore reversed entries. Attempt to fix here?
Think about code that attempts to fix package elements like _BIF, etc.
#endif
#endif

View File

@ -318,6 +318,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_MUTEX_HANDLE", SRC_TYPE_SIMPLE},
{"ACPI_MUTEX_INFO", SRC_TYPE_STRUCT},
{"ACPI_NAME", SRC_TYPE_SIMPLE},
{"ACPI_NAME_INFO", SRC_TYPE_STRUCT},
{"ACPI_NAME_UNION", SRC_TYPE_UNION},
{"ACPI_NAMESPACE_NODE", SRC_TYPE_STRUCT},
{"ACPI_NAMESTRING_INFO", SRC_TYPE_STRUCT},
@ -363,6 +364,9 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_OSD_HANDLER", SRC_TYPE_SIMPLE},
{"ACPI_OSD_EXEC_CALLBACK", SRC_TYPE_SIMPLE},
{"ACPI_OWNER_ID", SRC_TYPE_SIMPLE},
{"ACPI_PACKAGE_INFO", SRC_TYPE_STRUCT},
{"ACPI_PACKAGE_INFO2", SRC_TYPE_STRUCT},
{"ACPI_PACKAGE_INFO3", SRC_TYPE_STRUCT},
{"ACPI_PARSE_DOWNWARDS", SRC_TYPE_SIMPLE},
{"ACPI_PARSE_OBJ_ASL", SRC_TYPE_STRUCT},
{"ACPI_PARSE_OBJ_COMMON", SRC_TYPE_STRUCT},
@ -379,6 +383,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_PKG_STATE", SRC_TYPE_STRUCT},
{"ACPI_POINTER", SRC_TYPE_STRUCT},
{"ACPI_POINTERS", SRC_TYPE_UNION},
{"ACPI_PREDEFINED_INFO", SRC_TYPE_UNION},
{"ACPI_PREDEFINED_NAMES", SRC_TYPE_STRUCT},
{"ACPI_PSCOPE_STATE", SRC_TYPE_STRUCT},
{"ACPI_RESOURCE", SRC_TYPE_STRUCT},