diff options
author | jkim <jkim@FreeBSD.org> | 2013-12-19 05:51:01 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2013-12-19 05:51:01 +0000 |
commit | b37c83dbb637fc63c5ba07fe61555d4d6e29dd7c (patch) | |
tree | 7fcfdcc62c3319ffd669b18b080d40c9c5897210 /source/compiler | |
parent | a1672476f94b0c9ac84a682574aeb1eb481c484c (diff) | |
download | FreeBSD-src-b37c83dbb637fc63c5ba07fe61555d4d6e29dd7c.zip FreeBSD-src-b37c83dbb637fc63c5ba07fe61555d4d6e29dd7c.tar.gz |
Import ACPICA 20131218.
Diffstat (limited to 'source/compiler')
-rw-r--r-- | source/compiler/aslbtypes.c | 2 | ||||
-rw-r--r-- | source/compiler/asldefine.h | 2 | ||||
-rw-r--r-- | source/compiler/aslerror.c | 13 | ||||
-rw-r--r-- | source/compiler/aslfiles.c | 1 | ||||
-rw-r--r-- | source/compiler/aslglobal.h | 2 | ||||
-rw-r--r-- | source/compiler/asllookup.c | 56 | ||||
-rw-r--r-- | source/compiler/aslmain.c | 28 | ||||
-rw-r--r-- | source/compiler/aslmessages.h | 2 | ||||
-rw-r--r-- | source/compiler/asloperands.c | 1 | ||||
-rw-r--r-- | source/compiler/aslopt.c | 17 | ||||
-rw-r--r-- | source/compiler/asloptions.c | 12 | ||||
-rw-r--r-- | source/compiler/aslstartup.c | 1 | ||||
-rw-r--r-- | source/compiler/aslstubs.c | 2 | ||||
-rw-r--r-- | source/compiler/aslxref.c | 24 | ||||
-rw-r--r-- | source/compiler/dtcompile.c | 9 | ||||
-rw-r--r-- | source/compiler/dtcompiler.h | 10 | ||||
-rw-r--r-- | source/compiler/dtfield.c | 3 | ||||
-rw-r--r-- | source/compiler/dttable.c | 229 | ||||
-rw-r--r-- | source/compiler/dttemplate.h | 59 | ||||
-rw-r--r-- | source/compiler/dtutils.c | 1 | ||||
-rw-r--r-- | source/compiler/readme.txt | 28 |
21 files changed, 437 insertions, 65 deletions
diff --git a/source/compiler/aslbtypes.c b/source/compiler/aslbtypes.c index f9dc107..6c15465 100644 --- a/source/compiler/aslbtypes.c +++ b/source/compiler/aslbtypes.c @@ -243,7 +243,7 @@ AnMapEtypeToBtype ( return (ACPI_BTYPE_INTEGER | ACPI_BTYPE_DDB_HANDLE); - case ACPI_BTYPE_DEBUG_OBJECT: + case ACPI_TYPE_DEBUG_OBJECT: /* Cannot be used as a source operand */ diff --git a/source/compiler/asldefine.h b/source/compiler/asldefine.h index 76e2e12..127723d 100644 --- a/source/compiler/asldefine.h +++ b/source/compiler/asldefine.h @@ -55,7 +55,7 @@ #define ASL_INVOCATION_NAME "iasl" #define ASL_CREATOR_ID "INTL" -#define ASL_COMPLIANCE "Supports ACPI Specification Revision 5.0" +#define ASL_COMPLIANCE "Supports ACPI Specification Revision 5.0A" /* Configuration constants */ diff --git a/source/compiler/aslerror.c b/source/compiler/aslerror.c index d0e8e03..87651ec 100644 --- a/source/compiler/aslerror.c +++ b/source/compiler/aslerror.c @@ -200,6 +200,16 @@ AePrintException ( switch (Enode->Level) { + case ASL_WARNING: + case ASL_WARNING2: + case ASL_WARNING3: + + if (!Gbl_DisplayWarnings) + { + return; + } + break; + case ASL_REMARK: if (!Gbl_DisplayRemarks) @@ -222,11 +232,10 @@ AePrintException ( } } - /* Get the file handles */ + /* Get the various required file handles */ OutputFile = Gbl_Files[FileId].Handle; - if (!Enode->SourceLine) { /* Use the merged header/source file if present, otherwise use input file */ diff --git a/source/compiler/aslfiles.c b/source/compiler/aslfiles.c index 0881fd4..43136e9 100644 --- a/source/compiler/aslfiles.c +++ b/source/compiler/aslfiles.c @@ -824,6 +824,7 @@ FlParseInputPathname ( *(Substring+1) = 0; } + UtConvertBackslashes (Gbl_OutputFilenamePrefix); return (AE_OK); } #endif diff --git a/source/compiler/aslglobal.h b/source/compiler/aslglobal.h index 3f2c401..26d9a00 100644 --- a/source/compiler/aslglobal.h +++ b/source/compiler/aslglobal.h @@ -163,6 +163,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_GetAllTables, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ReferenceOptimizationFlag, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayWarnings, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayOptimizations, FALSE); ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_WarningLevel, ASL_WARNING); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseOriginalCompilerId, FALSE); @@ -232,7 +233,6 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_NumNamespaceObjects, 0) ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ReservedMethods, 0); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableSignature, "NO_SIG"); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableId, "NO_ID"); -ASL_EXTERN FILE *AcpiGbl_DebugFile; /* Placeholder for oswinxf only */ /* Static structures */ diff --git a/source/compiler/asllookup.c b/source/compiler/asllookup.c index e965f18..0f22664 100644 --- a/source/compiler/asllookup.c +++ b/source/compiler/asllookup.c @@ -105,7 +105,9 @@ LkFindUnreferencedObjects ( * DESCRIPTION: Check for an unreferenced namespace object and emit a warning. * We have to be careful, because some types and names are * typically or always unreferenced, we don't want to issue - * excessive warnings. + * excessive warnings. Note: Names that are declared within a + * control method are temporary, so we always issue a remark + * if they are not referenced. * ******************************************************************************/ @@ -117,6 +119,7 @@ LkIsObjectUsed ( void **ReturnValue) { ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle); + ACPI_NAMESPACE_NODE *Next; /* Referenced flag is set during the namespace xref */ @@ -126,23 +129,19 @@ LkIsObjectUsed ( return (AE_OK); } - /* - * Ignore names that start with an underscore, - * these are the reserved ACPI names and are typically not referenced, - * they are called by the host OS. - */ - if (Node->Name.Ascii[0] == '_') + if (!Node->Op) { return (AE_OK); } - /* There are some types that are typically not referenced, ignore them */ + /* These types are typically never directly referenced, ignore them */ switch (Node->Type) { case ACPI_TYPE_DEVICE: case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_POWER: + case ACPI_TYPE_THERMAL: case ACPI_TYPE_LOCAL_RESOURCE: return (AE_OK); @@ -152,12 +151,47 @@ LkIsObjectUsed ( break; } - /* All others are valid unreferenced namespace objects */ + /* Determine if the name is within a control method */ - if (Node->Op) + Next = Node->Parent; + while (Next) { - AslError (ASL_WARNING2, ASL_MSG_NOT_REFERENCED, LkGetNameOp (Node->Op), NULL); + if (Next->Type == ACPI_TYPE_METHOD) + { + /* + * Name is within a method, therefore it is temporary. + * Issue a remark even if it is a reserved name (starts + * with an underscore). + */ + sprintf (MsgBuffer, "Name is within method [%4.4s]", + Next->Name.Ascii); + AslError (ASL_REMARK, ASL_MSG_NOT_REFERENCED, + LkGetNameOp (Node->Op), MsgBuffer); + return (AE_OK); + } + + Next = Next->Parent; } + + /* The name is not within a control method */ + + /* + * Ignore names that start with an underscore. These are the reserved + * ACPI names and are typically not referenced since they are meant + * to be called by the host OS. + */ + if (Node->Name.Ascii[0] == '_') + { + return (AE_OK); + } + + /* + * What remains is an unresolved user name that is not within a method. + * However, the object could be referenced via another table, so issue + * the warning at level 2. + */ + AslError (ASL_WARNING2, ASL_MSG_NOT_REFERENCED, + LkGetNameOp (Node->Op), NULL); return (AE_OK); } diff --git a/source/compiler/aslmain.c b/source/compiler/aslmain.c index 81e102f..3ccb70c 100644 --- a/source/compiler/aslmain.c +++ b/source/compiler/aslmain.c @@ -94,11 +94,21 @@ Usage ( printf ("%s\n\n", ASL_COMPLIANCE); ACPI_USAGE_HEADER ("iasl [Options] [Files]"); - printf ("\nGlobal:\n"); + printf ("\nGeneral:\n"); ACPI_OPTION ("-@ <file>", "Specify command file"); ACPI_OPTION ("-I <dir>", "Specify additional include directory"); ACPI_OPTION ("-T <sig>|ALL|*", "Create table template file for ACPI <Sig>"); + ACPI_OPTION ("-p <prefix>", "Specify path/filename prefix for all output files"); ACPI_OPTION ("-v", "Display compiler version"); + ACPI_OPTION ("-vo", "Enable optimization comments"); + ACPI_OPTION ("-vs", "Disable signon"); + + printf ("\nHelp:\n"); + ACPI_OPTION ("-h", "This message"); + ACPI_OPTION ("-hc", "Display operators allowed in constant expressions"); + ACPI_OPTION ("-hf", "Display help for output filename generation"); + ACPI_OPTION ("-hr", "Display ACPI reserved method names"); + ACPI_OPTION ("-ht", "Display currently supported ACPI table names"); printf ("\nPreprocessor:\n"); ACPI_OPTION ("-D <symbol>", "Define symbol for preprocessor use"); @@ -106,13 +116,11 @@ Usage ( ACPI_OPTION ("-P", "Preprocess only and create preprocessor output file (*.i)"); ACPI_OPTION ("-Pn", "Disable preprocessor"); - printf ("\nGeneral Processing:\n"); - ACPI_OPTION ("-p <prefix>", "Specify path/filename prefix for all output files"); - ACPI_OPTION ("-va", "Disable all errors and warnings (summary only)"); + printf ("\nErrors, Warnings, and Remarks:\n"); + ACPI_OPTION ("-va", "Disable all errors/warnings/remarks"); + ACPI_OPTION ("-ve", "Report only errors (ignore warnings and remarks)"); ACPI_OPTION ("-vi", "Less verbose errors and warnings for use with IDEs"); - ACPI_OPTION ("-vo", "Enable optimization comments"); ACPI_OPTION ("-vr", "Disable remarks"); - ACPI_OPTION ("-vs", "Disable signon"); ACPI_OPTION ("-vw <messageid>", "Disable specific warning or remark"); ACPI_OPTION ("-w1 -w2 -w3", "Set warning reporting level"); ACPI_OPTION ("-we", "Report warnings as errors"); @@ -154,13 +162,6 @@ Usage ( ACPI_OPTION ("-in", "Ignore NoOp opcodes"); ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file"); - printf ("\nHelp:\n"); - ACPI_OPTION ("-h", "This message"); - ACPI_OPTION ("-hc", "Display operators allowed in constant expressions"); - ACPI_OPTION ("-hf", "Display help for output filename generation"); - ACPI_OPTION ("-hr", "Display ACPI reserved method names"); - ACPI_OPTION ("-ht", "Display currently supported ACPI table names"); - printf ("\nDebug Options:\n"); ACPI_OPTION ("-bf -bt", "Create debug file (full or parse tree only) (*.txt)"); ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)"); @@ -353,6 +354,7 @@ main ( if (Gbl_UseDefaultAmlFilename) { Gbl_OutputFilenamePrefix = argv[Index2]; + UtConvertBackslashes (Gbl_OutputFilenamePrefix); } Status = AslDoOneFile (argv[Index2]); diff --git a/source/compiler/aslmessages.h b/source/compiler/aslmessages.h index 9fb7229..f95042c 100644 --- a/source/compiler/aslmessages.h +++ b/source/compiler/aslmessages.h @@ -369,7 +369,7 @@ char *AslMessages [] = /* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke", /* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only", /* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope", -/* ASL_MSG_NOT_REFERENCED */ "Namespace object is not referenced", +/* ASL_MSG_NOT_REFERENCED */ "Object is not referenced", /* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag", /* ASL_MSG_NULL_STRING */ "Invalid zero-length (null) string", /* ASL_MSG_OPEN */ "Could not open file", diff --git a/source/compiler/asloperands.c b/source/compiler/asloperands.c index 4afbd96..8d03ae5 100644 --- a/source/compiler/asloperands.c +++ b/source/compiler/asloperands.c @@ -922,6 +922,7 @@ OpnDoDefinitionBlock ( strcat (Filename, (char *) Child->Asl.Value.Buffer); Gbl_OutputFilenamePrefix = Filename; + UtConvertBackslashes (Gbl_OutputFilenamePrefix); } Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; diff --git a/source/compiler/aslopt.c b/source/compiler/aslopt.c index 682737e..7a41ce8 100644 --- a/source/compiler/aslopt.c +++ b/source/compiler/aslopt.c @@ -576,7 +576,8 @@ OptOptimizeNamePath ( return_VOID; } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "%5d [%12.12s] [%12.12s] ", + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, + "PATH OPTIMIZE: Line %5d ParentOp [%12.12s] ThisOp [%12.12s] ", Op->Asl.LogicalLineNumber, AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode), AcpiPsGetOpcodeName (Op->Common.AmlOpcode))); @@ -620,7 +621,7 @@ OptOptimizeNamePath ( { /* This is the declaration of a new name */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAME")); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAME\n")); /* * The node of interest is the parent of this node (the containing @@ -646,7 +647,7 @@ OptOptimizeNamePath ( { /* This is a reference to an existing named object */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "REF ")); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "REFERENCE\n")); } /* @@ -688,9 +689,10 @@ OptOptimizeNamePath ( } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, - "%37s (%2u) ==> %-32s(%2u) %-32s", - (char *) CurrentPath.Pointer, (UINT32) CurrentPath.Length, - (char *) TargetPath.Pointer, (UINT32) TargetPath.Length, ExternalNameString)); + "CURRENT SCOPE: (%2u) %-37s FULL PATH TO NAME: (%2u) %-32s ACTUAL AML:%-32s\n", + (UINT32) CurrentPath.Length, (char *) CurrentPath.Pointer, + (UINT32) TargetPath.Length, (char *) TargetPath.Pointer, + ExternalNameString)); ACPI_FREE (ExternalNameString); @@ -747,7 +749,8 @@ OptOptimizeNamePath ( HowMuchShorter = (AmlNameStringLength - ACPI_STRLEN (NewPath)); OptTotal += HowMuchShorter; - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " REDUCED %2u (%u)", + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, + " REDUCED BY %2u (TOTAL SAVED %2u)", (UINT32) HowMuchShorter, OptTotal)); if (Flags & AML_NAMED) diff --git a/source/compiler/asloptions.c b/source/compiler/asloptions.c index 00e3000..d623567 100644 --- a/source/compiler/asloptions.c +++ b/source/compiler/asloptions.c @@ -523,6 +523,8 @@ AslDoOptions ( case 'p': /* Override default AML output filename */ Gbl_OutputFilenamePrefix = AcpiGbl_Optarg; + UtConvertBackslashes (Gbl_OutputFilenamePrefix); + Gbl_UseDefaultAmlFilename = FALSE; break; @@ -606,11 +608,19 @@ AslDoOptions ( case 'a': - /* Disable All error/warning messages */ + /* Disable all error/warning/remark messages */ Gbl_NoErrors = TRUE; break; + case 'e': + + /* Disable all warning/remark messages (errors only) */ + + Gbl_DisplayRemarks = FALSE; + Gbl_DisplayWarnings = FALSE; + break; + case 'i': /* * Support for integrated development environment(s). diff --git a/source/compiler/aslstartup.c b/source/compiler/aslstartup.c index b57b3b0..3e2841f 100644 --- a/source/compiler/aslstartup.c +++ b/source/compiler/aslstartup.c @@ -326,6 +326,7 @@ AslDoOneFile ( } Gbl_Files[ASL_FILE_INPUT].Filename = Filename; + UtConvertBackslashes (Filename); /* * AML Disassembly (Optional) diff --git a/source/compiler/aslstubs.c b/source/compiler/aslstubs.c index 5df167b..2b56ae7 100644 --- a/source/compiler/aslstubs.c +++ b/source/compiler/aslstubs.c @@ -239,7 +239,7 @@ ACPI_THREAD_ID AcpiOsGetThreadId ( void) { - return (0xFFFF); + return (1); } ACPI_STATUS diff --git a/source/compiler/aslxref.c b/source/compiler/aslxref.c index a04fefb..363bb9c 100644 --- a/source/compiler/aslxref.c +++ b/source/compiler/aslxref.c @@ -316,7 +316,7 @@ XfNamespaceLocateBegin ( */ if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* We are only interested in opcodes that have an associated name */ @@ -329,7 +329,7 @@ XfNamespaceLocateBegin ( (Op->Asl.ParseOpcode != PARSEOP_NAMESEG) && (Op->Asl.ParseOpcode != PARSEOP_METHODCALL)) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* @@ -340,7 +340,7 @@ XfNamespaceLocateBegin ( if ((Op->Asl.Parent) && (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF)) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* @@ -459,7 +459,8 @@ XfNamespaceLocateBegin ( Status = AE_OK; } - return (Status); + + return_ACPI_STATUS (Status); } /* Check for a reference vs. name declaration */ @@ -624,7 +625,6 @@ XfNamespaceLocateBegin ( (Op->Asl.ParseOpcode == PARSEOP_METHODCALL)) { - /* * A reference to a method within one of these opcodes is not an * invocation of the method, it is simply a reference to the method. @@ -634,7 +634,7 @@ XfNamespaceLocateBegin ( (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_DEREFOF) || (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_OBJECTTYPE))) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* * There are two types of method invocation: @@ -650,7 +650,7 @@ XfNamespaceLocateBegin ( Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type)); AslError (ASL_ERROR, ASL_MSG_NOT_METHOD, Op, MsgBuffer); - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* Save the method node in the caller's op */ @@ -658,7 +658,7 @@ XfNamespaceLocateBegin ( Op->Asl.Node = Node; if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* @@ -823,7 +823,7 @@ XfNamespaceLocateBegin ( } Op->Asl.Node = Node; - return (Status); + return_ACPI_STATUS (Status); } @@ -858,7 +858,7 @@ XfNamespaceLocateEnd ( OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode); if (!(OpInfo->Flags & AML_NAMED)) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* Not interested in name references, we did not open a scope for them */ @@ -867,7 +867,7 @@ XfNamespaceLocateEnd ( (Op->Asl.ParseOpcode == PARSEOP_NAMESEG) || (Op->Asl.ParseOpcode == PARSEOP_METHODCALL)) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* Pop the scope stack if necessary */ @@ -882,5 +882,5 @@ XfNamespaceLocateEnd ( (void) AcpiDsScopeStackPop (WalkState); } - return (AE_OK); + return_ACPI_STATUS (AE_OK); } diff --git a/source/compiler/dtcompile.c b/source/compiler/dtcompile.c index 2b92322..41e0fc4 100644 --- a/source/compiler/dtcompile.c +++ b/source/compiler/dtcompile.c @@ -446,6 +446,15 @@ DtCompileTable ( return (AE_BAD_PARAMETER); } + /* Ignore optional subtable if name does not match */ + + if ((Info->Flags & DT_OPTIONAL) && + ACPI_STRCMP ((*Field)->Name, Info->Name)) + { + *RetSubtable = NULL; + return (AE_OK); + } + Length = DtGetSubtableLength (*Field, Info); if (Length == ASL_EOF) { diff --git a/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h index f83ef77..cdf7121 100644 --- a/source/compiler/dtcompiler.h +++ b/source/compiler/dtcompiler.h @@ -400,6 +400,10 @@ DtCompileCsrt ( void **PFieldList); ACPI_STATUS +DtCompileDbg2 ( + void **PFieldList); + +ACPI_STATUS DtCompileDmar ( void **PFieldList); @@ -452,6 +456,10 @@ DtCompilePmtt ( void **PFieldList); ACPI_STATUS +DtCompilePcct ( + void **PFieldList); + +ACPI_STATUS DtCompileRsdt ( void **PFieldList); @@ -503,6 +511,7 @@ extern const unsigned char TemplateBert[]; extern const unsigned char TemplateBgrt[]; extern const unsigned char TemplateCpep[]; extern const unsigned char TemplateCsrt[]; +extern const unsigned char TemplateDbg2[]; extern const unsigned char TemplateDbgp[]; extern const unsigned char TemplateDmar[]; extern const unsigned char TemplateEcdt[]; @@ -520,6 +529,7 @@ extern const unsigned char TemplateMchi[]; extern const unsigned char TemplateMpst[]; extern const unsigned char TemplateMsct[]; extern const unsigned char TemplateMtmr[]; +extern const unsigned char TemplatePcct[]; extern const unsigned char TemplatePmtt[]; extern const unsigned char TemplateRsdt[]; extern const unsigned char TemplateS3pt[]; diff --git a/source/compiler/dtfield.c b/source/compiler/dtfield.c index a5642a1..f9524dd 100644 --- a/source/compiler/dtfield.c +++ b/source/compiler/dtfield.c @@ -340,7 +340,8 @@ DtCompileInteger ( if (Value > MaxValue) { - sprintf (MsgBuffer, "%8.8X%8.8X", ACPI_FORMAT_UINT64 (Value)); + sprintf (MsgBuffer, "%8.8X%8.8X - max %u bytes", + ACPI_FORMAT_UINT64 (Value), ByteLength); DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer); } diff --git a/source/compiler/dttable.c b/source/compiler/dttable.c index 3b84956..7ff5921 100644 --- a/source/compiler/dttable.c +++ b/source/compiler/dttable.c @@ -520,6 +520,156 @@ DtCompileCsrt ( /****************************************************************************** * + * FUNCTION: DtCompileDbg2 + * + * PARAMETERS: List - Current field list pointer + * + * RETURN: Status + * + * DESCRIPTION: Compile DBG2. + * + *****************************************************************************/ + +ACPI_STATUS +DtCompileDbg2 ( + void **List) +{ + ACPI_STATUS Status; + DT_SUBTABLE *Subtable; + DT_SUBTABLE *ParentTable; + DT_FIELD **PFieldList = (DT_FIELD **) List; + UINT32 SubtableCount; + ACPI_DBG2_HEADER *Dbg2Header; + ACPI_DBG2_DEVICE *DeviceInfo; + UINT16 CurrentOffset; + UINT32 i; + + + /* Main table */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2, &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + + /* Main table fields */ + + Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer); + Dbg2Header->InfoOffset = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF ( + ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header); + + SubtableCount = Dbg2Header->InfoCount; + DtPushSubtable (Subtable); + + /* Process all Device Information subtables (Count = InfoCount) */ + + while (*PFieldList && SubtableCount) + { + /* Subtable: Debug Device Information */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Device, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + DeviceInfo = ACPI_CAST_PTR (ACPI_DBG2_DEVICE, Subtable->Buffer); + CurrentOffset = (UINT16) sizeof (ACPI_DBG2_DEVICE); + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPushSubtable (Subtable); + + ParentTable = DtPeekSubtable (); + + /* BaseAddressRegister GAS array (Required, size is RegisterCount) */ + + DeviceInfo->BaseAddressOffset = CurrentOffset; + for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + CurrentOffset += (UINT16) sizeof (ACPI_GENERIC_ADDRESS); + DtInsertSubtable (ParentTable, Subtable); + } + + /* AddressSize array (Required, size = RegisterCount) */ + + DeviceInfo->AddressSizeOffset = CurrentOffset; + for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + CurrentOffset += (UINT16) sizeof (UINT32); + DtInsertSubtable (ParentTable, Subtable); + } + + /* NamespaceString device identifier (Required, size = NamePathLength) */ + + DeviceInfo->NamepathOffset = CurrentOffset; + Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Update the device info header */ + + DeviceInfo->NamepathLength = (UINT16) Subtable->Length; + CurrentOffset += (UINT16) DeviceInfo->NamepathLength; + DtInsertSubtable (ParentTable, Subtable); + + /* OemData - Variable-length data (Optional, size = OemDataLength) */ + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2OemData, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Update the device info header (zeros if no OEM data present) */ + + DeviceInfo->OemDataOffset = 0; + DeviceInfo->OemDataLength = 0; + + /* Optional subtable (OemData) */ + + if (Subtable && Subtable->Length) + { + DeviceInfo->OemDataOffset = CurrentOffset; + DeviceInfo->OemDataLength = (UINT16) Subtable->Length; + + DtInsertSubtable (ParentTable, Subtable); + } + + SubtableCount--; + DtPopSubtable (); /* Get next Device Information subtable */ + } + + DtPopSubtable (); + return (AE_OK); +} + + +/****************************************************************************** + * * FUNCTION: DtCompileDmar * * PARAMETERS: List - Current field list pointer @@ -1505,6 +1655,85 @@ DtCompileMtmr ( /****************************************************************************** * + * FUNCTION: DtCompilePcct + * + * PARAMETERS: List - Current field list pointer + * + * RETURN: Status + * + * DESCRIPTION: Compile PCCT. + * + *****************************************************************************/ + +ACPI_STATUS +DtCompilePcct ( + void **List) +{ + ACPI_STATUS Status; + DT_SUBTABLE *Subtable; + DT_SUBTABLE *ParentTable; + DT_FIELD **PFieldList = (DT_FIELD **) List; + DT_FIELD *SubtableStart; + ACPI_SUBTABLE_HEADER *PcctHeader; + ACPI_DMTABLE_INFO *InfoTable; + + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcct, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + + while (*PFieldList) + { + SubtableStart = *PFieldList; + Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcctHdr, + &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPushSubtable (Subtable); + + PcctHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer); + + switch (PcctHeader->Type) + { + case ACPI_PCCT_TYPE_GENERIC_SUBSPACE: + + InfoTable = AcpiDmTableInfoPcct0; + break; + + default: + + DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT"); + return (AE_ERROR); + } + + Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + DtPopSubtable (); + } + + return (AE_OK); +} + + +/****************************************************************************** + * * FUNCTION: DtCompilePmtt * * PARAMETERS: List - Current field list pointer diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h index f620abd..5080eee 100644 --- a/source/compiler/dttemplate.h +++ b/source/compiler/dttemplate.h @@ -174,6 +174,33 @@ const unsigned char TemplateCsrt[] = 0x43,0x48,0x41,0x37 /* 00000148 "CHA7" */ }; +const unsigned char TemplateDbg2[] = +{ + 0x44,0x42,0x47,0x32,0xB2,0x00,0x00,0x00, /* 00000000 "DBG2...." */ + 0x01,0xBA,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ + 0x15,0x11,0x13,0x20,0x2C,0x00,0x00,0x00, /* 00000020 "... ,..." */ + 0x02,0x00,0x00,0x00,0xEE,0x3F,0x00,0x02, /* 00000028 ".....?.." */ + 0x09,0x00,0x36,0x00,0x00,0x00,0x00,0x00, /* 00000030 "..6....." */ + 0x00,0x80,0x00,0x00,0x00,0x00,0x16,0x00, /* 00000038 "........" */ + 0x2E,0x00,0x01,0x32,0x00,0x03,0x88,0x77, /* 00000040 "...2...w" */ + 0x66,0x55,0x44,0x33,0x22,0x11,0x01,0x64, /* 00000048 "fUD3"..d" */ + 0x00,0x04,0x11,0x00,0xFF,0xEE,0xDD,0xCC, /* 00000050 "........" */ + 0xBB,0xAA,0x10,0x32,0x54,0x76,0x98,0xBA, /* 00000058 "...2Tv.." */ + 0xDC,0xFE,0x4D,0x79,0x44,0x65,0x76,0x69, /* 00000060 "..MyDevi" */ + 0x63,0x65,0x00,0xEE,0x47,0x00,0x01,0x11, /* 00000068 "ce..G..." */ + 0x00,0x26,0x00,0x10,0x00,0x37,0x00,0x00, /* 00000070 ".&...7.." */ + 0x80,0x00,0x00,0x00,0x00,0x16,0x00,0x22, /* 00000078 "......."" */ + 0x00,0x01,0x64,0x00,0x04,0x11,0x00,0xFF, /* 00000080 "..d....." */ + 0xEE,0xDD,0xCC,0xBB,0xAA,0x98,0xBA,0xDC, /* 00000088 "........" */ + 0xFE,0x5C,0x5C,0x5F,0x53,0x42,0x5F,0x2E, /* 00000090 ".\\_SB_." */ + 0x50,0x43,0x49,0x30,0x2E,0x44,0x42,0x47, /* 00000098 "PCI0.DBG" */ + 0x50,0x00,0x41,0x42,0x43,0x44,0x45,0x46, /* 000000A0 "P.ABCDEF" */ + 0x47,0x48,0x49,0x50,0x51,0x52,0x53,0x54, /* 000000A8 "GHIPQRST" */ + 0x55,0x56 /* 000000B0 "UV" */ +}; + const unsigned char TemplateDbgp[] = { 0x44,0x42,0x47,0x50,0x34,0x00,0x00,0x00, /* 00000000 "DBGP4..." */ @@ -353,10 +380,10 @@ const unsigned char TemplateFacs[] = const unsigned char TemplateFadt[] = { 0x46,0x41,0x43,0x50,0x0C,0x01,0x00,0x00, /* 00000000 "FACP...." */ - 0x05,0x18,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x05,0x64,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".dINTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x23,0x11,0x11,0x20,0x01,0x00,0x00,0x00, /* 00000020 "#.. ...." */ + 0x15,0x11,0x13,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ @@ -379,7 +406,7 @@ const unsigned char TemplateFadt[] = 0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00, /* 000000C0 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */ 0x01,0x20,0x00,0x03,0x01,0x00,0x00,0x00, /* 000000D0 ". ......" */ - 0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x01, /* 000000D8 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x40,0x00,0x01, /* 000000D8 ".....@.." */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */ 0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 000000F0 "........" */ @@ -646,6 +673,32 @@ const unsigned char TemplateMtmr[] = 0x00,0x00,0x00,0x00 /* 00000048 "...." */ }; +const unsigned char TemplatePcct[] = +{ + 0x50,0x43,0x43,0x54,0xAC,0x00,0x00,0x00, /* 00000000 "PCCT...." */ + 0x01,0x97,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ + 0x15,0x11,0x13,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 ".>......" */ + 0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, /* 00000038 "........" */ + 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, /* 00000040 """""""""" */ + 0x01,0x32,0x00,0x03,0x33,0x33,0x33,0x33, /* 00000048 ".2..3333" */ + 0x33,0x33,0x33,0x33,0x44,0x44,0x44,0x44, /* 00000050 "3333DDDD" */ + 0x44,0x44,0x44,0x44,0x55,0x55,0x55,0x55, /* 00000058 "DDDDUUUU" */ + 0x55,0x55,0x55,0x55,0x66,0x66,0x66,0x66, /* 00000060 "UUUUffff" */ + 0x77,0x77,0x77,0x77,0x88,0x88,0x00,0x3E, /* 00000068 "wwww...>" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF, /* 00000070 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEE,0xEE, /* 00000078 "........" */ + 0xEE,0xEE,0xEE,0xEE,0xEE,0xEE,0x01,0x32, /* 00000080 ".......2" */ + 0x00,0x03,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD, /* 00000088 "........" */ + 0xDD,0xDD,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC, /* 00000090 "........" */ + 0xCC,0xCC,0xBB,0xBB,0xBB,0xBB,0xBB,0xBB, /* 00000098 "........" */ + 0xBB,0xBB,0xAA,0xAA,0xAA,0xAA,0x99,0x99, /* 000000A0 "........" */ + 0x99,0x99,0x88,0x88 /* 000000A8 "...." */ +}; + const unsigned char TemplatePmtt[] = { 0x50,0x4D,0x54,0x54,0xB4,0x00,0x00,0x00, /* 00000000 "PMTT...." */ diff --git a/source/compiler/dtutils.c b/source/compiler/dtutils.c index e7376f4..d61620d 100644 --- a/source/compiler/dtutils.c +++ b/source/compiler/dtutils.c @@ -532,6 +532,7 @@ DtGetFieldLength ( case ACPI_DMT_ACCWIDTH: case ACPI_DMT_IVRS: case ACPI_DMT_MADT: + case ACPI_DMT_PCCT: case ACPI_DMT_PMTT: case ACPI_DMT_SRAT: case ACPI_DMT_ASF: diff --git a/source/compiler/readme.txt b/source/compiler/readme.txt index e47b99b..12f4cd0 100644 --- a/source/compiler/readme.txt +++ b/source/compiler/readme.txt @@ -1,8 +1,7 @@ /* * Miscellaneous instructions for building and using the iASL compiler. */ - -Last update: 24 October 2012 +Last update 9 December 2013. 1) Generating iASL from source @@ -30,17 +29,23 @@ be installed): 1a) Notes for Linux/Unix generation ----------------------------------- +iASL has been generated with these versions of Flex/Bison: + + flex: Version 2.5.32 + bison: Version 2.6.2 + +Other required packages: + + make + gcc C compiler + m4 (macro processor required by bison) + On Linux/Unix systems, the following commands will build the compiler: cd acpica (or cd acpica/generate/unix) make clean make iasl -iASL has been generated with these versions of Flex/Bison: - - Flex: Version 2.5.32 - Bison: Version 2.6.2 - 1b) Notes for Windows generation -------------------------------- @@ -58,12 +63,15 @@ iASL assumes that these tools are installed at this location: c:\GnuWin32 Once the tools are installed, ensure that this path is added to the -default system $PATH environment variable: +default system $Path environment variable: c:\GnuWin32\bin -At this point, you will need to reboot Windows to make system aware of -the updated $PATH. +Goto: ControlPanel/System/AdvancedSystemSettings/EnvironmentVariables + +Important: Now Windows must be rebooted to make the system aware of +the updated $Path. Otherwise, Bison will not be able to find the M4 +interpreter library and will fail. iASL has been generated with these versions of Flex/Bison for Windows: |