diff options
author | jkim <jkim@FreeBSD.org> | 2009-06-02 18:53:21 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2009-06-02 18:53:21 +0000 |
commit | 73af4710a0808de20bb2b092c916497d666c7c30 (patch) | |
tree | d651e323e75f9dcbfdcc972e9cb96f08c49ff0da /sys/contrib/dev/acpica/compiler | |
parent | fea04a3fd158d65e9ffd20e50e38364d82b85c44 (diff) | |
parent | 02935ea0ac5fb3dfc5e452b2a18288d7e523dc1b (diff) | |
download | FreeBSD-src-73af4710a0808de20bb2b092c916497d666c7c30.zip FreeBSD-src-73af4710a0808de20bb2b092c916497d666c7c30.tar.gz |
MFV: ACPICA 20090521
Diffstat (limited to 'sys/contrib/dev/acpica/compiler')
29 files changed, 1238 insertions, 497 deletions
diff --git a/sys/contrib/dev/acpica/compiler/aslanalyze.c b/sys/contrib/dev/acpica/compiler/aslanalyze.c index 93f2f0b..d44adda 100644 --- a/sys/contrib/dev/acpica/compiler/aslanalyze.c +++ b/sys/contrib/dev/acpica/compiler/aslanalyze.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslanalyze.c - check for semantic errors - * $Revision: 1.115 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,12 +115,10 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" -#include <contrib/dev/acpica/acparser.h> -#include <contrib/dev/acpica/amlcode.h> - -#include <ctype.h> +#include "acparser.h" +#include "amlcode.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslanalyze") @@ -179,6 +176,10 @@ static UINT32 AnGetInternalMethodReturnType ( ACPI_PARSE_OBJECT *Op); +BOOLEAN +AnIsResultUsed ( + ACPI_PARSE_OBJECT *Op); + /******************************************************************************* * @@ -272,7 +273,11 @@ AnMapArgTypeToBtype ( return (ACPI_BTYPE_MUTEX); case ARGI_DDBHANDLE: - return (ACPI_BTYPE_DDB_HANDLE); + /* + * DDBHandleObject := SuperName + * ACPI_BTYPE_REFERENCE: Index reference as parameter of Load/Unload + */ + return (ACPI_BTYPE_DDB_HANDLE | ACPI_BTYPE_REFERENCE); /* Interchangeable types */ /* @@ -682,7 +687,15 @@ AnCheckForReservedName ( return (ACPI_NOT_RESERVED_NAME); } - AslError (ASL_ERROR, ASL_MSG_RESERVED_WORD, Op, Op->Asl.ExternalName); + /* + * Was not actually emitted by the compiler. This is a special case, + * however. If the ASL code being compiled was the result of a + * dissasembly, it may possibly contain valid compiler-emitted names + * of the form "_T_x". We don't want to issue an error or even a + * warning and force the user to manually change the names. So, we + * will issue a remark instead. + */ + AslError (ASL_REMARK, ASL_MSG_COMPILER_RESERVED, Op, Op->Asl.ExternalName); return (ACPI_COMPILER_RESERVED_NAME); } @@ -718,6 +731,8 @@ AnCheckForReservedMethod ( ASL_METHOD_INFO *MethodInfo) { UINT32 Index; + UINT32 RequiredArgsCurrent; + UINT32 RequiredArgsOld; /* Check for a match against the reserved name list */ @@ -754,15 +769,23 @@ AnCheckForReservedMethod ( Gbl_ReservedMethods++; - /* Matched a reserved method name */ + /* + * Matched a reserved method name + * + * Validate the ASL-defined argument count. Allow two different legal + * arg counts. + */ + RequiredArgsCurrent = ReservedMethods[Index].NumArguments & 0x0F; + RequiredArgsOld = ReservedMethods[Index].NumArguments >> 4; - if (MethodInfo->NumArguments != ReservedMethods[Index].NumArguments) + if ((MethodInfo->NumArguments != RequiredArgsCurrent) && + (MethodInfo->NumArguments != RequiredArgsOld)) { sprintf (MsgBuffer, "%s requires %d", ReservedMethods[Index].Name, - ReservedMethods[Index].NumArguments); + RequiredArgsCurrent); - if (MethodInfo->NumArguments > ReservedMethods[Index].NumArguments) + if (MethodInfo->NumArguments > RequiredArgsCurrent) { AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, MsgBuffer); @@ -956,9 +979,9 @@ AnMethodAnalysisWalkBegin ( MethodInfo->ValidArgTypes[ActualArgs] = AnMapObjTypeToBtype (NextType); NextType->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; + ActualArgs++; } - ActualArgs++; NextType = NextType->Asl.Next; } @@ -1010,10 +1033,10 @@ AnMethodAnalysisWalkBegin ( if (!MethodInfo) { /* - * Probably was an error in the method declaration, - * no additional error here + * Local was used outside a control method, or there was an error + * in the method declaration. */ - ACPI_WARNING ((AE_INFO, "%p, No parent method", Op)); + AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD, Op, Op->Asl.ExternalName); return (AE_ERROR); } @@ -1054,10 +1077,10 @@ AnMethodAnalysisWalkBegin ( if (!MethodInfo) { /* - * Probably was an error in the method declaration, - * no additional error here + * Arg was used outside a control method, or there was an error + * in the method declaration. */ - ACPI_WARNING ((AE_INFO, "%p, No parent method", Op)); + AslError (ASL_REMARK, ASL_MSG_LOCAL_OUTSIDE_METHOD, Op, Op->Asl.ExternalName); return (AE_ERROR); } @@ -1705,6 +1728,30 @@ AnOperandTypecheckWalkEnd ( RuntimeArgTypes = OpInfo->RuntimeArgs; OpcodeClass = OpInfo->Class; +#ifdef ASL_ERROR_NAMED_OBJECT_IN_WHILE + /* + * Update 11/2008: In practice, we can't perform this check. A simple + * analysis is not sufficient. Also, it can cause errors when compiling + * disassembled code because of the way Switch operators are implemented + * (a While(One) loop with a named temp variable created within.) + */ + + /* + * If we are creating a named object, check if we are within a while loop + * by checking if the parent is a WHILE op. This is a simple analysis, but + * probably sufficient for many cases. + * + * Allow Scope(), Buffer(), and Package(). + */ + if (((OpcodeClass == AML_CLASS_NAMED_OBJECT) && (Op->Asl.AmlOpcode != AML_SCOPE_OP)) || + ((OpcodeClass == AML_CLASS_CREATE) && (OpInfo->Flags & AML_NSNODE))) + { + if (Op->Asl.Parent->Asl.AmlOpcode == AML_WHILE_OP) + { + AslError (ASL_ERROR, ASL_MSG_NAMED_OBJECT_IN_WHILE, Op, NULL); + } + } +#endif /* * Special case for control opcodes IF/RETURN/WHILE since they @@ -2074,6 +2121,7 @@ AnOtherSemanticAnalysisWalkBegin ( { case PARSEOP_ACQUIRE: case PARSEOP_WAIT: + case PARSEOP_LOADTABLE: break; default: diff --git a/sys/contrib/dev/acpica/compiler/aslcodegen.c b/sys/contrib/dev/acpica/compiler/aslcodegen.c index 25ee729..af3f292 100644 --- a/sys/contrib/dev/acpica/compiler/aslcodegen.c +++ b/sys/contrib/dev/acpica/compiler/aslcodegen.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslcodegen - AML code generation - * $Revision: 1.62 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,9 +115,9 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" -#include <contrib/dev/acpica/amlcode.h> +#include "amlcode.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslcodegen") @@ -235,24 +234,24 @@ CgAmlWriteWalk ( DbgPrint (ASL_TREE_OUTPUT, " "); } - DbgPrint (ASL_TREE_OUTPUT, - "%08X %04X %04X %01X %04X %04X %04X %04X %08X %08X %08X %08X %08X %04X %02d %02d\n", - /* 1 */ (UINT32) Op->Asl.Value.Integer, - /* 2 */ Op->Asl.ParseOpcode, - /* 3 */ Op->Asl.AmlOpcode, - /* 4 */ Op->Asl.AmlOpcodeLength, - /* 5 */ Op->Asl.AmlPkgLenBytes, - /* 6 */ Op->Asl.AmlLength, - /* 7 */ Op->Asl.AmlSubtreeLength, - /* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0, - /* 9 */ Op, - /* 10 */ Op->Asl.Child, - /* 11 */ Op->Asl.Parent, - /* 12 */ Op->Asl.CompileFlags, - /* 13 */ Op->Asl.AcpiBtype, - /* 14 */ Op->Asl.FinalAmlLength, - /* 15 */ Op->Asl.Column, - /* 16 */ Op->Asl.LineNumber); + DbgPrint (ASL_TREE_OUTPUT, + "%08X %04X %04X %01X %04X %04X %04X %04X %08X %08X %08X %08X %08X %04X %02d %02d\n", + /* 1 */ (UINT32) Op->Asl.Value.Integer, + /* 2 */ Op->Asl.ParseOpcode, + /* 3 */ Op->Asl.AmlOpcode, + /* 4 */ Op->Asl.AmlOpcodeLength, + /* 5 */ Op->Asl.AmlPkgLenBytes, + /* 6 */ Op->Asl.AmlLength, + /* 7 */ Op->Asl.AmlSubtreeLength, + /* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0, + /* 9 */ Op, + /* 10 */ Op->Asl.Child, + /* 11 */ Op->Asl.Parent, + /* 12 */ Op->Asl.CompileFlags, + /* 13 */ Op->Asl.AcpiBtype, + /* 14 */ Op->Asl.FinalAmlLength, + /* 15 */ Op->Asl.Column, + /* 16 */ Op->Asl.LineNumber); /* Generate the AML for this node */ diff --git a/sys/contrib/dev/acpica/compiler/aslcompile.c b/sys/contrib/dev/acpica/compiler/aslcompile.c index eba3552..07de1fe 100644 --- a/sys/contrib/dev/acpica/compiler/aslcompile.c +++ b/sys/contrib/dev/acpica/compiler/aslcompile.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslcompile - top level compile module - * $Revision: 1.97 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -117,7 +116,7 @@ #include <stdio.h> #include <time.h> -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslcompile") @@ -132,6 +131,16 @@ static ACPI_STATUS FlCheckForAscii ( ASL_FILE_INFO *FileInfo); +void +FlConsumeAnsiComment ( + ASL_FILE_INFO *FileInfo, + ASL_FILE_STATUS *Status); + +void +FlConsumeNewComment ( + ASL_FILE_INFO *FileInfo, + ASL_FILE_STATUS *Status); + /******************************************************************************* * @@ -466,7 +475,7 @@ FlCheckForAscii ( /* Check for an ASCII character */ - if (!isascii (Byte)) + if (!ACPI_IS_ASCII (Byte)) { if (BadBytes < 10) { @@ -914,16 +923,6 @@ CmCleanupAndExit ( } UtDisplaySummary (ASL_FILE_STDOUT); - - /* - * Return non-zero exit code if there have been errors, unless the - * global ignore error flag has been set - */ - if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) - { - exit (1); - } - exit (0); } diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.h b/sys/contrib/dev/acpica/compiler/aslcompiler.h index 6477665..54162a7 100644 --- a/sys/contrib/dev/acpica/compiler/aslcompiler.h +++ b/sys/contrib/dev/acpica/compiler/aslcompiler.h @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslcompiler.h - common include file for iASL - * $Revision: 1.148 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -139,15 +138,16 @@ #include <ctype.h> -#include <contrib/dev/acpica/acpi.h> -#include <contrib/dev/acpica/amlresrc.h> -#include <contrib/dev/acpica/acdebug.h> +#include "acpi.h" +#include "accommon.h" +#include "amlresrc.h" +#include "acdebug.h" /* Compiler headers */ -#include <contrib/dev/acpica/compiler/asldefine.h> -#include <contrib/dev/acpica/compiler/asltypes.h> -#include <contrib/dev/acpica/compiler/aslglobal.h> +#include "asldefine.h" +#include "asltypes.h" +#include "aslglobal.h" /******************************************************************************* @@ -188,6 +188,16 @@ AslPushInputFileStack ( FILE *InputFile, char *Filename); +/* + * aslstartup - called from main + */ +ACPI_STATUS +AslDoOnePathname ( + char *Pathname); + +ACPI_STATUS +AslDoOneFile ( + char *Filename); /* * aslcompile - compile mainline @@ -307,6 +317,10 @@ void AePrintErrorLog ( UINT32 FileId); +void +AeClearErrorLog ( + void); + ACPI_PHYSICAL_ADDRESS AeLocalGetRootPointer ( void); diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.l b/sys/contrib/dev/acpica/compiler/aslcompiler.l index 78be4ea..3a52348 100644 --- a/sys/contrib/dev/acpica/compiler/aslcompiler.l +++ b/sys/contrib/dev/acpica/compiler/aslcompiler.l @@ -3,7 +3,6 @@ /****************************************************************************** * * Module Name: aslcompiler.l - Flex input file - * $Revision: 1.79 $ * *****************************************************************************/ @@ -11,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -119,7 +118,7 @@ #include <stdlib.h> #include <string.h> -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" YYSTYPE AslCompilerlval; @@ -169,7 +168,8 @@ NamePathTail [.]{NameSeg} %% [ ] { count (0); } -[\n] { count (0); } +[\n] { count (0); } /* Handle files with both LF and CR/LF */ +[\r] { count (0); } /* termination on both Unix and Windows */ [ \t] { count (0); } diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.y b/sys/contrib/dev/acpica/compiler/aslcompiler.y index 0b33d38..053574f 100644 --- a/sys/contrib/dev/acpica/compiler/aslcompiler.y +++ b/sys/contrib/dev/acpica/compiler/aslcompiler.y @@ -3,7 +3,6 @@ /****************************************************************************** * * Module Name: aslcompiler.y - Bison input file (ASL grammar and actions) - * $Revision: 1.105 $ * *****************************************************************************/ @@ -11,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -124,11 +123,12 @@ */ #define YYINITDEPTH 600 -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <contrib/dev/acpica/acpi.h> +#include "acpi.h" +#include "accommon.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslparse") @@ -188,10 +188,10 @@ AslLocalAllocate (unsigned int Size); /*! [Begin] no source code translation */ /* - * These shift/reduce conflicts are expected. There should be zer0 + * These shift/reduce conflicts are expected. There should be zero * reduce/reduce conflicts. */ -%expect 64 +%expect 60 /* @@ -794,7 +794,7 @@ ASLCode ; DefinitionBlockTerm - : PARSEOP_DEFINITIONBLOCK '(' {$$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);} + : PARSEOP_DEFINITIONBLOCK '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);} String ',' String ',' ByteConst ',' @@ -1111,8 +1111,8 @@ Type6Opcode ; IncludeTerm - : PARSEOP_INCLUDE '(' {$$ = TrCreateLeafNode (PARSEOP_INCLUDE);} - String ')' {$$ = TrLinkChildren ($<n>3,1,$4);FlOpenIncludeFile ($4);} + : PARSEOP_INCLUDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE);} + String ')' {TrLinkChildren ($<n>3,1,$4);FlOpenIncludeFile ($4);} TermList IncludeEndTerm {$$ = TrLinkPeerNodes (3,$<n>3,$7,$8);} ; @@ -1147,7 +1147,7 @@ ExternalTerm BankFieldTerm - : PARSEOP_BANKFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} + : PARSEOP_BANKFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} NameString NameStringItem TermArgItem @@ -1198,7 +1198,7 @@ AccessAsTerm ; CreateBitFieldTerm - : PARSEOP_CREATEBITFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} + : PARSEOP_CREATEBITFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} TermArg TermArgItem NameStringItem @@ -1208,7 +1208,7 @@ CreateBitFieldTerm ; CreateByteFieldTerm - : PARSEOP_CREATEBYTEFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);} + : PARSEOP_CREATEBYTEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);} TermArg TermArgItem NameStringItem @@ -1218,7 +1218,7 @@ CreateByteFieldTerm ; CreateDWordFieldTerm - : PARSEOP_CREATEDWORDFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);} + : PARSEOP_CREATEDWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);} TermArg TermArgItem NameStringItem @@ -1228,7 +1228,7 @@ CreateDWordFieldTerm ; CreateFieldTerm - : PARSEOP_CREATEFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);} + : PARSEOP_CREATEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);} TermArg TermArgItem TermArgItem @@ -1239,7 +1239,7 @@ CreateFieldTerm ; CreateQWordFieldTerm - : PARSEOP_CREATEQWORDFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);} + : PARSEOP_CREATEQWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);} TermArg TermArgItem NameStringItem @@ -1249,7 +1249,7 @@ CreateQWordFieldTerm ; CreateWordFieldTerm - : PARSEOP_CREATEWORDFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);} + : PARSEOP_CREATEWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);} TermArg TermArgItem NameStringItem @@ -1259,7 +1259,7 @@ CreateWordFieldTerm ; DataRegionTerm - : PARSEOP_DATATABLEREGION '(' {$$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);} + : PARSEOP_DATATABLEREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);} NameString TermArgItem TermArgItem @@ -1270,7 +1270,7 @@ DataRegionTerm ; DeviceTerm - : PARSEOP_DEVICE '(' {$$ = TrCreateLeafNode (PARSEOP_DEVICE);} + : PARSEOP_DEVICE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);} NameString ')' '{' ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} @@ -1279,7 +1279,7 @@ DeviceTerm ; EventTerm - : PARSEOP_EVENT '(' {$$ = TrCreateLeafNode (PARSEOP_EVENT);} + : PARSEOP_EVENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);} NameString ')' {$$ = TrLinkChildren ($<n>3,1,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION));} | PARSEOP_EVENT '(' @@ -1287,7 +1287,7 @@ EventTerm ; FieldTerm - : PARSEOP_FIELD '(' {$$ = TrCreateLeafNode (PARSEOP_FIELD);} + : PARSEOP_FIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);} NameString ',' AccessTypeKeyword ',' LockRuleKeyword @@ -1299,7 +1299,7 @@ FieldTerm ; FunctionTerm - : PARSEOP_FUNCTION '(' {$$ = TrCreateLeafNode (PARSEOP_METHOD);} + : PARSEOP_FUNCTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} NameString OptionalParameterTypePackage OptionalParameterTypesPackage @@ -1313,7 +1313,7 @@ FunctionTerm ; IndexFieldTerm - : PARSEOP_INDEXFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} + : PARSEOP_INDEXFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} NameString NameStringItem ',' AccessTypeKeyword @@ -1326,9 +1326,9 @@ IndexFieldTerm ; MethodTerm - : PARSEOP_METHOD '(' {$$ = TrCreateLeafNode (PARSEOP_METHOD);} + : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} NameString - OptionalByteConstExpr {$$ = UtCheckIntegerRange ($5, 0, 7);} + OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} OptionalSerializeRuleKeyword OptionalByteConstExpr OptionalParameterTypePackage @@ -1340,7 +1340,7 @@ MethodTerm ; MutexTerm - : PARSEOP_MUTEX '(' {$$ = TrCreateLeafNode (PARSEOP_MUTEX);} + : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} NameString ',' ByteConstExpr ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} @@ -1349,7 +1349,7 @@ MutexTerm ; OpRegionTerm - : PARSEOP_OPERATIONREGION '(' {$$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} + : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} NameString ',' OpRegionSpaceIdTerm TermArgItem @@ -1365,7 +1365,7 @@ OpRegionSpaceIdTerm ; PowerResTerm - : PARSEOP_POWERRESOURCE '(' {$$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} + : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} NameString ',' ByteConstExpr ',' WordConstExpr @@ -1376,7 +1376,7 @@ PowerResTerm ; ProcessorTerm - : PARSEOP_PROCESSOR '(' {$$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} + : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} NameString ',' ByteConstExpr OptionalDWordConstExpr @@ -1388,7 +1388,7 @@ ProcessorTerm ; ThermalZoneTerm - : PARSEOP_THERMALZONE '(' {$$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} + : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} NameString ')' '{' ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} @@ -1401,7 +1401,7 @@ ThermalZoneTerm AliasTerm - : PARSEOP_ALIAS '(' {$$ = TrCreateLeafNode (PARSEOP_ALIAS);} + : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} NameString NameStringItem ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} @@ -1410,7 +1410,7 @@ AliasTerm ; NameTerm - : PARSEOP_NAME '(' {$$ = TrCreateLeafNode (PARSEOP_NAME);} + : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} NameString ',' DataObject ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} @@ -1419,7 +1419,7 @@ NameTerm ; ScopeTerm - : PARSEOP_SCOPE '(' {$$ = TrCreateLeafNode (PARSEOP_SCOPE);} + : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} NameString ')' '{' ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} @@ -1444,7 +1444,7 @@ ContinueTerm ; FatalTerm - : PARSEOP_FATAL '(' {$$ = TrCreateLeafNode (PARSEOP_FATAL);} + : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} ByteConstExpr ',' DWordConstExpr TermArgItem @@ -1458,7 +1458,7 @@ IfElseTerm ; IfTerm - : PARSEOP_IF '(' {$$ = TrCreateLeafNode (PARSEOP_IF);} + : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} TermArg ')' '{' TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} @@ -1469,7 +1469,7 @@ IfTerm ElseTerm : {$$ = NULL;} - | PARSEOP_ELSE '{' {$$ = TrCreateLeafNode (PARSEOP_ELSE);} + | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_ELSE '{' @@ -1478,11 +1478,11 @@ ElseTerm | PARSEOP_ELSE error {$$ = AslDoError(); yyclearin;} - | PARSEOP_ELSEIF '(' {$$ = TrCreateLeafNode (PARSEOP_ELSE);} - TermArg {$$ = TrCreateLeafNode (PARSEOP_IF);} + | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} + TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>5,2,$4,$8);} - ElseTerm {$$ = TrLinkPeerNode ($<n>5,$11);} + TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);} + ElseTerm {TrLinkPeerNode ($<n>5,$11);} {$$ = TrLinkChildren ($<n>3,1,$<n>5);} | PARSEOP_ELSEIF '(' @@ -1493,7 +1493,7 @@ ElseTerm ; LoadTerm - : PARSEOP_LOAD '(' {$$ = TrCreateLeafNode (PARSEOP_LOAD);} + : PARSEOP_LOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOAD);} NameString RequiredTarget ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -1506,7 +1506,7 @@ NoOpTerm ; NotifyTerm - : PARSEOP_NOTIFY '(' {$$ = TrCreateLeafNode (PARSEOP_NOTIFY);} + : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} SuperName TermArgItem ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -1515,7 +1515,7 @@ NotifyTerm ; ReleaseTerm - : PARSEOP_RELEASE '(' {$$ = TrCreateLeafNode (PARSEOP_RELEASE);} + : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} SuperName ')' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_RELEASE '(' @@ -1523,7 +1523,7 @@ ReleaseTerm ; ResetTerm - : PARSEOP_RESET '(' {$$ = TrCreateLeafNode (PARSEOP_RESET);} + : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} SuperName ')' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_RESET '(' @@ -1531,7 +1531,7 @@ ResetTerm ; ReturnTerm - : PARSEOP_RETURN '(' {$$ = TrCreateLeafNode (PARSEOP_RETURN);} + : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} OptionalReturnArg ')' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_RETURN {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_RETURN),1,TrCreateLeafNode (PARSEOP_ZERO));} @@ -1540,7 +1540,7 @@ ReturnTerm ; SignalTerm - : PARSEOP_SIGNAL '(' {$$ = TrCreateLeafNode (PARSEOP_SIGNAL);} + : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} SuperName ')' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_SIGNAL '(' @@ -1548,7 +1548,7 @@ SignalTerm ; SleepTerm - : PARSEOP_SLEEP '(' {$$ = TrCreateLeafNode (PARSEOP_SLEEP);} + : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} TermArg ')' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_SLEEP '(' @@ -1556,7 +1556,7 @@ SleepTerm ; StallTerm - : PARSEOP_STALL '(' {$$ = TrCreateLeafNode (PARSEOP_STALL);} + : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} TermArg ')' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_STALL '(' @@ -1564,7 +1564,7 @@ StallTerm ; SwitchTerm - : PARSEOP_SWITCH '(' {$$ = TrCreateLeafNode (PARSEOP_SWITCH);} + : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} TermArg ')' '{' CaseDefaultTermList '}' @@ -1607,7 +1607,7 @@ CaseTermList */ CaseTerm - : PARSEOP_CASE '(' {$$ = TrCreateLeafNode (PARSEOP_CASE);} + : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} DataObject ')' '{' TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} @@ -1616,14 +1616,14 @@ CaseTerm ; DefaultTerm - : PARSEOP_DEFAULT '{' {$$ = TrCreateLeafNode (PARSEOP_DEFAULT);} + : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);} TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_DEFAULT '{' error '}' {$$ = AslDoError(); yyclearin;} ; UnloadTerm - : PARSEOP_UNLOAD '(' {$$ = TrCreateLeafNode (PARSEOP_UNLOAD);} + : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} SuperName ')' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_UNLOAD '(' @@ -1631,7 +1631,7 @@ UnloadTerm ; WhileTerm - : PARSEOP_WHILE '(' {$$ = TrCreateLeafNode (PARSEOP_WHILE);} + : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} TermArg ')' '{' TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} @@ -1643,7 +1643,7 @@ WhileTerm /******* Type 2 opcodes *******************************************************/ AcquireTerm - : PARSEOP_ACQUIRE '(' {$$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} + : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} SuperName ',' WordConstExpr ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);} @@ -1652,7 +1652,7 @@ AcquireTerm ; AddTerm - : PARSEOP_ADD '(' {$$ = TrCreateLeafNode (PARSEOP_ADD);} + : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} TermArg TermArgItem Target @@ -1662,7 +1662,7 @@ AddTerm ; AndTerm - : PARSEOP_AND '(' {$$ = TrCreateLeafNode (PARSEOP_AND);} + : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} TermArg TermArgItem Target @@ -1672,7 +1672,7 @@ AndTerm ; ConcatTerm - : PARSEOP_CONCATENATE '(' {$$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} + : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} TermArg TermArgItem Target @@ -1682,7 +1682,7 @@ ConcatTerm ; ConcatResTerm - : PARSEOP_CONCATENATERESTEMPLATE '(' {$$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} + : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} TermArg TermArgItem Target @@ -1692,7 +1692,7 @@ ConcatResTerm ; CondRefOfTerm - : PARSEOP_CONDREFOF '(' {$$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} + : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} SuperName Target ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -1701,7 +1701,7 @@ CondRefOfTerm ; CopyObjectTerm - : PARSEOP_COPYOBJECT '(' {$$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} + : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} TermArg ',' SimpleTarget ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} @@ -1710,7 +1710,7 @@ CopyObjectTerm ; DecTerm - : PARSEOP_DECREMENT '(' {$$ = TrCreateLeafNode (PARSEOP_DECREMENT);} + : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} SuperName ')' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_DECREMENT '(' @@ -1718,7 +1718,7 @@ DecTerm ; DerefOfTerm - : PARSEOP_DEREFOF '(' {$$ = TrCreateLeafNode (PARSEOP_DEREFOF);} + : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} TermArg ')' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_DEREFOF '(' @@ -1726,7 +1726,7 @@ DerefOfTerm ; DivideTerm - : PARSEOP_DIVIDE '(' {$$ = TrCreateLeafNode (PARSEOP_DIVIDE);} + : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} TermArg TermArgItem Target @@ -1737,7 +1737,7 @@ DivideTerm ; FindSetLeftBitTerm - : PARSEOP_FINDSETLEFTBIT '(' {$$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} + : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} TermArg Target ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -1746,7 +1746,7 @@ FindSetLeftBitTerm ; FindSetRightBitTerm - : PARSEOP_FINDSETRIGHTBIT '(' {$$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} + : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} TermArg Target ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -1755,7 +1755,7 @@ FindSetRightBitTerm ; FromBCDTerm - : PARSEOP_FROMBCD '(' {$$ = TrCreateLeafNode (PARSEOP_FROMBCD);} + : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} TermArg Target ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -1764,7 +1764,7 @@ FromBCDTerm ; IncTerm - : PARSEOP_INCREMENT '(' {$$ = TrCreateLeafNode (PARSEOP_INCREMENT);} + : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} SuperName ')' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_INCREMENT '(' @@ -1772,7 +1772,7 @@ IncTerm ; IndexTerm - : PARSEOP_INDEX '(' {$$ = TrCreateLeafNode (PARSEOP_INDEX);} + : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} TermArg TermArgItem Target @@ -1782,7 +1782,7 @@ IndexTerm ; LAndTerm - : PARSEOP_LAND '(' {$$ = TrCreateLeafNode (PARSEOP_LAND);} + : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} TermArg TermArgItem ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -1791,7 +1791,7 @@ LAndTerm ; LEqualTerm - : PARSEOP_LEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} TermArg TermArgItem ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -1800,7 +1800,7 @@ LEqualTerm ; LGreaterTerm - : PARSEOP_LGREATER '(' {$$ = TrCreateLeafNode (PARSEOP_LGREATER);} + : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} TermArg TermArgItem ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -1809,7 +1809,7 @@ LGreaterTerm ; LGreaterEqualTerm - : PARSEOP_LGREATEREQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LLESS);} + : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} TermArg TermArgItem ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} @@ -1818,7 +1818,7 @@ LGreaterEqualTerm ; LLessTerm - : PARSEOP_LLESS '(' {$$ = TrCreateLeafNode (PARSEOP_LLESS);} + : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} TermArg TermArgItem ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -1827,7 +1827,7 @@ LLessTerm ; LLessEqualTerm - : PARSEOP_LLESSEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LGREATER);} + : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} TermArg TermArgItem ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} @@ -1836,7 +1836,7 @@ LLessEqualTerm ; LNotTerm - : PARSEOP_LNOT '(' {$$ = TrCreateLeafNode (PARSEOP_LNOT);} + : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} TermArg ')' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_LNOT '(' @@ -1844,7 +1844,7 @@ LNotTerm ; LNotEqualTerm - : PARSEOP_LNOTEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} TermArg TermArgItem ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} @@ -1853,7 +1853,7 @@ LNotEqualTerm ; LoadTableTerm - : PARSEOP_LOADTABLE '(' {$$ = TrCreateLeafNode (PARSEOP_LOADTABLE);} + : PARSEOP_LOADTABLE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOADTABLE);} TermArg TermArgItem TermArgItem @@ -1866,7 +1866,7 @@ LoadTableTerm ; LOrTerm - : PARSEOP_LOR '(' {$$ = TrCreateLeafNode (PARSEOP_LOR);} + : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} TermArg TermArgItem ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -1875,7 +1875,7 @@ LOrTerm ; MatchTerm - : PARSEOP_MATCH '(' {$$ = TrCreateLeafNode (PARSEOP_MATCH);} + : PARSEOP_MATCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);} TermArg ',' MatchOpKeyword TermArgItem @@ -1888,7 +1888,7 @@ MatchTerm ; MidTerm - : PARSEOP_MID '(' {$$ = TrCreateLeafNode (PARSEOP_MID);} + : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} TermArg TermArgItem TermArgItem @@ -1899,7 +1899,7 @@ MidTerm ; ModTerm - : PARSEOP_MOD '(' {$$ = TrCreateLeafNode (PARSEOP_MOD);} + : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} TermArg TermArgItem Target @@ -1909,7 +1909,7 @@ ModTerm ; MultiplyTerm - : PARSEOP_MULTIPLY '(' {$$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} + : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} TermArg TermArgItem Target @@ -1919,7 +1919,7 @@ MultiplyTerm ; NAndTerm - : PARSEOP_NAND '(' {$$ = TrCreateLeafNode (PARSEOP_NAND);} + : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} TermArg TermArgItem Target @@ -1929,7 +1929,7 @@ NAndTerm ; NOrTerm - : PARSEOP_NOR '(' {$$ = TrCreateLeafNode (PARSEOP_NOR);} + : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} TermArg TermArgItem Target @@ -1939,7 +1939,7 @@ NOrTerm ; NotTerm - : PARSEOP_NOT '(' {$$ = TrCreateLeafNode (PARSEOP_NOT);} + : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} TermArg Target ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -1948,7 +1948,7 @@ NotTerm ; ObjectTypeTerm - : PARSEOP_OBJECTTYPE '(' {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} + : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} SuperName ')' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_OBJECTTYPE '(' @@ -1956,7 +1956,7 @@ ObjectTypeTerm ; OrTerm - : PARSEOP_OR '(' {$$ = TrCreateLeafNode (PARSEOP_OR);} + : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} TermArg TermArgItem Target @@ -1970,7 +1970,7 @@ OrTerm * we've taken a pointer to it. (hard to tell if a local becomes initialized this way.) */ RefOfTerm - : PARSEOP_REFOF '(' {$$ = TrCreateLeafNode (PARSEOP_REFOF);} + : PARSEOP_REFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);} SuperName ')' {$$ = TrLinkChildren ($<n>3,1,TrSetNodeFlags ($4, NODE_IS_TARGET));} | PARSEOP_REFOF '(' @@ -1978,7 +1978,7 @@ RefOfTerm ; ShiftLeftTerm - : PARSEOP_SHIFTLEFT '(' {$$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} + : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} TermArg TermArgItem Target @@ -1988,7 +1988,7 @@ ShiftLeftTerm ; ShiftRightTerm - : PARSEOP_SHIFTRIGHT '(' {$$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} + : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} TermArg TermArgItem Target @@ -1998,7 +1998,7 @@ ShiftRightTerm ; SizeOfTerm - : PARSEOP_SIZEOF '(' {$$ = TrCreateLeafNode (PARSEOP_SIZEOF);} + : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} SuperName ')' {$$ = TrLinkChildren ($<n>3,1,$4);} | PARSEOP_SIZEOF '(' @@ -2006,7 +2006,7 @@ SizeOfTerm ; StoreTerm - : PARSEOP_STORE '(' {$$ = TrCreateLeafNode (PARSEOP_STORE);} + : PARSEOP_STORE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);} TermArg ',' SuperName ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} @@ -2015,7 +2015,7 @@ StoreTerm ; SubtractTerm - : PARSEOP_SUBTRACT '(' {$$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} + : PARSEOP_SUBTRACT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} TermArg TermArgItem Target @@ -2025,7 +2025,7 @@ SubtractTerm ; TimerTerm - : PARSEOP_TIMER '(' {$$ = TrCreateLeafNode (PARSEOP_TIMER);} + : PARSEOP_TIMER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} ')' {$$ = TrLinkChildren ($<n>3,0);} | PARSEOP_TIMER {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_TIMER),0);} | PARSEOP_TIMER '(' @@ -2033,7 +2033,7 @@ TimerTerm ; ToBCDTerm - : PARSEOP_TOBCD '(' {$$ = TrCreateLeafNode (PARSEOP_TOBCD);} + : PARSEOP_TOBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);} TermArg Target ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -2042,7 +2042,7 @@ ToBCDTerm ; ToBufferTerm - : PARSEOP_TOBUFFER '(' {$$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} + : PARSEOP_TOBUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} TermArg Target ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -2051,7 +2051,7 @@ ToBufferTerm ; ToDecimalStringTerm - : PARSEOP_TODECIMALSTRING '(' {$$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} + : PARSEOP_TODECIMALSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} TermArg Target ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -2060,7 +2060,7 @@ ToDecimalStringTerm ; ToHexStringTerm - : PARSEOP_TOHEXSTRING '(' {$$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} + : PARSEOP_TOHEXSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} TermArg Target ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -2069,7 +2069,7 @@ ToHexStringTerm ; ToIntegerTerm - : PARSEOP_TOINTEGER '(' {$$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} + : PARSEOP_TOINTEGER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} TermArg Target ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -2078,7 +2078,7 @@ ToIntegerTerm ; ToStringTerm - : PARSEOP_TOSTRING '(' {$$ = TrCreateLeafNode (PARSEOP_TOSTRING);} + : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} TermArg OptionalCount Target @@ -2095,7 +2095,7 @@ ToUUIDTerm ; WaitTerm - : PARSEOP_WAIT '(' {$$ = TrCreateLeafNode (PARSEOP_WAIT);} + : PARSEOP_WAIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} SuperName TermArgItem ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} @@ -2104,7 +2104,7 @@ WaitTerm ; XOrTerm - : PARSEOP_XOR '(' {$$ = TrCreateLeafNode (PARSEOP_XOR);} + : PARSEOP_XOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} TermArg TermArgItem Target @@ -2399,7 +2399,7 @@ OptionalCount BufferTerm - : PARSEOP_BUFFER '(' {$$ = TrCreateLeafNode (PARSEOP_BUFFER);} + : PARSEOP_BUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);} OptionalTermArg ')' '{' BufferTermData '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} @@ -2429,7 +2429,7 @@ DWordList ; PackageTerm - : PARSEOP_PACKAGE '(' {$$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} + : PARSEOP_PACKAGE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} VarPackageLengthTerm ')' '{' PackageList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} @@ -2481,7 +2481,7 @@ ResourceTemplateTerm ; UnicodeTerm - : PARSEOP_UNICODE '(' {$$ = TrCreateLeafNode (PARSEOP_UNICODE);} + : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} StringData ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);} | PARSEOP_UNICODE '(' @@ -2525,7 +2525,7 @@ ResourceMacroTerm ; DMATerm - : PARSEOP_DMA '(' {$$ = TrCreateLeafNode (PARSEOP_DMA);} + : PARSEOP_DMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);} DMATypeKeyword OptionalBusMasterKeyword ',' XferTypeKeyword @@ -2537,7 +2537,7 @@ DMATerm ; DWordIOTerm - : PARSEOP_DWORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDIO);} + : PARSEOP_DWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -2559,7 +2559,7 @@ DWordIOTerm ; DWordMemoryTerm - : PARSEOP_DWORDMEMORY '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} + : PARSEOP_DWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} OptionalResourceType_First OptionalDecodeType OptionalMinType @@ -2582,8 +2582,8 @@ DWordMemoryTerm ; DWordSpaceTerm - : PARSEOP_DWORDSPACE '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} - ByteConstExpr {$$ = UtCheckIntegerRange ($4, 0xC0, 0xFF);} + : PARSEOP_DWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType OptionalMinType @@ -2611,7 +2611,7 @@ EndDependentFnTerm ; ExtendedIOTerm - : PARSEOP_EXTENDEDIO '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} + : PARSEOP_EXTENDEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -2632,7 +2632,7 @@ ExtendedIOTerm ; ExtendedMemoryTerm - : PARSEOP_EXTENDEDMEMORY '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} + : PARSEOP_EXTENDEDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} OptionalResourceType_First OptionalDecodeType OptionalMinType @@ -2654,8 +2654,8 @@ ExtendedMemoryTerm ; ExtendedSpaceTerm - : PARSEOP_EXTENDEDSPACE '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} - ByteConstExpr {$$ = UtCheckIntegerRange ($4, 0xC0, 0xFF);} + : PARSEOP_EXTENDEDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType OptionalMinType @@ -2674,7 +2674,7 @@ ExtendedSpaceTerm ; FixedIOTerm - : PARSEOP_FIXEDIO '(' {$$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} + : PARSEOP_FIXEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} WordConstExpr ',' ByteConstExpr OptionalNameString_Last @@ -2684,7 +2684,7 @@ FixedIOTerm ; InterruptTerm - : PARSEOP_INTERRUPT '(' {$$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} + : PARSEOP_INTERRUPT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} OptionalResourceType_First ',' InterruptTypeKeyword ',' InterruptLevel @@ -2699,7 +2699,7 @@ InterruptTerm ; IOTerm - : PARSEOP_IO '(' {$$ = TrCreateLeafNode (PARSEOP_IO);} + : PARSEOP_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IO);} IODecodeKeyword ',' WordConstExpr ',' WordConstExpr @@ -2712,7 +2712,7 @@ IOTerm ; IRQNoFlagsTerm - : PARSEOP_IRQNOFLAGS '(' {$$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} + : PARSEOP_IRQNOFLAGS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} OptionalNameString_First ')' '{' ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} @@ -2721,7 +2721,7 @@ IRQNoFlagsTerm ; IRQTerm - : PARSEOP_IRQ '(' {$$ = TrCreateLeafNode (PARSEOP_IRQ);} + : PARSEOP_IRQ '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);} InterruptTypeKeyword ',' InterruptLevel OptionalShareType @@ -2733,7 +2733,7 @@ IRQTerm ; Memory24Term - : PARSEOP_MEMORY24 '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY24);} + : PARSEOP_MEMORY24 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY24);} OptionalReadWriteKeyword ',' WordConstExpr ',' WordConstExpr @@ -2746,7 +2746,7 @@ Memory24Term ; Memory32FixedTerm - : PARSEOP_MEMORY32FIXED '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} + : PARSEOP_MEMORY32FIXED '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} OptionalReadWriteKeyword ',' DWordConstExpr ',' DWordConstExpr @@ -2757,7 +2757,7 @@ Memory32FixedTerm ; Memory32Term - : PARSEOP_MEMORY32 '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY32);} + : PARSEOP_MEMORY32 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32);} OptionalReadWriteKeyword ',' DWordConstExpr ',' DWordConstExpr @@ -2770,7 +2770,7 @@ Memory32Term ; QWordIOTerm - : PARSEOP_QWORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDIO);} + : PARSEOP_QWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -2792,7 +2792,7 @@ QWordIOTerm ; QWordMemoryTerm - : PARSEOP_QWORDMEMORY '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} + : PARSEOP_QWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} OptionalResourceType_First OptionalDecodeType OptionalMinType @@ -2815,8 +2815,8 @@ QWordMemoryTerm ; QWordSpaceTerm - : PARSEOP_QWORDSPACE '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} - ByteConstExpr {$$ = UtCheckIntegerRange ($4, 0xC0, 0xFF);} + : PARSEOP_QWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType OptionalMinType @@ -2836,7 +2836,7 @@ QWordSpaceTerm ; RegisterTerm - : PARSEOP_REGISTER '(' {$$ = TrCreateLeafNode (PARSEOP_REGISTER);} + : PARSEOP_REGISTER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REGISTER);} AddressSpaceKeyword ',' ByteConstExpr ',' ByteConstExpr @@ -2849,7 +2849,7 @@ RegisterTerm ; StartDependentFnTerm - : PARSEOP_STARTDEPENDENTFN '(' {$$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} + : PARSEOP_STARTDEPENDENTFN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} ByteConstExpr ',' ByteConstExpr ')' '{' @@ -2859,7 +2859,7 @@ StartDependentFnTerm ; StartDependentFnNoPriTerm - : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} + : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} ')' '{' ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,1,$6);} | PARSEOP_STARTDEPENDENTFN_NOPRI '(' @@ -2867,7 +2867,7 @@ StartDependentFnNoPriTerm ; VendorLongTerm - : PARSEOP_VENDORLONG '(' {$$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} + : PARSEOP_VENDORLONG '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} OptionalNameString_First ')' '{' ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} @@ -2876,7 +2876,7 @@ VendorLongTerm ; VendorShortTerm - : PARSEOP_VENDORSHORT '(' {$$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} + : PARSEOP_VENDORSHORT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} OptionalNameString_First ')' '{' ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} @@ -2885,7 +2885,7 @@ VendorShortTerm ; WordBusNumberTerm - : PARSEOP_WORDBUSNUMBER '(' {$$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} + : PARSEOP_WORDBUSNUMBER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -2904,7 +2904,7 @@ WordBusNumberTerm ; WordIOTerm - : PARSEOP_WORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_WORDIO);} + : PARSEOP_WORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -2926,8 +2926,8 @@ WordIOTerm ; WordSpaceTerm - : PARSEOP_WORDSPACE '(' {$$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} - ByteConstExpr {$$ = UtCheckIntegerRange ($4, 0xC0, 0xFF);} + : PARSEOP_WORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType OptionalMinType @@ -3070,8 +3070,7 @@ OptionalRangeType OptionalReference : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ | ',' {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ - | ',' DataObject {$$ = $2;} - | ',' NameString {$$ = $2;} + | ',' TermArg {$$ = $2;} ; OptionalResourceType_First @@ -3080,8 +3079,7 @@ OptionalResourceType_First ; OptionalResourceType - : {$$ = NULL;} - | ',' {$$ = NULL;} + : ',' {$$ = NULL;} | ',' ResourceTypeKeyword {$$ = $2;} ; diff --git a/sys/contrib/dev/acpica/compiler/asldefine.h b/sys/contrib/dev/acpica/compiler/asldefine.h index 29f3568..c66040b 100644 --- a/sys/contrib/dev/acpica/compiler/asldefine.h +++ b/sys/contrib/dev/acpica/compiler/asldefine.h @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: asldefine.h - Common defines for the iASL compiler - * $Revision: 1.7 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -128,7 +127,7 @@ #define IntelAcpiCA "Intel ACPI Component Architecture" #define CompilerId "ASL Optimizing Compiler" #define DisassemblerId "AML Disassembler" -#define CompilerCopyright "Copyright (C) 2000 - 2007 Intel Corporation" +#define CompilerCopyright "Copyright (C) 2000 - 2009 Intel Corporation" #define CompilerCompliance "Supports ACPI Specification Revision 3.0a" #define CompilerName "iasl" #define CompilerCreatorId "INTL" diff --git a/sys/contrib/dev/acpica/compiler/aslerror.c b/sys/contrib/dev/acpica/compiler/aslerror.c index 7600158..87300b1 100644 --- a/sys/contrib/dev/acpica/compiler/aslerror.c +++ b/sys/contrib/dev/acpica/compiler/aslerror.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslerror - Error handling and statistics - * $Revision: 1.92 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,7 +115,7 @@ *****************************************************************************/ #define ASL_EXCEPTIONS -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslerror") @@ -128,6 +127,26 @@ AeAddToErrorLog ( ASL_ERROR_MSG *Enode); +void +AeClearErrorLog ( + void) +{ + ASL_ERROR_MSG *Enode = Gbl_ErrorLog; + ASL_ERROR_MSG *Next; + + /* Walk the error node list */ + + while (Enode) + { + Next = Enode->Next; + ACPI_FREE (Enode); + Enode = Next; + } + + Gbl_ErrorLog = NULL; +} + + /******************************************************************************* * * FUNCTION: AeAddToErrorLog @@ -228,6 +247,11 @@ AePrintException ( FILE *SourceFile; + if (Gbl_NoErrors) + { + return; + } + /* * Only listing files have a header, and remarks/optimizations * are always output @@ -288,7 +312,8 @@ AePrintException ( if (Actual) { fprintf (OutputFile, - "[*** iASL: Seek error on source code temp file ***]"); + "[*** iASL: Seek error on source code temp file %s ***]", + Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); } else { @@ -296,7 +321,8 @@ AePrintException ( if (!RActual) { fprintf (OutputFile, - "[*** iASL: Read error on source code temp file ***]"); + "[*** iASL: Read error on source code temp file %s ***]", + Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); } else while (RActual && SourceByte && (SourceByte != '\n')) diff --git a/sys/contrib/dev/acpica/compiler/aslfiles.c b/sys/contrib/dev/acpica/compiler/aslfiles.c index 9eace43..cb38e900 100644 --- a/sys/contrib/dev/acpica/compiler/aslfiles.c +++ b/sys/contrib/dev/acpica/compiler/aslfiles.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslfiles - file I/O suppoert - * $Revision: 1.54 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -115,8 +114,8 @@ * *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> -#include <contrib/dev/acpica/acapps.h> +#include "aslcompiler.h" +#include "acapps.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslfiles") @@ -191,7 +190,18 @@ FlOpenLocalFile ( char *Mode) { - strcpy (StringBuffer, Gbl_DirectoryPath); + StringBuffer[0] = 0; + + /* Check for an absolute pathname */ + + if ((LocalName[0] != '/') && /* Forward slash */ + (LocalName[0] != '\\') && /* backslash (Win) */ + (LocalName[1] != ':')) /* Device name (Win) */ + { + /* The include file path is relative, prepend the directory path */ + + strcat (StringBuffer, Gbl_DirectoryPath); + } strcat (StringBuffer, LocalName); DbgPrint (ASL_PARSE_OUTPUT, "FlOpenLocalFile: %s\n", StringBuffer); @@ -369,6 +379,8 @@ FlPrintFile ( va_start (Args, Format); Actual = vfprintf (Gbl_Files[FileId].Handle, Format, Args); + va_end (Args); + if (Actual == -1) { FlFileError (FileId, ASL_MSG_WRITE); diff --git a/sys/contrib/dev/acpica/compiler/aslfold.c b/sys/contrib/dev/acpica/compiler/aslfold.c index d744021..4bb305e 100644 --- a/sys/contrib/dev/acpica/compiler/aslfold.c +++ b/sys/contrib/dev/acpica/compiler/aslfold.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslfold - Constant folding - * $Revision: 1.20 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,12 +115,12 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" -#include <contrib/dev/acpica/amlcode.h> +#include "amlcode.h" -#include <contrib/dev/acpica/acdispat.h> -#include <contrib/dev/acpica/acparser.h> +#include "acdispat.h" +#include "acparser.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslfold") @@ -481,7 +480,7 @@ OpcAmlConstantWalk ( * Because we know we executed type 3/4/5 opcodes above, we know that * the result must be either an Integer, String, or Buffer. */ - switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) + switch (ObjDesc->Common.Type) { case ACPI_TYPE_INTEGER: diff --git a/sys/contrib/dev/acpica/compiler/aslglobal.h b/sys/contrib/dev/acpica/compiler/aslglobal.h index 07e8a46..4cb9121 100644 --- a/sys/contrib/dev/acpica/compiler/aslglobal.h +++ b/sys/contrib/dev/acpica/compiler/aslglobal.h @@ -3,7 +3,6 @@ /****************************************************************************** * * Module Name: aslglobal.h - Global variable definitions - * $Revision: 1.56 $ * *****************************************************************************/ @@ -11,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -144,7 +143,7 @@ extern FILE *AslCompilerin; extern int AslCompilerdebug; extern const ASL_MAPPING_ENTRY AslKeywordMapping[]; extern char *AslCompilertext; -extern char hex[]; +extern char HexLookup[]; #define ASL_LINE_BUFFER_SIZE 512 #define ASL_MSG_BUFFER_SIZE 4096 @@ -171,6 +170,9 @@ extern UINT32 Gbl_ExceptionCount[]; /* Option flags */ +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoCompile, TRUE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoSignon, TRUE); + ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_Acpi2, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE); @@ -186,6 +188,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ParseOnlyFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileTimesFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_FoldConstants, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseErrors, TRUE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoErrors, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisasmFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_GetAllTables, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE); diff --git a/sys/contrib/dev/acpica/compiler/asllength.c b/sys/contrib/dev/acpica/compiler/asllength.c index 056aaeb..bd222e6 100644 --- a/sys/contrib/dev/acpica/compiler/asllength.c +++ b/sys/contrib/dev/acpica/compiler/asllength.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: asllength - Tree walk to determine package and opcode lengths - * $Revision: 1.37 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,9 +115,9 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" -#include <contrib/dev/acpica/amlcode.h> +#include "amlcode.h" #define _COMPONENT ACPI_COMPILER diff --git a/sys/contrib/dev/acpica/compiler/asllisting.c b/sys/contrib/dev/acpica/compiler/asllisting.c index 31f70b8..f229d5f 100644 --- a/sys/contrib/dev/acpica/compiler/asllisting.c +++ b/sys/contrib/dev/acpica/compiler/asllisting.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: asllisting - Listing file generation - * $Revision: 1.63 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,11 +115,11 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" -#include <contrib/dev/acpica/amlcode.h> -#include <contrib/dev/acpica/acparser.h> -#include <contrib/dev/acpica/acnamesp.h> +#include "amlcode.h" +#include "acparser.h" +#include "acnamesp.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslisting") @@ -199,6 +198,12 @@ static void LsDoHexOutputAsm ( void); +ACPI_STATUS +LsTreeWriteWalk ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context); + /******************************************************************************* * diff --git a/sys/contrib/dev/acpica/compiler/aslload.c b/sys/contrib/dev/acpica/compiler/aslload.c index ebbc487..e61e0622 100644 --- a/sys/contrib/dev/acpica/compiler/aslload.c +++ b/sys/contrib/dev/acpica/compiler/aslload.c @@ -1,7 +1,6 @@ /****************************************************************************** * * Module Name: dswload - Dispatcher namespace load callbacks - * $Revision: 1.77 $ * *****************************************************************************/ @@ -9,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,10 +115,10 @@ #define __ASLLOAD_C__ -#include <contrib/dev/acpica/compiler/aslcompiler.h> -#include <contrib/dev/acpica/amlcode.h> -#include <contrib/dev/acpica/acdispat.h> -#include <contrib/dev/acpica/acnamesp.h> +#include "aslcompiler.h" +#include "amlcode.h" +#include "acdispat.h" +#include "acnamesp.h" #include "aslcompiler.y.h" @@ -145,7 +144,13 @@ LdNamespace1Begin ( void *Context); static ACPI_STATUS -LdNamespace1End ( +LdNamespace2Begin ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context); + +static ACPI_STATUS +LdCommonNamespaceEnd ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context); @@ -160,7 +165,7 @@ LdNamespace1End ( * RETURN: Status * * DESCRIPTION: Perform a walk of the parse tree that in turn loads all of the - * named ASL/AML objects into the namespace. The namespace is + * named ASL/AML objects into the namespace. The namespace is * constructed in order to resolve named references and references * to named fields within resource templates/descriptors. * @@ -183,10 +188,15 @@ LdLoadNamespace ( return AE_NO_MEMORY; } - /* Perform the walk of the parse tree */ + /* Walk the entire parse tree, first pass */ TrWalkParseTree (RootOp, ASL_WALK_VISIT_TWICE, LdNamespace1Begin, - LdNamespace1End, WalkState); + LdCommonNamespaceEnd, WalkState); + + /* Second pass to handle forward references */ + + TrWalkParseTree (RootOp, ASL_WALK_VISIT_TWICE, LdNamespace2Begin, + LdCommonNamespaceEnd, WalkState); /* Dump the namespace if debug is enabled */ @@ -304,7 +314,7 @@ LdLoadFieldElements ( * DESCRIPTION: Enter the named elements of the resource descriptor (children * of the parent) into the namespace. * - * NOTE: In the real AML namespace, these named elements never exist. But + * NOTE: In the real AML namespace, these named elements never exist. But * we simply use the namespace here as a symbol table so we can look * them up as they are referenced. * @@ -395,7 +405,7 @@ LdLoadResourceElements ( * * RETURN: Status * - * DESCRIPTION: Descending callback used during the parse tree walk. If this + * DESCRIPTION: Descending callback used during the parse tree walk. If this * is a named AML opcode, enter into the namespace * ******************************************************************************/ @@ -536,7 +546,7 @@ LdNamespace1Begin ( * The name referenced by Scope(Name) must already exist at this point. * In other words, forward references for Scope() are not supported. * The only real reason for this is that the MS interpreter cannot - * handle this case. Perhaps someday this case can go away. + * handle this case. Perhaps someday this case can go away. */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, @@ -621,7 +631,7 @@ LdNamespace1Begin ( /* * However, switch the type to be an actual scope so * that compilation can continue without generating a whole - * cascade of additional errors. Open the new scope. + * cascade of additional errors. Open the new scope. */ Node->Type = ACPI_TYPE_LOCAL_SCOPE; Status = AcpiDsScopeStackPush (Node, ACPI_TYPE_LOCAL_SCOPE, @@ -652,8 +662,8 @@ LdNamespace1Begin ( Flags |= ACPI_NS_ERROR_IF_FOUND; /* - * Enter the named type into the internal namespace. We enter the name - * as we go downward in the parse tree. Any necessary subobjects that + * Enter the named type into the internal namespace. We enter the name + * as we go downward in the parse tree. Any necessary subobjects that * involve arguments to the opcode must be created as we go back up the * parse tree later. */ @@ -672,7 +682,8 @@ LdNamespace1Begin ( Node->Type = (UINT8) ObjectType; Status = AE_OK; } - else if (Node->Flags & ANOBJ_IS_EXTERNAL) + else if ((Node->Flags & ANOBJ_IS_EXTERNAL) && + (Op->Asl.ParseOpcode != PARSEOP_EXTERNAL)) { /* * Allow one create on an object or segment that was @@ -752,7 +763,143 @@ Exit: /******************************************************************************* * - * FUNCTION: LdNamespace1End + * FUNCTION: LdNamespace2Begin + * + * PARAMETERS: ASL_WALK_CALLBACK + * + * RETURN: Status + * + * DESCRIPTION: Descending callback used during the pass 2 parse tree walk. + * Second pass resolves some forward references. + * + * Notes: + * Currently only needs to handle the Alias operator. + * Could be used to allow forward references from the Scope() operator, but + * the MS interpreter does not allow this, so this compiler does not either. + * + ******************************************************************************/ + +static ACPI_STATUS +LdNamespace2Begin ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level, + void *Context) +{ + ACPI_WALK_STATE *WalkState = (ACPI_WALK_STATE *) Context; + ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node; + ACPI_OBJECT_TYPE ObjectType; + BOOLEAN ForceNewScope = FALSE; + ACPI_PARSE_OBJECT *Arg; + char *Path; + ACPI_NAMESPACE_NODE *TargetNode; + + + ACPI_FUNCTION_NAME (LdNamespace2Begin); + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op %p [%s]\n", + Op, Op->Asl.ParseOpName)); + + + /* Ignore Ops with no namespace node */ + + Node = Op->Asl.Node; + if (!Node) + { + return (AE_OK); + } + + /* Get the type to determine if we should push the scope */ + + if ((Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) && + (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC)) + { + ObjectType = ACPI_TYPE_LOCAL_RESOURCE; + } + else + { + ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); + } + + /* Push scope for Resource Templates */ + + if (Op->Asl.ParseOpcode == PARSEOP_NAME) + { + if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC) + { + ForceNewScope = TRUE; + } + } + + /* Push the scope stack */ + + if (ForceNewScope || AcpiNsOpensScope (ObjectType)) + { + Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + + if (Op->Asl.ParseOpcode == PARSEOP_ALIAS) + { + /* Complete the alias node by getting and saving the target node */ + + /* First child is the alias target */ + + Arg = Op->Asl.Child; + + /* Get the target pathname */ + + Path = Arg->Asl.Namepath; + if (!Path) + { + Status = UtInternalizeName (Arg->Asl.ExternalName, &Path); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + } + + /* Get the NS node associated with the target. It must exist. */ + + Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY, + ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, + WalkState, &TargetNode); + if (ACPI_FAILURE (Status)) + { + if (Status == AE_NOT_FOUND) + { + AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, + Op->Asl.ExternalName); + + /* + * The name was not found, go ahead and create it. + * This prevents more errors later. + */ + Status = AcpiNsLookup (WalkState->ScopeInfo, Path, + ACPI_TYPE_ANY, + ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH, + WalkState, &(Node)); + return (AE_OK); + } + + AslCoreSubsystemError (Op, Status, "Failure from lookup\n", FALSE); + return (AE_OK); + } + + /* Save the target node within the alias node */ + + Node->Object = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, TargetNode); + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: LdCommonNamespaceEnd * * PARAMETERS: ASL_WALK_CALLBACK * @@ -764,7 +911,7 @@ Exit: ******************************************************************************/ static ACPI_STATUS -LdNamespace1End ( +LdCommonNamespaceEnd ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context) @@ -774,7 +921,7 @@ LdNamespace1End ( BOOLEAN ForceNewScope = FALSE; - ACPI_FUNCTION_NAME (LdNamespace1End); + ACPI_FUNCTION_NAME (LdCommonNamespaceEnd); /* We are only interested in opcodes that have an associated name */ @@ -812,7 +959,6 @@ LdNamespace1End ( if (ForceNewScope || AcpiNsOpensScope (ObjectType)) { - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s): Popping scope for Op [%s] %p\n", AcpiUtGetTypeName (ObjectType), Op->Asl.ParseOpName, Op)); diff --git a/sys/contrib/dev/acpica/compiler/asllookup.c b/sys/contrib/dev/acpica/compiler/asllookup.c index a970f12..06113f0 100644 --- a/sys/contrib/dev/acpica/compiler/asllookup.c +++ b/sys/contrib/dev/acpica/compiler/asllookup.c @@ -1,7 +1,6 @@ /****************************************************************************** * * Module Name: asllookup- Namespace lookup - * $Revision: 1.103 $ * *****************************************************************************/ @@ -9,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -115,13 +114,13 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" -#include <contrib/dev/acpica/acparser.h> -#include <contrib/dev/acpica/amlcode.h> -#include <contrib/dev/acpica/acnamesp.h> -#include <contrib/dev/acpica/acdispat.h> +#include "acparser.h" +#include "amlcode.h" +#include "acnamesp.h" +#include "acdispat.h" #define _COMPONENT ACPI_COMPILER @@ -174,6 +173,21 @@ LkIsObjectUsed ( void *Context, void **ReturnValue); +static ACPI_STATUS +LsDoOnePathname ( + ACPI_HANDLE ObjHandle, + UINT32 Level, + void *Context, + void **ReturnValue); + +void +LsSetupNsList ( + void *Handle); + +ACPI_PARSE_OBJECT * +LkGetNameOp ( + ACPI_PARSE_OBJECT *Op); + /******************************************************************************* * @@ -416,8 +430,21 @@ LsDoOneNamespaceObject ( } +/******************************************************************************* + * + * FUNCTION: LsSetupNsList + * + * PARAMETERS: Handle - local file handle + * + * RETURN: None + * + * DESCRIPTION: Set the namespace output file to the input handle + * + ******************************************************************************/ + void -LsSetupNsList (void * Handle) +LsSetupNsList ( + void *Handle) { Gbl_NsOutputFlag = TRUE; @@ -427,6 +454,44 @@ LsSetupNsList (void * Handle) /******************************************************************************* * + * FUNCTION: LsDoOnePathname + * + * PARAMETERS: ACPI_WALK_CALLBACK + * + * RETURN: Status + * + * DESCRIPTION: Print the full pathname for a namespace node. + * + ******************************************************************************/ + +static ACPI_STATUS +LsDoOnePathname ( + ACPI_HANDLE ObjHandle, + UINT32 Level, + void *Context, + void **ReturnValue) +{ + ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; + ACPI_STATUS Status; + ACPI_BUFFER TargetPath; + + + TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER; + Status = AcpiNsHandleToPathname (Node, &TargetPath); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n", TargetPath.Pointer); + ACPI_FREE (TargetPath.Pointer); + + return (AE_OK); +} + + +/******************************************************************************* + * * FUNCTION: LsDisplayNamespace * * PARAMETERS: None @@ -463,6 +528,15 @@ LsDisplayNamespace ( Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, FALSE, LsDoOneNamespaceObject, NULL, NULL); + + /* Print the full pathname for each namespace node */ + + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\nNamespace pathnames\n\n"); + + Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, FALSE, LsDoOnePathname, + NULL, NULL); + return (Status); } @@ -857,6 +931,17 @@ LkNamespaceLocateBegin ( } /* + * One special case: CondRefOf operator - we don't care if the name exists + * or not at this point, just ignore it, the point of the operator is to + * determine if the name exists at runtime. + */ + if ((Op->Asl.Parent) && + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF)) + { + return (AE_OK); + } + + /* * We must enable the "search-to-root" for single NameSegs, but * we have to be very careful about opening up scopes */ @@ -944,14 +1029,6 @@ LkNamespaceLocateBegin ( { /* The name doesn't exist, period */ - if ((Op->Asl.Parent) && - (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF)) - { - /* Ignore not found if parent is CondRefOf */ - - return (AE_OK); - } - AslError (ASL_ERROR, ASL_MSG_NOT_EXIST, Op, Op->Asl.ExternalName); } @@ -964,14 +1041,6 @@ LkNamespaceLocateBegin ( { /* Gave full path, the object does not exist */ - if ((Op->Asl.Parent) && - (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF)) - { - /* Ignore not found if parent is CondRefOf */ - - return (AE_OK); - } - AslError (ASL_ERROR, ASL_MSG_NOT_EXIST, Op, Op->Asl.ExternalName); } diff --git a/sys/contrib/dev/acpica/compiler/aslmain.c b/sys/contrib/dev/acpica/compiler/aslmain.c index 6fe94b4..d006955 100644 --- a/sys/contrib/dev/acpica/compiler/aslmain.c +++ b/sys/contrib/dev/acpica/compiler/aslmain.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslmain - compiler main and utilities - * $Revision: 1.96 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -118,10 +117,8 @@ #define _DECLARE_GLOBALS -#include <contrib/dev/acpica/compiler/aslcompiler.h> -#include <contrib/dev/acpica/acnamesp.h> -#include <contrib/dev/acpica/actables.h> -#include <contrib/dev/acpica/acapps.h> +#include "aslcompiler.h" +#include "acapps.h" #ifdef _DEBUG #include <crtdbg.h> @@ -130,15 +127,6 @@ #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslmain") -BOOLEAN AslToFile = TRUE; -BOOLEAN DoCompile = TRUE; -BOOLEAN DoSignon = TRUE; - -char hex[] = -{ - '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' -}; - /* Local prototypes */ static void @@ -157,14 +145,11 @@ static void AslInitialize ( void); -static void +static int AslCommandLine ( int argc, char **argv); -#ifdef _DEBUG -#include <crtdbg.h> -#endif /******************************************************************************* * @@ -184,7 +169,8 @@ Options ( { printf ("General Output:\n"); - printf (" -p <prefix> Specify filename prefix for all output files (including .aml)\n"); + printf (" -p <prefix> Specify path/filename prefix for all output files\n"); + printf (" -va Disable all errors and warnings (summary only)\n"); printf (" -vi Less verbose errors and warnings for use with IDEs\n"); printf (" -vo Enable optimization comments\n"); printf (" -vr Disable remarks\n"); @@ -212,7 +198,7 @@ Options ( printf (" -d [file] Disassemble or decode binary ACPI table to file (*.dsl)\n"); printf (" -dc [file] Disassemble AML and immediately compile it\n"); printf (" (Obtain DSDT from current system if no input file)\n"); - printf (" -e [file] Include ACPI table for external symbol resolution\n"); + printf (" -e [f1,f2] Include ACPI table(s) for external symbol resolution\n"); printf (" -2 Emit ACPI 2.0 compatible ASL code\n"); printf (" -g Get ACPI tables and write to files (*.dat)\n"); @@ -278,7 +264,7 @@ Usage ( void) { - printf ("Usage: %s [Options] [InputFile]\n\n", CompilerName); + printf ("Usage: %s [Options] [Files]\n\n", CompilerName); Options (); } @@ -334,13 +320,13 @@ AslInitialize ( * ******************************************************************************/ -static void +static int AslCommandLine ( int argc, char **argv) { BOOLEAN BadCommandLine = FALSE; - ACPI_NATIVE_INT j; + int j; /* Minimum command line contains at least one option or an input file */ @@ -400,7 +386,7 @@ AslCommandLine ( switch (AcpiGbl_Optarg[0]) { case '^': - DoCompile = FALSE; + Gbl_DoCompile = FALSE; break; case 'c': @@ -434,7 +420,7 @@ AslCommandLine ( /* Get all ACPI tables */ Gbl_GetAllTables = TRUE; - DoCompile = FALSE; + Gbl_DoCompile = FALSE; break; @@ -635,6 +621,12 @@ AslCommandLine ( switch (AcpiGbl_Optarg[0]) { + case 'a': + /* Disable All error/warning messages */ + + Gbl_NoErrors = TRUE; + break; + case 'i': /* Less verbose error messages */ @@ -650,7 +642,7 @@ AslCommandLine ( break; case 's': - DoSignon = FALSE; + Gbl_DoSignon = FALSE; break; default: @@ -699,9 +691,7 @@ AslCommandLine ( /* Next parameter must be the input filename */ - Gbl_Files[ASL_FILE_INPUT].Filename = argv[AcpiGbl_Optind]; - - if (!Gbl_Files[ASL_FILE_INPUT].Filename && + if (!argv[AcpiGbl_Optind] && !Gbl_DisasmFlag && !Gbl_GetAllTables) { @@ -709,7 +699,7 @@ AslCommandLine ( BadCommandLine = TRUE; } - if (DoSignon) + if (Gbl_DoSignon) { AslCompilerSignon (ASL_FILE_STDOUT); } @@ -723,11 +713,7 @@ AslCommandLine ( exit (1); } - if ((AcpiGbl_Optind + 1) < argc) - { - printf ("Warning: extra arguments (%d) after input filename are ignored\n\n", - argc - AcpiGbl_Optind - 1); - } + return (AcpiGbl_Optind); } @@ -739,8 +725,8 @@ AslCommandLine ( * * RETURN: Program termination code * - * DESCRIPTION: C main routine for the Asl Compiler. Handle command line - * options and begin the compile. + * DESCRIPTION: C main routine for the Asl Compiler. Handle command line + * options and begin the compile for each file on the command line * ******************************************************************************/ @@ -750,7 +736,7 @@ main ( char **argv) { ACPI_STATUS Status; - char *Prefix; + int Index; #ifdef _DEBUG @@ -761,105 +747,31 @@ main ( /* Init and command line */ AslInitialize (); - AslCommandLine (argc, argv); - - /* - * If -p not specified, we will use the input filename as the - * output filename prefix - */ - Status = FlSplitInputPathname (Gbl_Files[ASL_FILE_INPUT].Filename, - &Gbl_DirectoryPath, &Prefix); - if (ACPI_FAILURE (Status)) - { - return -1; - } + Index = AslCommandLine (argc, argv); - if (Gbl_UseDefaultAmlFilename) - { - Gbl_OutputFilenamePrefix = Prefix; - } - - /* AML Disassembly (Optional) */ + /* Options that have no additional parameters or pathnames */ - if (Gbl_DisasmFlag || Gbl_GetAllTables) + if (Gbl_GetAllTables) { - /* ACPI CA subsystem initialization */ - - Status = AdInitialize (); + Status = AslDoOneFile (NULL); if (ACPI_FAILURE (Status)) { - return -1; - } - - Status = AcpiAllocateRootTable (4); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("Could not initialize ACPI Table Manager, %s\n", - AcpiFormatException (Status)); - return -1; - } - - /* This is where the disassembly happens */ - - AcpiGbl_DbOpt_disasm = TRUE; - Status = AdAmlDisassemble (AslToFile, - Gbl_Files[ASL_FILE_INPUT].Filename, - Gbl_OutputFilenamePrefix, - &Gbl_Files[ASL_FILE_INPUT].Filename, - Gbl_GetAllTables); - if (ACPI_FAILURE (Status)) - { - return -1; - } - - /* - * Gbl_Files[ASL_FILE_INPUT].Filename was replaced with the - * .DSL disassembly file, which can now be compiled if requested - */ - if (DoCompile) - { - AcpiOsPrintf ("\nCompiling \"%s\"\n", - Gbl_Files[ASL_FILE_INPUT].Filename); + return (-1); } + return (0); } - /* - * ASL Compilation (Optional) - */ - if (DoCompile) - { - /* - * If -p not specified, we will use the input filename as the - * output filename prefix - */ - Status = FlSplitInputPathname (Gbl_Files[ASL_FILE_INPUT].Filename, - &Gbl_DirectoryPath, &Prefix); - if (ACPI_FAILURE (Status)) - { - return -1; - } - - if (Gbl_UseDefaultAmlFilename) - { - Gbl_OutputFilenamePrefix = Prefix; - } + /* Process each pathname/filename in the list, with possible wildcards */ - /* ACPI CA subsystem initialization (Must be re-initialized) */ - - Status = AcpiOsInitialize (); - AcpiUtInitGlobals (); - Status = AcpiUtMutexInitialize (); + while (argv[Index]) + { + Status = AslDoOnePathname (argv[Index]); if (ACPI_FAILURE (Status)) { - return -1; + return (-1); } - Status = AcpiNsRootInitialize (); - if (ACPI_FAILURE (Status)) - { - return -1; - } - Status = CmDoCompile (); + Index++; } return (0); diff --git a/sys/contrib/dev/acpica/compiler/aslmap.c b/sys/contrib/dev/acpica/compiler/aslmap.c index 5384d0b..f96e78c 100644 --- a/sys/contrib/dev/acpica/compiler/aslmap.c +++ b/sys/contrib/dev/acpica/compiler/aslmap.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslmap - parser to AML opcode mapping table - * $Revision: 1.87 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,9 +115,9 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> -#include <contrib/dev/acpica/amlcode.h> -#include <contrib/dev/acpica/acparser.h> +#include "aslcompiler.h" +#include "amlcode.h" +#include "acparser.h" #define _COMPONENT ACPI_COMPILER @@ -205,7 +204,7 @@ MpDisplayReservedNames ( else { printf ("Method with %d arguments, ", - ReservedMethods[i].NumArguments); + ReservedMethods[i].NumArguments & 0x0F); if (ReservedMethods[i].Flags & ASL_RSVD_RETURN_VALUE) { @@ -266,6 +265,7 @@ const ASL_RESERVED_INFO ReservedMethods[] = { {"_ALR", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ {"_ALT", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ {"_ASI", 0, ASL_RSVD_RESOURCE_NAME}, + {"_ASZ", 0, ASL_RSVD_RESOURCE_NAME}, {"_BAS", 0, ASL_RSVD_RESOURCE_NAME}, {"_BBN", 0, ASL_RSVD_RETURN_VALUE}, {"_BCL", 0, ASL_RSVD_RETURN_VALUE}, @@ -343,6 +343,7 @@ const ASL_RESERVED_INFO ReservedMethods[] = { {"_MIN", 0, ASL_RSVD_RESOURCE_NAME}, {"_MLS", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ {"_MSG", 1, 0}, + {"_MTP", 0, ASL_RSVD_RESOURCE_NAME}, {"_OFF", 0, 0}, {"_ON_", 0, 0}, {"_OS_", 0, ASL_RSVD_RETURN_VALUE}, @@ -403,7 +404,7 @@ const ASL_RESERVED_INFO ReservedMethods[] = { {"_S4W", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ {"_SB_", 0, ASL_RSVD_SCOPE}, {"_SBS", 0, ASL_RSVD_RETURN_VALUE}, - {"_SCP", 1, 0}, + {"_SCP", 0x13, 0}, /* Acpi 1.0 - one arg; Acpi 3.0 - three args */ {"_SDD", 1, 0}, /* Acpi 3.0 */ {"_SEG", 0, ASL_RSVD_RETURN_VALUE}, {"_SHR", 0, ASL_RSVD_RESOURCE_NAME}, diff --git a/sys/contrib/dev/acpica/compiler/aslopcodes.c b/sys/contrib/dev/acpica/compiler/aslopcodes.c index ae91dc8..e386266 100644 --- a/sys/contrib/dev/acpica/compiler/aslopcodes.c +++ b/sys/contrib/dev/acpica/compiler/aslopcodes.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslopcode - AML opcode generation - * $Revision: 1.74 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,9 +115,9 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" -#include <contrib/dev/acpica/amlcode.h> +#include "amlcode.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslopcodes") @@ -546,7 +545,7 @@ OpcDoEisaId ( UINT32 BigEndianId; char *InString; ACPI_STATUS Status = AE_OK; - ACPI_NATIVE_UINT i; + UINT32 i; InString = (char *) Op->Asl.Value.String; @@ -642,7 +641,7 @@ OpcDoUuId ( char *InString; char *Buffer; ACPI_STATUS Status = AE_OK; - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_PARSE_OBJECT *NewOp; diff --git a/sys/contrib/dev/acpica/compiler/asloperands.c b/sys/contrib/dev/acpica/compiler/asloperands.c index 8f4500e..c354855 100644 --- a/sys/contrib/dev/acpica/compiler/asloperands.c +++ b/sys/contrib/dev/acpica/compiler/asloperands.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: asloperands - AML operand processing - * $Revision: 1.61 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,9 +115,9 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" -#include <contrib/dev/acpica/amlcode.h> +#include "amlcode.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("asloperands") @@ -948,7 +947,8 @@ OpnDoDefinitionBlock ( { ACPI_PARSE_OBJECT *Child; ACPI_SIZE Length; - ACPI_NATIVE_UINT i; + UINT32 i; + char *Filename; /* @@ -966,7 +966,19 @@ OpnDoDefinitionBlock ( *Child->Asl.Value.Buffer && (Gbl_UseDefaultAmlFilename)) { - Gbl_OutputFilenamePrefix = (char *) Child->Asl.Value.Buffer; + /* + * We will use the AML filename that is embedded in the source file + * for the output filename. + */ + Filename = ACPI_ALLOCATE (strlen (Gbl_DirectoryPath) + + strlen ((char *) Child->Asl.Value.Buffer) + 1); + + /* Prepend the current directory path */ + + strcpy (Filename, Gbl_DirectoryPath); + strcat (Filename, (char *) Child->Asl.Value.Buffer); + + Gbl_OutputFilenamePrefix = Filename; } Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; diff --git a/sys/contrib/dev/acpica/compiler/aslopt.c b/sys/contrib/dev/acpica/compiler/aslopt.c index 2ea9aea..3013f4c 100644 --- a/sys/contrib/dev/acpica/compiler/aslopt.c +++ b/sys/contrib/dev/acpica/compiler/aslopt.c @@ -1,7 +1,6 @@ /****************************************************************************** * * Module Name: aslopt- Compiler optimizations - * $Revision: 1.26 $ * *****************************************************************************/ @@ -9,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -115,12 +114,12 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" -#include <contrib/dev/acpica/acparser.h> -#include <contrib/dev/acpica/amlcode.h> -#include <contrib/dev/acpica/acnamesp.h> +#include "acparser.h" +#include "amlcode.h" +#include "acnamesp.h" #define _COMPONENT ACPI_COMPILER @@ -288,9 +287,9 @@ OptBuildShortestPath ( { UINT32 NumCommonSegments; UINT32 MaxCommonSegments; - ACPI_NATIVE_UINT Index; + UINT32 Index; UINT32 NumCarats; - ACPI_NATIVE_UINT i; + UINT32 i; char *NewPath; char *NewPathExternal; ACPI_NAMESPACE_NODE *Node; @@ -437,7 +436,7 @@ OptBuildShortestPath ( { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " NOT SHORTER (New %u old %u)", - ACPI_STRLEN (NewPath), AmlNameStringLength)); + (UINT32) ACPI_STRLEN (NewPath), (UINT32) AmlNameStringLength)); ACPI_FREE (NewPathExternal); return (AE_NOT_FOUND); } @@ -753,8 +752,8 @@ OptOptimizeNamePath ( ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "%37s (%2u) ==> %-32s(%2u) %-32s", - (char *) CurrentPath.Pointer, CurrentPath.Length, - (char *) TargetPath.Pointer, TargetPath.Length, ExternalNameString)); + (char *) CurrentPath.Pointer, (UINT32) CurrentPath.Length, + (char *) TargetPath.Pointer, (UINT32) TargetPath.Length, ExternalNameString)); ACPI_FREE (ExternalNameString); @@ -812,7 +811,7 @@ OptOptimizeNamePath ( OptTotal += HowMuchShorter; ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " REDUCED %2u (%u)", - HowMuchShorter, OptTotal)); + (UINT32) HowMuchShorter, OptTotal)); if (Flags & AML_NAMED) { diff --git a/sys/contrib/dev/acpica/compiler/aslresource.c b/sys/contrib/dev/acpica/compiler/aslresource.c index c33637e..ceebd9c 100644 --- a/sys/contrib/dev/acpica/compiler/aslresource.c +++ b/sys/contrib/dev/acpica/compiler/aslresource.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslresource - Resource templates and descriptors - * $Revision: 1.43 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,9 +115,9 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" -#include <contrib/dev/acpica/amlcode.h> +#include "amlcode.h" #define _COMPONENT ACPI_COMPILER diff --git a/sys/contrib/dev/acpica/compiler/aslrestype1.c b/sys/contrib/dev/acpica/compiler/aslrestype1.c index e317436..edc8405 100644 --- a/sys/contrib/dev/acpica/compiler/aslrestype1.c +++ b/sys/contrib/dev/acpica/compiler/aslrestype1.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslrestype1 - Short (type1) resource templates and descriptors - * $Revision: 1.40 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,7 +115,7 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" #define _COMPONENT ACPI_COMPILER diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2.c b/sys/contrib/dev/acpica/compiler/aslrestype2.c index c42e4a9..7074a55 100644 --- a/sys/contrib/dev/acpica/compiler/aslrestype2.c +++ b/sys/contrib/dev/acpica/compiler/aslrestype2.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslrestype2 - Long (type2) resource templates and descriptors - * $Revision: 1.51 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,7 +115,7 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" #define _COMPONENT ACPI_COMPILER @@ -2488,20 +2487,25 @@ RsDoInterruptDescriptor ( InitializerOp = Op->Asl.Child; StringLength = RsGetStringDataLength (InitializerOp); - if (StringLength) - { - /* Make room for the ResourceSourceIndex */ - - OptionIndex++; - } /* Count the interrupt numbers */ for (i = 0; InitializerOp; i++) { InitializerOp = ASL_GET_PEER_NODE (InitializerOp); + if (i <= 6) { + if (i == 3 && + InitializerOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) + { + /* + * ResourceSourceIndex was specified, always make room for + * it, even if the ResourceSource was omitted. + */ + OptionIndex++; + } + continue; } @@ -2636,6 +2640,14 @@ RsDoInterruptDescriptor ( if (i == 7) { + if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) + { + /* Must be at least one interrupt */ + + AslError (ASL_ERROR, ASL_MSG_EX_INTERRUPT_LIST_MIN, + InitializerOp, NULL); + } + /* Check now for duplicates in list */ RsCheckListForDuplicates (InitializerOp); diff --git a/sys/contrib/dev/acpica/compiler/aslstartup.c b/sys/contrib/dev/acpica/compiler/aslstartup.c new file mode 100644 index 0000000..87e102b --- /dev/null +++ b/sys/contrib/dev/acpica/compiler/aslstartup.c @@ -0,0 +1,446 @@ + +/****************************************************************************** + * + * Module Name: aslstartup - Compiler startup routines, called from main + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + + +#include "aslcompiler.h" +#include "actables.h" +#include "acapps.h" + +#define _COMPONENT ACPI_COMPILER + ACPI_MODULE_NAME ("aslstartup") + + +#define ASL_MAX_FILES 256 +char *FileList[ASL_MAX_FILES]; +int FileCount; +BOOLEAN AslToFile = TRUE; + + +/* Local prototypes */ + +static void +AslInitializeGlobals ( + void); + +static char ** +AsDoWildcard ( + char *DirectoryPathname, + char *FileSpecifier); + + +/******************************************************************************* + * + * FUNCTION: AslInitializeGlobals + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Re-initialize globals needed to restart the compiler. This + * allows multiple files to be disassembled and/or compiled. + * + ******************************************************************************/ + +static void +AslInitializeGlobals ( + void) +{ + UINT32 i; + + + /* Init compiler globals */ + + Gbl_CurrentColumn = 0; + Gbl_CurrentLineNumber = 1; + Gbl_LogicalLineNumber = 1; + Gbl_CurrentLineOffset = 0; + Gbl_LineBufPtr = Gbl_CurrentLineBuffer; + + Gbl_ErrorLog = NULL; + Gbl_NextError = NULL; + + AslGbl_NextEvent = 0; + for (i = 0; i < ASL_NUM_REPORT_LEVELS; i++) + { + Gbl_ExceptionCount[i] = 0; + } + + Gbl_Files[ASL_FILE_AML_OUTPUT].Filename = NULL; +} + + +/****************************************************************************** + * + * FUNCTION: AsDoWildcard + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Process files via wildcards. This function is for the Windows + * case only. + * + ******************************************************************************/ + +static char ** +AsDoWildcard ( + char *DirectoryPathname, + char *FileSpecifier) +{ +#ifdef WIN32 + void *DirInfo; + char *Filename; + + + FileCount = 0; + + /* Open parent directory */ + + DirInfo = AcpiOsOpenDirectory (DirectoryPathname, FileSpecifier, REQUEST_FILE_ONLY); + if (!DirInfo) + { + /* Either the directory of file does not exist */ + + Gbl_Files[ASL_FILE_INPUT].Filename = FileSpecifier; + FlFileError (ASL_FILE_INPUT, ASL_MSG_OPEN); + AslAbort (); + } + + /* Process each file that matches the wildcard specification */ + + while ((Filename = AcpiOsGetNextFilename (DirInfo))) + { + /* Add the filename to the file list */ + + FileList[FileCount] = AcpiOsAllocate (strlen (Filename) + 1); + strcpy (FileList[FileCount], Filename); + FileCount++; + + if (FileCount >= ASL_MAX_FILES) + { + printf ("Max files reached\n"); + FileList[0] = NULL; + return (FileList); + } + } + + /* Cleanup */ + + AcpiOsCloseDirectory (DirInfo); + FileList[FileCount] = NULL; + return (FileList); + +#else + /* + * Linux/Unix cases - Wildcards are expanded by the shell automatically. + * Just return the filename in a null terminated list + */ + FileList[0] = AcpiOsAllocate (strlen (FileSpecifier) + 1); + strcpy (FileList[0], FileSpecifier); + FileList[1] = NULL; + + return (FileList); +#endif +} + + +/******************************************************************************* + * + * FUNCTION: AslDoOneFile + * + * PARAMETERS: Filename - Name of the file + * + * RETURN: Status + * + * DESCRIPTION: Process a single file - either disassemble, compile, or both + * + ******************************************************************************/ + +ACPI_STATUS +AslDoOneFile ( + char *Filename) +{ + ACPI_STATUS Status; + + + Gbl_Files[ASL_FILE_INPUT].Filename = Filename; + + /* Re-initialize "some" compiler globals */ + + AslInitializeGlobals (); + + /* + * AML Disassembly (Optional) + */ + if (Gbl_DisasmFlag || Gbl_GetAllTables) + { + /* ACPI CA subsystem initialization */ + + Status = AdInitialize (); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + Status = AcpiAllocateRootTable (4); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("Could not initialize ACPI Table Manager, %s\n", + AcpiFormatException (Status)); + return (Status); + } + + /* This is where the disassembly happens */ + + AcpiGbl_DbOpt_disasm = TRUE; + Status = AdAmlDisassemble (AslToFile, + Gbl_Files[ASL_FILE_INPUT].Filename, + Gbl_OutputFilenamePrefix, + &Gbl_Files[ASL_FILE_INPUT].Filename, + Gbl_GetAllTables); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Shutdown compiler and ACPICA subsystem */ + + AeClearErrorLog (); + AcpiTerminate (); + + /* + * Gbl_Files[ASL_FILE_INPUT].Filename was replaced with the + * .DSL disassembly file, which can now be compiled if requested + */ + if (Gbl_DoCompile) + { + AcpiOsPrintf ("\nCompiling \"%s\"\n", + Gbl_Files[ASL_FILE_INPUT].Filename); + } + } + + /* + * ASL Compilation (Optional) + */ + if (Gbl_DoCompile) + { + /* + * If -p not specified, we will use the input filename as the + * output filename prefix + */ + if (Gbl_UseDefaultAmlFilename) + { + Gbl_OutputFilenamePrefix = Gbl_Files[ASL_FILE_INPUT].Filename; + } + + /* ACPI CA subsystem initialization (Must be re-initialized) */ + + Status = AdInitialize (); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + Status = CmDoCompile (); + AcpiTerminate (); + + /* + * Return non-zero exit code if there have been errors, unless the + * global ignore error flag has been set + */ + if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) + { + return (AE_ERROR); + } + + AeClearErrorLog (); + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AslDoOnePathname + * + * PARAMETERS: Pathname - Full pathname, possibly with wildcards + * + * RETURN: Status + * + * DESCRIPTION: Process one pathname, possible terminated with a wildcard + * specification. If a wildcard, it is expanded and the multiple + * files are processed. + * + ******************************************************************************/ + +ACPI_STATUS +AslDoOnePathname ( + char *Pathname) +{ + ACPI_STATUS Status; + char **FileList; + char *Filename; + char *FullPathname; + + + /* Split incoming path into a directory/filename combo */ + + Status = FlSplitInputPathname (Pathname, &Gbl_DirectoryPath, &Filename); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Expand possible wildcard into a file list (Windows/DOS only) */ + + FileList = AsDoWildcard (Gbl_DirectoryPath, Filename); + while (*FileList) + { + FullPathname = ACPI_ALLOCATE ( + strlen (Gbl_DirectoryPath) + strlen (*FileList) + 1); + + /* Construct a full path to the file */ + + strcpy (FullPathname, Gbl_DirectoryPath); + strcat (FullPathname, *FileList); + + /* + * If -p not specified, we will use the input filename as the + * output filename prefix + */ + if (Gbl_UseDefaultAmlFilename) + { + Gbl_OutputFilenamePrefix = FullPathname; + } + + Status = AslDoOneFile (FullPathname); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ACPI_FREE (FullPathname); + ACPI_FREE (*FileList); + *FileList = NULL; + FileList++; + } + + ACPI_FREE (Gbl_DirectoryPath); + ACPI_FREE (Filename); + return (AE_OK); +} + diff --git a/sys/contrib/dev/acpica/compiler/aslstubs.c b/sys/contrib/dev/acpica/compiler/aslstubs.c index eb6b12a..cb822e5 100644 --- a/sys/contrib/dev/acpica/compiler/aslstubs.c +++ b/sys/contrib/dev/acpica/compiler/aslstubs.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslstubs - Stubs used to link to Aml interpreter - * $Revision: 1.20 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -115,10 +114,11 @@ * *****************************************************************************/ -#include <stdio.h> -#include <contrib/dev/acpica/compiler/aslcompiler.h> -#include <contrib/dev/acpica/acdispat.h> -#include <contrib/dev/acpica/actables.h> +#include "aslcompiler.h" +#include "acdispat.h" +#include "actables.h" +#include "acevents.h" +#include "acinterp.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslstubs") @@ -137,6 +137,24 @@ AeLocalGetRootPointer ( } ACPI_STATUS +AcpiHwReadPort ( + ACPI_IO_ADDRESS Address, + UINT32 *Value, + UINT32 Width) +{ + return (AE_OK); +} + +ACPI_STATUS +AcpiHwWritePort ( + ACPI_IO_ADDRESS Address, + UINT32 Value, + UINT32 Width) +{ + return (AE_OK); +} + +ACPI_STATUS AcpiDsMethodError ( ACPI_STATUS Status, ACPI_WALK_STATE *WalkState) @@ -146,7 +164,7 @@ AcpiDsMethodError ( ACPI_STATUS AcpiDsMethodDataGetValue ( - UINT16 Opcode, + UINT8 Type, UINT32 Index, ACPI_WALK_STATE *WalkState, ACPI_OPERAND_OBJECT **DestDesc) @@ -156,7 +174,7 @@ AcpiDsMethodDataGetValue ( ACPI_STATUS AcpiDsMethodDataGetNode ( - UINT16 Opcode, + UINT8 Type, UINT32 Index, ACPI_WALK_STATE *WalkState, ACPI_NAMESPACE_NODE **Node) @@ -166,7 +184,7 @@ AcpiDsMethodDataGetNode ( ACPI_STATUS AcpiDsStoreObjectToLocal ( - UINT16 Opcode, + UINT8 Type, UINT32 Index, ACPI_OPERAND_OBJECT *SrcDesc, ACPI_WALK_STATE *WalkState) @@ -197,14 +215,14 @@ AcpiEvIsNotifyObject ( } ACPI_STATUS -AcpiEvAcquireGlobalLock( - UINT32 Timeout) +AcpiEvAcquireGlobalLock ( + UINT16 Timeout) { return (AE_OK); } ACPI_STATUS -AcpiEvReleaseGlobalLock( +AcpiEvReleaseGlobalLock ( void) { return (AE_OK); @@ -273,7 +291,7 @@ AcpiTbFindTable ( char *Signature, char *OemId, char *OemTableId, - ACPI_NATIVE_UINT *TableIndex) + UINT32 *TableIndex) { return (AE_SUPPORT); } diff --git a/sys/contrib/dev/acpica/compiler/asltransform.c b/sys/contrib/dev/acpica/compiler/asltransform.c index b76a266..eb45468 100644 --- a/sys/contrib/dev/acpica/compiler/asltransform.c +++ b/sys/contrib/dev/acpica/compiler/asltransform.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: asltransform - Parse tree transforms - * $Revision: 1.42 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,7 +115,7 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" #define _COMPONENT ACPI_COMPILER @@ -468,6 +467,7 @@ TrDoSwitch ( ACPI_PARSE_OBJECT *Peer; ACPI_PARSE_OBJECT *NewOp; ACPI_PARSE_OBJECT *NewOp2; + ACPI_PARSE_OBJECT *MethodOp; char *PredicateValueName; UINT16 Index; UINT32 Btype; @@ -729,18 +729,32 @@ TrDoSwitch ( { Next = Next->Asl.Parent; } + MethodOp = Next; NewOp->Asl.CompileFlags |= NODE_COMPILER_EMITTED; NewOp->Asl.Parent = Next; /* Insert name after the method name and arguments */ - Next = Next->Asl.Child; - Next = Next->Asl.Next; - Next = Next->Asl.Next; - Next = Next->Asl.Next; - Next = Next->Asl.Next; - Next = Next->Asl.Next; + Next = Next->Asl.Child; /* Name */ + Next = Next->Asl.Next; /* NumArgs */ + Next = Next->Asl.Next; /* SerializeRule */ + + /* + * If method is not Serialized, we must make is so, because of the way + * that Switch() must be implemented -- we cannot allow multiple threads + * to execute this method concurrently since we need to create local + * temporary name(s). + */ + if (Next->Asl.ParseOpcode != PARSEOP_SERIALIZERULE_SERIAL) + { + AslError (ASL_REMARK, ASL_MSG_SERIALIZED, MethodOp, "Due to use of Switch operator"); + Next->Asl.ParseOpcode = PARSEOP_SERIALIZERULE_SERIAL; + } + + Next = Next->Asl.Next; /* SyncLevel */ + Next = Next->Asl.Next; /* ReturnType */ + Next = Next->Asl.Next; /* ParameterTypes */ TrAmlInsertPeer (Next, NewOp); TrAmlInitLineNumbers (NewOp, Next); @@ -763,7 +777,7 @@ TrDoSwitch ( case ACPI_BTYPE_STRING: NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, - (ACPI_INTEGER) ""); + (ACPI_INTEGER) ACPI_TO_INTEGER ("")); break; case ACPI_BTYPE_BUFFER: diff --git a/sys/contrib/dev/acpica/compiler/asltree.c b/sys/contrib/dev/acpica/compiler/asltree.c index db9893d..30f59ee 100644 --- a/sys/contrib/dev/acpica/compiler/asltree.c +++ b/sys/contrib/dev/acpica/compiler/asltree.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: asltree - parse tree management - * $Revision: 1.63 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,7 +115,7 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" #define _COMPONENT ACPI_COMPILER @@ -914,6 +913,7 @@ TrLinkPeerNodes ( This->Asl.Next = Next; This = Next; } + va_end (ap); DbgPrint (ASL_PARSE_OUTPUT,"\n\n"); return (Start); diff --git a/sys/contrib/dev/acpica/compiler/asltypes.h b/sys/contrib/dev/acpica/compiler/asltypes.h index 51beeb2..6b3c424 100644 --- a/sys/contrib/dev/acpica/compiler/asltypes.h +++ b/sys/contrib/dev/acpica/compiler/asltypes.h @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: asltypes.h - compiler data types and struct definitions - * $Revision: 1.89 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -340,6 +339,7 @@ typedef enum ASL_MSG_EARLY_EOF, ASL_MSG_ENCODING_LENGTH, ASL_MSG_EX_INTERRUPT_LIST, + ASL_MSG_EX_INTERRUPT_LIST_MIN, ASL_MSG_EX_INTERRUPT_NUMBER, ASL_MSG_FIELD_ACCESS_WIDTH, ASL_MSG_FIELD_UNIT_ACCESS_WIDTH, @@ -422,7 +422,11 @@ typedef enum ASL_MSG_RESULT_NOT_USED, ASL_MSG_NOT_REFERENCED, ASL_MSG_NON_ZERO, - ASL_MSG_STRING_LENGTH + ASL_MSG_STRING_LENGTH, + ASL_MSG_SERIALIZED, + ASL_MSG_COMPILER_RESERVED, + ASL_MSG_NAMED_OBJECT_IN_WHILE, + ASL_MSG_LOCAL_OUTSIDE_METHOD } ASL_MESSAGE_IDS; @@ -454,6 +458,7 @@ char *AslMessages [] = { /* ASL_MSG_EARLY_EOF */ "Premature end-of-file reached", /* ASL_MSG_ENCODING_LENGTH */ "Package length too long to encode", /* ASL_MSG_EX_INTERRUPT_LIST */ "Too many interrupts (255 max)", +/* ASL_MSG_EX_INTERRUPT_LIST_MIN */ "Too few interrupts (1 minimum required)", /* ASL_MSG_EX_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 32 bits)", /* ASL_MSG_FIELD_ACCESS_WIDTH */ "Access width is greater than region size", /* ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */ "Access width of Field Unit extends beyond region limit", @@ -510,7 +515,7 @@ char *AslMessages [] = { /* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid operand type for reserved name, must be", /* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value", /* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name", -/* ASL_MSG_RESERVED_WORD */ "Use of reserved word", +/* ASL_MSG_RESERVED_WORD */ "Use of reserved name", /* ASL_MSG_RESOURCE_FIELD */ "Resource field name cannot be used as a target", /* ASL_MSG_RESOURCE_INDEX */ "Missing ResourceSourceIndex (required)", /* ASL_MSG_RESOURCE_LIST */ "Too many resource items (internal error)", @@ -536,7 +541,11 @@ char *AslMessages [] = { /* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect", /* ASL_MSG_NOT_REFERENCED */ "Namespace object is not referenced", /* ASL_MSG_NON_ZERO */ "Operand evaluates to zero", -/* ASL_MSG_STRING_LENGTH */ "String literal too long" +/* ASL_MSG_STRING_LENGTH */ "String literal too long", +/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized", +/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name", +/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop", +/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method" }; diff --git a/sys/contrib/dev/acpica/compiler/aslutils.c b/sys/contrib/dev/acpica/compiler/aslutils.c index 5acf1fc..ecba7c3 100644 --- a/sys/contrib/dev/acpica/compiler/aslutils.c +++ b/sys/contrib/dev/acpica/compiler/aslutils.c @@ -2,7 +2,6 @@ /****************************************************************************** * * Module Name: aslutils -- compiler utilities - * $Revision: 1.72 $ * *****************************************************************************/ @@ -10,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. * All rights reserved. * * 2. License @@ -116,10 +115,10 @@ *****************************************************************************/ -#include <contrib/dev/acpica/compiler/aslcompiler.h> +#include "aslcompiler.h" #include "aslcompiler.y.h" -#include <contrib/dev/acpica/acnamesp.h> -#include <contrib/dev/acpica/amlcode.h> +#include "acnamesp.h" +#include "amlcode.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslutils") @@ -131,6 +130,12 @@ static const char * const *yytname = &AslCompilername[254]; extern const char * const yytname[]; #endif +char HexLookup[] = +{ + '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' +}; + + /* Local prototypes */ static ACPI_STATUS @@ -333,8 +338,8 @@ UtConvertByteToHex ( Buffer[0] = '0'; Buffer[1] = 'x'; - Buffer[2] = (UINT8) hex[(RawByte >> 4) & 0xF]; - Buffer[3] = (UINT8) hex[RawByte & 0xF]; + Buffer[2] = (UINT8) HexLookup[(RawByte >> 4) & 0xF]; + Buffer[3] = (UINT8) HexLookup[RawByte & 0xF]; } @@ -359,8 +364,8 @@ UtConvertByteToAsmHex ( { Buffer[0] = '0'; - Buffer[1] = (UINT8) hex[(RawByte >> 4) & 0xF]; - Buffer[2] = (UINT8) hex[RawByte & 0xF]; + Buffer[1] = (UINT8) HexLookup[(RawByte >> 4) & 0xF]; + Buffer[2] = (UINT8) HexLookup[RawByte & 0xF]; Buffer[3] = 'h'; } @@ -530,7 +535,7 @@ UtDisplaySummary ( if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors)) { FlPrintFile (FileId, - "AML Output: %s - %d bytes %d named objects %d executable opcodes\n\n", + "AML Output: %s - %d bytes, %d named objects, %d executable opcodes\n\n", Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength, TotalNamedObjects, TotalExecutableOpcodes); } |