Update ACPI to 20100121.
Changes from ACPI include: * eliminate unnecessary invocations of the _STA method, which in turn can improve boot times. * Implemented an additional repair for predefined method return values. * Removed the obsolete ACPI_INTEGER data type. * Removed the unused UINT32_STRUCT type, and the obsolete Integer64 field in the parse tree object. * Added additional warning options for the gcc-4 generation. * Enhanced automatic data type conversions for predefined name repairs. * Implemented automatic removal of null package elements during predefined name repairs. * Implemented a repair for the predefined _FDE and _GTM names. * Implemented additional module-level code support. * Fixed possible mutex acquisition errors when running _REG methods. * Fixed a possible memory leak during module-level code execution. * Removed messages for successful predefined repair(s). * Implemented a post-order callback to AcpiWalkNamespace. * Modified the behavior of the operation region memory mapping cache for SystemMemory. * Implemented an automatic repair for predefined methods that must return sorted lists. * Fixed a possible fault during predefined name validation if a return Package object contains NULL elements. * Implemented additional module-level executable AML code support. * Fixed a problem where an Operation Region _REG method could be executed more than once. * Fixed a possible memory leak for the Scope() ASL operator. * Implemented a run-time repair for the _MAT predefined method. * Implemented a run-time repair for the _BIF and _BIX predefined methods. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35559 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -103,6 +103,7 @@ local namespace_src =
|
||||
nsparse.c
|
||||
nspredef.c
|
||||
nsrepair.c
|
||||
nsrepair2.c
|
||||
nssearch.c
|
||||
nsutils.c
|
||||
nswalk.c
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -119,7 +119,6 @@
|
||||
#include "acapps.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_TOOLS
|
||||
@@ -135,12 +134,13 @@ AdWriteBuffer (
|
||||
|
||||
char FilenameBuf[20];
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AfGenerateFilename
|
||||
*
|
||||
* PARAMETERS: Prefix - prefix string
|
||||
* TableId - The table ID
|
||||
* PARAMETERS: Prefix - prefix string
|
||||
* TableId - The table ID
|
||||
*
|
||||
* RETURN: Pointer to the completed string
|
||||
*
|
||||
@@ -180,9 +180,9 @@ AdGenerateFilename (
|
||||
*
|
||||
* FUNCTION: AfWriteBuffer
|
||||
*
|
||||
* PARAMETERS: Filename - name of file
|
||||
* Buffer - data to write
|
||||
* Length - length of data
|
||||
* PARAMETERS: Filename - name of file
|
||||
* Buffer - data to write
|
||||
* Length - length of data
|
||||
*
|
||||
* RETURN: Actual number of bytes written
|
||||
*
|
||||
@@ -217,10 +217,10 @@ AdWriteBuffer (
|
||||
*
|
||||
* FUNCTION: AfWriteTable
|
||||
*
|
||||
* PARAMETERS: Table - pointer to the ACPI table
|
||||
* Length - length of the table
|
||||
* TableName - the table signature
|
||||
* OemTableID - from the table header
|
||||
* PARAMETERS: Table - pointer to the ACPI table
|
||||
* Length - length of the table
|
||||
* TableName - the table signature
|
||||
* OemTableID - from the table header
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@@ -272,7 +272,7 @@ FlGenerateFilename (
|
||||
* Copy the original filename to a new buffer. Leave room for the worst case
|
||||
* where we append the suffix, an added dot and the null terminator.
|
||||
*/
|
||||
NewFilename = ACPI_ALLOCATE_ZEROED (
|
||||
NewFilename = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE)
|
||||
strlen (InputFilename) + strlen (Suffix) + 2);
|
||||
strcpy (NewFilename, InputFilename);
|
||||
|
||||
@@ -314,7 +314,7 @@ FlStrdup (
|
||||
char *NewString;
|
||||
|
||||
|
||||
NewString = ACPI_ALLOCATE (strlen (String) + 1);
|
||||
NewString = ACPI_ALLOCATE ((ACPI_SIZE) strlen (String) + 1);
|
||||
if (!NewString)
|
||||
{
|
||||
return (NULL);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -132,14 +132,18 @@
|
||||
#define _COMPONENT ACPI_TOOLS
|
||||
ACPI_MODULE_NAME ("adisasm")
|
||||
|
||||
extern int AslCompilerdebug;
|
||||
|
||||
extern int AslCompilerdebug;
|
||||
extern char *Gbl_ExternalFilename;
|
||||
|
||||
|
||||
ACPI_STATUS
|
||||
LsDisplayNamespace (
|
||||
void);
|
||||
|
||||
void
|
||||
LsSetupNsList (void * Handle);
|
||||
LsSetupNsList (
|
||||
void *Handle);
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
@@ -153,14 +157,6 @@ void
|
||||
AdDisassemblerHeader (
|
||||
char *Filename);
|
||||
|
||||
void
|
||||
AdAddExternalsToNamespace (
|
||||
void);
|
||||
|
||||
UINT32
|
||||
AdMethodExternalCount (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AdDeferredParse (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
@@ -171,8 +167,6 @@ ACPI_STATUS
|
||||
AdParseDeferredOps (
|
||||
ACPI_PARSE_OBJECT *Root);
|
||||
|
||||
ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot;
|
||||
|
||||
|
||||
/* Stubs for ASL compiler */
|
||||
|
||||
@@ -192,7 +186,6 @@ AcpiDsMethodError (
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
ACPI_STATUS
|
||||
@@ -238,18 +231,19 @@ AcpiDsMethodDataInitArgs (
|
||||
}
|
||||
|
||||
|
||||
ACPI_TABLE_DESC LocalTables[1];
|
||||
static ACPI_TABLE_DESC LocalTables[1];
|
||||
static ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AdInitialize
|
||||
*
|
||||
* PARAMETERS: None.
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: CA initialization
|
||||
* DESCRIPTION: ACPICA and local initialization
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -296,89 +290,15 @@ AdInitialize (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AdAddExternalsToNamespace
|
||||
*
|
||||
* PARAMETERS:
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AdAddExternalsToNamespace (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList;
|
||||
ACPI_OPERAND_OBJECT *MethodDesc;
|
||||
|
||||
|
||||
while (External)
|
||||
{
|
||||
Status = AcpiNsLookup (NULL, External->InternalPath, External->Type,
|
||||
ACPI_IMODE_LOAD_PASS1, ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE,
|
||||
NULL, &Node);
|
||||
|
||||
if (External->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
MethodDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
|
||||
MethodDesc->Method.ParamCount = (UINT8) External->Value;
|
||||
Node->Object = MethodDesc;
|
||||
}
|
||||
|
||||
External = External->Next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AdMethodExternalCount
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Return the number of externals that have been generated
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
AdMethodExternalCount (
|
||||
void)
|
||||
{
|
||||
ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList;
|
||||
UINT32 Count = 0;
|
||||
|
||||
|
||||
while (External)
|
||||
{
|
||||
if (External->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
Count++;
|
||||
}
|
||||
|
||||
External = External->Next;
|
||||
}
|
||||
|
||||
return (Count);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AdAmlDisassemble
|
||||
*
|
||||
* PARAMETERS: Filename - AML input filename
|
||||
* OutToFile - TRUE if output should go to a file
|
||||
* Prefix - Path prefix for output
|
||||
* OutFilename - where the filename is returned
|
||||
* GetAllTables - TRUE if all tables are desired
|
||||
* PARAMETERS: Filename - AML input filename
|
||||
* OutToFile - TRUE if output should go to a file
|
||||
* Prefix - Path prefix for output
|
||||
* OutFilename - where the filename is returned
|
||||
* GetAllTables - TRUE if all tables are desired
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
@@ -386,8 +306,6 @@ AdMethodExternalCount (
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
extern char *Gbl_ExternalFilename;
|
||||
|
||||
ACPI_STATUS
|
||||
AdAmlDisassemble (
|
||||
BOOLEAN OutToFile,
|
||||
@@ -403,12 +321,11 @@ AdAmlDisassemble (
|
||||
ACPI_TABLE_HEADER *Table = NULL;
|
||||
ACPI_TABLE_HEADER *ExternalTable;
|
||||
ACPI_OWNER_ID OwnerId;
|
||||
ACPI_EXTERNAL_LIST *NextExternal;
|
||||
|
||||
|
||||
/*
|
||||
* Input: AML Code from either a file,
|
||||
* or via GetTables (memory or registry)
|
||||
* Input: AML code from either a file or via GetTables (memory or
|
||||
* registry)
|
||||
*/
|
||||
if (Filename)
|
||||
{
|
||||
@@ -462,13 +379,7 @@ AdAmlDisassemble (
|
||||
|
||||
/* Clear external list generated by Scope in external tables */
|
||||
|
||||
while (AcpiGbl_ExternalList)
|
||||
{
|
||||
NextExternal = AcpiGbl_ExternalList->Next;
|
||||
ACPI_FREE (AcpiGbl_ExternalList->Path);
|
||||
ACPI_FREE (AcpiGbl_ExternalList);
|
||||
AcpiGbl_ExternalList = NextExternal;
|
||||
}
|
||||
AcpiDmClearExternalList ();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -501,8 +412,7 @@ AdAmlDisassemble (
|
||||
}
|
||||
|
||||
/*
|
||||
* Output: ASL code.
|
||||
* Redirect to a file if requested
|
||||
* Output: ASL code. Redirect to a file if requested
|
||||
*/
|
||||
if (OutToFile)
|
||||
{
|
||||
@@ -589,11 +499,11 @@ AdAmlDisassemble (
|
||||
* tree with the new information (namely, the number of arguments per
|
||||
* method)
|
||||
*/
|
||||
if (AdMethodExternalCount ())
|
||||
if (AcpiDmGetExternalMethodCount ())
|
||||
{
|
||||
fprintf (stderr,
|
||||
"\nFound %d external control methods, reparsing with new information\n",
|
||||
AdMethodExternalCount());
|
||||
AcpiDmGetExternalMethodCount ());
|
||||
|
||||
/*
|
||||
* Reparse, rebuild namespace. no need to xref namespace
|
||||
@@ -611,7 +521,7 @@ AdAmlDisassemble (
|
||||
AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST;
|
||||
|
||||
Status = AcpiNsRootInitialize ();
|
||||
AdAddExternalsToNamespace ();
|
||||
AcpiDmAddExternalsToNamespace ();
|
||||
|
||||
/* Parse table. No need to reload it, however (FALSE) */
|
||||
|
||||
@@ -855,9 +765,9 @@ AdDisplayTables (
|
||||
*
|
||||
* FUNCTION: AdDeferredParse
|
||||
*
|
||||
* PARAMETERS: Op - Root Op of the deferred opcode
|
||||
* Aml - Pointer to the raw AML
|
||||
* AmlLength - Length of the AML
|
||||
* PARAMETERS: Op - Root Op of the deferred opcode
|
||||
* Aml - Pointer to the raw AML
|
||||
* AmlLength - Length of the AML
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
@@ -981,7 +891,7 @@ AdDeferredParse (
|
||||
*
|
||||
* FUNCTION: AdParseDeferredOps
|
||||
*
|
||||
* PARAMETERS: Root - Root of the parse tree
|
||||
* PARAMETERS: Root - Root of the parse tree
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
@@ -1055,8 +965,8 @@ AdParseDeferredOps (
|
||||
*
|
||||
* FUNCTION: AdGetLocalTables
|
||||
*
|
||||
* PARAMETERS: Filename - Not used
|
||||
* GetAllTables - TRUE if all tables are desired
|
||||
* PARAMETERS: Filename - Not used
|
||||
* GetAllTables - TRUE if all tables are desired
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
@@ -1138,6 +1048,11 @@ AdGetLocalTables (
|
||||
|
||||
Status = AcpiTbStoreTable (0, NewTable, NewTable->Length,
|
||||
0, &TableIndex);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
fprintf (stderr, "Could not store DSDT\n");
|
||||
return AE_NO_ACPI_TABLES;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1169,10 +1084,10 @@ AdGetLocalTables (
|
||||
*
|
||||
* FUNCTION: AdParseTable
|
||||
*
|
||||
* PARAMETERS: Table - Pointer to the raw table
|
||||
* OwnerId - Returned OwnerId of the table
|
||||
* LoadTable - If add table to the global table list
|
||||
* External - If this is an external table
|
||||
* PARAMETERS: Table - Pointer to the raw table
|
||||
* OwnerId - Returned OwnerId of the table
|
||||
* LoadTable - If add table to the global table list
|
||||
* External - If this is an external table
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -118,7 +118,6 @@
|
||||
#include "accommon.h"
|
||||
#include "acparser.h"
|
||||
#include "amlcode.h"
|
||||
#include "acdebug.h"
|
||||
#include "acdisasm.h"
|
||||
#include "acdispat.h"
|
||||
#include "acnamesp.h"
|
||||
@@ -184,7 +183,7 @@ AcpiDmResourceDescendingOp (
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpTree
|
||||
*
|
||||
* PARAMETERS: Origin - Starting object
|
||||
* PARAMETERS: Origin - Starting object
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@@ -218,7 +217,7 @@ AcpiDmDumpTree (
|
||||
*
|
||||
* FUNCTION: AcpiDmFindOrphanMethods
|
||||
*
|
||||
* PARAMETERS: Origin - Starting object
|
||||
* PARAMETERS: Origin - Starting object
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@@ -426,7 +425,6 @@ AcpiDmDumpDescending (
|
||||
void *Context)
|
||||
{
|
||||
ACPI_OP_WALK_INFO *Info = Context;
|
||||
const ACPI_OPCODE_INFO *OpInfo;
|
||||
char *Path;
|
||||
|
||||
|
||||
@@ -435,11 +433,9 @@ AcpiDmDumpDescending (
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
|
||||
Info->Count++;
|
||||
|
||||
/* Most of the information (count, level, name) here */
|
||||
|
||||
Info->Count++;
|
||||
AcpiOsPrintf ("% 5d [%2.2d] ", Info->Count, Level);
|
||||
AcpiDmIndent (Level);
|
||||
AcpiOsPrintf ("%-28s", AcpiPsGetOpcodeName (Op->Common.AmlOpcode));
|
||||
@@ -472,7 +468,7 @@ AcpiDmDumpDescending (
|
||||
case AML_METHOD_OP:
|
||||
case AML_DEVICE_OP:
|
||||
case AML_INT_NAMEDFIELD_OP:
|
||||
AcpiOsPrintf ("%4.4s", &Op->Named.Name);
|
||||
AcpiOsPrintf ("%4.4s", ACPI_CAST_PTR (char, &Op->Named.Name));
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -536,7 +532,7 @@ AcpiDmFindOrphanDescending (
|
||||
{
|
||||
/* This NamePath has no args, assume it is an integer */
|
||||
|
||||
AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
@@ -547,11 +543,11 @@ AcpiDmFindOrphanDescending (
|
||||
{
|
||||
/* One Arg means this is just a Store(Name,Target) */
|
||||
|
||||
AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
|
||||
AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
@@ -567,7 +563,7 @@ AcpiDmFindOrphanDescending (
|
||||
{
|
||||
/* This NamePath has no args, assume it is an integer */
|
||||
|
||||
AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
@@ -576,11 +572,11 @@ AcpiDmFindOrphanDescending (
|
||||
{
|
||||
/* One Arg means this is just a Store(Name,Target) */
|
||||
|
||||
AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
|
||||
AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -611,7 +607,7 @@ AcpiDmFindOrphanDescending (
|
||||
/* And namepath is the first argument */
|
||||
(ParentOp->Common.Value.Arg == Op))
|
||||
{
|
||||
AcpiDmAddToExternalList (Op->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -621,7 +617,7 @@ AcpiDmFindOrphanDescending (
|
||||
* operator) - it *must* be a method invocation, nothing else is
|
||||
* grammatically possible.
|
||||
*/
|
||||
AcpiDmAddToExternalList (Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
|
||||
AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
|
||||
|
||||
}
|
||||
break;
|
||||
@@ -858,7 +854,7 @@ AcpiDmXrefDescendingOp (
|
||||
{
|
||||
if (Status == AE_NOT_FOUND)
|
||||
{
|
||||
AcpiDmAddToExternalList (Path, (UINT8) ObjectType, 0);
|
||||
AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType, 0);
|
||||
|
||||
/*
|
||||
* We could install this into the namespace, but we catch duplicate
|
||||
@@ -888,12 +884,12 @@ AcpiDmXrefDescendingOp (
|
||||
|
||||
if (ObjectType2 == ACPI_TYPE_METHOD)
|
||||
{
|
||||
AcpiDmAddToExternalList (Path, ACPI_TYPE_METHOD,
|
||||
AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_METHOD,
|
||||
Object->Method.ParamCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiDmAddToExternalList (Path, (UINT8) ObjectType2, 0);
|
||||
AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, 0);
|
||||
}
|
||||
|
||||
Op->Common.Node = Node;
|
||||
|
||||
@@ -0,0 +1,646 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dmextern - Support for External() ASL statements
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, 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.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "amlcode.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acdisasm.h"
|
||||
|
||||
|
||||
/*
|
||||
* This module is used for application-level code (iASL disassembler) only.
|
||||
*
|
||||
* It contains the code to create and emit any necessary External() ASL
|
||||
* statements for the module being disassembled.
|
||||
*/
|
||||
#define _COMPONENT ACPI_CA_DISASSEMBLER
|
||||
ACPI_MODULE_NAME ("dmextern")
|
||||
|
||||
|
||||
/*
|
||||
* This table maps ACPI_OBJECT_TYPEs to the corresponding ASL
|
||||
* ObjectTypeKeyword. Used to generate typed external declarations
|
||||
*/
|
||||
static const char *AcpiGbl_DmTypeNames[] =
|
||||
{
|
||||
/* 00 */ "", /* Type ANY */
|
||||
/* 01 */ ", IntObj",
|
||||
/* 02 */ ", StrObj",
|
||||
/* 03 */ ", BuffObj",
|
||||
/* 04 */ ", PkgObj",
|
||||
/* 05 */ ", FieldUnitObj",
|
||||
/* 06 */ ", DeviceObj",
|
||||
/* 07 */ ", EventObj",
|
||||
/* 08 */ ", MethodObj",
|
||||
/* 09 */ ", MutexObj",
|
||||
/* 10 */ ", OpRegionObj",
|
||||
/* 11 */ ", PowerResObj",
|
||||
/* 12 */ ", ProcessorObj",
|
||||
/* 13 */ ", ThermalZoneObj",
|
||||
/* 14 */ ", BuffFieldObj",
|
||||
/* 15 */ ", DDBHandleObj",
|
||||
/* 16 */ "", /* Debug object */
|
||||
/* 17 */ ", FieldUnitObj",
|
||||
/* 18 */ ", FieldUnitObj",
|
||||
/* 19 */ ", FieldUnitObj"
|
||||
};
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static const char *
|
||||
AcpiDmGetObjectTypeName (
|
||||
ACPI_OBJECT_TYPE Type);
|
||||
|
||||
static char *
|
||||
AcpiDmNormalizeParentPrefix (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *Path);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmGetObjectTypeName
|
||||
*
|
||||
* PARAMETERS: Type - An ACPI_OBJECT_TYPE
|
||||
*
|
||||
* RETURN: Pointer to a string
|
||||
*
|
||||
* DESCRIPTION: Map an object type to the ASL object type string.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static const char *
|
||||
AcpiDmGetObjectTypeName (
|
||||
ACPI_OBJECT_TYPE Type)
|
||||
{
|
||||
|
||||
if (Type == ACPI_TYPE_LOCAL_SCOPE)
|
||||
{
|
||||
Type = ACPI_TYPE_DEVICE;
|
||||
}
|
||||
|
||||
else if (Type > ACPI_TYPE_LOCAL_INDEX_FIELD)
|
||||
{
|
||||
return ("");
|
||||
}
|
||||
|
||||
return (AcpiGbl_DmTypeNames[Type]);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmNormalizeParentPrefix
|
||||
*
|
||||
* PARAMETERS: Op - Parse op
|
||||
* Path - Path with parent prefix
|
||||
*
|
||||
* RETURN: The full pathname to the object (from the namespace root)
|
||||
*
|
||||
* DESCRIPTION: Returns the full pathname of a path with parent prefix
|
||||
* The caller must free the fullpath returned.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static char *
|
||||
AcpiDmNormalizeParentPrefix (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *Path)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
char *Fullpath;
|
||||
char *ParentPath;
|
||||
ACPI_SIZE Length;
|
||||
|
||||
|
||||
/* Search upwards in the parse tree until we reach a namespace node */
|
||||
|
||||
while (Op)
|
||||
{
|
||||
if (Op->Common.Node)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Op = Op->Common.Parent;
|
||||
}
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the actual parent node for the reference:
|
||||
* Remove all carat prefixes from the input path.
|
||||
* There may be multiple parent prefixes (For example, ^^^M000)
|
||||
*/
|
||||
Node = Op->Common.Node;
|
||||
while (Node && (*Path == (UINT8) AML_PARENT_PREFIX))
|
||||
{
|
||||
Node = AcpiNsGetParentNode (Node);
|
||||
Path++;
|
||||
}
|
||||
|
||||
if (!Node)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Get the full pathname for the parent node */
|
||||
|
||||
ParentPath = AcpiNsGetExternalPathname (Node);
|
||||
if (!ParentPath)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
Length = (ACPI_STRLEN (ParentPath) + ACPI_STRLEN (Path) + 1);
|
||||
Fullpath = ACPI_ALLOCATE_ZEROED (Length);
|
||||
if (!Fullpath)
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/*
|
||||
* Concatenate parent fullpath and path. For example,
|
||||
* parent fullpath "\_SB_", Path "^INIT", Fullpath "\_SB_.INIT"
|
||||
*
|
||||
* Copy the parent path
|
||||
*/
|
||||
ACPI_STRCAT (Fullpath, ParentPath);
|
||||
|
||||
/* Add dot separator (don't need dot if parent fullpath is a single "\") */
|
||||
|
||||
if (ParentPath[1])
|
||||
{
|
||||
ACPI_STRCAT (Fullpath, ".");
|
||||
}
|
||||
|
||||
/* Copy child path (carat parent prefix(es) were skipped above) */
|
||||
|
||||
ACPI_STRCAT (Fullpath, Path);
|
||||
|
||||
Cleanup:
|
||||
ACPI_FREE (ParentPath);
|
||||
return (Fullpath);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmAddToExternalList
|
||||
*
|
||||
* PARAMETERS: Op - Current parser Op
|
||||
* Path - Internal (AML) path to the object
|
||||
* Type - ACPI object type to be added
|
||||
* Value - Arg count if adding a Method object
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Insert a new name into the global list of Externals which
|
||||
* will in turn be later emitted as an External() declaration
|
||||
* in the disassembled output.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmAddToExternalList (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *Path,
|
||||
UINT8 Type,
|
||||
UINT32 Value)
|
||||
{
|
||||
char *ExternalPath;
|
||||
char *Fullpath = NULL;
|
||||
ACPI_EXTERNAL_LIST *NewExternal;
|
||||
ACPI_EXTERNAL_LIST *NextExternal;
|
||||
ACPI_EXTERNAL_LIST *PrevExternal = NULL;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
if (!Path)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Externalize the ACPI path */
|
||||
|
||||
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path,
|
||||
NULL, &ExternalPath);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get the full pathname from root if "Path" has a parent prefix */
|
||||
|
||||
if (*Path == (UINT8) AML_PARENT_PREFIX)
|
||||
{
|
||||
Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
|
||||
if (Fullpath)
|
||||
{
|
||||
/* Set new external path */
|
||||
|
||||
ACPI_FREE (ExternalPath);
|
||||
ExternalPath = Fullpath;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check all existing externals to ensure no duplicates */
|
||||
|
||||
NextExternal = AcpiGbl_ExternalList;
|
||||
while (NextExternal)
|
||||
{
|
||||
if (!ACPI_STRCMP (ExternalPath, NextExternal->Path))
|
||||
{
|
||||
/* Duplicate method, check that the Value (ArgCount) is the same */
|
||||
|
||||
if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
|
||||
(NextExternal->Value != Value))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Argument count mismatch for method %s %d %d",
|
||||
NextExternal->Path, NextExternal->Value, Value));
|
||||
}
|
||||
|
||||
/* Allow upgrade of type from ANY */
|
||||
|
||||
else if (NextExternal->Type == ACPI_TYPE_ANY)
|
||||
{
|
||||
NextExternal->Type = Type;
|
||||
NextExternal->Value = Value;
|
||||
}
|
||||
|
||||
ACPI_FREE (ExternalPath);
|
||||
return;
|
||||
}
|
||||
|
||||
NextExternal = NextExternal->Next;
|
||||
}
|
||||
|
||||
/* Allocate and init a new External() descriptor */
|
||||
|
||||
NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST));
|
||||
if (!NewExternal)
|
||||
{
|
||||
ACPI_FREE (ExternalPath);
|
||||
return;
|
||||
}
|
||||
|
||||
NewExternal->Path = ExternalPath;
|
||||
NewExternal->Type = Type;
|
||||
NewExternal->Value = Value;
|
||||
NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
|
||||
|
||||
/* Was the external path with parent prefix normalized to a fullpath? */
|
||||
|
||||
if (Fullpath == ExternalPath)
|
||||
{
|
||||
/* Get new internal path */
|
||||
|
||||
Status = AcpiNsInternalizeName (ExternalPath, &Path);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (ExternalPath);
|
||||
ACPI_FREE (NewExternal);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set flag to indicate External->InternalPath need to be freed */
|
||||
|
||||
NewExternal->Flags |= ACPI_IPATH_ALLOCATED;
|
||||
}
|
||||
|
||||
NewExternal->InternalPath = Path;
|
||||
|
||||
/* Link the new descriptor into the global list, ordered by string length */
|
||||
|
||||
NextExternal = AcpiGbl_ExternalList;
|
||||
while (NextExternal)
|
||||
{
|
||||
if (NewExternal->Length <= NextExternal->Length)
|
||||
{
|
||||
if (PrevExternal)
|
||||
{
|
||||
PrevExternal->Next = NewExternal;
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiGbl_ExternalList = NewExternal;
|
||||
}
|
||||
|
||||
NewExternal->Next = NextExternal;
|
||||
return;
|
||||
}
|
||||
|
||||
PrevExternal = NextExternal;
|
||||
NextExternal = NextExternal->Next;
|
||||
}
|
||||
|
||||
if (PrevExternal)
|
||||
{
|
||||
PrevExternal->Next = NewExternal;
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiGbl_ExternalList = NewExternal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmAddExternalsToNamespace
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Add all externals to the namespace. Allows externals to be
|
||||
* "resolved".
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmAddExternalsToNamespace (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_OPERAND_OBJECT *MethodDesc;
|
||||
ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList;
|
||||
|
||||
|
||||
while (External)
|
||||
{
|
||||
/* Add the external name (object) into the namespace */
|
||||
|
||||
Status = AcpiNsLookup (NULL, External->InternalPath, External->Type,
|
||||
ACPI_IMODE_LOAD_PASS1,
|
||||
ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE,
|
||||
NULL, &Node);
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"while adding external to namespace [%s]",
|
||||
External->Path));
|
||||
}
|
||||
else if (External->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
/* For methods, we need to save the argument count */
|
||||
|
||||
MethodDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
|
||||
MethodDesc->Method.ParamCount = (UINT8) External->Value;
|
||||
Node->Object = MethodDesc;
|
||||
}
|
||||
|
||||
External = External->Next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmGetExternalMethodCount
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: The number of control method externals in the external list
|
||||
*
|
||||
* DESCRIPTION: Return the number of method externals that have been generated.
|
||||
* If any control method externals have been found, we must
|
||||
* re-parse the entire definition block with the new information
|
||||
* (number of arguments for the methods.) This is limitation of
|
||||
* AML, we don't know the number of arguments from the control
|
||||
* method invocation itself.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
AcpiDmGetExternalMethodCount (
|
||||
void)
|
||||
{
|
||||
ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList;
|
||||
UINT32 Count = 0;
|
||||
|
||||
|
||||
while (External)
|
||||
{
|
||||
if (External->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
Count++;
|
||||
}
|
||||
|
||||
External = External->Next;
|
||||
}
|
||||
|
||||
return (Count);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmClearExternalList
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Free the entire External info list
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmClearExternalList (
|
||||
void)
|
||||
{
|
||||
ACPI_EXTERNAL_LIST *NextExternal;
|
||||
|
||||
|
||||
while (AcpiGbl_ExternalList)
|
||||
{
|
||||
NextExternal = AcpiGbl_ExternalList->Next;
|
||||
ACPI_FREE (AcpiGbl_ExternalList->Path);
|
||||
ACPI_FREE (AcpiGbl_ExternalList);
|
||||
AcpiGbl_ExternalList = NextExternal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmEmitExternals
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Emit an External() ASL statement for each of the externals in
|
||||
* the global external info list.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmEmitExternals (
|
||||
void)
|
||||
{
|
||||
ACPI_EXTERNAL_LIST *NextExternal;
|
||||
|
||||
|
||||
if (!AcpiGbl_ExternalList)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Walk the list of externals (unresolved references)
|
||||
* found during the AML parsing
|
||||
*/
|
||||
while (AcpiGbl_ExternalList)
|
||||
{
|
||||
AcpiOsPrintf (" External (%s%s",
|
||||
AcpiGbl_ExternalList->Path,
|
||||
AcpiDmGetObjectTypeName (AcpiGbl_ExternalList->Type));
|
||||
|
||||
if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
AcpiOsPrintf (") // %d Arguments\n",
|
||||
AcpiGbl_ExternalList->Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (")\n");
|
||||
}
|
||||
|
||||
/* Free this external info block and move on to next external */
|
||||
|
||||
NextExternal = AcpiGbl_ExternalList->Next;
|
||||
if (AcpiGbl_ExternalList->Flags & ACPI_IPATH_ALLOCATED)
|
||||
{
|
||||
ACPI_FREE (AcpiGbl_ExternalList->InternalPath);
|
||||
}
|
||||
|
||||
ACPI_FREE (AcpiGbl_ExternalList->Path);
|
||||
ACPI_FREE (AcpiGbl_ExternalList);
|
||||
AcpiGbl_ExternalList = NextExternal;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -218,7 +218,6 @@ static const char *AcpiDmIvrsSubnames[] =
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define ACPI_FADT_PM_RESERVED 8
|
||||
|
||||
static const char *AcpiDmFadtProfiles[] =
|
||||
@@ -954,7 +953,7 @@ AcpiDmCheckAscii (
|
||||
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
RepairedName[i] = Name[i];
|
||||
RepairedName[i] = (char) Name[i];
|
||||
|
||||
if (!Name[i])
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -195,9 +195,9 @@ AcpiGetopt(
|
||||
|
||||
if (*++OptsPtr == ':')
|
||||
{
|
||||
if (argv[AcpiGbl_Optind][CurrentCharPtr+1] != '\0')
|
||||
if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0')
|
||||
{
|
||||
AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][CurrentCharPtr+1];
|
||||
AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][(int) (CurrentCharPtr+1)];
|
||||
}
|
||||
else if (++AcpiGbl_Optind >= argc)
|
||||
{
|
||||
@@ -218,9 +218,9 @@ AcpiGetopt(
|
||||
|
||||
else if (*OptsPtr == '^')
|
||||
{
|
||||
if (argv[AcpiGbl_Optind][CurrentCharPtr+1] != '\0')
|
||||
if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0')
|
||||
{
|
||||
AcpiGbl_Optarg = &argv[AcpiGbl_Optind][CurrentCharPtr+1];
|
||||
AcpiGbl_Optarg = &argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -71,6 +71,7 @@ SRCS= aslcompilerparse.c aslcompilerlex.c aslanalyze.c aslcodegen.c \
|
||||
../common/adfile.c \
|
||||
../common/adisasm.c \
|
||||
../common/adwalk.c \
|
||||
../common/dmextern.c \
|
||||
../common/dmrestag.c \
|
||||
../common/dmtable.c \
|
||||
../common/dmtbinfo.c \
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -667,8 +667,8 @@ AnCheckForReservedName (
|
||||
{
|
||||
/* The next two characters must be hex digits */
|
||||
|
||||
if ((isxdigit (Name[2])) &&
|
||||
(isxdigit (Name[3])))
|
||||
if ((isxdigit ((int) Name[2])) &&
|
||||
(isxdigit ((int) Name[3])))
|
||||
{
|
||||
return (ACPI_EVENT_RESERVED_NAME);
|
||||
}
|
||||
@@ -1236,7 +1236,7 @@ AnMethodAnalysisWalkBegin (
|
||||
*/
|
||||
for (i = 0; Next->Asl.Value.String[i]; i++)
|
||||
{
|
||||
if (!isalnum (Next->Asl.Value.String[i]))
|
||||
if (!isalnum ((int) Next->Asl.Value.String[i]))
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING,
|
||||
Next, Next->Asl.Value.String);
|
||||
@@ -2157,7 +2157,7 @@ AnOtherSemanticAnalysisWalkBegin (
|
||||
*/
|
||||
if (((ArgNode->Asl.ParseOpcode == PARSEOP_WORDCONST) ||
|
||||
(ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER)) &&
|
||||
(ArgNode->Asl.Value.Integer >= (ACPI_INTEGER) ACPI_WAIT_FOREVER))
|
||||
(ArgNode->Asl.Value.Integer >= (UINT64) ACPI_WAIT_FOREVER))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -895,6 +895,14 @@ CmCleanupAndExit (
|
||||
10) / Gbl_NsLookupCount);
|
||||
}
|
||||
|
||||
|
||||
if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
|
||||
{
|
||||
printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT);
|
||||
}
|
||||
|
||||
UtDisplaySummary (ASL_FILE_STDOUT);
|
||||
|
||||
/* Close all open files */
|
||||
|
||||
for (i = 2; i < ASL_MAX_FILE_TYPE; i++)
|
||||
@@ -902,14 +910,6 @@ CmCleanupAndExit (
|
||||
FlCloseFile (i);
|
||||
}
|
||||
|
||||
/*
|
||||
* TBD: SourceOutput should be .TMP, then rename if we want to keep it?
|
||||
*/
|
||||
if (!Gbl_SourceOutputFlag)
|
||||
{
|
||||
remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
|
||||
}
|
||||
|
||||
/* Delete AML file if there are errors */
|
||||
|
||||
if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors))
|
||||
@@ -917,12 +917,19 @@ CmCleanupAndExit (
|
||||
remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename);
|
||||
}
|
||||
|
||||
if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
|
||||
/*
|
||||
* Delete intermediate ("combined") source file (if -ls flag not set)
|
||||
*
|
||||
* TBD: SourceOutput should be .TMP, then rename if we want to keep it?
|
||||
*/
|
||||
if (!Gbl_SourceOutputFlag)
|
||||
{
|
||||
printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT);
|
||||
if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename))
|
||||
{
|
||||
printf ("Could not remove SRC file, %s\n",
|
||||
Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
|
||||
}
|
||||
}
|
||||
|
||||
UtDisplaySummary (ASL_FILE_STDOUT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -511,7 +511,7 @@ TrCreateLeafNode (
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateValuedLeafNode (
|
||||
UINT32 ParseOpcode,
|
||||
ACPI_INTEGER Value);
|
||||
UINT64 Value);
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrLinkChildren (
|
||||
@@ -718,7 +718,7 @@ UtCheckIntegerRange (
|
||||
UINT32 LowValue,
|
||||
UINT32 HighValue);
|
||||
|
||||
ACPI_INTEGER
|
||||
UINT64
|
||||
UtDoConstant (
|
||||
char *String);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
+137
-137
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -127,7 +127,7 @@
|
||||
#define IntelAcpiCA "Intel ACPI Component Architecture"
|
||||
#define CompilerId "ASL Optimizing Compiler"
|
||||
#define DisassemblerId "AML Disassembler"
|
||||
#define CompilerCopyright "Copyright (C) 2000 - 2009 Intel Corporation"
|
||||
#define CompilerCopyright "Copyright (c) 2000 - 2010 Intel Corporation"
|
||||
#define CompilerCompliance "Supports ACPI Specification Revision 4.0"
|
||||
#define CompilerName "iasl"
|
||||
#define CompilerCreatorId "INTL"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -169,13 +169,7 @@ AeAddToErrorLog (
|
||||
ASL_ERROR_MSG *Prev;
|
||||
|
||||
|
||||
if (!Gbl_ErrorLog)
|
||||
{
|
||||
Gbl_ErrorLog = Enode;
|
||||
return;
|
||||
}
|
||||
|
||||
/* List is sorted according to line number */
|
||||
/* If Gbl_ErrorLog is null, this is the first error node */
|
||||
|
||||
if (!Gbl_ErrorLog)
|
||||
{
|
||||
@@ -183,8 +177,10 @@ AeAddToErrorLog (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Walk error list until we find a line number greater than ours */
|
||||
|
||||
/*
|
||||
* Walk error list until we find a line number greater than ours.
|
||||
* List is sorted according to line number.
|
||||
*/
|
||||
Prev = NULL;
|
||||
Next = Gbl_ErrorLog;
|
||||
|
||||
@@ -535,6 +531,7 @@ AslCommonError (
|
||||
Gbl_NextError = Gbl_ErrorLog;
|
||||
CmDoOutputFiles ();
|
||||
CmCleanupAndExit ();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -165,7 +165,6 @@ ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_LineBufPtr, Gbl_Curren
|
||||
|
||||
ASL_EXTERN ASL_ERROR_MSG ASL_INIT_GLOBAL (*Gbl_ErrorLog,NULL);
|
||||
ASL_EXTERN ASL_ERROR_MSG ASL_INIT_GLOBAL (*Gbl_NextError,NULL);
|
||||
extern UINT32 Gbl_ExceptionCount[];
|
||||
|
||||
|
||||
/* Option flags */
|
||||
@@ -278,5 +277,12 @@ ASL_EXTERN char MsgBuffer[ASL_MSG_BUFFER_SIZE];
|
||||
ASL_EXTERN char StringBuffer[ASL_MSG_BUFFER_SIZE];
|
||||
ASL_EXTERN char StringBuffer2[ASL_MSG_BUFFER_SIZE];
|
||||
|
||||
|
||||
#ifdef _DECLARE_GLOBALS
|
||||
UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0};
|
||||
#else
|
||||
extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS];
|
||||
#endif
|
||||
|
||||
#endif /* __ASLGLOBAL_H */
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -534,7 +534,7 @@ LdNamespace1Begin (
|
||||
if (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC)
|
||||
{
|
||||
Status = LdLoadResourceElements (Op, WalkState);
|
||||
goto Exit;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
|
||||
@@ -575,8 +575,10 @@ LdNamespace1Begin (
|
||||
goto FinishNode;
|
||||
}
|
||||
|
||||
AslCoreSubsystemError (Op, Status, "Failure from lookup\n", FALSE);
|
||||
goto Exit;
|
||||
AslCoreSubsystemError (Op, Status,
|
||||
"Failure from namespace lookup", FALSE);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* We found a node with this name, now check the type */
|
||||
@@ -711,15 +713,14 @@ LdNamespace1Begin (
|
||||
|
||||
AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Op,
|
||||
Op->Asl.ExternalName);
|
||||
Status = AE_OK;
|
||||
goto Exit;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AslCoreSubsystemError (Op, Status,
|
||||
"Failure from lookup %s\n", FALSE);
|
||||
goto Exit;
|
||||
"Failure from namespace lookup", FALSE);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -757,8 +758,7 @@ FinishNode:
|
||||
Node->Value = (UINT32) Op->Asl.Extra;
|
||||
}
|
||||
|
||||
Exit:
|
||||
return (Status);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
@@ -885,7 +885,8 @@ LdNamespace2Begin (
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
AslCoreSubsystemError (Op, Status, "Failure from lookup\n", FALSE);
|
||||
AslCoreSubsystemError (Op, Status,
|
||||
"Failure from namespace lookup", FALSE);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -165,9 +165,6 @@ static int
|
||||
AslDoResponseFile (
|
||||
char *Filename);
|
||||
|
||||
extern int AcpiGbl_Opterr;
|
||||
extern int AcpiGbl_Optind;
|
||||
|
||||
|
||||
#define ASL_TOKEN_SEPARATORS " \t\n"
|
||||
#define ASL_SUPPORTED_OPTIONS "@:2b:cd^e:fgh^i^I:l^o:p:r:s:t:v:w:x:"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -328,7 +328,7 @@ OpcSetOptimalIntegerSize (
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_INTEGER_MAX:
|
||||
case ACPI_UINT64_MAX:
|
||||
|
||||
/* Check for table integer width (32 or 64) */
|
||||
|
||||
@@ -568,7 +568,7 @@ OpcDoEisaId (
|
||||
|
||||
if (i < 3)
|
||||
{
|
||||
if (!isupper (InString[i]))
|
||||
if (!isupper ((int) InString[i]))
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
}
|
||||
@@ -576,7 +576,7 @@ OpcDoEisaId (
|
||||
|
||||
/* Last 4 characters must be hex digits */
|
||||
|
||||
else if (!isxdigit (InString[i]))
|
||||
else if (!isxdigit ((int) InString[i]))
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
}
|
||||
@@ -666,7 +666,7 @@ OpcDoUuId (
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isxdigit (InString[i]))
|
||||
if (!isxdigit ((int) InString[i]))
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -604,7 +604,7 @@ OpnDoRegion (
|
||||
}
|
||||
else
|
||||
{
|
||||
Op->Asl.Value.Integer = ACPI_INTEGER_MAX;
|
||||
Op->Asl.Value.Integer = ACPI_UINT64_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -997,7 +1007,7 @@ OpnDoDefinitionBlock (
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (!isalnum (Gbl_TableSignature[i]))
|
||||
if (!isalnum ((int) Gbl_TableSignature[i]))
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child,
|
||||
"Contains non-alphanumeric characters");
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -184,7 +184,7 @@ RsCreateBitField (
|
||||
{
|
||||
|
||||
Op->Asl.ExternalName = Name;
|
||||
Op->Asl.Value.Integer = ((ACPI_INTEGER) ByteOffset * 8) + BitOffset;
|
||||
Op->Asl.Value.Integer = ((UINT64) ByteOffset * 8) + BitOffset;
|
||||
Op->Asl.CompileFlags |= (NODE_IS_RESOURCE_FIELD | NODE_IS_BIT_OFFSET);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
Executable → Regular
+1
-1
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -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;
|
||||
@@ -552,7 +554,7 @@ TrDoSwitch (
|
||||
|
||||
NewOp = NewOp2;
|
||||
NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESTRING,
|
||||
(ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName));
|
||||
(UINT64) ACPI_TO_INTEGER (PredicateValueName));
|
||||
NewOp->Asl.Next = NewOp2;
|
||||
TrAmlInitLineNumbers (NewOp2, Predicate);
|
||||
|
||||
@@ -610,7 +612,7 @@ TrDoSwitch (
|
||||
* CaseOp->Child->Peer is the beginning of the case block
|
||||
*/
|
||||
NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESTRING,
|
||||
(ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName));
|
||||
(UINT64) ACPI_TO_INTEGER (PredicateValueName));
|
||||
NewOp->Asl.Next = Predicate;
|
||||
TrAmlInitLineNumbers (NewOp, Predicate);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -762,7 +761,7 @@ TrDoSwitch (
|
||||
/* Create the NameSeg child for the Name node */
|
||||
|
||||
NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
|
||||
(ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName));
|
||||
(UINT64) ACPI_TO_INTEGER (PredicateValueName));
|
||||
NewOp2->Asl.CompileFlags |= NODE_IS_NAME_DECLARATION;
|
||||
NewOp->Asl.Child = NewOp2;
|
||||
|
||||
@@ -772,22 +771,22 @@ TrDoSwitch (
|
||||
{
|
||||
case ACPI_BTYPE_INTEGER:
|
||||
NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_ZERO,
|
||||
(ACPI_INTEGER) 0);
|
||||
(UINT64) 0);
|
||||
break;
|
||||
|
||||
case ACPI_BTYPE_STRING:
|
||||
NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL,
|
||||
(ACPI_INTEGER) ACPI_TO_INTEGER (""));
|
||||
(UINT64) ACPI_TO_INTEGER (""));
|
||||
break;
|
||||
|
||||
case ACPI_BTYPE_BUFFER:
|
||||
(void) TrLinkPeerNode (NewOp2, TrCreateValuedLeafNode (PARSEOP_BUFFER,
|
||||
(ACPI_INTEGER) 0));
|
||||
(UINT64) 0));
|
||||
Next = NewOp2->Asl.Next;
|
||||
(void) TrLinkChildren (Next, 1, TrCreateValuedLeafNode (PARSEOP_ZERO,
|
||||
(ACPI_INTEGER) 1));
|
||||
(UINT64) 1));
|
||||
(void) TrLinkPeerNode (Next->Asl.Child,
|
||||
TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (ACPI_INTEGER) 0));
|
||||
TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (UINT64) 0));
|
||||
|
||||
TrAmlSetSubtreeParent (Next->Asl.Child, Next);
|
||||
break;
|
||||
@@ -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;
|
||||
(UINT64) ACPI_TO_INTEGER (PredicateValueName));
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -490,7 +490,7 @@ TrCreateLeafNode (
|
||||
ACPI_PARSE_OBJECT *
|
||||
TrCreateValuedLeafNode (
|
||||
UINT32 ParseOpcode,
|
||||
ACPI_INTEGER Value)
|
||||
UINT64 Value)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -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",
|
||||
@@ -569,11 +571,6 @@ char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
|
||||
|
||||
#define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */
|
||||
|
||||
/* Exception counters */
|
||||
|
||||
UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0};
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ASL_EXCEPTIONS */
|
||||
|
||||
#endif /* __ASLTYPES_H */
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -142,7 +142,7 @@ static ACPI_STATUS
|
||||
UtStrtoul64 (
|
||||
char *String,
|
||||
UINT32 Base,
|
||||
ACPI_INTEGER *RetInteger);
|
||||
UINT64 *RetInteger);
|
||||
|
||||
static void
|
||||
UtPadNameWithUnderscores (
|
||||
@@ -846,12 +846,12 @@ UtAttachNamepathToOwner (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_INTEGER
|
||||
UINT64
|
||||
UtDoConstant (
|
||||
char *String)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_INTEGER Converted;
|
||||
UINT64 Converted;
|
||||
char ErrBuf[64];
|
||||
|
||||
|
||||
@@ -888,11 +888,11 @@ static ACPI_STATUS
|
||||
UtStrtoul64 (
|
||||
char *String,
|
||||
UINT32 Base,
|
||||
ACPI_INTEGER *RetInteger)
|
||||
UINT64 *RetInteger)
|
||||
{
|
||||
UINT32 Index;
|
||||
UINT32 Sign;
|
||||
ACPI_INTEGER ReturnValue = 0;
|
||||
UINT64 ReturnValue = 0;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
|
||||
@@ -916,7 +916,7 @@ UtStrtoul64 (
|
||||
|
||||
/* Skip over any white space in the buffer: */
|
||||
|
||||
while (isspace (*String) || *String == '\t')
|
||||
while (isspace ((int) *String) || *String == '\t')
|
||||
{
|
||||
++String;
|
||||
}
|
||||
@@ -948,7 +948,7 @@ UtStrtoul64 (
|
||||
{
|
||||
if (*String == '0')
|
||||
{
|
||||
if (tolower (*(++String)) == 'x')
|
||||
if (tolower ((int) *(++String)) == 'x')
|
||||
{
|
||||
Base = 16;
|
||||
++String;
|
||||
@@ -975,7 +975,7 @@ UtStrtoul64 (
|
||||
|
||||
if (Base == 16 &&
|
||||
*String == '0' &&
|
||||
tolower (*(++String)) == 'x')
|
||||
tolower ((int) *(++String)) == 'x')
|
||||
{
|
||||
String++;
|
||||
}
|
||||
@@ -984,14 +984,14 @@ UtStrtoul64 (
|
||||
|
||||
while (*String)
|
||||
{
|
||||
if (isdigit (*String))
|
||||
if (isdigit ((int) *String))
|
||||
{
|
||||
Index = ((UINT8) *String) - '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
Index = (UINT8) toupper (*String);
|
||||
if (isupper ((char) Index))
|
||||
Index = (UINT8) toupper ((int) *String);
|
||||
if (isupper ((int) Index))
|
||||
{
|
||||
Index = Index - 'A' + 10;
|
||||
}
|
||||
@@ -1008,8 +1008,8 @@ UtStrtoul64 (
|
||||
|
||||
/* Check to see if value is out of range: */
|
||||
|
||||
if (ReturnValue > ((ACPI_INTEGER_MAX - (ACPI_INTEGER) Index) /
|
||||
(ACPI_INTEGER) Base))
|
||||
if (ReturnValue > ((ACPI_UINT64_MAX - (UINT64) Index) /
|
||||
(UINT64) Base))
|
||||
{
|
||||
goto ErrorExit;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -130,6 +130,7 @@
|
||||
#define _COMPONENT ACPI_CA_DEBUGGER
|
||||
ACPI_MODULE_NAME ("dbcmds")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
@@ -382,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -474,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);
|
||||
}
|
||||
@@ -501,7 +502,7 @@ AcpiDbWalkForExecute (
|
||||
void **ReturnValue)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
|
||||
UINT32 *Count = (UINT32 *) Context;
|
||||
ACPI_EXECUTE_WALK *Info = (ACPI_EXECUTE_WALK *) Context;
|
||||
ACPI_BUFFER ReturnObj;
|
||||
ACPI_STATUS Status;
|
||||
char *Pathname;
|
||||
@@ -542,7 +543,6 @@ AcpiDbWalkForExecute (
|
||||
|
||||
if (ObjInfo->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
|
||||
/* Setup default parameters */
|
||||
|
||||
for (i = 0; i < ObjInfo->ParamCount; i++)
|
||||
@@ -556,11 +556,9 @@ AcpiDbWalkForExecute (
|
||||
}
|
||||
|
||||
ACPI_FREE (ObjInfo);
|
||||
|
||||
ReturnObj.Pointer = NULL;
|
||||
ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
|
||||
|
||||
|
||||
/* Do the actual method execution */
|
||||
|
||||
AcpiGbl_MethodExecuting = TRUE;
|
||||
@@ -569,11 +567,21 @@ AcpiDbWalkForExecute (
|
||||
|
||||
AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status));
|
||||
AcpiGbl_MethodExecuting = FALSE;
|
||||
|
||||
ACPI_FREE (Pathname);
|
||||
(*Count)++;
|
||||
|
||||
return (AE_OK);
|
||||
/* Ignore status from method execution */
|
||||
|
||||
Status = AE_OK;
|
||||
|
||||
/* Update count, check if we have executed enough methods */
|
||||
|
||||
Info->Count++;
|
||||
if (Info->Count >= Info->MaxCount)
|
||||
{
|
||||
Status = AE_CTRL_TERMINATE;
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
@@ -581,27 +589,37 @@ AcpiDbWalkForExecute (
|
||||
*
|
||||
* FUNCTION: AcpiDbBatchExecute
|
||||
*
|
||||
* PARAMETERS: None
|
||||
* PARAMETERS: CountArg - Max number of methods to execute
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Namespace batch execution.
|
||||
* DESCRIPTION: Namespace batch execution. Execute predefined names in the
|
||||
* namespace, up to the max count, if specified.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDbBatchExecute (
|
||||
void)
|
||||
char *CountArg)
|
||||
{
|
||||
UINT32 Count = 0;
|
||||
ACPI_EXECUTE_WALK Info;
|
||||
|
||||
|
||||
Info.Count = 0;
|
||||
Info.MaxCount = ACPI_UINT32_MAX;
|
||||
|
||||
if (CountArg)
|
||||
{
|
||||
Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0);
|
||||
}
|
||||
|
||||
|
||||
/* Search all nodes in namespace */
|
||||
|
||||
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
|
||||
AcpiDbWalkForExecute, (void *) &Count, NULL);
|
||||
AcpiDbWalkForExecute, NULL, (void *) &Info, NULL);
|
||||
|
||||
AcpiOsPrintf ("Executed %d predefined names in the namespace\n", Count);
|
||||
AcpiOsPrintf ("Executed %d predefined names in the namespace\n", Info.Count);
|
||||
}
|
||||
|
||||
|
||||
@@ -1143,15 +1161,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)
|
||||
@@ -1303,7 +1319,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",
|
||||
@@ -1419,7 +1435,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);
|
||||
@@ -1920,7 +1936,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);
|
||||
@@ -2107,7 +2123,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 */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -243,7 +243,7 @@ AcpiDbExecuteMethod (
|
||||
default:
|
||||
|
||||
Params[i].Type = ACPI_TYPE_INTEGER;
|
||||
Params[i].Integer.Value = i * (ACPI_INTEGER) 0x1000;
|
||||
Params[i].Integer.Value = i * (UINT64) 0x1000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
@@ -484,7 +484,7 @@ AcpiDbExecute (
|
||||
* Allow any handlers in separate threads to complete.
|
||||
* (Such as Notify handlers invoked from AML executed above).
|
||||
*/
|
||||
AcpiOsSleep ((ACPI_INTEGER) 10);
|
||||
AcpiOsSleep ((UINT64) 10);
|
||||
|
||||
|
||||
#ifdef ACPI_DEBUG_OUTPUT
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -150,9 +150,6 @@ AcpiDbCheckTextModeCorruption (
|
||||
UINT32 TableLength,
|
||||
UINT32 FileLength);
|
||||
|
||||
static ACPI_STATUS
|
||||
AeLocalLoadTable (
|
||||
ACPI_TABLE_HEADER *TablePtr);
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -424,7 +421,7 @@ AcpiDbReadTable (
|
||||
{
|
||||
/* Now validate the checksum */
|
||||
|
||||
Status = AcpiTbChecksum ((void *) *Table,
|
||||
Status = AcpiTbVerifyChecksum ((void *) *Table,
|
||||
ACPI_CAST_PTR (ACPI_TABLE_HEADER, *Table)->Length);
|
||||
|
||||
if (Status == AE_BAD_CHECKSUM)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -644,7 +644,7 @@ AcpiDbCommandDispatch (
|
||||
break;
|
||||
|
||||
case CMD_BATCH:
|
||||
AcpiDbBatchExecute ();
|
||||
AcpiDbBatchExecute (AcpiGbl_DbArgs[1]);
|
||||
break;
|
||||
|
||||
case CMD_BREAKPOINT:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -275,6 +275,10 @@ AcpiDbDumpExternalObject (
|
||||
AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length);
|
||||
if (ObjDesc->Buffer.Length)
|
||||
{
|
||||
if (ObjDesc->Buffer.Length > 16)
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
}
|
||||
AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
|
||||
ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -473,8 +473,8 @@ AcpiDmDisassembleOneOp (
|
||||
|
||||
case AML_QWORD_OP:
|
||||
|
||||
AcpiOsPrintf ("0x%8.8X%8.8X", Op->Common.Value.Integer64.Hi,
|
||||
Op->Common.Value.Integer64.Lo);
|
||||
AcpiOsPrintf ("0x%8.8X%8.8X",
|
||||
ACPI_FORMAT_UINT64 (Op->Common.Value.Integer));
|
||||
break;
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -129,9 +129,6 @@
|
||||
ACPI_MODULE_NAME ("dmutils")
|
||||
|
||||
|
||||
ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList = NULL;
|
||||
|
||||
|
||||
/* Data used in keeping track of fields */
|
||||
#if 0
|
||||
const char *AcpiGbl_FENames[] =
|
||||
@@ -202,121 +199,6 @@ const char *AcpiGbl_IrqDecode[] =
|
||||
};
|
||||
|
||||
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmAddToExternalList
|
||||
*
|
||||
* PARAMETERS: Path - Internal (AML) path to the object
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Insert a new path into the list of Externals which will in
|
||||
* turn be emitted as an External() declaration in the disassembled
|
||||
* output.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmAddToExternalList (
|
||||
char *Path,
|
||||
UINT8 Type,
|
||||
UINT32 Value)
|
||||
{
|
||||
char *ExternalPath;
|
||||
ACPI_EXTERNAL_LIST *NewExternal;
|
||||
ACPI_EXTERNAL_LIST *NextExternal;
|
||||
ACPI_EXTERNAL_LIST *PrevExternal = NULL;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
if (!Path)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Externalize the ACPI path */
|
||||
|
||||
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path,
|
||||
NULL, &ExternalPath);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Ensure that we don't have duplicate externals */
|
||||
|
||||
NextExternal = AcpiGbl_ExternalList;
|
||||
while (NextExternal)
|
||||
{
|
||||
/* Allow upgrade of type from ANY */
|
||||
|
||||
if (!ACPI_STRCMP (ExternalPath, NextExternal->Path))
|
||||
{
|
||||
/* Duplicate method, check that the Value (ArgCount) is the same */
|
||||
|
||||
if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
|
||||
(NextExternal->Value != Value))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Argument count mismatch for method %s %d %d",
|
||||
NextExternal->Path, NextExternal->Value, Value));
|
||||
}
|
||||
if (NextExternal->Type == ACPI_TYPE_ANY)
|
||||
{
|
||||
NextExternal->Type = Type;
|
||||
NextExternal->Value = Value;
|
||||
}
|
||||
ACPI_FREE (ExternalPath);
|
||||
return;
|
||||
}
|
||||
NextExternal = NextExternal->Next;
|
||||
}
|
||||
|
||||
/* Allocate and init a new External() descriptor */
|
||||
|
||||
NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST));
|
||||
NewExternal->InternalPath = Path;
|
||||
NewExternal->Path = ExternalPath;
|
||||
NewExternal->Type = Type;
|
||||
NewExternal->Value = Value;
|
||||
NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
|
||||
|
||||
/* Link the new descriptor into the global list, ordered by string length */
|
||||
|
||||
NextExternal = AcpiGbl_ExternalList;
|
||||
while (NextExternal)
|
||||
{
|
||||
if (NewExternal->Length <= NextExternal->Length)
|
||||
{
|
||||
if (PrevExternal)
|
||||
{
|
||||
PrevExternal->Next = NewExternal;
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiGbl_ExternalList = NewExternal;
|
||||
}
|
||||
|
||||
NewExternal->Next = NextExternal;
|
||||
return;
|
||||
}
|
||||
|
||||
PrevExternal = NextExternal;
|
||||
NextExternal = NextExternal->Next;
|
||||
}
|
||||
|
||||
if (PrevExternal)
|
||||
{
|
||||
PrevExternal->Next = NewExternal;
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiGbl_ExternalList = NewExternal;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDecodeAttribute
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -130,6 +130,17 @@
|
||||
|
||||
#define DB_FULL_OP_INFO "[%4.4s] @%5.5X #%4.4X: "
|
||||
|
||||
/* Stub for non-compiler code */
|
||||
|
||||
#ifndef ACPI_ASL_COMPILER
|
||||
void
|
||||
AcpiDmEmitExternals (
|
||||
void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
@@ -148,69 +159,6 @@ static UINT32
|
||||
AcpiDmBlockType (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
static const char *
|
||||
AcpiDmGetObjectTypeName (
|
||||
ACPI_OBJECT_TYPE Type);
|
||||
|
||||
/*
|
||||
* This table maps ACPI_OBJECT_TYPEs to the corresponding ASL
|
||||
* ObjectTypeKeyword. Used to generate typed external declarations
|
||||
*/
|
||||
static const char *AcpiGbl_DmTypeNames[] =
|
||||
{
|
||||
/* 00 */ "", /* Type ANY */
|
||||
/* 01 */ ", IntObj",
|
||||
/* 02 */ ", StrObj",
|
||||
/* 03 */ ", BuffObj",
|
||||
/* 04 */ ", PkgObj",
|
||||
/* 05 */ ", FieldUnitObj",
|
||||
/* 06 */ ", DeviceObj",
|
||||
/* 07 */ ", EventObj",
|
||||
/* 08 */ ", MethodObj",
|
||||
/* 09 */ ", MutexObj",
|
||||
/* 10 */ ", OpRegionObj",
|
||||
/* 11 */ ", PowerResObj",
|
||||
/* 12 */ ", ProcessorObj",
|
||||
/* 13 */ ", ThermalZoneObj",
|
||||
/* 14 */ ", BuffFieldObj",
|
||||
/* 15 */ ", DDBHandleObj",
|
||||
/* 16 */ "", /* Debug object */
|
||||
/* 17 */ ", FieldUnitObj",
|
||||
/* 18 */ ", FieldUnitObj",
|
||||
/* 19 */ ", FieldUnitObj"
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmGetObjectTypeName
|
||||
*
|
||||
* PARAMETERS: Type - An ACPI_OBJECT_TYPE
|
||||
*
|
||||
* RETURN: Pointer to a string
|
||||
*
|
||||
* DESCRIPTION: Map an object type to the ASL object type string.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static const char *
|
||||
AcpiDmGetObjectTypeName (
|
||||
ACPI_OBJECT_TYPE Type)
|
||||
{
|
||||
|
||||
if (Type == ACPI_TYPE_LOCAL_SCOPE)
|
||||
{
|
||||
Type = ACPI_TYPE_DEVICE;
|
||||
}
|
||||
|
||||
else if (Type > ACPI_TYPE_LOCAL_INDEX_FIELD)
|
||||
{
|
||||
return ("");
|
||||
}
|
||||
|
||||
return (AcpiGbl_DmTypeNames[Type]);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -522,7 +470,6 @@ AcpiDmDescendingOp (
|
||||
const ACPI_OPCODE_INFO *OpInfo;
|
||||
UINT32 Name;
|
||||
ACPI_PARSE_OBJECT *NextOp;
|
||||
ACPI_EXTERNAL_LIST *NextExternal;
|
||||
|
||||
|
||||
if (Op->Common.DisasmFlags & ACPI_PARSEOP_IGNORE)
|
||||
@@ -554,35 +501,7 @@ AcpiDmDescendingOp (
|
||||
|
||||
/* Emit all External() declarations here */
|
||||
|
||||
if (AcpiGbl_ExternalList)
|
||||
{
|
||||
/*
|
||||
* Walk the list of externals (unresolved references)
|
||||
* found during parsing
|
||||
*/
|
||||
while (AcpiGbl_ExternalList)
|
||||
{
|
||||
AcpiOsPrintf (" External (%s%s",
|
||||
AcpiGbl_ExternalList->Path,
|
||||
AcpiDmGetObjectTypeName (AcpiGbl_ExternalList->Type));
|
||||
|
||||
if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
AcpiOsPrintf (") // %d Arguments\n", AcpiGbl_ExternalList->Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (")\n");
|
||||
}
|
||||
|
||||
NextExternal = AcpiGbl_ExternalList->Next;
|
||||
ACPI_FREE (AcpiGbl_ExternalList->Path);
|
||||
ACPI_FREE (AcpiGbl_ExternalList);
|
||||
AcpiGbl_ExternalList = NextExternal;
|
||||
}
|
||||
AcpiOsPrintf ("\n");
|
||||
}
|
||||
|
||||
AcpiDmEmitExternals ();
|
||||
return (AE_OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -314,7 +314,7 @@ AcpiDsGetFieldNames (
|
||||
ACPI_PARSE_OBJECT *Arg)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_INTEGER Position;
|
||||
UINT64 Position;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info);
|
||||
@@ -338,8 +338,8 @@ AcpiDsGetFieldNames (
|
||||
{
|
||||
case AML_INT_RESERVEDFIELD_OP:
|
||||
|
||||
Position = (ACPI_INTEGER) Info->FieldBitPosition
|
||||
+ (ACPI_INTEGER) Arg->Common.Value.Size;
|
||||
Position = (UINT64) Info->FieldBitPosition
|
||||
+ (UINT64) Arg->Common.Value.Size;
|
||||
|
||||
if (Position > ACPI_UINT32_MAX)
|
||||
{
|
||||
@@ -406,8 +406,8 @@ AcpiDsGetFieldNames (
|
||||
|
||||
/* Keep track of bit position for the next field */
|
||||
|
||||
Position = (ACPI_INTEGER) Info->FieldBitPosition
|
||||
+ (ACPI_INTEGER) Arg->Common.Value.Size;
|
||||
Position = (UINT64) Info->FieldBitPosition
|
||||
+ (UINT64) Arg->Common.Value.Size;
|
||||
|
||||
if (Position > ACPI_UINT32_MAX)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -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"));
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -519,7 +519,7 @@ AcpiDsCallControlMethod (
|
||||
|
||||
if (ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY)
|
||||
{
|
||||
Status = ObjDesc->Method.Implementation (NextWalkState);
|
||||
Status = ObjDesc->Method.Extra.Implementation (NextWalkState);
|
||||
if (Status == AE_OK)
|
||||
{
|
||||
Status = AE_CTRL_TERMINATE;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -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)
|
||||
@@ -787,7 +787,7 @@ AcpiDsInitObjectFromOp (
|
||||
|
||||
case AML_ONES_OP:
|
||||
|
||||
ObjDesc->Integer.Value = ACPI_INTEGER_MAX;
|
||||
ObjDesc->Integer.Value = ACPI_UINT64_MAX;
|
||||
|
||||
/* Truncate value if we are executing from a 32-bit ACPI table */
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -263,7 +263,7 @@ AcpiDsLoad1BeginOp (
|
||||
* Target of Scope() not found. Generate an External for it, and
|
||||
* insert the name into the namespace.
|
||||
*/
|
||||
AcpiDmAddToExternalList (Path, ACPI_TYPE_DEVICE, 0);
|
||||
AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0);
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
|
||||
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
|
||||
WalkState, &Node);
|
||||
@@ -296,18 +296,19 @@ AcpiDsLoad1BeginOp (
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/*
|
||||
* These types we will allow, but we will change the type. This
|
||||
* enables some existing code of the form:
|
||||
* These types we will allow, but we will change the type.
|
||||
* This enables some existing code of the form:
|
||||
*
|
||||
* Name (DEB, 0)
|
||||
* Scope (DEB) { ... }
|
||||
*
|
||||
* Note: silently change the type here. On the second pass, we will report
|
||||
* a warning
|
||||
* Note: silently change the type here. On the second pass,
|
||||
* we will report a warning
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n",
|
||||
Path, AcpiUtGetTypeName (Node->Type)));
|
||||
"Type override - [%4.4s] had invalid type (%s) "
|
||||
"for Scope operator, changed to type ANY\n",
|
||||
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type)));
|
||||
|
||||
Node->Type = ACPI_TYPE_ANY;
|
||||
WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;
|
||||
@@ -318,8 +319,9 @@ AcpiDsLoad1BeginOp (
|
||||
/* All other types are an error */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid type (%s) for target of Scope operator [%4.4s] (Cannot override)",
|
||||
AcpiUtGetTypeName (Node->Type), Path));
|
||||
"Invalid type (%s) for target of "
|
||||
"Scope operator [%4.4s] (Cannot override)",
|
||||
AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node)));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
@@ -732,29 +734,45 @@ AcpiDsLoad2BeginOp (
|
||||
break;
|
||||
|
||||
case AML_SCOPE_OP:
|
||||
/*
|
||||
* The Path is an object reference to an existing object.
|
||||
* Don't enter the name into the namespace, but look it up
|
||||
* for use later.
|
||||
*/
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
|
||||
|
||||
/* Special case for Scope(\) -> refers to the Root node */
|
||||
|
||||
if (Op && (Op->Named.Node == AcpiGbl_RootNode))
|
||||
{
|
||||
Node = Op->Named.Node;
|
||||
|
||||
Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* The Path is an object reference to an existing object.
|
||||
* Don't enter the name into the namespace, but look it up
|
||||
* for use later.
|
||||
*/
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
|
||||
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
|
||||
WalkState, &(Node));
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
if (Status == AE_NOT_FOUND)
|
||||
{
|
||||
Status = AE_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
}
|
||||
if (Status == AE_NOT_FOUND)
|
||||
{
|
||||
Status = AE_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
}
|
||||
#else
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
#endif
|
||||
return_ACPI_STATUS (Status);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -778,15 +796,16 @@ AcpiDsLoad2BeginOp (
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/*
|
||||
* These types we will allow, but we will change the type. This
|
||||
* enables some existing code of the form:
|
||||
* These types we will allow, but we will change the type.
|
||||
* This enables some existing code of the form:
|
||||
*
|
||||
* Name (DEB, 0)
|
||||
* Scope (DEB) { ... }
|
||||
*/
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)",
|
||||
BufferPtr, AcpiUtGetTypeName (Node->Type)));
|
||||
"Type override - [%4.4s] had invalid type (%s) "
|
||||
"for Scope operator, changed to type ANY\n",
|
||||
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type)));
|
||||
|
||||
Node->Type = ACPI_TYPE_ANY;
|
||||
WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;
|
||||
@@ -797,8 +816,9 @@ AcpiDsLoad2BeginOp (
|
||||
/* All other types are an error */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid type (%s) for target of Scope operator [%4.4s]",
|
||||
AcpiUtGetTypeName (Node->Type), BufferPtr));
|
||||
"Invalid type (%s) for target of "
|
||||
"Scope operator [%4.4s] (Cannot override)",
|
||||
AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node)));
|
||||
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
@@ -1138,33 +1158,40 @@ AcpiDsLoad2EndOp (
|
||||
}
|
||||
|
||||
/*
|
||||
* If we are executing a method, initialize the region
|
||||
* The OpRegion is not fully parsed at this time. The only valid
|
||||
* argument is the SpaceId. (We must save the address of the
|
||||
* AML of the address and length operands)
|
||||
*
|
||||
* If we have a valid region, initialize it. The namespace is
|
||||
* unlocked at this point.
|
||||
*
|
||||
* Need to unlock interpreter if it is locked (if we are running
|
||||
* a control method), in order to allow _REG methods to be run
|
||||
* during AcpiEvInitializeRegion.
|
||||
*/
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
/*
|
||||
* Executing a method: initialize the region and unlock
|
||||
* the interpreter
|
||||
*/
|
||||
Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
|
||||
RegionSpace, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
AcpiExExitInterpreter ();
|
||||
}
|
||||
|
||||
/*
|
||||
* The OpRegion is not fully parsed at this time. Only valid
|
||||
* argument is the SpaceId. (We must save the address of the
|
||||
* AML of the address and length operands)
|
||||
*/
|
||||
|
||||
/*
|
||||
* If we have a valid region, initialize it
|
||||
* Namespace is NOT locked at this point.
|
||||
*
|
||||
* TBD: need to unlock interpreter if it is locked, in order
|
||||
* to allow _REG methods to be run.
|
||||
*/
|
||||
Status = AcpiEvInitializeRegion (AcpiNsGetAttachedObject (Node),
|
||||
FALSE);
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
AcpiExEnterInterpreter ();
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -128,6 +128,11 @@
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static BOOLEAN
|
||||
AcpiEvHasDefaultHandler (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_ADR_SPACE_TYPE SpaceId);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiEvRegRun (
|
||||
ACPI_HANDLE ObjHandle,
|
||||
@@ -231,6 +236,57 @@ UnlockAndExit:
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvHasDefaultHandler
|
||||
*
|
||||
* PARAMETERS: Node - Namespace node for the device
|
||||
* SpaceId - The address space ID
|
||||
*
|
||||
* RETURN: TRUE if default handler is installed, FALSE otherwise
|
||||
*
|
||||
* DESCRIPTION: Check if the default handler is installed for the requested
|
||||
* space ID.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static BOOLEAN
|
||||
AcpiEvHasDefaultHandler (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_ADR_SPACE_TYPE SpaceId)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_OPERAND_OBJECT *HandlerObj;
|
||||
|
||||
|
||||
/* Must have an existing internal object */
|
||||
|
||||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
if (ObjDesc)
|
||||
{
|
||||
HandlerObj = ObjDesc->Device.Handler;
|
||||
|
||||
/* Walk the linked list of handlers for this object */
|
||||
|
||||
while (HandlerObj)
|
||||
{
|
||||
if (HandlerObj->AddressSpace.SpaceId == SpaceId)
|
||||
{
|
||||
if (HandlerObj->AddressSpace.HandlerFlags &
|
||||
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
HandlerObj = HandlerObj->AddressSpace.Next;
|
||||
}
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvInitializeOpRegions
|
||||
@@ -266,11 +322,16 @@ AcpiEvInitializeOpRegions (
|
||||
for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++)
|
||||
{
|
||||
/*
|
||||
* TBD: Make sure handler is the DEFAULT handler, otherwise
|
||||
* _REG will have already been run.
|
||||
* Make sure the installed handler is the DEFAULT handler. If not the
|
||||
* default, the _REG methods will have already been run (when the
|
||||
* handler was installed)
|
||||
*/
|
||||
Status = AcpiEvExecuteRegMethods (AcpiGbl_RootNode,
|
||||
AcpiGbl_DefaultAddressSpaces[i]);
|
||||
if (AcpiEvHasDefaultHandler (AcpiGbl_RootNode,
|
||||
AcpiGbl_DefaultAddressSpaces[i]))
|
||||
{
|
||||
Status = AcpiEvExecuteRegMethods (AcpiGbl_RootNode,
|
||||
AcpiGbl_DefaultAddressSpaces[i]);
|
||||
}
|
||||
}
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
@@ -339,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 */
|
||||
|
||||
@@ -385,7 +442,7 @@ Cleanup1:
|
||||
* RegionOffset - Where in the region to read or write
|
||||
* BitWidth - Field width in bits (8, 16, 32, or 64)
|
||||
* Value - Pointer to in or out value, must be
|
||||
* full 64-bit ACPI_INTEGER
|
||||
* a full 64-bit integer
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
@@ -400,7 +457,7 @@ AcpiEvAddressSpaceDispatch (
|
||||
UINT32 Function,
|
||||
UINT32 RegionOffset,
|
||||
UINT32 BitWidth,
|
||||
ACPI_INTEGER *Value)
|
||||
UINT64 *Value)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_ADR_SPACE_HANDLER Handler;
|
||||
@@ -788,7 +845,7 @@ AcpiEvInstallHandler (
|
||||
|
||||
/* Convert and validate the device handle */
|
||||
|
||||
Node = AcpiNsMapHandleToNode (ObjHandle);
|
||||
Node = AcpiNsValidateHandle (ObjHandle);
|
||||
if (!Node)
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
@@ -1112,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:
|
||||
@@ -1152,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);
|
||||
@@ -1186,7 +1243,7 @@ AcpiEvRegRun (
|
||||
|
||||
/* Convert and validate the device handle */
|
||||
|
||||
Node = AcpiNsMapHandleToNode (ObjHandle);
|
||||
Node = AcpiNsValidateHandle (ObjHandle);
|
||||
if (!Node)
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -260,7 +260,7 @@ AcpiEvPciConfigRegionSetup (
|
||||
void **RegionContext)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_INTEGER PciValue;
|
||||
UINT64 PciValue;
|
||||
ACPI_PCI_ID *PciId = *RegionContext;
|
||||
ACPI_OPERAND_OBJECT *HandlerObj;
|
||||
ACPI_NAMESPACE_NODE *ParentNode;
|
||||
@@ -716,6 +716,20 @@ AcpiEvInitializeRegion (
|
||||
HandlerObj = ObjDesc->ThermalZone.Handler;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_METHOD:
|
||||
/*
|
||||
* If we are executing module level code, the original
|
||||
* Node's object was replaced by this Method object and we
|
||||
* saved the handler in the method object.
|
||||
*
|
||||
* See AcpiNsExecModuleCode
|
||||
*/
|
||||
if (ObjDesc->Method.Flags & AOPOBJ_MODULE_LEVEL)
|
||||
{
|
||||
HandlerObj = ObjDesc->Method.Extra.Handler;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Ignore other objects */
|
||||
break;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -368,7 +368,7 @@ AcpiInstallNotifyHandler (
|
||||
|
||||
/* Convert and validate the device handle */
|
||||
|
||||
Node = AcpiNsMapHandleToNode (Device);
|
||||
Node = AcpiNsValidateHandle (Device);
|
||||
if (!Node)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
@@ -555,7 +555,7 @@ AcpiRemoveNotifyHandler (
|
||||
|
||||
/* Convert and validate the device handle */
|
||||
|
||||
Node = AcpiNsMapHandleToNode (Device);
|
||||
Node = AcpiNsValidateHandle (Device);
|
||||
if (!Node)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -805,7 +805,7 @@ AcpiInstallGpeBlock (
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Node = AcpiNsMapHandleToNode (GpeDevice);
|
||||
Node = AcpiNsValidateHandle (GpeDevice);
|
||||
if (!Node)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
@@ -905,7 +905,7 @@ AcpiRemoveGpeBlock (
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Node = AcpiNsMapHandleToNode (GpeDevice);
|
||||
Node = AcpiNsValidateHandle (GpeDevice);
|
||||
if (!Node)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -171,7 +171,7 @@ AcpiInstallAddressSpaceHandler (
|
||||
|
||||
/* Convert and validate the device handle */
|
||||
|
||||
Node = AcpiNsMapHandleToNode (Device);
|
||||
Node = AcpiNsValidateHandle (Device);
|
||||
if (!Node)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
@@ -244,7 +244,7 @@ AcpiRemoveAddressSpaceHandler (
|
||||
|
||||
/* Convert and validate the device handle */
|
||||
|
||||
Node = AcpiNsMapHandleToNode (Device);
|
||||
Node = AcpiNsValidateHandle (Device);
|
||||
if (!Node ||
|
||||
((Node->Type != ACPI_TYPE_DEVICE) &&
|
||||
(Node->Type != ACPI_TYPE_PROCESSOR) &&
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -389,7 +387,7 @@ AcpiExRegionRead (
|
||||
UINT8 *Buffer)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_INTEGER Value;
|
||||
UINT64 Value;
|
||||
UINT32 RegionOffset = 0;
|
||||
UINT32 i;
|
||||
|
||||
@@ -612,7 +610,10 @@ AcpiExLoadOp (
|
||||
Status = AcpiTbAddTable (&TableDesc, &TableIndex);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
/* Delete allocated table buffer */
|
||||
|
||||
AcpiTbDeleteTable (&TableDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -655,13 +656,6 @@ AcpiExLoadOp (
|
||||
AcpiGbl_TableHandlerContext);
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/* Delete allocated table buffer */
|
||||
|
||||
AcpiTbDeleteTable (&TableDesc);
|
||||
}
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
static UINT32
|
||||
AcpiExConvertToAscii (
|
||||
ACPI_INTEGER Integer,
|
||||
UINT64 Integer,
|
||||
UINT16 Base,
|
||||
UINT8 *String,
|
||||
UINT8 MaxLength);
|
||||
@@ -158,7 +158,7 @@ AcpiExConvertToInteger (
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ReturnDesc;
|
||||
UINT8 *Pointer;
|
||||
ACPI_INTEGER Result;
|
||||
UINT64 Result;
|
||||
UINT32 i;
|
||||
UINT32 Count;
|
||||
ACPI_STATUS Status;
|
||||
@@ -247,7 +247,7 @@ AcpiExConvertToInteger (
|
||||
* Little endian is used, meaning that the first byte of the buffer
|
||||
* is the LSB of the integer
|
||||
*/
|
||||
Result |= (((ACPI_INTEGER) Pointer[i]) << (i * 8));
|
||||
Result |= (((UINT64) Pointer[i]) << (i * 8));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -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);
|
||||
@@ -390,12 +389,12 @@ AcpiExConvertToBuffer (
|
||||
|
||||
static UINT32
|
||||
AcpiExConvertToAscii (
|
||||
ACPI_INTEGER Integer,
|
||||
UINT64 Integer,
|
||||
UINT16 Base,
|
||||
UINT8 *String,
|
||||
UINT8 DataWidth)
|
||||
{
|
||||
ACPI_INTEGER Digit;
|
||||
UINT64 Digit;
|
||||
UINT32 i;
|
||||
UINT32 j;
|
||||
UINT32 k = 0;
|
||||
@@ -660,7 +659,7 @@ AcpiExConvertToString (
|
||||
for (i = 0; i < ObjDesc->Buffer.Length; i++)
|
||||
{
|
||||
NewBuf += AcpiExConvertToAscii (
|
||||
(ACPI_INTEGER) ObjDesc->Buffer.Pointer[i], Base,
|
||||
(UINT64) ObjDesc->Buffer.Pointer[i], Base,
|
||||
NewBuf, 1);
|
||||
*NewBuf++ = Separator; /* each separated by a comma or space */
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -217,7 +217,7 @@ AcpiExReadDataFromField (
|
||||
/* Call the region handler for the read */
|
||||
|
||||
Status = AcpiExAccessRegion (ObjDesc, 0,
|
||||
ACPI_CAST_PTR (ACPI_INTEGER, BufferDesc->Buffer.Pointer),
|
||||
ACPI_CAST_PTR (UINT64, BufferDesc->Buffer.Pointer),
|
||||
Function);
|
||||
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
|
||||
goto Exit;
|
||||
@@ -226,7 +226,7 @@ AcpiExReadDataFromField (
|
||||
/*
|
||||
* Allocate a buffer for the contents of the field.
|
||||
*
|
||||
* If the field is larger than the size of an ACPI_INTEGER, create
|
||||
* If the field is larger than the current integer width, create
|
||||
* a BUFFER to hold it. Otherwise, use an INTEGER. This allows
|
||||
* the use of arithmetic operators on the returned value if the
|
||||
* field size is equal or smaller than an Integer.
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -409,7 +408,7 @@ AcpiExWriteDataToField (
|
||||
* same buffer)
|
||||
*/
|
||||
Status = AcpiExAccessRegion (ObjDesc, 0,
|
||||
(ACPI_INTEGER *) Buffer, Function);
|
||||
(UINT64 *) Buffer, Function);
|
||||
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
|
||||
|
||||
*ResultDesc = BufferDesc;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -133,13 +133,13 @@ static ACPI_STATUS
|
||||
AcpiExFieldDatumIo (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
UINT32 FieldDatumByteOffset,
|
||||
ACPI_INTEGER *Value,
|
||||
UINT64 *Value,
|
||||
UINT32 ReadWrite);
|
||||
|
||||
static BOOLEAN
|
||||
AcpiExRegisterOverflow (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_INTEGER Value);
|
||||
UINT64 Value);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiExSetupRegion (
|
||||
@@ -296,7 +296,7 @@ AcpiExSetupRegion (
|
||||
* FieldDatumByteOffset - Byte offset of this datum within the
|
||||
* parent field
|
||||
* Value - Where to store value (must at least
|
||||
* the size of ACPI_INTEGER)
|
||||
* 64 bits)
|
||||
* Function - Read or Write flag plus other region-
|
||||
* dependent flags
|
||||
*
|
||||
@@ -310,7 +310,7 @@ ACPI_STATUS
|
||||
AcpiExAccessRegion (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
UINT32 FieldDatumByteOffset,
|
||||
ACPI_INTEGER *Value,
|
||||
UINT64 *Value,
|
||||
UINT32 Function)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
@@ -408,7 +408,7 @@ AcpiExAccessRegion (
|
||||
static BOOLEAN
|
||||
AcpiExRegisterOverflow (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_INTEGER Value)
|
||||
UINT64 Value)
|
||||
{
|
||||
|
||||
if (ObjDesc->CommonField.BitLength >= ACPI_INTEGER_BIT_SIZE)
|
||||
@@ -420,7 +420,7 @@ AcpiExRegisterOverflow (
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
if (Value >= ((ACPI_INTEGER) 1 << ObjDesc->CommonField.BitLength))
|
||||
if (Value >= ((UINT64) 1 << ObjDesc->CommonField.BitLength))
|
||||
{
|
||||
/*
|
||||
* The Value is larger than the maximum value that can fit into
|
||||
@@ -457,11 +457,11 @@ static ACPI_STATUS
|
||||
AcpiExFieldDatumIo (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
UINT32 FieldDatumByteOffset,
|
||||
ACPI_INTEGER *Value,
|
||||
UINT64 *Value,
|
||||
UINT32 ReadWrite)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_INTEGER LocalValue;
|
||||
UINT64 LocalValue;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_U32 (ExFieldDatumIo, FieldDatumByteOffset);
|
||||
@@ -543,7 +543,7 @@ AcpiExFieldDatumIo (
|
||||
* the register
|
||||
*/
|
||||
if (AcpiExRegisterOverflow (ObjDesc->BankField.BankObj,
|
||||
(ACPI_INTEGER) ObjDesc->BankField.Value))
|
||||
(UINT64) ObjDesc->BankField.Value))
|
||||
{
|
||||
return_ACPI_STATUS (AE_AML_REGISTER_LIMIT);
|
||||
}
|
||||
@@ -586,7 +586,7 @@ AcpiExFieldDatumIo (
|
||||
* the register
|
||||
*/
|
||||
if (AcpiExRegisterOverflow (ObjDesc->IndexField.IndexObj,
|
||||
(ACPI_INTEGER) ObjDesc->IndexField.Value))
|
||||
(UINT64) ObjDesc->IndexField.Value))
|
||||
{
|
||||
return_ACPI_STATUS (AE_AML_REGISTER_LIMIT);
|
||||
}
|
||||
@@ -615,7 +615,7 @@ AcpiExFieldDatumIo (
|
||||
"Read from Data Register\n"));
|
||||
|
||||
Status = AcpiExExtractFromField (ObjDesc->IndexField.DataObj,
|
||||
Value, sizeof (ACPI_INTEGER));
|
||||
Value, sizeof (UINT64));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -626,7 +626,7 @@ AcpiExFieldDatumIo (
|
||||
ACPI_FORMAT_UINT64 (*Value)));
|
||||
|
||||
Status = AcpiExInsertIntoField (ObjDesc->IndexField.DataObj,
|
||||
Value, sizeof (ACPI_INTEGER));
|
||||
Value, sizeof (UINT64));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -679,13 +679,13 @@ AcpiExFieldDatumIo (
|
||||
ACPI_STATUS
|
||||
AcpiExWriteWithUpdateRule (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_INTEGER Mask,
|
||||
ACPI_INTEGER FieldValue,
|
||||
UINT64 Mask,
|
||||
UINT64 FieldValue,
|
||||
UINT32 FieldDatumByteOffset)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_INTEGER MergedValue;
|
||||
ACPI_INTEGER CurrentValue;
|
||||
UINT64 MergedValue;
|
||||
UINT64 CurrentValue;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_U32 (ExWriteWithUpdateRule, Mask);
|
||||
@@ -697,7 +697,7 @@ AcpiExWriteWithUpdateRule (
|
||||
|
||||
/* If the mask is all ones, we don't need to worry about the update rule */
|
||||
|
||||
if (Mask != ACPI_INTEGER_MAX)
|
||||
if (Mask != ACPI_UINT64_MAX)
|
||||
{
|
||||
/* Decode the update rule */
|
||||
|
||||
@@ -787,8 +787,8 @@ AcpiExExtractFromField (
|
||||
UINT32 BufferLength)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_INTEGER RawDatum;
|
||||
ACPI_INTEGER MergedDatum;
|
||||
UINT64 RawDatum;
|
||||
UINT64 MergedDatum;
|
||||
UINT32 FieldOffset = 0;
|
||||
UINT32 BufferOffset = 0;
|
||||
UINT32 BufferTailBits;
|
||||
@@ -917,10 +917,10 @@ AcpiExInsertIntoField (
|
||||
UINT32 BufferLength)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_INTEGER Mask;
|
||||
ACPI_INTEGER WidthMask;
|
||||
ACPI_INTEGER MergedDatum;
|
||||
ACPI_INTEGER RawDatum = 0;
|
||||
UINT64 Mask;
|
||||
UINT64 WidthMask;
|
||||
UINT64 MergedDatum;
|
||||
UINT64 RawDatum = 0;
|
||||
UINT32 FieldOffset = 0;
|
||||
UINT32 BufferOffset = 0;
|
||||
UINT32 BufferTailBits;
|
||||
@@ -972,7 +972,7 @@ AcpiExInsertIntoField (
|
||||
*/
|
||||
if (ObjDesc->CommonField.AccessBitWidth == ACPI_INTEGER_BIT_SIZE)
|
||||
{
|
||||
WidthMask = ACPI_INTEGER_MAX;
|
||||
WidthMask = ACPI_UINT64_MAX;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -508,11 +508,11 @@ Cleanup:
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_INTEGER
|
||||
UINT64
|
||||
AcpiExDoMathOp (
|
||||
UINT16 Opcode,
|
||||
ACPI_INTEGER Integer0,
|
||||
ACPI_INTEGER Integer1)
|
||||
UINT64 Integer0,
|
||||
UINT64 Integer1)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
@@ -615,8 +615,8 @@ AcpiExDoMathOp (
|
||||
ACPI_STATUS
|
||||
AcpiExDoLogicalNumericOp (
|
||||
UINT16 Opcode,
|
||||
ACPI_INTEGER Integer0,
|
||||
ACPI_INTEGER Integer1,
|
||||
UINT64 Integer0,
|
||||
UINT64 Integer1,
|
||||
BOOLEAN *LogicalResult)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
@@ -690,8 +690,8 @@ AcpiExDoLogicalOp (
|
||||
BOOLEAN *LogicalResult)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *LocalOperand1 = Operand1;
|
||||
ACPI_INTEGER Integer0;
|
||||
ACPI_INTEGER Integer1;
|
||||
UINT64 Integer0;
|
||||
UINT64 Integer1;
|
||||
UINT32 Length0;
|
||||
UINT32 Length1;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -490,6 +490,15 @@ AcpiExReleaseMutex (
|
||||
return_ACPI_STATUS (AE_AML_MUTEX_NOT_ACQUIRED);
|
||||
}
|
||||
|
||||
/* Must have a valid thread ID */
|
||||
|
||||
if (!WalkState->Thread)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], null thread info",
|
||||
AcpiUtGetNodeName (ObjDesc->Mutex.Node)));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
/*
|
||||
* The Mutex is owned, but this thread must be the owner.
|
||||
* Special case for Global Lock, any thread can release
|
||||
@@ -505,15 +514,6 @@ AcpiExReleaseMutex (
|
||||
return_ACPI_STATUS (AE_AML_NOT_OWNER);
|
||||
}
|
||||
|
||||
/* Must have a valid thread ID */
|
||||
|
||||
if (!WalkState->Thread)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], null thread info",
|
||||
AcpiUtGetNodeName (ObjDesc->Mutex.Node)));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
/*
|
||||
* The sync level of the mutex must be equal to the current sync level. In
|
||||
* other words, the current level means that at least one mutex at that
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -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 */
|
||||
@@ -369,8 +368,8 @@ AcpiExOpcode_1A_1T_1R (
|
||||
ACPI_OPERAND_OBJECT *ReturnDesc2 = NULL;
|
||||
UINT32 Temp32;
|
||||
UINT32 i;
|
||||
ACPI_INTEGER PowerOfTen;
|
||||
ACPI_INTEGER Digit;
|
||||
UINT64 PowerOfTen;
|
||||
UINT64 Digit;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_1T_1R,
|
||||
@@ -478,7 +477,7 @@ AcpiExOpcode_1A_1T_1R (
|
||||
/* Sum the digit into the result with the current power of 10 */
|
||||
|
||||
ReturnDesc->Integer.Value +=
|
||||
(((ACPI_INTEGER) Temp32) * PowerOfTen);
|
||||
(((UINT64) Temp32) * PowerOfTen);
|
||||
|
||||
/* Shift to next BCD digit */
|
||||
|
||||
@@ -507,7 +506,7 @@ AcpiExOpcode_1A_1T_1R (
|
||||
* remainder from above
|
||||
*/
|
||||
ReturnDesc->Integer.Value |=
|
||||
(((ACPI_INTEGER) Temp32) << ACPI_MUL_4 (i));
|
||||
(((UINT64) Temp32) << ACPI_MUL_4 (i));
|
||||
}
|
||||
|
||||
/* Overflow if there is any data left in Digit */
|
||||
@@ -554,7 +553,7 @@ AcpiExOpcode_1A_1T_1R (
|
||||
|
||||
/* The object exists in the namespace, return TRUE */
|
||||
|
||||
ReturnDesc->Integer.Value = ACPI_INTEGER_MAX;
|
||||
ReturnDesc->Integer.Value = ACPI_UINT64_MAX;
|
||||
goto Cleanup;
|
||||
|
||||
|
||||
@@ -720,7 +719,7 @@ AcpiExOpcode_1A_0T_1R (
|
||||
ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
UINT32 Type;
|
||||
ACPI_INTEGER Value;
|
||||
UINT64 Value;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_0T_1R,
|
||||
@@ -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;
|
||||
@@ -746,7 +745,7 @@ AcpiExOpcode_1A_0T_1R (
|
||||
*/
|
||||
if (!Operand[0]->Integer.Value)
|
||||
{
|
||||
ReturnDesc->Integer.Value = ACPI_INTEGER_MAX;
|
||||
ReturnDesc->Integer.Value = ACPI_UINT64_MAX;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -383,7 +383,7 @@ AcpiExOpcode_2A_1T_1R (
|
||||
{
|
||||
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
|
||||
ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
|
||||
ACPI_INTEGER Index;
|
||||
UINT64 Index;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_SIZE Length;
|
||||
|
||||
@@ -716,7 +716,7 @@ StoreLogicalResult:
|
||||
*/
|
||||
if (LogicalResult)
|
||||
{
|
||||
ReturnDesc->Integer.Value = ACPI_INTEGER_MAX;
|
||||
ReturnDesc->Integer.Value = ACPI_UINT64_MAX;
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -239,7 +239,7 @@ AcpiExOpcode_3A_1T_1R (
|
||||
ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
|
||||
char *Buffer = NULL;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_INTEGER Index;
|
||||
UINT64 Index;
|
||||
ACPI_SIZE Length;
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -305,7 +305,7 @@ AcpiExOpcode_6A_0T_1R (
|
||||
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
|
||||
ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_INTEGER Index;
|
||||
UINT64 Index;
|
||||
ACPI_OPERAND_OBJECT *ThisElement;
|
||||
|
||||
|
||||
@@ -344,8 +344,9 @@ AcpiExOpcode_6A_0T_1R (
|
||||
}
|
||||
|
||||
/* Create an integer for the return value */
|
||||
/* Default return value is ACPI_UINT64_MAX if no match found */
|
||||
|
||||
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
|
||||
ReturnDesc = AcpiUtCreateIntegerObject (ACPI_UINT64_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,
|
||||
@@ -365,7 +362,7 @@ AcpiExOpcode_6A_0T_1R (
|
||||
*
|
||||
* Upon finding a match, the loop will terminate via "break" at
|
||||
* the bottom. If it terminates "normally", MatchValue will be
|
||||
* ACPI_INTEGER_MAX (Ones) (its initial value) indicating that no
|
||||
* ACPI_UINT64_MAX (Ones) (its initial value) indicating that no
|
||||
* match was found.
|
||||
*/
|
||||
for ( ; Index < Operand[0]->Package.Count; Index++)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -149,7 +149,7 @@ AcpiExSystemMemorySpaceHandler (
|
||||
UINT32 Function,
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
UINT32 BitWidth,
|
||||
ACPI_INTEGER *Value,
|
||||
UINT64 *Value,
|
||||
void *HandlerContext,
|
||||
void *RegionContext)
|
||||
{
|
||||
@@ -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
|
||||
@@ -197,7 +198,7 @@ AcpiExSystemMemorySpaceHandler (
|
||||
* Hardware does not support non-aligned data transfers, we must verify
|
||||
* the request.
|
||||
*/
|
||||
(void) AcpiUtShortDivide ((ACPI_INTEGER) Address, Length, NULL, &Remainder);
|
||||
(void) AcpiUtShortDivide ((UINT64) Address, Length, NULL, &Remainder);
|
||||
if (Remainder != 0)
|
||||
{
|
||||
return_ACPI_STATUS (AE_AML_ALIGNMENT);
|
||||
@@ -210,8 +211,8 @@ AcpiExSystemMemorySpaceHandler (
|
||||
* 2) Address beyond the current mapping?
|
||||
*/
|
||||
if ((Address < MemInfo->MappedPhysicalAddress) ||
|
||||
(((ACPI_INTEGER) Address + Length) >
|
||||
((ACPI_INTEGER)
|
||||
(((UINT64) Address + Length) >
|
||||
((UINT64)
|
||||
MemInfo->MappedPhysicalAddress + MemInfo->MappedLength)))
|
||||
{
|
||||
/*
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -262,7 +282,7 @@ AcpiExSystemMemorySpaceHandler (
|
||||
* access
|
||||
*/
|
||||
LogicalAddrPtr = MemInfo->MappedLogicalAddress +
|
||||
((ACPI_INTEGER) Address - (ACPI_INTEGER) MemInfo->MappedPhysicalAddress);
|
||||
((UINT64) Address - (UINT64) MemInfo->MappedPhysicalAddress);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"System-Memory (width %d) R/W %d Address=%8.8X%8.8X\n",
|
||||
@@ -284,19 +304,19 @@ AcpiExSystemMemorySpaceHandler (
|
||||
switch (BitWidth)
|
||||
{
|
||||
case 8:
|
||||
*Value = (ACPI_INTEGER) ACPI_GET8 (LogicalAddrPtr);
|
||||
*Value = (UINT64) ACPI_GET8 (LogicalAddrPtr);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
*Value = (ACPI_INTEGER) ACPI_GET16 (LogicalAddrPtr);
|
||||
*Value = (UINT64) ACPI_GET16 (LogicalAddrPtr);
|
||||
break;
|
||||
|
||||
case 32:
|
||||
*Value = (ACPI_INTEGER) ACPI_GET32 (LogicalAddrPtr);
|
||||
*Value = (UINT64) ACPI_GET32 (LogicalAddrPtr);
|
||||
break;
|
||||
|
||||
case 64:
|
||||
*Value = (ACPI_INTEGER) ACPI_GET64 (LogicalAddrPtr);
|
||||
*Value = (UINT64) ACPI_GET64 (LogicalAddrPtr);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -363,7 +383,7 @@ AcpiExSystemIoSpaceHandler (
|
||||
UINT32 Function,
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
UINT32 BitWidth,
|
||||
ACPI_INTEGER *Value,
|
||||
UINT64 *Value,
|
||||
void *HandlerContext,
|
||||
void *RegionContext)
|
||||
{
|
||||
@@ -427,7 +447,7 @@ AcpiExPciConfigSpaceHandler (
|
||||
UINT32 Function,
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
UINT32 BitWidth,
|
||||
ACPI_INTEGER *Value,
|
||||
UINT64 *Value,
|
||||
void *HandlerContext,
|
||||
void *RegionContext)
|
||||
{
|
||||
@@ -507,7 +527,7 @@ AcpiExCmosSpaceHandler (
|
||||
UINT32 Function,
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
UINT32 BitWidth,
|
||||
ACPI_INTEGER *Value,
|
||||
UINT64 *Value,
|
||||
void *HandlerContext,
|
||||
void *RegionContext)
|
||||
{
|
||||
@@ -544,7 +564,7 @@ AcpiExPciBarSpaceHandler (
|
||||
UINT32 Function,
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
UINT32 BitWidth,
|
||||
ACPI_INTEGER *Value,
|
||||
UINT64 *Value,
|
||||
void *HandlerContext,
|
||||
void *RegionContext)
|
||||
{
|
||||
@@ -581,7 +601,7 @@ AcpiExDataTableSpaceHandler (
|
||||
UINT32 Function,
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
UINT32 BitWidth,
|
||||
ACPI_INTEGER *Value,
|
||||
UINT64 *Value,
|
||||
void *HandlerContext,
|
||||
void *RegionContext)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user