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:
Fredrik Holmqvist
2010-02-21 19:46:35 +00:00
parent b1e7ac2a63
commit 57c418cdd6
220 changed files with 3644 additions and 1564 deletions
@@ -103,6 +103,7 @@ local namespace_src =
nsparse.c nsparse.c
nspredef.c nspredef.c
nsrepair.c nsrepair.c
nsrepair2.c
nssearch.c nssearch.c
nsutils.c nsutils.c
nswalk.c nswalk.c
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -119,7 +119,6 @@
#include "acapps.h" #include "acapps.h"
#include <stdio.h> #include <stdio.h>
#include <string.h>
#define _COMPONENT ACPI_TOOLS #define _COMPONENT ACPI_TOOLS
@@ -135,12 +134,13 @@ AdWriteBuffer (
char FilenameBuf[20]; char FilenameBuf[20];
/****************************************************************************** /******************************************************************************
* *
* FUNCTION: AfGenerateFilename * FUNCTION: AfGenerateFilename
* *
* PARAMETERS: Prefix - prefix string * PARAMETERS: Prefix - prefix string
* TableId - The table ID * TableId - The table ID
* *
* RETURN: Pointer to the completed string * RETURN: Pointer to the completed string
* *
@@ -180,9 +180,9 @@ AdGenerateFilename (
* *
* FUNCTION: AfWriteBuffer * FUNCTION: AfWriteBuffer
* *
* PARAMETERS: Filename - name of file * PARAMETERS: Filename - name of file
* Buffer - data to write * Buffer - data to write
* Length - length of data * Length - length of data
* *
* RETURN: Actual number of bytes written * RETURN: Actual number of bytes written
* *
@@ -217,10 +217,10 @@ AdWriteBuffer (
* *
* FUNCTION: AfWriteTable * FUNCTION: AfWriteTable
* *
* PARAMETERS: Table - pointer to the ACPI table * PARAMETERS: Table - pointer to the ACPI table
* Length - length of the table * Length - length of the table
* TableName - the table signature * TableName - the table signature
* OemTableID - from the table header * OemTableID - from the table header
* *
* RETURN: None * RETURN: None
* *
@@ -272,7 +272,7 @@ FlGenerateFilename (
* Copy the original filename to a new buffer. Leave room for the worst case * 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. * 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); strlen (InputFilename) + strlen (Suffix) + 2);
strcpy (NewFilename, InputFilename); strcpy (NewFilename, InputFilename);
@@ -314,7 +314,7 @@ FlStrdup (
char *NewString; char *NewString;
NewString = ACPI_ALLOCATE (strlen (String) + 1); NewString = ACPI_ALLOCATE ((ACPI_SIZE) strlen (String) + 1);
if (!NewString) if (!NewString)
{ {
return (NULL); return (NULL);
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -132,14 +132,18 @@
#define _COMPONENT ACPI_TOOLS #define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME ("adisasm") ACPI_MODULE_NAME ("adisasm")
extern int AslCompilerdebug;
extern int AslCompilerdebug;
extern char *Gbl_ExternalFilename;
ACPI_STATUS ACPI_STATUS
LsDisplayNamespace ( LsDisplayNamespace (
void); void);
void void
LsSetupNsList (void * Handle); LsSetupNsList (
void *Handle);
/* Local prototypes */ /* Local prototypes */
@@ -153,14 +157,6 @@ void
AdDisassemblerHeader ( AdDisassemblerHeader (
char *Filename); char *Filename);
void
AdAddExternalsToNamespace (
void);
UINT32
AdMethodExternalCount (
void);
ACPI_STATUS ACPI_STATUS
AdDeferredParse ( AdDeferredParse (
ACPI_PARSE_OBJECT *Op, ACPI_PARSE_OBJECT *Op,
@@ -171,8 +167,6 @@ ACPI_STATUS
AdParseDeferredOps ( AdParseDeferredOps (
ACPI_PARSE_OBJECT *Root); ACPI_PARSE_OBJECT *Root);
ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot;
/* Stubs for ASL compiler */ /* Stubs for ASL compiler */
@@ -192,7 +186,6 @@ AcpiDsMethodError (
{ {
return (Status); return (Status);
} }
#endif #endif
ACPI_STATUS 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 * FUNCTION: AdInitialize
* *
* PARAMETERS: None. * PARAMETERS: None
* *
* RETURN: Status * 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 * FUNCTION: AdAmlDisassemble
* *
* PARAMETERS: Filename - AML input filename * PARAMETERS: Filename - AML input filename
* OutToFile - TRUE if output should go to a file * OutToFile - TRUE if output should go to a file
* Prefix - Path prefix for output * Prefix - Path prefix for output
* OutFilename - where the filename is returned * OutFilename - where the filename is returned
* GetAllTables - TRUE if all tables are desired * GetAllTables - TRUE if all tables are desired
* *
* RETURN: Status * RETURN: Status
* *
@@ -386,8 +306,6 @@ AdMethodExternalCount (
* *
*****************************************************************************/ *****************************************************************************/
extern char *Gbl_ExternalFilename;
ACPI_STATUS ACPI_STATUS
AdAmlDisassemble ( AdAmlDisassemble (
BOOLEAN OutToFile, BOOLEAN OutToFile,
@@ -403,12 +321,11 @@ AdAmlDisassemble (
ACPI_TABLE_HEADER *Table = NULL; ACPI_TABLE_HEADER *Table = NULL;
ACPI_TABLE_HEADER *ExternalTable; ACPI_TABLE_HEADER *ExternalTable;
ACPI_OWNER_ID OwnerId; ACPI_OWNER_ID OwnerId;
ACPI_EXTERNAL_LIST *NextExternal;
/* /*
* Input: AML Code from either a file, * Input: AML code from either a file or via GetTables (memory or
* or via GetTables (memory or registry) * registry)
*/ */
if (Filename) if (Filename)
{ {
@@ -462,13 +379,7 @@ AdAmlDisassemble (
/* Clear external list generated by Scope in external tables */ /* Clear external list generated by Scope in external tables */
while (AcpiGbl_ExternalList) AcpiDmClearExternalList ();
{
NextExternal = AcpiGbl_ExternalList->Next;
ACPI_FREE (AcpiGbl_ExternalList->Path);
ACPI_FREE (AcpiGbl_ExternalList);
AcpiGbl_ExternalList = NextExternal;
}
} }
} }
else else
@@ -501,8 +412,7 @@ AdAmlDisassemble (
} }
/* /*
* Output: ASL code. * Output: ASL code. Redirect to a file if requested
* Redirect to a file if requested
*/ */
if (OutToFile) if (OutToFile)
{ {
@@ -589,11 +499,11 @@ AdAmlDisassemble (
* tree with the new information (namely, the number of arguments per * tree with the new information (namely, the number of arguments per
* method) * method)
*/ */
if (AdMethodExternalCount ()) if (AcpiDmGetExternalMethodCount ())
{ {
fprintf (stderr, fprintf (stderr,
"\nFound %d external control methods, reparsing with new information\n", "\nFound %d external control methods, reparsing with new information\n",
AdMethodExternalCount()); AcpiDmGetExternalMethodCount ());
/* /*
* Reparse, rebuild namespace. no need to xref namespace * Reparse, rebuild namespace. no need to xref namespace
@@ -611,7 +521,7 @@ AdAmlDisassemble (
AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST; AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST;
Status = AcpiNsRootInitialize (); Status = AcpiNsRootInitialize ();
AdAddExternalsToNamespace (); AcpiDmAddExternalsToNamespace ();
/* Parse table. No need to reload it, however (FALSE) */ /* Parse table. No need to reload it, however (FALSE) */
@@ -855,9 +765,9 @@ AdDisplayTables (
* *
* FUNCTION: AdDeferredParse * FUNCTION: AdDeferredParse
* *
* PARAMETERS: Op - Root Op of the deferred opcode * PARAMETERS: Op - Root Op of the deferred opcode
* Aml - Pointer to the raw AML * Aml - Pointer to the raw AML
* AmlLength - Length of the AML * AmlLength - Length of the AML
* *
* RETURN: Status * RETURN: Status
* *
@@ -981,7 +891,7 @@ AdDeferredParse (
* *
* FUNCTION: AdParseDeferredOps * FUNCTION: AdParseDeferredOps
* *
* PARAMETERS: Root - Root of the parse tree * PARAMETERS: Root - Root of the parse tree
* *
* RETURN: Status * RETURN: Status
* *
@@ -1055,8 +965,8 @@ AdParseDeferredOps (
* *
* FUNCTION: AdGetLocalTables * FUNCTION: AdGetLocalTables
* *
* PARAMETERS: Filename - Not used * PARAMETERS: Filename - Not used
* GetAllTables - TRUE if all tables are desired * GetAllTables - TRUE if all tables are desired
* *
* RETURN: Status * RETURN: Status
* *
@@ -1138,6 +1048,11 @@ AdGetLocalTables (
Status = AcpiTbStoreTable (0, NewTable, NewTable->Length, Status = AcpiTbStoreTable (0, NewTable, NewTable->Length,
0, &TableIndex); 0, &TableIndex);
if (ACPI_FAILURE (Status))
{
fprintf (stderr, "Could not store DSDT\n");
return AE_NO_ACPI_TABLES;
}
} }
else else
{ {
@@ -1169,10 +1084,10 @@ AdGetLocalTables (
* *
* FUNCTION: AdParseTable * FUNCTION: AdParseTable
* *
* PARAMETERS: Table - Pointer to the raw table * PARAMETERS: Table - Pointer to the raw table
* OwnerId - Returned OwnerId of the table * OwnerId - Returned OwnerId of the table
* LoadTable - If add table to the global table list * LoadTable - If add table to the global table list
* External - If this is an external table * External - If this is an external table
* *
* RETURN: Status * RETURN: Status
* *
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -118,7 +118,6 @@
#include "accommon.h" #include "accommon.h"
#include "acparser.h" #include "acparser.h"
#include "amlcode.h" #include "amlcode.h"
#include "acdebug.h"
#include "acdisasm.h" #include "acdisasm.h"
#include "acdispat.h" #include "acdispat.h"
#include "acnamesp.h" #include "acnamesp.h"
@@ -184,7 +183,7 @@ AcpiDmResourceDescendingOp (
* *
* FUNCTION: AcpiDmDumpTree * FUNCTION: AcpiDmDumpTree
* *
* PARAMETERS: Origin - Starting object * PARAMETERS: Origin - Starting object
* *
* RETURN: None * RETURN: None
* *
@@ -218,7 +217,7 @@ AcpiDmDumpTree (
* *
* FUNCTION: AcpiDmFindOrphanMethods * FUNCTION: AcpiDmFindOrphanMethods
* *
* PARAMETERS: Origin - Starting object * PARAMETERS: Origin - Starting object
* *
* RETURN: None * RETURN: None
* *
@@ -426,7 +425,6 @@ AcpiDmDumpDescending (
void *Context) void *Context)
{ {
ACPI_OP_WALK_INFO *Info = Context; ACPI_OP_WALK_INFO *Info = Context;
const ACPI_OPCODE_INFO *OpInfo;
char *Path; char *Path;
@@ -435,11 +433,9 @@ AcpiDmDumpDescending (
return (AE_OK); return (AE_OK);
} }
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
Info->Count++;
/* Most of the information (count, level, name) here */ /* Most of the information (count, level, name) here */
Info->Count++;
AcpiOsPrintf ("% 5d [%2.2d] ", Info->Count, Level); AcpiOsPrintf ("% 5d [%2.2d] ", Info->Count, Level);
AcpiDmIndent (Level); AcpiDmIndent (Level);
AcpiOsPrintf ("%-28s", AcpiPsGetOpcodeName (Op->Common.AmlOpcode)); AcpiOsPrintf ("%-28s", AcpiPsGetOpcodeName (Op->Common.AmlOpcode));
@@ -472,7 +468,7 @@ AcpiDmDumpDescending (
case AML_METHOD_OP: case AML_METHOD_OP:
case AML_DEVICE_OP: case AML_DEVICE_OP:
case AML_INT_NAMEDFIELD_OP: case AML_INT_NAMEDFIELD_OP:
AcpiOsPrintf ("%4.4s", &Op->Named.Name); AcpiOsPrintf ("%4.4s", ACPI_CAST_PTR (char, &Op->Named.Name));
break; break;
default: default:
@@ -536,7 +532,7 @@ AcpiDmFindOrphanDescending (
{ {
/* This NamePath has no args, assume it is an integer */ /* 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); return (AE_OK);
} }
@@ -547,11 +543,11 @@ AcpiDmFindOrphanDescending (
{ {
/* One Arg means this is just a Store(Name,Target) */ /* 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); return (AE_OK);
} }
AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
} }
break; break;
#endif #endif
@@ -567,7 +563,7 @@ AcpiDmFindOrphanDescending (
{ {
/* This NamePath has no args, assume it is an integer */ /* 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); return (AE_OK);
} }
@@ -576,11 +572,11 @@ AcpiDmFindOrphanDescending (
{ {
/* One Arg means this is just a Store(Name,Target) */ /* 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); return (AE_OK);
} }
AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
} }
break; break;
@@ -611,7 +607,7 @@ AcpiDmFindOrphanDescending (
/* And namepath is the first argument */ /* And namepath is the first argument */
(ParentOp->Common.Value.Arg == Op)) (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; break;
} }
} }
@@ -621,7 +617,7 @@ AcpiDmFindOrphanDescending (
* operator) - it *must* be a method invocation, nothing else is * operator) - it *must* be a method invocation, nothing else is
* grammatically possible. * grammatically possible.
*/ */
AcpiDmAddToExternalList (Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
} }
break; break;
@@ -858,7 +854,7 @@ AcpiDmXrefDescendingOp (
{ {
if (Status == AE_NOT_FOUND) 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 * We could install this into the namespace, but we catch duplicate
@@ -888,12 +884,12 @@ AcpiDmXrefDescendingOp (
if (ObjectType2 == ACPI_TYPE_METHOD) if (ObjectType2 == ACPI_TYPE_METHOD)
{ {
AcpiDmAddToExternalList (Path, ACPI_TYPE_METHOD, AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_METHOD,
Object->Method.ParamCount); Object->Method.ParamCount);
} }
else else
{ {
AcpiDmAddToExternalList (Path, (UINT8) ObjectType2, 0); AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, 0);
} }
Op->Common.Node = Node; 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 * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -218,7 +218,6 @@ static const char *AcpiDmIvrsSubnames[] =
}; };
#define ACPI_FADT_PM_RESERVED 8 #define ACPI_FADT_PM_RESERVED 8
static const char *AcpiDmFadtProfiles[] = static const char *AcpiDmFadtProfiles[] =
@@ -954,7 +953,7 @@ AcpiDmCheckAscii (
for (i = 0; i < Count; i++) for (i = 0; i < Count; i++)
{ {
RepairedName[i] = Name[i]; RepairedName[i] = (char) Name[i];
if (!Name[i]) if (!Name[i])
{ {
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -195,9 +195,9 @@ AcpiGetopt(
if (*++OptsPtr == ':') 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) else if (++AcpiGbl_Optind >= argc)
{ {
@@ -218,9 +218,9 @@ AcpiGetopt(
else if (*OptsPtr == '^') 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 else
{ {
@@ -71,6 +71,7 @@ SRCS= aslcompilerparse.c aslcompilerlex.c aslanalyze.c aslcodegen.c \
../common/adfile.c \ ../common/adfile.c \
../common/adisasm.c \ ../common/adisasm.c \
../common/adwalk.c \ ../common/adwalk.c \
../common/dmextern.c \
../common/dmrestag.c \ ../common/dmrestag.c \
../common/dmtable.c \ ../common/dmtable.c \
../common/dmtbinfo.c \ ../common/dmtbinfo.c \
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -667,8 +667,8 @@ AnCheckForReservedName (
{ {
/* The next two characters must be hex digits */ /* The next two characters must be hex digits */
if ((isxdigit (Name[2])) && if ((isxdigit ((int) Name[2])) &&
(isxdigit (Name[3]))) (isxdigit ((int) Name[3])))
{ {
return (ACPI_EVENT_RESERVED_NAME); return (ACPI_EVENT_RESERVED_NAME);
} }
@@ -1236,7 +1236,7 @@ AnMethodAnalysisWalkBegin (
*/ */
for (i = 0; Next->Asl.Value.String[i]; i++) 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, AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING,
Next, Next->Asl.Value.String); Next, Next->Asl.Value.String);
@@ -2157,7 +2157,7 @@ AnOtherSemanticAnalysisWalkBegin (
*/ */
if (((ArgNode->Asl.ParseOpcode == PARSEOP_WORDCONST) || if (((ArgNode->Asl.ParseOpcode == PARSEOP_WORDCONST) ||
(ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER)) && (ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER)) &&
(ArgNode->Asl.Value.Integer >= (ACPI_INTEGER) ACPI_WAIT_FOREVER)) (ArgNode->Asl.Value.Integer >= (UINT64) ACPI_WAIT_FOREVER))
{ {
break; break;
} }
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -895,6 +895,14 @@ CmCleanupAndExit (
10) / Gbl_NsLookupCount); 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 */ /* Close all open files */
for (i = 2; i < ASL_MAX_FILE_TYPE; i++) for (i = 2; i < ASL_MAX_FILE_TYPE; i++)
@@ -902,14 +910,6 @@ CmCleanupAndExit (
FlCloseFile (i); 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 */ /* Delete AML file if there are errors */
if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors))
@@ -917,12 +917,19 @@ CmCleanupAndExit (
remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); 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 * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -511,7 +511,7 @@ TrCreateLeafNode (
ACPI_PARSE_OBJECT * ACPI_PARSE_OBJECT *
TrCreateValuedLeafNode ( TrCreateValuedLeafNode (
UINT32 ParseOpcode, UINT32 ParseOpcode,
ACPI_INTEGER Value); UINT64 Value);
ACPI_PARSE_OBJECT * ACPI_PARSE_OBJECT *
TrLinkChildren ( TrLinkChildren (
@@ -718,7 +718,7 @@ UtCheckIntegerRange (
UINT32 LowValue, UINT32 LowValue,
UINT32 HighValue); UINT32 HighValue);
ACPI_INTEGER UINT64
UtDoConstant ( UtDoConstant (
char *String); char *String);
@@ -10,7 +10,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -127,7 +127,7 @@
#define IntelAcpiCA "Intel ACPI Component Architecture" #define IntelAcpiCA "Intel ACPI Component Architecture"
#define CompilerId "ASL Optimizing Compiler" #define CompilerId "ASL Optimizing Compiler"
#define DisassemblerId "AML Disassembler" #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 CompilerCompliance "Supports ACPI Specification Revision 4.0"
#define CompilerName "iasl" #define CompilerName "iasl"
#define CompilerCreatorId "INTL" #define CompilerCreatorId "INTL"
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -169,13 +169,7 @@ AeAddToErrorLog (
ASL_ERROR_MSG *Prev; ASL_ERROR_MSG *Prev;
if (!Gbl_ErrorLog) /* If Gbl_ErrorLog is null, this is the first error node */
{
Gbl_ErrorLog = Enode;
return;
}
/* List is sorted according to line number */
if (!Gbl_ErrorLog) if (!Gbl_ErrorLog)
{ {
@@ -183,8 +177,10 @@ AeAddToErrorLog (
return; 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; Prev = NULL;
Next = Gbl_ErrorLog; Next = Gbl_ErrorLog;
@@ -535,6 +531,7 @@ AslCommonError (
Gbl_NextError = Gbl_ErrorLog; Gbl_NextError = Gbl_ErrorLog;
CmDoOutputFiles (); CmDoOutputFiles ();
CmCleanupAndExit (); CmCleanupAndExit ();
exit(1);
} }
return; return;
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -10,7 +10,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 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_ErrorLog,NULL);
ASL_EXTERN ASL_ERROR_MSG ASL_INIT_GLOBAL (*Gbl_NextError,NULL); ASL_EXTERN ASL_ERROR_MSG ASL_INIT_GLOBAL (*Gbl_NextError,NULL);
extern UINT32 Gbl_ExceptionCount[];
/* Option flags */ /* 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 StringBuffer[ASL_MSG_BUFFER_SIZE];
ASL_EXTERN char StringBuffer2[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 */ #endif /* __ASLGLOBAL_H */
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -534,7 +534,7 @@ LdNamespace1Begin (
if (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC) if (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC)
{ {
Status = LdLoadResourceElements (Op, WalkState); Status = LdLoadResourceElements (Op, WalkState);
goto Exit; return_ACPI_STATUS (Status);
} }
ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
@@ -575,8 +575,10 @@ LdNamespace1Begin (
goto FinishNode; goto FinishNode;
} }
AslCoreSubsystemError (Op, Status, "Failure from lookup\n", FALSE); AslCoreSubsystemError (Op, Status,
goto Exit; "Failure from namespace lookup", FALSE);
return_ACPI_STATUS (Status);
} }
/* We found a node with this name, now check the type */ /* We found a node with this name, now check the type */
@@ -711,15 +713,14 @@ LdNamespace1Begin (
AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Op, AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Op,
Op->Asl.ExternalName); Op->Asl.ExternalName);
Status = AE_OK; return_ACPI_STATUS (AE_OK);
goto Exit;
} }
} }
else else
{ {
AslCoreSubsystemError (Op, Status, AslCoreSubsystemError (Op, Status,
"Failure from lookup %s\n", FALSE); "Failure from namespace lookup", FALSE);
goto Exit; return_ACPI_STATUS (Status);
} }
} }
@@ -757,8 +758,7 @@ FinishNode:
Node->Value = (UINT32) Op->Asl.Extra; Node->Value = (UINT32) Op->Asl.Extra;
} }
Exit: return_ACPI_STATUS (Status);
return (Status);
} }
@@ -885,7 +885,8 @@ LdNamespace2Begin (
return (AE_OK); return (AE_OK);
} }
AslCoreSubsystemError (Op, Status, "Failure from lookup\n", FALSE); AslCoreSubsystemError (Op, Status,
"Failure from namespace lookup", FALSE);
return (AE_OK); return (AE_OK);
} }
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -526,7 +526,7 @@ LsDisplayNamespace (
/* Walk entire namespace from the root */ /* Walk entire namespace from the root */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, LsDoOneNamespaceObject, ACPI_UINT32_MAX, FALSE, LsDoOneNamespaceObject, NULL,
NULL, NULL); NULL, NULL);
/* Print the full pathname for each namespace node */ /* Print the full pathname for each namespace node */
@@ -534,7 +534,7 @@ LsDisplayNamespace (
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\nNamespace pathnames\n\n"); FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\nNamespace pathnames\n\n");
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, LsDoOnePathname, ACPI_UINT32_MAX, FALSE, LsDoOnePathname, NULL,
NULL, NULL); NULL, NULL);
return (Status); return (Status);
@@ -598,7 +598,7 @@ LkObjectExists (
/* Walk entire namespace from the supplied root */ /* Walk entire namespace from the supplied root */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, LsCompareOneNamespaceObject, ACPI_UINT32_MAX, FALSE, LsCompareOneNamespaceObject, NULL,
Name, NULL); Name, NULL);
if (Status == AE_CTRL_TRUE) if (Status == AE_CTRL_TRUE)
{ {
@@ -753,7 +753,7 @@ LkFindUnreferencedObjects (
/* Walk entire namespace from the supplied root */ /* Walk entire namespace from the supplied root */
(void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, (void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, LkIsObjectUsed, ACPI_UINT32_MAX, FALSE, LkIsObjectUsed, NULL,
NULL, NULL); NULL, NULL);
} }
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -165,9 +165,6 @@ static int
AslDoResponseFile ( AslDoResponseFile (
char *Filename); char *Filename);
extern int AcpiGbl_Opterr;
extern int AcpiGbl_Optind;
#define ASL_TOKEN_SEPARATORS " \t\n" #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:" #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 * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -328,7 +328,7 @@ OpcSetOptimalIntegerSize (
} }
break; break;
case ACPI_INTEGER_MAX: case ACPI_UINT64_MAX:
/* Check for table integer width (32 or 64) */ /* Check for table integer width (32 or 64) */
@@ -568,7 +568,7 @@ OpcDoEisaId (
if (i < 3) if (i < 3)
{ {
if (!isupper (InString[i])) if (!isupper ((int) InString[i]))
{ {
Status = AE_BAD_PARAMETER; Status = AE_BAD_PARAMETER;
} }
@@ -576,7 +576,7 @@ OpcDoEisaId (
/* Last 4 characters must be hex digits */ /* Last 4 characters must be hex digits */
else if (!isxdigit (InString[i])) else if (!isxdigit ((int) InString[i]))
{ {
Status = AE_BAD_PARAMETER; Status = AE_BAD_PARAMETER;
} }
@@ -666,7 +666,7 @@ OpcDoUuId (
} }
else else
{ {
if (!isxdigit (InString[i])) if (!isxdigit ((int) InString[i]))
{ {
Status = AE_BAD_PARAMETER; Status = AE_BAD_PARAMETER;
} }
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -604,7 +604,7 @@ OpnDoRegion (
} }
else 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) || if ((PackageLengthOp->Asl.ParseOpcode == PARSEOP_INTEGER) ||
(PackageLengthOp->Asl.ParseOpcode == PARSEOP_QWORDCONST)) (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; PackageLength = (UINT32) PackageLengthOp->Asl.Value.Integer;
} }
else else if (PackageLengthOp->Asl.Value.Integer < PackageLength)
{ {
/* /*
* Initializer list is longer than the package length. This * The package length is smaller than the length of the
* is an error as per the ACPI spec. * initializer list. This is an error as per the ACPI spec.
*/ */
AslError (ASL_ERROR, ASL_MSG_LIST_LENGTH, AslError (ASL_ERROR, ASL_MSG_LIST_LENGTH_LONG,
PackageLengthOp->Asl.Next, NULL); PackageLengthOp, NULL);
} }
} }
@@ -997,7 +1007,7 @@ OpnDoDefinitionBlock (
for (i = 0; i < 4; i++) 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, AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child,
"Contains non-alphanumeric characters"); "Contains non-alphanumeric characters");
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -184,7 +184,7 @@ RsCreateBitField (
{ {
Op->Asl.ExternalName = Name; 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); Op->Asl.CompileFlags |= (NODE_IS_RESOURCE_FIELD | NODE_IS_BIT_OFFSET);
} }
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
+1 -1
View File
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -468,6 +468,8 @@ TrDoSwitch (
ACPI_PARSE_OBJECT *NewOp; ACPI_PARSE_OBJECT *NewOp;
ACPI_PARSE_OBJECT *NewOp2; ACPI_PARSE_OBJECT *NewOp2;
ACPI_PARSE_OBJECT *MethodOp; ACPI_PARSE_OBJECT *MethodOp;
ACPI_PARSE_OBJECT *StoreOp;
ACPI_PARSE_OBJECT *BreakOp;
char *PredicateValueName; char *PredicateValueName;
UINT16 Index; UINT16 Index;
UINT32 Btype; UINT32 Btype;
@@ -552,7 +554,7 @@ TrDoSwitch (
NewOp = NewOp2; NewOp = NewOp2;
NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESTRING,
(ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); (UINT64) ACPI_TO_INTEGER (PredicateValueName));
NewOp->Asl.Next = NewOp2; NewOp->Asl.Next = NewOp2;
TrAmlInitLineNumbers (NewOp2, Predicate); TrAmlInitLineNumbers (NewOp2, Predicate);
@@ -610,7 +612,7 @@ TrDoSwitch (
* CaseOp->Child->Peer is the beginning of the case block * CaseOp->Child->Peer is the beginning of the case block
*/ */
NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESTRING,
(ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); (UINT64) ACPI_TO_INTEGER (PredicateValueName));
NewOp->Asl.Next = Predicate; NewOp->Asl.Next = Predicate;
TrAmlInitLineNumbers (NewOp, Predicate); TrAmlInitLineNumbers (NewOp, Predicate);
@@ -638,11 +640,7 @@ TrDoSwitch (
*/ */
if (CurrentParentNode == StartNode) if (CurrentParentNode == StartNode)
{ {
Conditional->Asl.Parent = CurrentParentNode->Asl.Parent; Conditional->Asl.Next = NULL;
/* Link IF into the peer list */
TrAmlInsertPeer (CurrentParentNode, Conditional);
} }
else else
{ {
@@ -695,6 +693,7 @@ TrDoSwitch (
{ {
return; return;
} }
TrAmlInitNode (DefaultOp, PARSEOP_ELSE); TrAmlInitNode (DefaultOp, PARSEOP_ELSE);
DefaultOp->Asl.Parent = Conditional->Asl.Parent; DefaultOp->Asl.Parent = Conditional->Asl.Parent;
@@ -762,7 +761,7 @@ TrDoSwitch (
/* Create the NameSeg child for the Name node */ /* Create the NameSeg child for the Name node */
NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESEG, NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
(ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); (UINT64) ACPI_TO_INTEGER (PredicateValueName));
NewOp2->Asl.CompileFlags |= NODE_IS_NAME_DECLARATION; NewOp2->Asl.CompileFlags |= NODE_IS_NAME_DECLARATION;
NewOp->Asl.Child = NewOp2; NewOp->Asl.Child = NewOp2;
@@ -772,22 +771,22 @@ TrDoSwitch (
{ {
case ACPI_BTYPE_INTEGER: case ACPI_BTYPE_INTEGER:
NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_ZERO, NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_ZERO,
(ACPI_INTEGER) 0); (UINT64) 0);
break; break;
case ACPI_BTYPE_STRING: case ACPI_BTYPE_STRING:
NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL,
(ACPI_INTEGER) ACPI_TO_INTEGER ("")); (UINT64) ACPI_TO_INTEGER (""));
break; break;
case ACPI_BTYPE_BUFFER: case ACPI_BTYPE_BUFFER:
(void) TrLinkPeerNode (NewOp2, TrCreateValuedLeafNode (PARSEOP_BUFFER, (void) TrLinkPeerNode (NewOp2, TrCreateValuedLeafNode (PARSEOP_BUFFER,
(ACPI_INTEGER) 0)); (UINT64) 0));
Next = NewOp2->Asl.Next; Next = NewOp2->Asl.Next;
(void) TrLinkChildren (Next, 1, TrCreateValuedLeafNode (PARSEOP_ZERO, (void) TrLinkChildren (Next, 1, TrCreateValuedLeafNode (PARSEOP_ZERO,
(ACPI_INTEGER) 1)); (UINT64) 1));
(void) TrLinkPeerNode (Next->Asl.Child, (void) TrLinkPeerNode (Next->Asl.Child,
TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (ACPI_INTEGER) 0)); TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (UINT64) 0));
TrAmlSetSubtreeParent (Next->Asl.Child, Next); TrAmlSetSubtreeParent (Next->Asl.Child, Next);
break; break;
@@ -799,22 +798,44 @@ TrDoSwitch (
TrAmlSetSubtreeParent (NewOp2, NewOp); 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) * Switch() value. The store is of the form: Store (Value, _T_x)
* where _T_x is the temp variable. * where _T_x is the temp variable.
*/ */
TrAmlInitNode (StartNode, PARSEOP_STORE); TrAmlInitNode (StartNode, PARSEOP_WHILE);
StartNode->Asl.Child = NULL; 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 */ /* Complete the Store subtree */
StartNode->Asl.Child = Predicate; StoreOp->Asl.Child = Predicate;
Predicate->Asl.Parent = StartNode; Predicate->Asl.Parent = StoreOp;
NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG, NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG,
(ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); (UINT64) ACPI_TO_INTEGER (PredicateValueName));
NewOp->Asl.Parent = StartNode; NewOp->Asl.Parent = StoreOp;
Predicate->Asl.Next = NewOp; 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 * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -490,7 +490,7 @@ TrCreateLeafNode (
ACPI_PARSE_OBJECT * ACPI_PARSE_OBJECT *
TrCreateValuedLeafNode ( TrCreateValuedLeafNode (
UINT32 ParseOpcode, UINT32 ParseOpcode,
ACPI_INTEGER Value) UINT64 Value)
{ {
ACPI_PARSE_OBJECT *Op; ACPI_PARSE_OBJECT *Op;
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -369,7 +369,8 @@ typedef enum
ASL_MSG_INVALID_TIME, ASL_MSG_INVALID_TIME,
ASL_MSG_INVALID_TYPE, ASL_MSG_INVALID_TYPE,
ASL_MSG_INVALID_UUID, 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_FILE_OPEN,
ASL_MSG_LISTING_FILENAME, ASL_MSG_LISTING_FILENAME,
ASL_MSG_LOCAL_INIT, ASL_MSG_LOCAL_INIT,
@@ -488,7 +489,8 @@ char *AslMessages [] = {
/* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)", /* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)",
/* ASL_MSG_INVALID_TYPE */ "Invalid type", /* ASL_MSG_INVALID_TYPE */ "Invalid type",
/* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"", /* 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_FILE_OPEN */ "Could not open listing file",
/* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename", /* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename",
/* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized", /* 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 */ #define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */
/* Exception counters */ #endif /* ASL_EXCEPTIONS */
UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0};
#endif
#endif /* __ASLTYPES_H */ #endif /* __ASLTYPES_H */
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -142,7 +142,7 @@ static ACPI_STATUS
UtStrtoul64 ( UtStrtoul64 (
char *String, char *String,
UINT32 Base, UINT32 Base,
ACPI_INTEGER *RetInteger); UINT64 *RetInteger);
static void static void
UtPadNameWithUnderscores ( UtPadNameWithUnderscores (
@@ -846,12 +846,12 @@ UtAttachNamepathToOwner (
* *
******************************************************************************/ ******************************************************************************/
ACPI_INTEGER UINT64
UtDoConstant ( UtDoConstant (
char *String) char *String)
{ {
ACPI_STATUS Status; ACPI_STATUS Status;
ACPI_INTEGER Converted; UINT64 Converted;
char ErrBuf[64]; char ErrBuf[64];
@@ -888,11 +888,11 @@ static ACPI_STATUS
UtStrtoul64 ( UtStrtoul64 (
char *String, char *String,
UINT32 Base, UINT32 Base,
ACPI_INTEGER *RetInteger) UINT64 *RetInteger)
{ {
UINT32 Index; UINT32 Index;
UINT32 Sign; UINT32 Sign;
ACPI_INTEGER ReturnValue = 0; UINT64 ReturnValue = 0;
ACPI_STATUS Status = AE_OK; ACPI_STATUS Status = AE_OK;
@@ -916,7 +916,7 @@ UtStrtoul64 (
/* Skip over any white space in the buffer: */ /* Skip over any white space in the buffer: */
while (isspace (*String) || *String == '\t') while (isspace ((int) *String) || *String == '\t')
{ {
++String; ++String;
} }
@@ -948,7 +948,7 @@ UtStrtoul64 (
{ {
if (*String == '0') if (*String == '0')
{ {
if (tolower (*(++String)) == 'x') if (tolower ((int) *(++String)) == 'x')
{ {
Base = 16; Base = 16;
++String; ++String;
@@ -975,7 +975,7 @@ UtStrtoul64 (
if (Base == 16 && if (Base == 16 &&
*String == '0' && *String == '0' &&
tolower (*(++String)) == 'x') tolower ((int) *(++String)) == 'x')
{ {
String++; String++;
} }
@@ -984,14 +984,14 @@ UtStrtoul64 (
while (*String) while (*String)
{ {
if (isdigit (*String)) if (isdigit ((int) *String))
{ {
Index = ((UINT8) *String) - '0'; Index = ((UINT8) *String) - '0';
} }
else else
{ {
Index = (UINT8) toupper (*String); Index = (UINT8) toupper ((int) *String);
if (isupper ((char) Index)) if (isupper ((int) Index))
{ {
Index = Index - 'A' + 10; Index = Index - 'A' + 10;
} }
@@ -1008,8 +1008,8 @@ UtStrtoul64 (
/* Check to see if value is out of range: */ /* Check to see if value is out of range: */
if (ReturnValue > ((ACPI_INTEGER_MAX - (ACPI_INTEGER) Index) / if (ReturnValue > ((ACPI_UINT64_MAX - (UINT64) Index) /
(ACPI_INTEGER) Base)) (UINT64) Base))
{ {
goto ErrorExit; goto ErrorExit;
} }
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -130,6 +130,7 @@
#define _COMPONENT ACPI_CA_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbcmds") ACPI_MODULE_NAME ("dbcmds")
/* Local prototypes */ /* Local prototypes */
static ACPI_STATUS static ACPI_STATUS
@@ -382,7 +383,7 @@ AcpiDbFindReferences (
/* Search all nodes in namespace */ /* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, (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 */ /* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, (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); AcpiOsPrintf ("Found %d predefined names in the namespace\n", Count);
} }
@@ -501,7 +502,7 @@ AcpiDbWalkForExecute (
void **ReturnValue) void **ReturnValue)
{ {
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
UINT32 *Count = (UINT32 *) Context; ACPI_EXECUTE_WALK *Info = (ACPI_EXECUTE_WALK *) Context;
ACPI_BUFFER ReturnObj; ACPI_BUFFER ReturnObj;
ACPI_STATUS Status; ACPI_STATUS Status;
char *Pathname; char *Pathname;
@@ -542,7 +543,6 @@ AcpiDbWalkForExecute (
if (ObjInfo->Type == ACPI_TYPE_METHOD) if (ObjInfo->Type == ACPI_TYPE_METHOD)
{ {
/* Setup default parameters */ /* Setup default parameters */
for (i = 0; i < ObjInfo->ParamCount; i++) for (i = 0; i < ObjInfo->ParamCount; i++)
@@ -556,11 +556,9 @@ AcpiDbWalkForExecute (
} }
ACPI_FREE (ObjInfo); ACPI_FREE (ObjInfo);
ReturnObj.Pointer = NULL; ReturnObj.Pointer = NULL;
ReturnObj.Length = ACPI_ALLOCATE_BUFFER; ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
/* Do the actual method execution */ /* Do the actual method execution */
AcpiGbl_MethodExecuting = TRUE; AcpiGbl_MethodExecuting = TRUE;
@@ -569,11 +567,21 @@ AcpiDbWalkForExecute (
AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status)); AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status));
AcpiGbl_MethodExecuting = FALSE; AcpiGbl_MethodExecuting = FALSE;
ACPI_FREE (Pathname); 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 * FUNCTION: AcpiDbBatchExecute
* *
* PARAMETERS: None * PARAMETERS: CountArg - Max number of methods to execute
* *
* RETURN: None * RETURN: None
* *
* DESCRIPTION: Namespace batch execution. * DESCRIPTION: Namespace batch execution. Execute predefined names in the
* namespace, up to the max count, if specified.
* *
******************************************************************************/ ******************************************************************************/
void void
AcpiDbBatchExecute ( 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 */ /* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, (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 */ /* Create and initialize the new object */
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); ObjDesc = AcpiUtCreateIntegerObject ((UINT64) Value);
if (!ObjDesc) if (!ObjDesc)
{ {
AcpiOsPrintf ("Could not create an internal object\n"); AcpiOsPrintf ("Could not create an internal object\n");
return; return;
} }
ObjDesc->Integer.Value = Value;
/* Store the new object into the target */ /* Store the new object into the target */
switch (Type) switch (Type)
@@ -1303,7 +1319,7 @@ AcpiDbDisplayObjects (
/* Walk the namespace from the root */ /* Walk the namespace from the root */
(void) AcpiWalkNamespace (Type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, (void) AcpiWalkNamespace (Type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForSpecificObjects, (void *) &Info, NULL); AcpiDbWalkForSpecificObjects, NULL, (void *) &Info, NULL);
AcpiOsPrintf ( AcpiOsPrintf (
"\nFound %u objects of type [%s] in the current ACPI Namespace\n", "\nFound %u objects of type [%s] in the current ACPI Namespace\n",
@@ -1419,7 +1435,7 @@ AcpiDbFindNameInNamespace (
/* Walk the namespace from the root */ /* Walk the namespace from the root */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkAndMatchName, AcpiName, NULL); AcpiDbWalkAndMatchName, NULL, AcpiName, NULL);
AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT); AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
return (AE_OK); return (AE_OK);
@@ -1920,7 +1936,7 @@ AcpiDbCheckIntegrity (
/* Search all nodes in namespace */ /* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, (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", AcpiOsPrintf ("Verified %d namespace nodes with %d Objects\n",
Info.Nodes, Info.Objects); Info.Nodes, Info.Objects);
@@ -2107,7 +2123,7 @@ AcpiDbGetBusInfo (
/* Search all nodes in namespace */ /* Search all nodes in namespace */
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbBusWalk, NULL, NULL); AcpiDbBusWalk, NULL, NULL, NULL);
} }
#endif /* ACPI_DEBUGGER */ #endif /* ACPI_DEBUGGER */
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -243,7 +243,7 @@ AcpiDbExecuteMethod (
default: default:
Params[i].Type = ACPI_TYPE_INTEGER; Params[i].Type = ACPI_TYPE_INTEGER;
Params[i].Integer.Value = i * (ACPI_INTEGER) 0x1000; Params[i].Integer.Value = i * (UINT64) 0x1000;
break; break;
} }
} }
@@ -453,7 +453,7 @@ AcpiDbExecute (
if (*Name == '*') if (*Name == '*')
{ {
(void) AcpiWalkNamespace (ACPI_TYPE_METHOD, ACPI_ROOT_OBJECT, (void) AcpiWalkNamespace (ACPI_TYPE_METHOD, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, AcpiDbExecutionWalk, NULL, NULL); ACPI_UINT32_MAX, AcpiDbExecutionWalk, NULL, NULL, NULL);
return; return;
} }
else else
@@ -484,7 +484,7 @@ AcpiDbExecute (
* Allow any handlers in separate threads to complete. * Allow any handlers in separate threads to complete.
* (Such as Notify handlers invoked from AML executed above). * (Such as Notify handlers invoked from AML executed above).
*/ */
AcpiOsSleep ((ACPI_INTEGER) 10); AcpiOsSleep ((UINT64) 10);
#ifdef ACPI_DEBUG_OUTPUT #ifdef ACPI_DEBUG_OUTPUT
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -150,9 +150,6 @@ AcpiDbCheckTextModeCorruption (
UINT32 TableLength, UINT32 TableLength,
UINT32 FileLength); UINT32 FileLength);
static ACPI_STATUS
AeLocalLoadTable (
ACPI_TABLE_HEADER *TablePtr);
#endif #endif
/******************************************************************************* /*******************************************************************************
@@ -424,7 +421,7 @@ AcpiDbReadTable (
{ {
/* Now validate the checksum */ /* Now validate the checksum */
Status = AcpiTbChecksum ((void *) *Table, Status = AcpiTbVerifyChecksum ((void *) *Table,
ACPI_CAST_PTR (ACPI_TABLE_HEADER, *Table)->Length); ACPI_CAST_PTR (ACPI_TABLE_HEADER, *Table)->Length);
if (Status == AE_BAD_CHECKSUM) if (Status == AE_BAD_CHECKSUM)
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -644,7 +644,7 @@ AcpiDbCommandDispatch (
break; break;
case CMD_BATCH: case CMD_BATCH:
AcpiDbBatchExecute (); AcpiDbBatchExecute (AcpiGbl_DbArgs[1]);
break; break;
case CMD_BREAKPOINT: case CMD_BREAKPOINT:
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -446,7 +446,7 @@ AcpiDbCountNamespaceObjects (
} }
(void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, (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 * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -275,6 +275,10 @@ AcpiDbDumpExternalObject (
AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length); AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length);
if (ObjDesc->Buffer.Length) if (ObjDesc->Buffer.Length)
{ {
if (ObjDesc->Buffer.Length > 16)
{
AcpiOsPrintf ("\n");
}
AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT); ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
} }
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -473,8 +473,8 @@ AcpiDmDisassembleOneOp (
case AML_QWORD_OP: case AML_QWORD_OP:
AcpiOsPrintf ("0x%8.8X%8.8X", Op->Common.Value.Integer64.Hi, AcpiOsPrintf ("0x%8.8X%8.8X",
Op->Common.Value.Integer64.Lo); ACPI_FORMAT_UINT64 (Op->Common.Value.Integer));
break; break;
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -129,9 +129,6 @@
ACPI_MODULE_NAME ("dmutils") ACPI_MODULE_NAME ("dmutils")
ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList = NULL;
/* Data used in keeping track of fields */ /* Data used in keeping track of fields */
#if 0 #if 0
const char *AcpiGbl_FENames[] = 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 * FUNCTION: AcpiDmDecodeAttribute
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -130,6 +130,17 @@
#define DB_FULL_OP_INFO "[%4.4s] @%5.5X #%4.4X: " #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 */ /* Local prototypes */
static ACPI_STATUS static ACPI_STATUS
@@ -148,69 +159,6 @@ static UINT32
AcpiDmBlockType ( AcpiDmBlockType (
ACPI_PARSE_OBJECT *Op); 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; const ACPI_OPCODE_INFO *OpInfo;
UINT32 Name; UINT32 Name;
ACPI_PARSE_OBJECT *NextOp; ACPI_PARSE_OBJECT *NextOp;
ACPI_EXTERNAL_LIST *NextExternal;
if (Op->Common.DisasmFlags & ACPI_PARSEOP_IGNORE) if (Op->Common.DisasmFlags & ACPI_PARSEOP_IGNORE)
@@ -554,35 +501,7 @@ AcpiDmDescendingOp (
/* Emit all External() declarations here */ /* Emit all External() declarations here */
if (AcpiGbl_ExternalList) AcpiDmEmitExternals ();
{
/*
* 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");
}
return (AE_OK); return (AE_OK);
} }
} }
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -314,7 +314,7 @@ AcpiDsGetFieldNames (
ACPI_PARSE_OBJECT *Arg) ACPI_PARSE_OBJECT *Arg)
{ {
ACPI_STATUS Status; ACPI_STATUS Status;
ACPI_INTEGER Position; UINT64 Position;
ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info); ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info);
@@ -338,8 +338,8 @@ AcpiDsGetFieldNames (
{ {
case AML_INT_RESERVEDFIELD_OP: case AML_INT_RESERVEDFIELD_OP:
Position = (ACPI_INTEGER) Info->FieldBitPosition Position = (UINT64) Info->FieldBitPosition
+ (ACPI_INTEGER) Arg->Common.Value.Size; + (UINT64) Arg->Common.Value.Size;
if (Position > ACPI_UINT32_MAX) if (Position > ACPI_UINT32_MAX)
{ {
@@ -406,8 +406,8 @@ AcpiDsGetFieldNames (
/* Keep track of bit position for the next field */ /* Keep track of bit position for the next field */
Position = (ACPI_INTEGER) Info->FieldBitPosition Position = (UINT64) Info->FieldBitPosition
+ (ACPI_INTEGER) Arg->Common.Value.Size; + (UINT64) Arg->Common.Value.Size;
if (Position > ACPI_UINT32_MAX) if (Position > ACPI_UINT32_MAX)
{ {
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -283,7 +283,7 @@ AcpiDsInitializeObjects (
* the namespace reader lock. * the namespace reader lock.
*/ */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, StartNode, ACPI_UINT32_MAX, 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)) if (ACPI_FAILURE (Status))
{ {
ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace")); ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -519,7 +519,7 @@ AcpiDsCallControlMethod (
if (ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY) if (ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY)
{ {
Status = ObjDesc->Method.Implementation (NextWalkState); Status = ObjDesc->Method.Extra.Implementation (NextWalkState);
if (Status == AE_OK) if (Status == AE_OK)
{ {
Status = AE_CTRL_TERMINATE; Status = AE_CTRL_TERMINATE;
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -524,13 +524,12 @@ AcpiDsMethodDataGetValue (
if (AcpiGbl_EnableInterpreterSlack) if (AcpiGbl_EnableInterpreterSlack)
{ {
Object = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); Object = AcpiUtCreateIntegerObject ((UINT64) 0);
if (!Object) if (!Object)
{ {
return_ACPI_STATUS (AE_NO_MEMORY); return_ACPI_STATUS (AE_NO_MEMORY);
} }
Object->Integer.Value = 0;
Node->Object = Object; Node->Object = Object;
} }
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -574,7 +574,7 @@ AcpiDsBuildInternalPackageObj (
* *
* Note: technically, this is an error, from ACPI spec: "It is an error * 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 * 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 * no exception is returned. This provides Windows compatibility. Some
* BIOSs will alter the NumElements on the fly, creating this type * BIOSs will alter the NumElements on the fly, creating this type
* of ill-formed package object. * of ill-formed package object.
@@ -598,8 +598,8 @@ AcpiDsBuildInternalPackageObj (
Arg = Arg->Common.Next; Arg = Arg->Common.Next;
} }
ACPI_ERROR ((AE_INFO, ACPI_INFO ((AE_INFO,
"Package List length (0x%X) larger than NumElements count (0x%X), truncated\n", "Actual Package length (0x%X) is larger than NumElements field (0x%X), truncated\n",
i, ElementCount)); i, ElementCount));
} }
else if (i < ElementCount) else if (i < ElementCount)
@@ -787,7 +787,7 @@ AcpiDsInitObjectFromOp (
case AML_ONES_OP: 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 */ /* Truncate value if we are executing from a 32-bit ACPI table */
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -263,7 +263,7 @@ AcpiDsLoad1BeginOp (
* Target of Scope() not found. Generate an External for it, and * Target of Scope() not found. Generate an External for it, and
* insert the name into the namespace. * 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, Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
WalkState, &Node); WalkState, &Node);
@@ -296,18 +296,19 @@ AcpiDsLoad1BeginOp (
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
/* /*
* These types we will allow, but we will change the type. This * These types we will allow, but we will change the type.
* enables some existing code of the form: * This enables some existing code of the form:
* *
* Name (DEB, 0) * Name (DEB, 0)
* Scope (DEB) { ... } * Scope (DEB) { ... }
* *
* Note: silently change the type here. On the second pass, we will report * Note: silently change the type here. On the second pass,
* a warning * we will report a warning
*/ */
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n", "Type override - [%4.4s] had invalid type (%s) "
Path, AcpiUtGetTypeName (Node->Type))); "for Scope operator, changed to type ANY\n",
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type)));
Node->Type = ACPI_TYPE_ANY; Node->Type = ACPI_TYPE_ANY;
WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;
@@ -318,8 +319,9 @@ AcpiDsLoad1BeginOp (
/* All other types are an error */ /* All other types are an error */
ACPI_ERROR ((AE_INFO, ACPI_ERROR ((AE_INFO,
"Invalid type (%s) for target of Scope operator [%4.4s] (Cannot override)", "Invalid type (%s) for target of "
AcpiUtGetTypeName (Node->Type), Path)); "Scope operator [%4.4s] (Cannot override)",
AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE); return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
} }
@@ -732,29 +734,45 @@ AcpiDsLoad2BeginOp (
break; break;
case AML_SCOPE_OP: case AML_SCOPE_OP:
/*
* The Path is an object reference to an existing object. /* Special case for Scope(\) -> refers to the Root node */
* Don't enter the name into the namespace, but look it up
* for use later. if (Op && (Op->Named.Node == AcpiGbl_RootNode))
*/ {
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType, 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, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
WalkState, &(Node)); WalkState, &(Node));
if (ACPI_FAILURE (Status)) if (ACPI_FAILURE (Status))
{ {
#ifdef ACPI_ASL_COMPILER #ifdef ACPI_ASL_COMPILER
if (Status == AE_NOT_FOUND) if (Status == AE_NOT_FOUND)
{ {
Status = AE_OK; Status = AE_OK;
} }
else else
{ {
ACPI_ERROR_NAMESPACE (BufferPtr, Status); ACPI_ERROR_NAMESPACE (BufferPtr, Status);
} }
#else #else
ACPI_ERROR_NAMESPACE (BufferPtr, Status); ACPI_ERROR_NAMESPACE (BufferPtr, Status);
#endif #endif
return_ACPI_STATUS (Status); return_ACPI_STATUS (Status);
}
} }
/* /*
@@ -778,15 +796,16 @@ AcpiDsLoad2BeginOp (
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
/* /*
* These types we will allow, but we will change the type. This * These types we will allow, but we will change the type.
* enables some existing code of the form: * This enables some existing code of the form:
* *
* Name (DEB, 0) * Name (DEB, 0)
* Scope (DEB) { ... } * Scope (DEB) { ... }
*/ */
ACPI_WARNING ((AE_INFO, ACPI_WARNING ((AE_INFO,
"Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)", "Type override - [%4.4s] had invalid type (%s) "
BufferPtr, AcpiUtGetTypeName (Node->Type))); "for Scope operator, changed to type ANY\n",
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type)));
Node->Type = ACPI_TYPE_ANY; Node->Type = ACPI_TYPE_ANY;
WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;
@@ -797,8 +816,9 @@ AcpiDsLoad2BeginOp (
/* All other types are an error */ /* All other types are an error */
ACPI_ERROR ((AE_INFO, ACPI_ERROR ((AE_INFO,
"Invalid type (%s) for target of Scope operator [%4.4s]", "Invalid type (%s) for target of "
AcpiUtGetTypeName (Node->Type), BufferPtr)); "Scope operator [%4.4s] (Cannot override)",
AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node)));
return (AE_AML_OPERAND_TYPE); 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) if (WalkState->MethodNode)
{ {
/*
* Executing a method: initialize the region and unlock
* the interpreter
*/
Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length, Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
RegionSpace, WalkState); RegionSpace, WalkState);
if (ACPI_FAILURE (Status)) if (ACPI_FAILURE (Status))
{ {
return (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), Status = AcpiEvInitializeRegion (AcpiNsGetAttachedObject (Node),
FALSE); FALSE);
if (WalkState->MethodNode)
{
AcpiExEnterInterpreter ();
}
if (ACPI_FAILURE (Status)) if (ACPI_FAILURE (Status))
{ {
/* /*
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -1110,7 +1110,7 @@ AcpiEvCreateGpeBlock (
Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD, GpeDevice, Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD, GpeDevice,
ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK, ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
AcpiEvSaveMethodInfo, GpeBlock, NULL); AcpiEvSaveMethodInfo, NULL, GpeBlock, NULL);
/* Return the new block */ /* Return the new block */
@@ -1192,7 +1192,7 @@ AcpiEvInitializeGpeBlock (
Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK, ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK,
AcpiEvMatchPrwAndGpe, &GpeInfo, NULL); AcpiEvMatchPrwAndGpe, NULL, &GpeInfo, NULL);
} }
/* /*
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -128,6 +128,11 @@
/* Local prototypes */ /* Local prototypes */
static BOOLEAN
AcpiEvHasDefaultHandler (
ACPI_NAMESPACE_NODE *Node,
ACPI_ADR_SPACE_TYPE SpaceId);
static ACPI_STATUS static ACPI_STATUS
AcpiEvRegRun ( AcpiEvRegRun (
ACPI_HANDLE ObjHandle, 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 * FUNCTION: AcpiEvInitializeOpRegions
@@ -266,11 +322,16 @@ AcpiEvInitializeOpRegions (
for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++) for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++)
{ {
/* /*
* TBD: Make sure handler is the DEFAULT handler, otherwise * Make sure the installed handler is the DEFAULT handler. If not the
* _REG will have already been run. * default, the _REG methods will have already been run (when the
* handler was installed)
*/ */
Status = AcpiEvExecuteRegMethods (AcpiGbl_RootNode, if (AcpiEvHasDefaultHandler (AcpiGbl_RootNode,
AcpiGbl_DefaultAddressSpaces[i]); AcpiGbl_DefaultAddressSpaces[i]))
{
Status = AcpiEvExecuteRegMethods (AcpiGbl_RootNode,
AcpiGbl_DefaultAddressSpaces[i]);
}
} }
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
@@ -339,25 +400,21 @@ AcpiEvExecuteRegMethod (
* connection status 1 for connecting the handler, 0 for disconnecting * connection status 1 for connecting the handler, 0 for disconnecting
* the handler (Passed as a parameter) * the handler (Passed as a parameter)
*/ */
Args[0] = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); Args[0] = AcpiUtCreateIntegerObject ((UINT64) RegionObj->Region.SpaceId);
if (!Args[0]) if (!Args[0])
{ {
Status = AE_NO_MEMORY; Status = AE_NO_MEMORY;
goto Cleanup1; goto Cleanup1;
} }
Args[1] = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); Args[1] = AcpiUtCreateIntegerObject ((UINT64) Function);
if (!Args[1]) if (!Args[1])
{ {
Status = AE_NO_MEMORY; Status = AE_NO_MEMORY;
goto Cleanup2; goto Cleanup2;
} }
/* Setup the parameter objects */ Args[2] = NULL; /* Terminate list */
Args[0]->Integer.Value = RegionObj->Region.SpaceId;
Args[1]->Integer.Value = Function;
Args[2] = NULL;
/* Execute the method, no return value */ /* Execute the method, no return value */
@@ -385,7 +442,7 @@ Cleanup1:
* RegionOffset - Where in the region to read or write * RegionOffset - Where in the region to read or write
* BitWidth - Field width in bits (8, 16, 32, or 64) * BitWidth - Field width in bits (8, 16, 32, or 64)
* Value - Pointer to in or out value, must be * Value - Pointer to in or out value, must be
* full 64-bit ACPI_INTEGER * a full 64-bit integer
* *
* RETURN: Status * RETURN: Status
* *
@@ -400,7 +457,7 @@ AcpiEvAddressSpaceDispatch (
UINT32 Function, UINT32 Function,
UINT32 RegionOffset, UINT32 RegionOffset,
UINT32 BitWidth, UINT32 BitWidth,
ACPI_INTEGER *Value) UINT64 *Value)
{ {
ACPI_STATUS Status; ACPI_STATUS Status;
ACPI_ADR_SPACE_HANDLER Handler; ACPI_ADR_SPACE_HANDLER Handler;
@@ -788,7 +845,7 @@ AcpiEvInstallHandler (
/* Convert and validate the device handle */ /* Convert and validate the device handle */
Node = AcpiNsMapHandleToNode (ObjHandle); Node = AcpiNsValidateHandle (ObjHandle);
if (!Node) if (!Node)
{ {
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
@@ -1112,7 +1169,7 @@ AcpiEvInstallSpaceHandler (
* of the branch * of the branch
*/ */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX, Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
ACPI_NS_WALK_UNLOCK, AcpiEvInstallHandler, ACPI_NS_WALK_UNLOCK, AcpiEvInstallHandler, NULL,
HandlerObj, NULL); HandlerObj, NULL);
UnlockAndExit: UnlockAndExit:
@@ -1152,7 +1209,7 @@ AcpiEvExecuteRegMethods (
* regions of this Space ID before we can run any _REG methods) * regions of this Space ID before we can run any _REG methods)
*/ */
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX, Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL,
&SpaceId, NULL); &SpaceId, NULL);
return_ACPI_STATUS (Status); return_ACPI_STATUS (Status);
@@ -1186,7 +1243,7 @@ AcpiEvRegRun (
/* Convert and validate the device handle */ /* Convert and validate the device handle */
Node = AcpiNsMapHandleToNode (ObjHandle); Node = AcpiNsValidateHandle (ObjHandle);
if (!Node) if (!Node)
{ {
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -260,7 +260,7 @@ AcpiEvPciConfigRegionSetup (
void **RegionContext) void **RegionContext)
{ {
ACPI_STATUS Status = AE_OK; ACPI_STATUS Status = AE_OK;
ACPI_INTEGER PciValue; UINT64 PciValue;
ACPI_PCI_ID *PciId = *RegionContext; ACPI_PCI_ID *PciId = *RegionContext;
ACPI_OPERAND_OBJECT *HandlerObj; ACPI_OPERAND_OBJECT *HandlerObj;
ACPI_NAMESPACE_NODE *ParentNode; ACPI_NAMESPACE_NODE *ParentNode;
@@ -716,6 +716,20 @@ AcpiEvInitializeRegion (
HandlerObj = ObjDesc->ThermalZone.Handler; HandlerObj = ObjDesc->ThermalZone.Handler;
break; 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: default:
/* Ignore other objects */ /* Ignore other objects */
break; break;
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -368,7 +368,7 @@ AcpiInstallNotifyHandler (
/* Convert and validate the device handle */ /* Convert and validate the device handle */
Node = AcpiNsMapHandleToNode (Device); Node = AcpiNsValidateHandle (Device);
if (!Node) if (!Node)
{ {
Status = AE_BAD_PARAMETER; Status = AE_BAD_PARAMETER;
@@ -555,7 +555,7 @@ AcpiRemoveNotifyHandler (
/* Convert and validate the device handle */ /* Convert and validate the device handle */
Node = AcpiNsMapHandleToNode (Device); Node = AcpiNsValidateHandle (Device);
if (!Node) if (!Node)
{ {
Status = AE_BAD_PARAMETER; Status = AE_BAD_PARAMETER;
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -805,7 +805,7 @@ AcpiInstallGpeBlock (
return (Status); return (Status);
} }
Node = AcpiNsMapHandleToNode (GpeDevice); Node = AcpiNsValidateHandle (GpeDevice);
if (!Node) if (!Node)
{ {
Status = AE_BAD_PARAMETER; Status = AE_BAD_PARAMETER;
@@ -905,7 +905,7 @@ AcpiRemoveGpeBlock (
return (Status); return (Status);
} }
Node = AcpiNsMapHandleToNode (GpeDevice); Node = AcpiNsValidateHandle (GpeDevice);
if (!Node) if (!Node)
{ {
Status = AE_BAD_PARAMETER; Status = AE_BAD_PARAMETER;
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -171,7 +171,7 @@ AcpiInstallAddressSpaceHandler (
/* Convert and validate the device handle */ /* Convert and validate the device handle */
Node = AcpiNsMapHandleToNode (Device); Node = AcpiNsValidateHandle (Device);
if (!Node) if (!Node)
{ {
Status = AE_BAD_PARAMETER; Status = AE_BAD_PARAMETER;
@@ -244,7 +244,7 @@ AcpiRemoveAddressSpaceHandler (
/* Convert and validate the device handle */ /* Convert and validate the device handle */
Node = AcpiNsMapHandleToNode (Device); Node = AcpiNsValidateHandle (Device);
if (!Node || if (!Node ||
((Node->Type != ACPI_TYPE_DEVICE) && ((Node->Type != ACPI_TYPE_DEVICE) &&
(Node->Type != ACPI_TYPE_PROCESSOR) && (Node->Type != ACPI_TYPE_PROCESSOR) &&
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -263,15 +263,13 @@ AcpiExLoadTableOp (
/* Table not found, return an Integer=0 and AE_OK */ /* Table not found, return an Integer=0 and AE_OK */
DdbHandle = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); DdbHandle = AcpiUtCreateIntegerObject ((UINT64) 0);
if (!DdbHandle) if (!DdbHandle)
{ {
return_ACPI_STATUS (AE_NO_MEMORY); return_ACPI_STATUS (AE_NO_MEMORY);
} }
DdbHandle->Integer.Value = 0;
*ReturnDesc = DdbHandle; *ReturnDesc = DdbHandle;
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
@@ -389,7 +387,7 @@ AcpiExRegionRead (
UINT8 *Buffer) UINT8 *Buffer)
{ {
ACPI_STATUS Status; ACPI_STATUS Status;
ACPI_INTEGER Value; UINT64 Value;
UINT32 RegionOffset = 0; UINT32 RegionOffset = 0;
UINT32 i; UINT32 i;
@@ -612,7 +610,10 @@ AcpiExLoadOp (
Status = AcpiTbAddTable (&TableDesc, &TableIndex); Status = AcpiTbAddTable (&TableDesc, &TableIndex);
if (ACPI_FAILURE (Status)) if (ACPI_FAILURE (Status))
{ {
goto Cleanup; /* Delete allocated table buffer */
AcpiTbDeleteTable (&TableDesc);
return_ACPI_STATUS (Status);
} }
/* /*
@@ -655,13 +656,6 @@ AcpiExLoadOp (
AcpiGbl_TableHandlerContext); AcpiGbl_TableHandlerContext);
} }
Cleanup:
if (ACPI_FAILURE (Status))
{
/* Delete allocated table buffer */
AcpiTbDeleteTable (&TableDesc);
}
return_ACPI_STATUS (Status); return_ACPI_STATUS (Status);
} }
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -129,7 +129,7 @@
static UINT32 static UINT32
AcpiExConvertToAscii ( AcpiExConvertToAscii (
ACPI_INTEGER Integer, UINT64 Integer,
UINT16 Base, UINT16 Base,
UINT8 *String, UINT8 *String,
UINT8 MaxLength); UINT8 MaxLength);
@@ -158,7 +158,7 @@ AcpiExConvertToInteger (
{ {
ACPI_OPERAND_OBJECT *ReturnDesc; ACPI_OPERAND_OBJECT *ReturnDesc;
UINT8 *Pointer; UINT8 *Pointer;
ACPI_INTEGER Result; UINT64 Result;
UINT32 i; UINT32 i;
UINT32 Count; UINT32 Count;
ACPI_STATUS Status; ACPI_STATUS Status;
@@ -247,7 +247,7 @@ AcpiExConvertToInteger (
* Little endian is used, meaning that the first byte of the buffer * Little endian is used, meaning that the first byte of the buffer
* is the LSB of the integer * is the LSB of the integer
*/ */
Result |= (((ACPI_INTEGER) Pointer[i]) << (i * 8)); Result |= (((UINT64) Pointer[i]) << (i * 8));
} }
break; break;
@@ -260,7 +260,7 @@ AcpiExConvertToInteger (
/* Create a new integer */ /* Create a new integer */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); ReturnDesc = AcpiUtCreateIntegerObject (Result);
if (!ReturnDesc) if (!ReturnDesc)
{ {
return_ACPI_STATUS (AE_NO_MEMORY); return_ACPI_STATUS (AE_NO_MEMORY);
@@ -271,7 +271,6 @@ AcpiExConvertToInteger (
/* Save the Result */ /* Save the Result */
ReturnDesc->Integer.Value = Result;
AcpiExTruncateFor32bitTable (ReturnDesc); AcpiExTruncateFor32bitTable (ReturnDesc);
*ResultDesc = ReturnDesc; *ResultDesc = ReturnDesc;
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
@@ -390,12 +389,12 @@ AcpiExConvertToBuffer (
static UINT32 static UINT32
AcpiExConvertToAscii ( AcpiExConvertToAscii (
ACPI_INTEGER Integer, UINT64 Integer,
UINT16 Base, UINT16 Base,
UINT8 *String, UINT8 *String,
UINT8 DataWidth) UINT8 DataWidth)
{ {
ACPI_INTEGER Digit; UINT64 Digit;
UINT32 i; UINT32 i;
UINT32 j; UINT32 j;
UINT32 k = 0; UINT32 k = 0;
@@ -660,7 +659,7 @@ AcpiExConvertToString (
for (i = 0; i < ObjDesc->Buffer.Length; i++) for (i = 0; i < ObjDesc->Buffer.Length; i++)
{ {
NewBuf += AcpiExConvertToAscii ( NewBuf += AcpiExConvertToAscii (
(ACPI_INTEGER) ObjDesc->Buffer.Pointer[i], Base, (UINT64) ObjDesc->Buffer.Pointer[i], Base,
NewBuf, 1); NewBuf, 1);
*NewBuf++ = Separator; /* each separated by a comma or space */ *NewBuf++ = Separator; /* each separated by a comma or space */
} }
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -217,7 +217,7 @@ AcpiExReadDataFromField (
/* Call the region handler for the read */ /* Call the region handler for the read */
Status = AcpiExAccessRegion (ObjDesc, 0, Status = AcpiExAccessRegion (ObjDesc, 0,
ACPI_CAST_PTR (ACPI_INTEGER, BufferDesc->Buffer.Pointer), ACPI_CAST_PTR (UINT64, BufferDesc->Buffer.Pointer),
Function); Function);
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags); AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
goto Exit; goto Exit;
@@ -226,7 +226,7 @@ AcpiExReadDataFromField (
/* /*
* Allocate a buffer for the contents of the field. * 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 * a BUFFER to hold it. Otherwise, use an INTEGER. This allows
* the use of arithmetic operators on the returned value if the * the use of arithmetic operators on the returned value if the
* field size is equal or smaller than an Integer. * field size is equal or smaller than an Integer.
@@ -249,14 +249,13 @@ AcpiExReadDataFromField (
{ {
/* Field will fit within an Integer (normal case) */ /* Field will fit within an Integer (normal case) */
BufferDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); BufferDesc = AcpiUtCreateIntegerObject ((UINT64) 0);
if (!BufferDesc) if (!BufferDesc)
{ {
return_ACPI_STATUS (AE_NO_MEMORY); return_ACPI_STATUS (AE_NO_MEMORY);
} }
Length = AcpiGbl_IntegerByteWidth; Length = AcpiGbl_IntegerByteWidth;
BufferDesc->Integer.Value = 0;
Buffer = &BufferDesc->Integer.Value; Buffer = &BufferDesc->Integer.Value;
} }
@@ -409,7 +408,7 @@ AcpiExWriteDataToField (
* same buffer) * same buffer)
*/ */
Status = AcpiExAccessRegion (ObjDesc, 0, Status = AcpiExAccessRegion (ObjDesc, 0,
(ACPI_INTEGER *) Buffer, Function); (UINT64 *) Buffer, Function);
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags); AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
*ResultDesc = BufferDesc; *ResultDesc = BufferDesc;
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -133,13 +133,13 @@ static ACPI_STATUS
AcpiExFieldDatumIo ( AcpiExFieldDatumIo (
ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT *ObjDesc,
UINT32 FieldDatumByteOffset, UINT32 FieldDatumByteOffset,
ACPI_INTEGER *Value, UINT64 *Value,
UINT32 ReadWrite); UINT32 ReadWrite);
static BOOLEAN static BOOLEAN
AcpiExRegisterOverflow ( AcpiExRegisterOverflow (
ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_INTEGER Value); UINT64 Value);
static ACPI_STATUS static ACPI_STATUS
AcpiExSetupRegion ( AcpiExSetupRegion (
@@ -296,7 +296,7 @@ AcpiExSetupRegion (
* FieldDatumByteOffset - Byte offset of this datum within the * FieldDatumByteOffset - Byte offset of this datum within the
* parent field * parent field
* Value - Where to store value (must at least * Value - Where to store value (must at least
* the size of ACPI_INTEGER) * 64 bits)
* Function - Read or Write flag plus other region- * Function - Read or Write flag plus other region-
* dependent flags * dependent flags
* *
@@ -310,7 +310,7 @@ ACPI_STATUS
AcpiExAccessRegion ( AcpiExAccessRegion (
ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT *ObjDesc,
UINT32 FieldDatumByteOffset, UINT32 FieldDatumByteOffset,
ACPI_INTEGER *Value, UINT64 *Value,
UINT32 Function) UINT32 Function)
{ {
ACPI_STATUS Status; ACPI_STATUS Status;
@@ -408,7 +408,7 @@ AcpiExAccessRegion (
static BOOLEAN static BOOLEAN
AcpiExRegisterOverflow ( AcpiExRegisterOverflow (
ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_INTEGER Value) UINT64 Value)
{ {
if (ObjDesc->CommonField.BitLength >= ACPI_INTEGER_BIT_SIZE) if (ObjDesc->CommonField.BitLength >= ACPI_INTEGER_BIT_SIZE)
@@ -420,7 +420,7 @@ AcpiExRegisterOverflow (
return (FALSE); 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 * The Value is larger than the maximum value that can fit into
@@ -457,11 +457,11 @@ static ACPI_STATUS
AcpiExFieldDatumIo ( AcpiExFieldDatumIo (
ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT *ObjDesc,
UINT32 FieldDatumByteOffset, UINT32 FieldDatumByteOffset,
ACPI_INTEGER *Value, UINT64 *Value,
UINT32 ReadWrite) UINT32 ReadWrite)
{ {
ACPI_STATUS Status; ACPI_STATUS Status;
ACPI_INTEGER LocalValue; UINT64 LocalValue;
ACPI_FUNCTION_TRACE_U32 (ExFieldDatumIo, FieldDatumByteOffset); ACPI_FUNCTION_TRACE_U32 (ExFieldDatumIo, FieldDatumByteOffset);
@@ -543,7 +543,7 @@ AcpiExFieldDatumIo (
* the register * the register
*/ */
if (AcpiExRegisterOverflow (ObjDesc->BankField.BankObj, if (AcpiExRegisterOverflow (ObjDesc->BankField.BankObj,
(ACPI_INTEGER) ObjDesc->BankField.Value)) (UINT64) ObjDesc->BankField.Value))
{ {
return_ACPI_STATUS (AE_AML_REGISTER_LIMIT); return_ACPI_STATUS (AE_AML_REGISTER_LIMIT);
} }
@@ -586,7 +586,7 @@ AcpiExFieldDatumIo (
* the register * the register
*/ */
if (AcpiExRegisterOverflow (ObjDesc->IndexField.IndexObj, if (AcpiExRegisterOverflow (ObjDesc->IndexField.IndexObj,
(ACPI_INTEGER) ObjDesc->IndexField.Value)) (UINT64) ObjDesc->IndexField.Value))
{ {
return_ACPI_STATUS (AE_AML_REGISTER_LIMIT); return_ACPI_STATUS (AE_AML_REGISTER_LIMIT);
} }
@@ -615,7 +615,7 @@ AcpiExFieldDatumIo (
"Read from Data Register\n")); "Read from Data Register\n"));
Status = AcpiExExtractFromField (ObjDesc->IndexField.DataObj, Status = AcpiExExtractFromField (ObjDesc->IndexField.DataObj,
Value, sizeof (ACPI_INTEGER)); Value, sizeof (UINT64));
} }
else else
{ {
@@ -626,7 +626,7 @@ AcpiExFieldDatumIo (
ACPI_FORMAT_UINT64 (*Value))); ACPI_FORMAT_UINT64 (*Value)));
Status = AcpiExInsertIntoField (ObjDesc->IndexField.DataObj, Status = AcpiExInsertIntoField (ObjDesc->IndexField.DataObj,
Value, sizeof (ACPI_INTEGER)); Value, sizeof (UINT64));
} }
break; break;
@@ -679,13 +679,13 @@ AcpiExFieldDatumIo (
ACPI_STATUS ACPI_STATUS
AcpiExWriteWithUpdateRule ( AcpiExWriteWithUpdateRule (
ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_INTEGER Mask, UINT64 Mask,
ACPI_INTEGER FieldValue, UINT64 FieldValue,
UINT32 FieldDatumByteOffset) UINT32 FieldDatumByteOffset)
{ {
ACPI_STATUS Status = AE_OK; ACPI_STATUS Status = AE_OK;
ACPI_INTEGER MergedValue; UINT64 MergedValue;
ACPI_INTEGER CurrentValue; UINT64 CurrentValue;
ACPI_FUNCTION_TRACE_U32 (ExWriteWithUpdateRule, Mask); 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 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 */ /* Decode the update rule */
@@ -787,8 +787,8 @@ AcpiExExtractFromField (
UINT32 BufferLength) UINT32 BufferLength)
{ {
ACPI_STATUS Status; ACPI_STATUS Status;
ACPI_INTEGER RawDatum; UINT64 RawDatum;
ACPI_INTEGER MergedDatum; UINT64 MergedDatum;
UINT32 FieldOffset = 0; UINT32 FieldOffset = 0;
UINT32 BufferOffset = 0; UINT32 BufferOffset = 0;
UINT32 BufferTailBits; UINT32 BufferTailBits;
@@ -917,10 +917,10 @@ AcpiExInsertIntoField (
UINT32 BufferLength) UINT32 BufferLength)
{ {
ACPI_STATUS Status; ACPI_STATUS Status;
ACPI_INTEGER Mask; UINT64 Mask;
ACPI_INTEGER WidthMask; UINT64 WidthMask;
ACPI_INTEGER MergedDatum; UINT64 MergedDatum;
ACPI_INTEGER RawDatum = 0; UINT64 RawDatum = 0;
UINT32 FieldOffset = 0; UINT32 FieldOffset = 0;
UINT32 BufferOffset = 0; UINT32 BufferOffset = 0;
UINT32 BufferTailBits; UINT32 BufferTailBits;
@@ -972,7 +972,7 @@ AcpiExInsertIntoField (
*/ */
if (ObjDesc->CommonField.AccessBitWidth == ACPI_INTEGER_BIT_SIZE) if (ObjDesc->CommonField.AccessBitWidth == ACPI_INTEGER_BIT_SIZE)
{ {
WidthMask = ACPI_INTEGER_MAX; WidthMask = ACPI_UINT64_MAX;
} }
else else
{ {
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -508,11 +508,11 @@ Cleanup:
* *
******************************************************************************/ ******************************************************************************/
ACPI_INTEGER UINT64
AcpiExDoMathOp ( AcpiExDoMathOp (
UINT16 Opcode, UINT16 Opcode,
ACPI_INTEGER Integer0, UINT64 Integer0,
ACPI_INTEGER Integer1) UINT64 Integer1)
{ {
ACPI_FUNCTION_ENTRY (); ACPI_FUNCTION_ENTRY ();
@@ -615,8 +615,8 @@ AcpiExDoMathOp (
ACPI_STATUS ACPI_STATUS
AcpiExDoLogicalNumericOp ( AcpiExDoLogicalNumericOp (
UINT16 Opcode, UINT16 Opcode,
ACPI_INTEGER Integer0, UINT64 Integer0,
ACPI_INTEGER Integer1, UINT64 Integer1,
BOOLEAN *LogicalResult) BOOLEAN *LogicalResult)
{ {
ACPI_STATUS Status = AE_OK; ACPI_STATUS Status = AE_OK;
@@ -690,8 +690,8 @@ AcpiExDoLogicalOp (
BOOLEAN *LogicalResult) BOOLEAN *LogicalResult)
{ {
ACPI_OPERAND_OBJECT *LocalOperand1 = Operand1; ACPI_OPERAND_OBJECT *LocalOperand1 = Operand1;
ACPI_INTEGER Integer0; UINT64 Integer0;
ACPI_INTEGER Integer1; UINT64 Integer1;
UINT32 Length0; UINT32 Length0;
UINT32 Length1; UINT32 Length1;
ACPI_STATUS Status = AE_OK; ACPI_STATUS Status = AE_OK;
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -490,6 +490,15 @@ AcpiExReleaseMutex (
return_ACPI_STATUS (AE_AML_MUTEX_NOT_ACQUIRED); 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. * The Mutex is owned, but this thread must be the owner.
* Special case for Global Lock, any thread can release * Special case for Global Lock, any thread can release
@@ -505,15 +514,6 @@ AcpiExReleaseMutex (
return_ACPI_STATUS (AE_AML_NOT_OWNER); 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 * 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 * other words, the current level means that at least one mutex at that
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -183,13 +183,12 @@ AcpiExOpcode_0A_0T_1R (
/* Create a return object of type Integer */ /* Create a return object of type Integer */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); ReturnDesc = AcpiUtCreateIntegerObject (AcpiOsGetTimer ());
if (!ReturnDesc) if (!ReturnDesc)
{ {
Status = AE_NO_MEMORY; Status = AE_NO_MEMORY;
goto Cleanup; goto Cleanup;
} }
ReturnDesc->Integer.Value = AcpiOsGetTimer ();
break; break;
default: /* Unknown opcode */ default: /* Unknown opcode */
@@ -369,8 +368,8 @@ AcpiExOpcode_1A_1T_1R (
ACPI_OPERAND_OBJECT *ReturnDesc2 = NULL; ACPI_OPERAND_OBJECT *ReturnDesc2 = NULL;
UINT32 Temp32; UINT32 Temp32;
UINT32 i; UINT32 i;
ACPI_INTEGER PowerOfTen; UINT64 PowerOfTen;
ACPI_INTEGER Digit; UINT64 Digit;
ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_1T_1R, 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 */ /* Sum the digit into the result with the current power of 10 */
ReturnDesc->Integer.Value += ReturnDesc->Integer.Value +=
(((ACPI_INTEGER) Temp32) * PowerOfTen); (((UINT64) Temp32) * PowerOfTen);
/* Shift to next BCD digit */ /* Shift to next BCD digit */
@@ -507,7 +506,7 @@ AcpiExOpcode_1A_1T_1R (
* remainder from above * remainder from above
*/ */
ReturnDesc->Integer.Value |= 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 */ /* 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 */ /* The object exists in the namespace, return TRUE */
ReturnDesc->Integer.Value = ACPI_INTEGER_MAX; ReturnDesc->Integer.Value = ACPI_UINT64_MAX;
goto Cleanup; goto Cleanup;
@@ -720,7 +719,7 @@ AcpiExOpcode_1A_0T_1R (
ACPI_OPERAND_OBJECT *ReturnDesc = NULL; ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
ACPI_STATUS Status = AE_OK; ACPI_STATUS Status = AE_OK;
UINT32 Type; UINT32 Type;
ACPI_INTEGER Value; UINT64 Value;
ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_0T_1R, ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_0T_1R,
@@ -733,7 +732,7 @@ AcpiExOpcode_1A_0T_1R (
{ {
case AML_LNOT_OP: /* LNot (Operand) */ case AML_LNOT_OP: /* LNot (Operand) */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); ReturnDesc = AcpiUtCreateIntegerObject ((UINT64) 0);
if (!ReturnDesc) if (!ReturnDesc)
{ {
Status = AE_NO_MEMORY; Status = AE_NO_MEMORY;
@@ -746,7 +745,7 @@ AcpiExOpcode_1A_0T_1R (
*/ */
if (!Operand[0]->Integer.Value) if (!Operand[0]->Integer.Value)
{ {
ReturnDesc->Integer.Value = ACPI_INTEGER_MAX; ReturnDesc->Integer.Value = ACPI_UINT64_MAX;
} }
break; break;
@@ -838,14 +837,12 @@ AcpiExOpcode_1A_0T_1R (
/* Allocate a descriptor to hold the type. */ /* Allocate a descriptor to hold the type. */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); ReturnDesc = AcpiUtCreateIntegerObject ((UINT64) Type);
if (!ReturnDesc) if (!ReturnDesc)
{ {
Status = AE_NO_MEMORY; Status = AE_NO_MEMORY;
goto Cleanup; goto Cleanup;
} }
ReturnDesc->Integer.Value = Type;
break; break;
@@ -917,14 +914,12 @@ AcpiExOpcode_1A_0T_1R (
* Now that we have the size of the object, create a result * Now that we have the size of the object, create a result
* object to hold the value * object to hold the value
*/ */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); ReturnDesc = AcpiUtCreateIntegerObject (Value);
if (!ReturnDesc) if (!ReturnDesc)
{ {
Status = AE_NO_MEMORY; Status = AE_NO_MEMORY;
goto Cleanup; goto Cleanup;
} }
ReturnDesc->Integer.Value = Value;
break; break;
@@ -1089,21 +1084,18 @@ AcpiExOpcode_1A_0T_1R (
* NOTE: index into a buffer is NOT a pointer to a * NOTE: index into a buffer is NOT a pointer to a
* sub-buffer of the main buffer, it is only a pointer to a * sub-buffer of the main buffer, it is only a pointer to a
* single element (byte) of the buffer! * 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) if (!ReturnDesc)
{ {
Status = AE_NO_MEMORY; Status = AE_NO_MEMORY;
goto Cleanup; 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; break;
@@ -8,7 +8,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -383,7 +383,7 @@ AcpiExOpcode_2A_1T_1R (
{ {
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
ACPI_OPERAND_OBJECT *ReturnDesc = NULL; ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
ACPI_INTEGER Index; UINT64 Index;
ACPI_STATUS Status = AE_OK; ACPI_STATUS Status = AE_OK;
ACPI_SIZE Length; ACPI_SIZE Length;
@@ -716,7 +716,7 @@ StoreLogicalResult:
*/ */
if (LogicalResult) if (LogicalResult)
{ {
ReturnDesc->Integer.Value = ACPI_INTEGER_MAX; ReturnDesc->Integer.Value = ACPI_UINT64_MAX;
} }
Cleanup: Cleanup:
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -239,7 +239,7 @@ AcpiExOpcode_3A_1T_1R (
ACPI_OPERAND_OBJECT *ReturnDesc = NULL; ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
char *Buffer = NULL; char *Buffer = NULL;
ACPI_STATUS Status = AE_OK; ACPI_STATUS Status = AE_OK;
ACPI_INTEGER Index; UINT64 Index;
ACPI_SIZE Length; ACPI_SIZE Length;
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -305,7 +305,7 @@ AcpiExOpcode_6A_0T_1R (
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
ACPI_OPERAND_OBJECT *ReturnDesc = NULL; ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
ACPI_STATUS Status = AE_OK; ACPI_STATUS Status = AE_OK;
ACPI_INTEGER Index; UINT64 Index;
ACPI_OPERAND_OBJECT *ThisElement; ACPI_OPERAND_OBJECT *ThisElement;
@@ -344,8 +344,9 @@ AcpiExOpcode_6A_0T_1R (
} }
/* Create an integer for the return value */ /* 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) if (!ReturnDesc)
{ {
Status = AE_NO_MEMORY; 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 * Examine each element until a match is found. Both match conditions
* must be satisfied for a match to occur. Within the loop, * 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 * Upon finding a match, the loop will terminate via "break" at
* the bottom. If it terminates "normally", MatchValue will be * 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. * match was found.
*/ */
for ( ; Index < Operand[0]->Package.Count; Index++) for ( ; Index < Operand[0]->Package.Count; Index++)
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -149,7 +149,7 @@ AcpiExSystemMemorySpaceHandler (
UINT32 Function, UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address, ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth, UINT32 BitWidth,
ACPI_INTEGER *Value, UINT64 *Value,
void *HandlerContext, void *HandlerContext,
void *RegionContext) void *RegionContext)
{ {
@@ -157,7 +157,8 @@ AcpiExSystemMemorySpaceHandler (
void *LogicalAddrPtr = NULL; void *LogicalAddrPtr = NULL;
ACPI_MEM_SPACE_CONTEXT *MemInfo = RegionContext; ACPI_MEM_SPACE_CONTEXT *MemInfo = RegionContext;
UINT32 Length; UINT32 Length;
ACPI_SIZE WindowSize; ACPI_SIZE MapLength;
ACPI_SIZE PageBoundaryMapLength;
#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED #ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
UINT32 Remainder; UINT32 Remainder;
#endif #endif
@@ -197,7 +198,7 @@ AcpiExSystemMemorySpaceHandler (
* Hardware does not support non-aligned data transfers, we must verify * Hardware does not support non-aligned data transfers, we must verify
* the request. * the request.
*/ */
(void) AcpiUtShortDivide ((ACPI_INTEGER) Address, Length, NULL, &Remainder); (void) AcpiUtShortDivide ((UINT64) Address, Length, NULL, &Remainder);
if (Remainder != 0) if (Remainder != 0)
{ {
return_ACPI_STATUS (AE_AML_ALIGNMENT); return_ACPI_STATUS (AE_AML_ALIGNMENT);
@@ -210,8 +211,8 @@ AcpiExSystemMemorySpaceHandler (
* 2) Address beyond the current mapping? * 2) Address beyond the current mapping?
*/ */
if ((Address < MemInfo->MappedPhysicalAddress) || if ((Address < MemInfo->MappedPhysicalAddress) ||
(((ACPI_INTEGER) Address + Length) > (((UINT64) Address + Length) >
((ACPI_INTEGER) ((UINT64)
MemInfo->MappedPhysicalAddress + MemInfo->MappedLength))) MemInfo->MappedPhysicalAddress + MemInfo->MappedLength)))
{ {
/* /*
@@ -227,26 +228,45 @@ AcpiExSystemMemorySpaceHandler (
} }
/* /*
* Don't attempt to map memory beyond the end of the region, and * October 2009: Attempt to map from the requested address to the
* constrain the maximum mapping size to something reasonable. * 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); ((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 */ /* Create a new mapping starting at the address given */
MemInfo->MappedLogicalAddress = AcpiOsMapMemory ( MemInfo->MappedLogicalAddress = AcpiOsMapMemory (
(ACPI_PHYSICAL_ADDRESS) Address, WindowSize); (ACPI_PHYSICAL_ADDRESS) Address, MapLength);
if (!MemInfo->MappedLogicalAddress) if (!MemInfo->MappedLogicalAddress)
{ {
ACPI_ERROR ((AE_INFO, ACPI_ERROR ((AE_INFO,
"Could not map memory at %8.8X%8.8X, size %X", "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; MemInfo->MappedLength = 0;
return_ACPI_STATUS (AE_NO_MEMORY); return_ACPI_STATUS (AE_NO_MEMORY);
} }
@@ -254,7 +274,7 @@ AcpiExSystemMemorySpaceHandler (
/* Save the physical address and mapping size */ /* Save the physical address and mapping size */
MemInfo->MappedPhysicalAddress = Address; MemInfo->MappedPhysicalAddress = Address;
MemInfo->MappedLength = WindowSize; MemInfo->MappedLength = MapLength;
} }
/* /*
@@ -262,7 +282,7 @@ AcpiExSystemMemorySpaceHandler (
* access * access
*/ */
LogicalAddrPtr = MemInfo->MappedLogicalAddress + LogicalAddrPtr = MemInfo->MappedLogicalAddress +
((ACPI_INTEGER) Address - (ACPI_INTEGER) MemInfo->MappedPhysicalAddress); ((UINT64) Address - (UINT64) MemInfo->MappedPhysicalAddress);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"System-Memory (width %d) R/W %d Address=%8.8X%8.8X\n", "System-Memory (width %d) R/W %d Address=%8.8X%8.8X\n",
@@ -284,19 +304,19 @@ AcpiExSystemMemorySpaceHandler (
switch (BitWidth) switch (BitWidth)
{ {
case 8: case 8:
*Value = (ACPI_INTEGER) ACPI_GET8 (LogicalAddrPtr); *Value = (UINT64) ACPI_GET8 (LogicalAddrPtr);
break; break;
case 16: case 16:
*Value = (ACPI_INTEGER) ACPI_GET16 (LogicalAddrPtr); *Value = (UINT64) ACPI_GET16 (LogicalAddrPtr);
break; break;
case 32: case 32:
*Value = (ACPI_INTEGER) ACPI_GET32 (LogicalAddrPtr); *Value = (UINT64) ACPI_GET32 (LogicalAddrPtr);
break; break;
case 64: case 64:
*Value = (ACPI_INTEGER) ACPI_GET64 (LogicalAddrPtr); *Value = (UINT64) ACPI_GET64 (LogicalAddrPtr);
break; break;
default: default:
@@ -363,7 +383,7 @@ AcpiExSystemIoSpaceHandler (
UINT32 Function, UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address, ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth, UINT32 BitWidth,
ACPI_INTEGER *Value, UINT64 *Value,
void *HandlerContext, void *HandlerContext,
void *RegionContext) void *RegionContext)
{ {
@@ -427,7 +447,7 @@ AcpiExPciConfigSpaceHandler (
UINT32 Function, UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address, ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth, UINT32 BitWidth,
ACPI_INTEGER *Value, UINT64 *Value,
void *HandlerContext, void *HandlerContext,
void *RegionContext) void *RegionContext)
{ {
@@ -507,7 +527,7 @@ AcpiExCmosSpaceHandler (
UINT32 Function, UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address, ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth, UINT32 BitWidth,
ACPI_INTEGER *Value, UINT64 *Value,
void *HandlerContext, void *HandlerContext,
void *RegionContext) void *RegionContext)
{ {
@@ -544,7 +564,7 @@ AcpiExPciBarSpaceHandler (
UINT32 Function, UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address, ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth, UINT32 BitWidth,
ACPI_INTEGER *Value, UINT64 *Value,
void *HandlerContext, void *HandlerContext,
void *RegionContext) void *RegionContext)
{ {
@@ -581,7 +601,7 @@ AcpiExDataTableSpaceHandler (
UINT32 Function, UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address, ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth, UINT32 BitWidth,
ACPI_INTEGER *Value, UINT64 *Value,
void *HandlerContext, void *HandlerContext,
void *RegionContext) void *RegionContext)
{ {
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -10,7 +10,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License
@@ -9,7 +9,7 @@
* *
* 1. Copyright Notice * 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. * All rights reserved.
* *
* 2. License * 2. License

Some files were not shown because too many files have changed in this diff Show More