diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2015-08-25 19:41:12 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2015-08-25 19:41:12 +0000 |
commit | c25a97c7b4f09b4c9efa992434d341f5b89629ff (patch) | |
tree | 2fa9d2167f719968f73daa4ec16528a068d308ad /source | |
parent | 136eac2a0638d3c751b1987603f71a9ae26879fd (diff) | |
download | src-test2-c25a97c7b4f09b4c9efa992434d341f5b89629ff.tar.gz src-test2-c25a97c7b4f09b4c9efa992434d341f5b89629ff.zip |
Notes
Diffstat (limited to 'source')
77 files changed, 1282 insertions, 754 deletions
diff --git a/source/common/adisasm.c b/source/common/adisasm.c index 839bafecab30..8afabd5bcc12 100644 --- a/source/common/adisasm.c +++ b/source/common/adisasm.c @@ -133,7 +133,7 @@ AcpiDsMethodDataInitArgs ( static ACPI_TABLE_DESC LocalTables[1]; -ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot; +static ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot; /******************************************************************************* @@ -187,7 +187,6 @@ AdInitialize ( AcpiGbl_RootTableList.CurrentTableCount = 0; AcpiGbl_RootTableList.Tables = LocalTables; - AcpiGbl_PreviousOp = NULL; return (Status); } @@ -317,7 +316,7 @@ AdAmlDisassemble ( return (Status); } - if (!AcpiGbl_DbOpt_Disasm) + if (!AcpiGbl_DmOpt_Disasm) { return (AE_OK); } @@ -506,7 +505,7 @@ AdAmlDisassemble ( /* Optional displays */ - if (AcpiGbl_DbOpt_Disasm) + if (AcpiGbl_DmOpt_Disasm) { /* This is the real disassembly */ @@ -742,7 +741,7 @@ AdDisplayTables ( return (AE_NOT_EXIST); } - if (!AcpiGbl_DbOpt_Verbose) + if (!AcpiGbl_DmOpt_Listing) { AdCreateTableHeader (Filename, Table); } @@ -750,7 +749,7 @@ AdDisplayTables ( AcpiDmDisassemble (NULL, AcpiGbl_ParseOpRoot, ACPI_UINT32_MAX); MpEmitMappingInfo (); - if (AcpiGbl_DbOpt_Verbose) + if (AcpiGbl_DmOpt_Listing) { AcpiOsPrintf ("\n\nTable Header:\n"); AcpiUtDebugDumpBuffer ((UINT8 *) Table, sizeof (ACPI_TABLE_HEADER), diff --git a/source/common/dmtable.c b/source/common/dmtable.c index 9845ddeb219f..3f9e64dbdca3 100644 --- a/source/common/dmtable.c +++ b/source/common/dmtable.c @@ -702,7 +702,7 @@ AcpiDmLineHeader2 ( * SubtableLength - Length of this sub-descriptor * Info - Info table for this ACPI table * - * RETURN: None + * RETURN: Status * * DESCRIPTION: Display ACPI table contents by walking the Info table. * diff --git a/source/compiler/aslmain.c b/source/compiler/aslmain.c index bbb907636b16..4550ea16dee9 100644 --- a/source/compiler/aslmain.c +++ b/source/compiler/aslmain.c @@ -192,6 +192,7 @@ Usage ( ACPI_OPTION ("-e <f1 f2 ...>", "Include ACPI table(s) for external symbol resolution"); ACPI_OPTION ("-fe <file>", "Specify external symbol declaration file"); ACPI_OPTION ("-in", "Ignore NoOp opcodes"); + ACPI_OPTION ("-l", "Disassemble to mixed ASL and AML code"); ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file"); printf ("\nDebug Options:\n"); @@ -298,6 +299,8 @@ AslInitialize ( UINT32 i; + AcpiGbl_DmOpt_Verbose = FALSE; + for (i = 0; i < ASL_NUM_FILES; i++) { Gbl_Files[i].Handle = NULL; diff --git a/source/compiler/asloperands.c b/source/compiler/asloperands.c index 174a53ac75ed..913ac90a7abc 100644 --- a/source/compiler/asloperands.c +++ b/source/compiler/asloperands.c @@ -932,13 +932,13 @@ OpnDoDefinitionBlock ( if (Child->Asl.Value.String) { Gbl_TableSignature = Child->Asl.Value.String; - if (strlen (Gbl_TableSignature) != 4) + if (strlen (Gbl_TableSignature) != ACPI_NAME_SIZE) { AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child, - "Length not exactly 4"); + "Length is not exactly 4"); } - for (i = 0; i < 4; i++) + for (i = 0; i < ACPI_NAME_SIZE; i++) { if (!isalnum ((int) Gbl_TableSignature[i])) { diff --git a/source/compiler/asloptions.c b/source/compiler/asloptions.c index 69c83257a550..0be33e7f5abc 100644 --- a/source/compiler/asloptions.c +++ b/source/compiler/asloptions.c @@ -286,11 +286,6 @@ AslDoOptions ( AcpiGbl_CstyleDisassembly = FALSE; break; - case 'v': - - AcpiGbl_DbOpt_Verbose = TRUE; - break; - default: printf ("Unknown option: -d%s\n", AcpiGbl_Optarg); @@ -445,6 +440,7 @@ AslDoOptions ( /* Produce listing file (Mixed source/aml) */ Gbl_ListingFlag = TRUE; + AcpiGbl_DmOpt_Listing = TRUE; break; case 'i': diff --git a/source/compiler/aslstartup.c b/source/compiler/aslstartup.c index 0e05da401c0b..c04ae9c12f6a 100644 --- a/source/compiler/aslstartup.c +++ b/source/compiler/aslstartup.c @@ -253,7 +253,7 @@ AslDoDisassembly ( /* This is where the disassembly happens */ - AcpiGbl_DbOpt_Disasm = TRUE; + AcpiGbl_DmOpt_Disasm = TRUE; Status = AdAmlDisassemble (AslToFile, Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_OutputFilenamePrefix, &Gbl_Files[ASL_FILE_INPUT].Filename); diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c index d22bf4ca79e2..c9d06f977f83 100644 --- a/source/components/debugger/dbcmds.c +++ b/source/components/debugger/dbcmds.c @@ -49,7 +49,6 @@ #include "acresrc.h" #include "actables.h" -#ifdef ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbcmds") @@ -88,6 +87,7 @@ AcpiDbDoOneSleepState ( static char *AcpiDbTraceMethodName = NULL; + /******************************************************************************* * * FUNCTION: AcpiDbConvertToNode @@ -140,7 +140,8 @@ AcpiDbConvertToNode ( Node = AcpiDbLocalNsLookup (InString); if (!Node) { - AcpiOsPrintf ("Could not find [%s] in namespace, defaulting to root node\n", + AcpiOsPrintf ( + "Could not find [%s] in namespace, defaulting to root node\n", InString); Node = AcpiGbl_RootNode; } @@ -203,7 +204,7 @@ AcpiDbSleep ( * * PARAMETERS: SleepState - Desired sleep state (0-5) * - * RETURN: Status + * RETURN: None * * DESCRIPTION: Simulate a sleep/wake sequence * @@ -340,7 +341,8 @@ AcpiDbDisplayTableInfo ( /* Header */ - AcpiOsPrintf ("Idx ID Status Type TableHeader (Sig, Address, Length)\n"); + AcpiOsPrintf ("Idx ID Status Type " + "TableHeader (Sig, Address, Length, Misc)\n"); /* Walk the entire root table list */ @@ -499,7 +501,8 @@ AcpiDbSendNotify ( else { AcpiOsPrintf ( - "Named object [%4.4s] Type %s, must be Device/Thermal/Processor type\n", + "Named object [%4.4s] Type %s, " + "must be Device/Thermal/Processor type\n", AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type)); } } @@ -532,8 +535,7 @@ AcpiDbDisplayInterfaces ( if (!ActionArg) { - (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, - ACPI_WAIT_FOREVER); + (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); NextInterface = AcpiGbl_SupportedInterfaces; while (NextInterface) @@ -542,6 +544,7 @@ AcpiDbDisplayInterfaces ( { AcpiOsPrintf ("%s\n", NextInterface->Name); } + NextInterface = NextInterface->Next; } @@ -647,7 +650,8 @@ AcpiDbDisplayTemplate ( if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Could not convert Buffer to a resource list: %s, %s\n", + AcpiOsPrintf ( + "Could not convert Buffer to a resource list: %s, %s\n", BufferArg, AcpiFormatException (Status)); goto DumpBuffer; } @@ -708,7 +712,8 @@ AcpiDmCompareAmlResources ( if (Aml1BufferLength != Aml2BufferLength) { AcpiOsPrintf ( - "**** Buffer length mismatch in converted AML: Original %X, New %X ****\n", + "**** Buffer length mismatch in converted " + "AML: Original %X, New %X ****\n", Aml1BufferLength, Aml2BufferLength); } @@ -732,7 +737,8 @@ AcpiDmCompareAmlResources ( if (Aml1Length != Aml2Length) { AcpiOsPrintf ( - "**** Length mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X Len1 %X, Len2 %X ****\n", + "**** Length mismatch in descriptor [%.2X] type %2.2X, " + "Offset %8.8X Len1 %X, Len2 %X ****\n", Count, ResourceType, Offset, Aml1Length, Aml2Length); } @@ -741,7 +747,8 @@ AcpiDmCompareAmlResources ( else if (memcmp (Aml1, Aml2, Aml1Length)) { AcpiOsPrintf ( - "**** Data mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X ****\n", + "**** Data mismatch in descriptor [%.2X] type %2.2X, " + "Offset %8.8X ****\n", Count, ResourceType, Offset); for (i = 0; i < Aml1Length; i++) @@ -749,7 +756,8 @@ AcpiDmCompareAmlResources ( if (Aml1[i] != Aml2[i]) { AcpiOsPrintf ( - "Mismatch at byte offset %.2X: is %2.2X, should be %2.2X\n", + "Mismatch at byte offset %.2X: is %2.2X, " + "should be %2.2X\n", i, Aml2[i], Aml1[i]); } } @@ -914,10 +922,15 @@ AcpiDbDeviceResources ( /* Get handles to the resource methods for this device */ - (void) AcpiGetHandle (Node, METHOD_NAME__PRT, ACPI_CAST_PTR (ACPI_HANDLE, &PrtNode)); - (void) AcpiGetHandle (Node, METHOD_NAME__CRS, ACPI_CAST_PTR (ACPI_HANDLE, &CrsNode)); - (void) AcpiGetHandle (Node, METHOD_NAME__PRS, ACPI_CAST_PTR (ACPI_HANDLE, &PrsNode)); - (void) AcpiGetHandle (Node, METHOD_NAME__AEI, ACPI_CAST_PTR (ACPI_HANDLE, &AeiNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__PRT, + ACPI_CAST_PTR (ACPI_HANDLE, &PrtNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__CRS, + ACPI_CAST_PTR (ACPI_HANDLE, &CrsNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__PRS, + ACPI_CAST_PTR (ACPI_HANDLE, &PrsNode)); + (void) AcpiGetHandle (Node, METHOD_NAME__AEI, + ACPI_CAST_PTR (ACPI_HANDLE, &AeiNode)); + if (!PrtNode && !CrsNode && !PrsNode && !AeiNode) { goto Cleanup; /* Nothing to do */ @@ -1071,7 +1084,8 @@ GetPrs: goto GetAei; } - AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer)); + AcpiRsDumpResourceList (ACPI_CAST_PTR ( + ACPI_RESOURCE, AcpiGbl_DbBuffer)); } @@ -1104,7 +1118,8 @@ GetAei: goto Cleanup; } - AcpiRsDumpResourceList (ACPI_CAST_PTR (ACPI_RESOURCE, AcpiGbl_DbBuffer)); + AcpiRsDumpResourceList (ACPI_CAST_PTR ( + ACPI_RESOURCE, AcpiGbl_DbBuffer)); } @@ -1143,7 +1158,7 @@ AcpiDbDisplayResources ( if (!ObjectArg || (!strcmp (ObjectArg, "*"))) { (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL); + ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL); } else { @@ -1154,7 +1169,8 @@ AcpiDbDisplayResources ( { if (Node->Type != ACPI_TYPE_DEVICE) { - AcpiOsPrintf ("%4.4s: Name is not a device object (%s)\n", + AcpiOsPrintf ( + "%4.4s: Name is not a device object (%s)\n", Node->Name.Ascii, AcpiUtGetTypeName (Node->Type)); } else @@ -1219,6 +1235,19 @@ AcpiDbGenerateGpe ( (void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber); } + +/******************************************************************************* + * + * FUNCTION: AcpiDbGenerateSci + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Simulate an SCI -- just call the SCI dispatch. + * + ******************************************************************************/ + void AcpiDbGenerateSci ( void) @@ -1259,10 +1288,12 @@ AcpiDbTrace ( { AcpiUtStrupr (EnableArg); } + if (OnceArg) { AcpiUtStrupr (OnceArg); } + if (MethodArg) { if (AcpiDbTraceMethodName) @@ -1270,14 +1301,18 @@ AcpiDbTrace ( ACPI_FREE (AcpiDbTraceMethodName); AcpiDbTraceMethodName = NULL; } + AcpiDbTraceMethodName = ACPI_ALLOCATE (strlen (MethodArg) + 1); if (!AcpiDbTraceMethodName) { - AcpiOsPrintf ("Failed to allocate method name (%s)\n", MethodArg); + AcpiOsPrintf ("Failed to allocate method name (%s)\n", + MethodArg); return; } + strcpy (AcpiDbTraceMethodName, MethodArg); } + if (!strcmp (EnableArg, "ENABLE") || !strcmp (EnableArg, "METHOD") || !strcmp (EnableArg, "OPCODE")) @@ -1298,10 +1333,12 @@ AcpiDbTrace ( } Flags = ACPI_TRACE_ENABLED; + if (!strcmp (EnableArg, "OPCODE")) { Flags |= ACPI_TRACE_OPCODE; } + if (OnceArg && !strcmp (OnceArg, "ONCE")) { Flags |= ACPI_TRACE_ONESHOT; @@ -1309,7 +1346,5 @@ AcpiDbTrace ( } (void) AcpiDebugTrace (AcpiDbTraceMethodName, - DebugLevel, DebugLayer, Flags); + DebugLevel, DebugLayer, Flags); } - -#endif /* ACPI_DEBUGGER */ diff --git a/source/components/debugger/dbconvert.c b/source/components/debugger/dbconvert.c index 4c7b4ba4a717..058838a42e84 100644 --- a/source/components/debugger/dbconvert.c +++ b/source/components/debugger/dbconvert.c @@ -45,7 +45,6 @@ #include "accommon.h" #include "acdebug.h" -#ifdef ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbconvert") @@ -528,5 +527,3 @@ AcpiDbDumpPldBuffer ( ACPI_FREE (PldInfo); ACPI_FREE (NewBuffer); } - -#endif /* ACPI_DEBUGGER */ diff --git a/source/components/debugger/dbdisply.c b/source/components/debugger/dbdisply.c index 10821a2f4a0d..267ab58fd859 100644 --- a/source/components/debugger/dbdisply.c +++ b/source/components/debugger/dbdisply.c @@ -51,8 +51,6 @@ #include "acdebug.h" -#ifdef ACPI_DEBUGGER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbdisply") @@ -242,7 +240,8 @@ AcpiDbDecodeAndDisplayObject ( ObjPtr = AcpiDbGetPointer (Target); if (!AcpiOsReadable (ObjPtr, 16)) { - AcpiOsPrintf ("Address %p is invalid in this address space\n", + AcpiOsPrintf ( + "Address %p is invalid in this address space\n", ObjPtr); return; } @@ -258,7 +257,8 @@ AcpiDbDecodeAndDisplayObject ( if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_NAMESPACE_NODE))) { AcpiOsPrintf ( - "Cannot read entire Named object at address %p\n", ObjPtr); + "Cannot read entire Named object at address %p\n", + ObjPtr); return; } @@ -271,13 +271,14 @@ AcpiDbDecodeAndDisplayObject ( if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_OPERAND_OBJECT))) { - AcpiOsPrintf ("Cannot read entire ACPI object at address %p\n", + AcpiOsPrintf ( + "Cannot read entire ACPI object at address %p\n", ObjPtr); return; } - AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display, - ACPI_UINT32_MAX); + AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), + Display, ACPI_UINT32_MAX); AcpiExDumpObjectDescriptor (ObjPtr, 1); break; @@ -288,12 +289,13 @@ AcpiDbDecodeAndDisplayObject ( if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_PARSE_OBJECT))) { AcpiOsPrintf ( - "Cannot read entire Parser object at address %p\n", ObjPtr); + "Cannot read entire Parser object at address %p\n", + ObjPtr); return; } - AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display, - ACPI_UINT32_MAX); + AcpiUtDebugDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), + Display, ACPI_UINT32_MAX); AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr); break; @@ -332,7 +334,7 @@ AcpiDbDecodeAndDisplayObject ( DumpNode: /* Now dump the NS node */ - Status = AcpiGetName (Node, ACPI_FULL_PATHNAME, &RetBuf); + Status = AcpiGetName (Node, ACPI_FULL_PATHNAME_NO_TRAILING, &RetBuf); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not convert name to pathname\n"); @@ -365,8 +367,8 @@ DumpNode: return; } - AcpiUtDebugDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT), - Display, ACPI_UINT32_MAX); + AcpiUtDebugDumpBuffer ((void *) ObjDesc, + sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX); AcpiExDumpObjectDescriptor (ObjDesc, 1); } } @@ -587,7 +589,7 @@ AcpiDbDisplayResults ( } AcpiOsPrintf ("Method [%4.4s] has %X stacked result objects\n", - AcpiUtGetNodeName (Node), ResultCount); + AcpiUtGetNodeName (Node), ResultCount); /* From the top element of result stack */ @@ -599,11 +601,13 @@ AcpiDbDisplayResults ( ObjDesc = Frame->Results.ObjDesc[Index]; AcpiOsPrintf ("Result%u: ", i); AcpiDbDisplayInternalObject (ObjDesc, WalkState); + if (Index == 0) { Frame = Frame->Results.Next; Index = ACPI_RESULTS_FRAME_OBJ_NUM; } + Index--; } } @@ -642,7 +646,6 @@ AcpiDbDisplayCallingTree ( while (WalkState) { Node = WalkState->MethodNode; - AcpiOsPrintf (" [%4.4s]\n", AcpiUtGetNodeName (Node)); WalkState = WalkState->Next; @@ -710,14 +713,17 @@ AcpiDbDisplayObjectType ( { AcpiOsPrintf ("HID: %s\n", Info->HardwareId.String); } + if (Info->Valid & ACPI_VALID_UID) { AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String); } + if (Info->Valid & ACPI_VALID_SUB) { AcpiOsPrintf ("SUB: %s\n", Info->SubsystemId.String); } + if (Info->Valid & ACPI_VALID_CID) { for (i = 0; i < Info->CompatibleIdList.Count; i++) @@ -842,7 +848,8 @@ AcpiDbDisplayGpes ( GpeBlock = GpeXruptInfo->GpeBlockListHead; while (GpeBlock) { - Status = AcpiGetName (GpeBlock->Node, ACPI_FULL_PATHNAME, &RetBuf); + Status = AcpiGetName (GpeBlock->Node, + ACPI_FULL_PATHNAME_NO_TRAILING, &RetBuf); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not convert name to pathname\n"); @@ -857,13 +864,16 @@ AcpiDbDisplayGpes ( GpeType = "GPE Block Device"; } - AcpiOsPrintf ("\nBlock %u - Info %p DeviceNode %p [%s] - %s\n", + AcpiOsPrintf ( + "\nBlock %u - Info %p DeviceNode %p [%s] - %s\n", Block, GpeBlock, GpeBlock->Node, Buffer, GpeType); - AcpiOsPrintf (" Registers: %u (%u GPEs)\n", + AcpiOsPrintf ( + " Registers: %u (%u GPEs)\n", GpeBlock->RegisterCount, GpeBlock->GpeCount); - AcpiOsPrintf (" GPE range: 0x%X to 0x%X on interrupt %u\n", + AcpiOsPrintf ( + " GPE range: 0x%X to 0x%X on interrupt %u\n", GpeBlock->BlockBaseNumber, GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1), GpeXruptInfo->InterruptNumber); @@ -871,8 +881,10 @@ AcpiDbDisplayGpes ( AcpiOsPrintf ( " RegisterInfo: %p Status %8.8X%8.8X Enable %8.8X%8.8X\n", GpeBlock->RegisterInfo, - ACPI_FORMAT_UINT64 (GpeBlock->RegisterInfo->StatusAddress.Address), - ACPI_FORMAT_UINT64 (GpeBlock->RegisterInfo->EnableAddress.Address)); + ACPI_FORMAT_UINT64 ( + GpeBlock->RegisterInfo->StatusAddress.Address), + ACPI_FORMAT_UINT64 ( + GpeBlock->RegisterInfo->EnableAddress.Address)); AcpiOsPrintf (" EventInfo: %p\n", GpeBlock->EventInfo); @@ -883,14 +895,18 @@ AcpiDbDisplayGpes ( GpeRegisterInfo = &GpeBlock->RegisterInfo[i]; AcpiOsPrintf ( - " Reg %u: (GPE %.2X-%.2X) RunEnable %2.2X WakeEnable %2.2X" + " Reg %u: (GPE %.2X-%.2X) " + "RunEnable %2.2X WakeEnable %2.2X" " Status %8.8X%8.8X Enable %8.8X%8.8X\n", i, GpeRegisterInfo->BaseGpeNumber, - GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1), + GpeRegisterInfo->BaseGpeNumber + + (ACPI_GPE_REGISTER_WIDTH - 1), GpeRegisterInfo->EnableForRun, GpeRegisterInfo->EnableForWake, - ACPI_FORMAT_UINT64 (GpeRegisterInfo->StatusAddress.Address), - ACPI_FORMAT_UINT64 (GpeRegisterInfo->EnableAddress.Address)); + ACPI_FORMAT_UINT64 ( + GpeRegisterInfo->StatusAddress.Address), + ACPI_FORMAT_UINT64 ( + GpeRegisterInfo->EnableAddress.Address)); /* Now look at the individual GPEs in this byte register */ @@ -958,7 +974,9 @@ AcpiDbDisplayGpes ( Count++; Notify = Notify->Next; } - AcpiOsPrintf ("Implicit Notify on %u devices", Count); + + AcpiOsPrintf ("Implicit Notify on %u devices", + Count); break; case ACPI_GPE_DISPATCH_RAW_HANDLER: @@ -976,9 +994,11 @@ AcpiDbDisplayGpes ( AcpiOsPrintf (")\n"); } } + Block++; GpeBlock = GpeBlock->Next; } + GpeXruptInfo = GpeXruptInfo->Next; } } @@ -1024,12 +1044,15 @@ AcpiDbDisplayHandlers ( while (HandlerObj) { - if (AcpiGbl_SpaceIdList[i] == HandlerObj->AddressSpace.SpaceId) + if (AcpiGbl_SpaceIdList[i] == + HandlerObj->AddressSpace.SpaceId) { AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, (HandlerObj->AddressSpace.HandlerFlags & - ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User", + ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? + "Default" : "User", HandlerObj->AddressSpace.Handler); + goto FoundHandler; } @@ -1054,7 +1077,8 @@ AcpiDbDisplayHandlers ( "User-defined ID", HandlerObj->AddressSpace.SpaceId); AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, (HandlerObj->AddressSpace.HandlerFlags & - ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User", + ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? + "Default" : "User", HandlerObj->AddressSpace.Handler); } @@ -1090,7 +1114,9 @@ AcpiDbDisplayHandlers ( for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_HandlerList); i++) { - AcpiOsPrintf (ACPI_HANDLER_NAME_STRING, AcpiGbl_HandlerList[i].Name); + AcpiOsPrintf (ACPI_HANDLER_NAME_STRING, + AcpiGbl_HandlerList[i].Name); + if (AcpiGbl_HandlerList[i].Handler) { AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User", @@ -1108,8 +1134,8 @@ AcpiDbDisplayHandlers ( AcpiOsPrintf ("\nOperation Region Handlers for specific devices:\n"); (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, AcpiDbDisplayNonRootHandlers, - NULL, NULL, NULL); + ACPI_UINT32_MAX, AcpiDbDisplayNonRootHandlers, + NULL, NULL, NULL); } @@ -1173,5 +1199,3 @@ AcpiDbDisplayNonRootHandlers ( ACPI_FREE (Pathname); return (AE_OK); } - -#endif /* ACPI_DEBUGGER */ diff --git a/source/components/debugger/dbexec.c b/source/components/debugger/dbexec.c index 433cc55c3b73..ebd02b7c8927 100644 --- a/source/components/debugger/dbexec.c +++ b/source/components/debugger/dbexec.c @@ -46,7 +46,6 @@ #include "acdebug.h" #include "acnamesp.h" -#ifdef ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbexec") @@ -213,7 +212,8 @@ AcpiDbExecuteMethod ( if (Status == AE_BUFFER_OVERFLOW) { ACPI_ERROR ((AE_INFO, - "Possible overflow of internal debugger buffer (size 0x%X needed 0x%X)", + "Possible overflow of internal debugger " + "buffer (size 0x%X needed 0x%X)", ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length)); } } @@ -380,10 +380,11 @@ AcpiDbExecutionWalk ( Status = AcpiEvaluateObject (Node, NULL, NULL, &ReturnObj); - AcpiOsPrintf ("Evaluation of [%4.4s] returned %s\n", AcpiUtGetNodeName (Node), - AcpiFormatException (Status)); - AcpiGbl_MethodExecuting = FALSE; + AcpiOsPrintf ("Evaluation of [%4.4s] returned %s\n", + AcpiUtGetNodeName (Node), + AcpiFormatException (Status)); + AcpiGbl_MethodExecuting = FALSE; return (AE_OK); } @@ -394,6 +395,7 @@ AcpiDbExecutionWalk ( * * PARAMETERS: Name - Name of method to execute * Args - Parameters to the method + * Types - * Flags - single step/no single step * * RETURN: None @@ -414,7 +416,6 @@ AcpiDbExecute ( ACPI_BUFFER ReturnObj; char *NameString; - #ifdef ACPI_DEBUG_OUTPUT UINT32 PreviousAllocations; UINT32 Allocations; @@ -428,7 +429,7 @@ AcpiDbExecute ( if (*Name == '*') { (void) AcpiWalkNamespace (ACPI_TYPE_METHOD, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, AcpiDbExecutionWalk, NULL, NULL, NULL); + ACPI_UINT32_MAX, AcpiDbExecutionWalk, NULL, NULL, NULL); return; } else @@ -464,7 +465,8 @@ AcpiDbExecute ( &AcpiGbl_DbMethodInfo.Method); if (ACPI_SUCCESS (Status)) { - Status = AcpiDbExecuteMethod (&AcpiGbl_DbMethodInfo, &ReturnObj); + Status = AcpiDbExecuteMethod (&AcpiGbl_DbMethodInfo, + &ReturnObj); } ACPI_FREE (NameString); } @@ -485,15 +487,17 @@ AcpiDbExecute ( if (Allocations > 0) { - AcpiOsPrintf ("0x%X Outstanding allocations after evaluation of %s\n", - Allocations, AcpiGbl_DbMethodInfo.Pathname); + AcpiOsPrintf ( + "0x%X Outstanding allocations after evaluation of %s\n", + Allocations, AcpiGbl_DbMethodInfo.Pathname); } #endif if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Evaluation of %s failed with status %s\n", - AcpiGbl_DbMethodInfo.Pathname, AcpiFormatException (Status)); + AcpiGbl_DbMethodInfo.Pathname, + AcpiFormatException (Status)); } else { @@ -502,15 +506,18 @@ AcpiDbExecute ( if (ReturnObj.Length) { AcpiOsPrintf ( - "Evaluation of %s returned object %p, external buffer length %X\n", + "Evaluation of %s returned object %p, " + "external buffer length %X\n", AcpiGbl_DbMethodInfo.Pathname, ReturnObj.Pointer, (UINT32) ReturnObj.Length); + AcpiDbDumpExternalObject (ReturnObj.Pointer, 1); /* Dump a _PLD buffer if present */ if (ACPI_COMPARE_NAME ((ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, - AcpiGbl_DbMethodInfo.Method)->Name.Ascii), METHOD_NAME__PLD)) + AcpiGbl_DbMethodInfo.Method)->Name.Ascii), + METHOD_NAME__PLD)) { AcpiDbDumpPldBuffer (ReturnObj.Pointer); } @@ -563,8 +570,10 @@ AcpiDbMethodThread ( if (Info->InitArgs) { - AcpiDbUint32ToHexString (Info->NumCreated, Info->IndexOfThreadStr); - AcpiDbUint32ToHexString ((UINT32) AcpiOsGetThreadId (), Info->IdOfThreadStr); + AcpiDbUint32ToHexString (Info->NumCreated, + Info->IndexOfThreadStr); + AcpiDbUint32ToHexString ((UINT32) AcpiOsGetThreadId (), + Info->IdOfThreadStr); } if (Info->Threads && (Info->NumCreated < Info->NumThreads)) @@ -599,7 +608,8 @@ AcpiDbMethodThread ( #if 0 if ((i % 100) == 0) { - AcpiOsPrintf ("%u loops, Thread 0x%x\n", i, AcpiOsGetThreadId ()); + AcpiOsPrintf ("%u loops, Thread 0x%x\n", + i, AcpiOsGetThreadId ()); } if (ReturnObj.Length) @@ -614,7 +624,8 @@ AcpiDbMethodThread ( /* Signal our completion */ Allow = 0; - (void) AcpiOsWaitSemaphore (Info->ThreadCompleteGate, 1, ACPI_WAIT_FOREVER); + (void) AcpiOsWaitSemaphore (Info->ThreadCompleteGate, + 1, ACPI_WAIT_FOREVER); Info->NumCompleted++; if (Info->NumCompleted == Info->NumThreads) @@ -630,7 +641,8 @@ AcpiDbMethodThread ( Status = AcpiOsSignalSemaphore (Info->MainThreadGate, 1); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Could not signal debugger thread sync semaphore, %s\n", + AcpiOsPrintf ( + "Could not signal debugger thread sync semaphore, %s\n", AcpiFormatException (Status)); } } @@ -686,7 +698,8 @@ AcpiDbCreateExecutionThreads ( Status = AcpiOsCreateSemaphore (1, 0, &MainThreadGate); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Could not create semaphore for synchronization with the main thread, %s\n", + AcpiOsPrintf ("Could not create semaphore for " + "synchronization with the main thread, %s\n", AcpiFormatException (Status)); return; } @@ -698,8 +711,10 @@ AcpiDbCreateExecutionThreads ( Status = AcpiOsCreateSemaphore (1, 1, &ThreadCompleteGate); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Could not create semaphore for synchronization between the created threads, %s\n", + AcpiOsPrintf ("Could not create semaphore for " + "synchronization between the created threads, %s\n", AcpiFormatException (Status)); + (void) AcpiOsDeleteSemaphore (MainThreadGate); return; } @@ -707,8 +722,10 @@ AcpiDbCreateExecutionThreads ( Status = AcpiOsCreateSemaphore (1, 1, &InfoGate); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Could not create semaphore for synchronization of AcpiGbl_DbMethodInfo, %s\n", + AcpiOsPrintf ("Could not create semaphore for " + "synchronization of AcpiGbl_DbMethodInfo, %s\n", AcpiFormatException (Status)); + (void) AcpiOsDeleteSemaphore (ThreadCompleteGate); (void) AcpiOsDeleteSemaphore (MainThreadGate); return; @@ -720,6 +737,7 @@ AcpiDbCreateExecutionThreads ( AcpiGbl_DbMethodInfo.NumThreads = NumThreads; Size = sizeof (ACPI_THREAD_ID) * AcpiGbl_DbMethodInfo.NumThreads; + AcpiGbl_DbMethodInfo.Threads = AcpiOsAllocate (Size); if (AcpiGbl_DbMethodInfo.Threads == NULL) { @@ -807,5 +825,3 @@ CleanupAndExit: AcpiOsFree (AcpiGbl_DbMethodInfo.Threads); AcpiGbl_DbMethodInfo.Threads = NULL; } - -#endif /* ACPI_DEBUGGER */ diff --git a/source/components/debugger/dbfileio.c b/source/components/debugger/dbfileio.c index 5d526207a5cb..aaeda4527f86 100644 --- a/source/components/debugger/dbfileio.c +++ b/source/components/debugger/dbfileio.c @@ -47,13 +47,12 @@ #include "acdebug.h" #include "actables.h" -#if (defined ACPI_DEBUGGER || defined ACPI_DISASSEMBLER) #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbfileio") -#ifdef ACPI_DEBUGGER +#ifdef ACPI_DEBUGGER /******************************************************************************* * * FUNCTION: AcpiDbCloseDebugFile @@ -78,7 +77,8 @@ AcpiDbCloseDebugFile ( fclose (AcpiGbl_DebugFile); AcpiGbl_DebugFile = NULL; AcpiGbl_DbOutputToFile = FALSE; - AcpiOsPrintf ("Debug output file %s closed\n", AcpiGbl_DbDebugFilename); + AcpiOsPrintf ("Debug output file %s closed\n", + AcpiGbl_DbDebugFilename); } #endif } @@ -145,12 +145,12 @@ AeLocalLoadTable ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status = AE_OK; -/* ACPI_TABLE_DESC TableInfo; */ ACPI_FUNCTION_TRACE (AeLocalLoadTable); -#if 0 +#if 0 +/* ACPI_TABLE_DESC TableInfo; */ if (!Table) { @@ -282,5 +282,3 @@ AcpiDbGetTableFromFile ( #endif /* ACPI_APPLICATION */ return (AE_OK); } - -#endif /* ACPI_DEBUGGER */ diff --git a/source/components/debugger/dbhistry.c b/source/components/debugger/dbhistry.c index bc29d3b09ebc..a05e842062dc 100644 --- a/source/components/debugger/dbhistry.c +++ b/source/components/debugger/dbhistry.c @@ -45,7 +45,6 @@ #include "accommon.h" #include "acdebug.h" -#ifdef ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbhistry") @@ -102,6 +101,7 @@ AcpiDbAddToHistory ( { BufferLen = (UINT16) strlen ( AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command); + if (CmdLen > BufferLen) { AcpiOsFree (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex]. @@ -269,5 +269,3 @@ AcpiDbGetHistoryByIndex ( AcpiOsPrintf ("Invalid history number: %u\n", HistoryIndex); return (NULL); } - -#endif /* ACPI_DEBUGGER */ diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c index 15dfb4b3a70c..981d7062e29d 100644 --- a/source/components/debugger/dbinput.c +++ b/source/components/debugger/dbinput.c @@ -46,11 +46,10 @@ #include "acdebug.h" -#ifdef ACPI_DEBUGGER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbinput") + /* Local prototypes */ static UINT32 @@ -95,20 +94,15 @@ enum AcpiExDebuggerCommands CMD_BREAKPOINT, CMD_BUSINFO, CMD_CALL, - CMD_CLOSE, CMD_DEBUG, CMD_DISASSEMBLE, CMD_DISASM, CMD_DUMP, - CMD_ENABLEACPI, CMD_EVALUATE, - CMD_EVENT, CMD_EXECUTE, CMD_EXIT, CMD_FIND, CMD_GO, - CMD_GPE, - CMD_GPES, CMD_HANDLERS, CMD_HELP, CMD_HELP2, @@ -120,37 +114,47 @@ enum AcpiExDebuggerCommands CMD_INTO, CMD_LEVEL, CMD_LIST, - CMD_LOAD, CMD_LOCALS, CMD_LOCKS, CMD_METHODS, CMD_NAMESPACE, CMD_NOTIFY, CMD_OBJECTS, - CMD_OPEN, CMD_OSI, CMD_OWNER, CMD_PATHS, - CMD_PREDEFINED, CMD_PREFIX, CMD_QUIT, CMD_REFERENCES, CMD_RESOURCES, CMD_RESULTS, - CMD_SCI, CMD_SET, - CMD_SLEEP, CMD_STATS, CMD_STOP, CMD_TABLES, CMD_TEMPLATE, - CMD_TERMINATE, - CMD_TEST, - CMD_THREADS, CMD_TRACE, CMD_TREE, CMD_TYPE, - CMD_UNLOAD +#ifdef ACPI_APPLICATION + CMD_ENABLEACPI, + CMD_EVENT, + CMD_GPE, + CMD_GPES, + CMD_SCI, + CMD_SLEEP, + + CMD_CLOSE, + CMD_LOAD, + CMD_OPEN, + CMD_UNLOAD, + + CMD_TERMINATE, + CMD_THREADS, + + CMD_PREDEFINED, + CMD_TEST, +#endif }; #define CMD_FIRST_VALID 2 @@ -168,20 +172,15 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = {"BREAKPOINT", 1}, {"BUSINFO", 0}, {"CALL", 0}, - {"CLOSE", 0}, {"DEBUG", 1}, {"DISASSEMBLE", 1}, {"DISASM", 1}, {"DUMP", 1}, - {"ENABLEACPI", 0}, {"EVALUATE", 1}, - {"EVENT", 1}, {"EXECUTE", 1}, {"EXIT", 0}, {"FIND", 1}, {"GO", 0}, - {"GPE", 1}, - {"GPES", 0}, {"HANDLERS", 0}, {"HELP", 0}, {"?", 0}, @@ -193,37 +192,47 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = {"INTO", 0}, {"LEVEL", 0}, {"LIST", 0}, - {"LOAD", 1}, {"LOCALS", 0}, {"LOCKS", 0}, {"METHODS", 0}, {"NAMESPACE", 0}, {"NOTIFY", 2}, - {"OBJECTS", 1}, - {"OPEN", 1}, + {"OBJECTS", 0}, {"OSI", 0}, {"OWNER", 1}, {"PATHS", 0}, - {"PREDEFINED", 0}, {"PREFIX", 0}, {"QUIT", 0}, {"REFERENCES", 1}, {"RESOURCES", 0}, {"RESULTS", 0}, - {"SCI", 0}, {"SET", 3}, - {"SLEEP", 0}, {"STATS", 1}, {"STOP", 0}, {"TABLES", 0}, {"TEMPLATE", 1}, - {"TERMINATE", 0}, - {"TEST", 1}, - {"THREADS", 3}, {"TRACE", 1}, {"TREE", 0}, {"TYPE", 1}, +#ifdef ACPI_APPLICATION + {"ENABLEACPI", 0}, + {"EVENT", 1}, + {"GPE", 1}, + {"GPES", 0}, + {"SCI", 0}, + {"SLEEP", 0}, + + {"CLOSE", 0}, + {"LOAD", 1}, + {"OPEN", 1}, {"UNLOAD", 1}, + + {"TERMINATE", 0}, + {"THREADS", 3}, + + {"PREDEFINED", 0}, + {"TEST", 1}, +#endif {NULL, 0} }; @@ -237,7 +246,6 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = {1, " Allocations", "Display list of current memory allocations\n"}, {2, " Dump <Address>|<Namepath>", "\n"}, {0, " [Byte|Word|Dword|Qword]", "Display ACPI objects or memory\n"}, - {1, " EnableAcpi", "Enable ACPI (hardware) mode\n"}, {1, " Handlers", "Info about global handlers\n"}, {1, " Help [Command]", "This help screen or individual command\n"}, {1, " History", "Display command history buffer\n"}, @@ -254,7 +262,6 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = {1, " Stack", "Display CPU stack usage\n"}, {1, " Tables", "Info about current ACPI table(s)\n"}, {1, " Tables", "Display info about loaded ACPI tables\n"}, - {1, " Unload <Namepath>", "Unload an ACPI table via namespace object\n"}, {1, " ! <CommandNumber>", "Execute command from history buffer\n"}, {1, " !!", "Execute last command again\n"}, @@ -266,7 +273,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = {1, " Methods", "Display list of loaded control methods\n"}, {1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"}, {1, " Notify <Object> <Value>", "Send a notification on Object\n"}, - {1, " Objects <ObjectType>", "Display all objects of the given type\n"}, + {1, " Objects [ObjectType]", "Display summary of all objects or just given type\n"}, {1, " Owner <OwnerId> [Depth]", "Display loaded namespace by object owner\n"}, {1, " Paths", "Display full pathnames of namespace objects\n"}, {1, " Predefined", "Check all predefined names\n"}, @@ -275,7 +282,6 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = {1, " Resources [DeviceName]", "Display Device resources (no arg = all devices)\n"}, {1, " Set N <NamedObject> <Value>", "Set value for named integer\n"}, {1, " Template <Object>", "Format/dump a Buffer/ResourceTemplate\n"}, - {1, " Terminate", "Delete namespace and all internal objects\n"}, {1, " Type <Object>", "Display object type\n"}, {0, "\nControl Method Execution Commands:","\n"}, @@ -297,7 +303,6 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = {1, " Results", "Display method result stack\n"}, {1, " Set <A|L> <#> <Value>", "Set method data (Arguments/Locals)\n"}, {1, " Stop", "Terminate control method\n"}, - {1, " Thread <Threads><Loops><Namepath>", "Spawn threads to execute method(s)\n"}, {5, " Trace <State> [<Namepath>] [Once]", "Trace control method execution\n"}, {1, " Enable", "Enable all messages\n"}, {1, " Disable", "Disable tracing\n"}, @@ -306,10 +311,12 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = {1, " Tree", "Display control method calling tree\n"}, {1, " <Enter>", "Single step next AML opcode (over calls)\n"}, - {0, "\nHardware Related Commands:", "\n"}, +#ifdef ACPI_APPLICATION + {0, "\nHardware Simulation Commands:", "\n"}, + {1, " EnableAcpi", "Enable ACPI (hardware) mode\n"}, {1, " Event <F|G> <Value>", "Generate AcpiEvent (Fixed/GPE)\n"}, {1, " Gpe <GpeNum> [GpeBlockDevice]", "Simulate a GPE\n"}, - {1, " Gpes", "Display info on all GPEs\n"}, + {1, " Gpes", "Display info on all GPE devices\n"}, {1, " Sci", "Generate an SCI\n"}, {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"}, @@ -317,11 +324,17 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = {1, " Close", "Close debug output file\n"}, {1, " Load <Input Filename>", "Load ACPI table from a file\n"}, {1, " Open <Output Filename>", "Open a file for debug output\n"}, + {1, " Unload <Namepath>", "Unload an ACPI table via namespace object\n"}, + + {0, "\nUser Space Commands:", "\n"}, + {1, " Terminate", "Delete namespace and all internal objects\n"}, + {1, " Thread <Threads><Loops><NamePath>", "Spawn threads to execute method(s)\n"}, {0, "\nDebug Test Commands:", "\n"}, {3, " Test <TestName>", "Invoke a debug test\n"}, {1, " Objects", "Read/write/compare all namespace data objects\n"}, {1, " Predefined", "Execute all ACPI predefined names (_STA, etc.)\n"}, +#endif {0, NULL, NULL} }; @@ -645,7 +658,8 @@ AcpiDbGetLine ( if (AcpiUtSafeStrcpy (AcpiGbl_DbParsedBuf, sizeof (AcpiGbl_DbParsedBuf), InputBuffer)) { - AcpiOsPrintf ("Buffer overflow while parsing input line (max %u characters)\n", + AcpiOsPrintf ( + "Buffer overflow while parsing input line (max %u characters)\n", sizeof (AcpiGbl_DbParsedBuf)); return (0); } @@ -707,7 +721,7 @@ AcpiDbMatchCommand ( for (i = CMD_FIRST_VALID; AcpiGbl_DbCommands[i].Name; i++) { if (strstr (AcpiGbl_DbCommands[i].Name, UserCommand) == - AcpiGbl_DbCommands[i].Name) + AcpiGbl_DbCommands[i].Name) { return (i); } @@ -777,7 +791,8 @@ AcpiDbCommandDispatch ( ParamCount, AcpiGbl_DbCommands[CommandIndex].Name, AcpiGbl_DbCommands[CommandIndex].MinArgs); - AcpiDbDisplayCommandInfo (AcpiGbl_DbCommands[CommandIndex].Name, FALSE); + AcpiDbDisplayCommandInfo ( + AcpiGbl_DbCommands[CommandIndex].Name, FALSE); return (AE_CTRL_TRUE); } @@ -822,11 +837,6 @@ AcpiDbCommandDispatch ( Status = AE_OK; break; - case CMD_CLOSE: - - AcpiDbCloseDebugFile (); - break; - case CMD_DEBUG: AcpiDbExecute (AcpiGbl_DbArgs[1], @@ -844,23 +854,6 @@ AcpiDbCommandDispatch ( AcpiDbDecodeAndDisplayObject (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); break; - case CMD_ENABLEACPI: -#if (!ACPI_REDUCED_HARDWARE) - - Status = AcpiEnable(); - if (ACPI_FAILURE(Status)) - { - AcpiOsPrintf("AcpiEnable failed (Status=%X)\n", Status); - return (Status); - } -#endif /* !ACPI_REDUCED_HARDWARE */ - break; - - case CMD_EVENT: - - AcpiOsPrintf ("Event command not implemented\n"); - break; - case CMD_EVALUATE: case CMD_EXECUTE: @@ -878,16 +871,6 @@ AcpiDbCommandDispatch ( AcpiGbl_CmSingleStep = FALSE; return (AE_OK); - case CMD_GPE: - - AcpiDbGenerateGpe (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); - break; - - case CMD_GPES: - - AcpiDbDisplayGpes (); - break; - case CMD_HANDLERS: AcpiDbDisplayHandlers (); @@ -949,9 +932,11 @@ AcpiDbCommandDispatch ( if (ParamCount == 0) { - AcpiOsPrintf ("Current debug level for file output is: %8.8lX\n", + AcpiOsPrintf ( + "Current debug level for file output is: %8.8lX\n", AcpiGbl_DbDebugLevel); - AcpiOsPrintf ("Current debug level for console output is: %8.8lX\n", + AcpiOsPrintf ( + "Current debug level for console output is: %8.8lX\n", AcpiGbl_DbConsoleDebugLevel); } else if (ParamCount == 2) @@ -978,11 +963,6 @@ AcpiDbCommandDispatch ( AcpiDbDisassembleAml (AcpiGbl_DbArgs[1], Op); break; - case CMD_LOAD: - - Status = AcpiDbGetTableFromFile (AcpiGbl_DbArgs[1], NULL, FALSE); - break; - case CMD_LOCKS: AcpiDbDisplayLocks (); @@ -1015,11 +995,6 @@ AcpiDbCommandDispatch ( Status = AcpiDbDisplayObjects (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); break; - case CMD_OPEN: - - AcpiDbOpenDebugFile (AcpiGbl_DbArgs[1]); - break; - case CMD_OSI: AcpiDbDisplayInterfaces (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); @@ -1035,11 +1010,6 @@ AcpiDbCommandDispatch ( AcpiDbDumpNamespacePaths (); break; - case CMD_PREDEFINED: - - AcpiDbCheckPredefinedNames (); - break; - case CMD_PREFIX: AcpiDbSetScope (AcpiGbl_DbArgs[1]); @@ -1060,22 +1030,12 @@ AcpiDbCommandDispatch ( AcpiDbDisplayResults (); break; - case CMD_SCI: - - AcpiDbGenerateSci (); - break; - case CMD_SET: AcpiDbSetMethodData (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], AcpiGbl_DbArgs[3]); break; - case CMD_SLEEP: - - Status = AcpiDbSleep (AcpiGbl_DbArgs[1]); - break; - case CMD_STATS: Status = AcpiDbDisplayStatistics (AcpiGbl_DbArgs[1]); @@ -1095,6 +1055,81 @@ AcpiDbCommandDispatch ( AcpiDbDisplayTemplate (AcpiGbl_DbArgs[1]); break; + case CMD_TRACE: + + AcpiDbTrace (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], AcpiGbl_DbArgs[3]); + break; + + case CMD_TREE: + + AcpiDbDisplayCallingTree (); + break; + + case CMD_TYPE: + + AcpiDbDisplayObjectType (AcpiGbl_DbArgs[1]); + break; + +#ifdef ACPI_APPLICATION + + /* Hardware simulation commands. */ + + case CMD_ENABLEACPI: +#if (!ACPI_REDUCED_HARDWARE) + + Status = AcpiEnable(); + if (ACPI_FAILURE(Status)) + { + AcpiOsPrintf("AcpiEnable failed (Status=%X)\n", Status); + return (Status); + } +#endif /* !ACPI_REDUCED_HARDWARE */ + break; + + case CMD_EVENT: + + AcpiOsPrintf ("Event command not implemented\n"); + break; + + case CMD_GPE: + + AcpiDbGenerateGpe (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); + break; + + case CMD_GPES: + + AcpiDbDisplayGpes (); + break; + + case CMD_SCI: + + AcpiDbGenerateSci (); + break; + + case CMD_SLEEP: + + Status = AcpiDbSleep (AcpiGbl_DbArgs[1]); + break; + + /* File I/O commands. */ + + case CMD_CLOSE: + + AcpiDbCloseDebugFile (); + break; + + case CMD_LOAD: + + Status = AcpiDbGetTableFromFile (AcpiGbl_DbArgs[1], NULL, FALSE); + break; + + case CMD_OPEN: + + AcpiDbOpenDebugFile (AcpiGbl_DbArgs[1]); + break; + + /* User space commands. */ + case CMD_TERMINATE: AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); @@ -1108,36 +1143,29 @@ AcpiDbCommandDispatch ( /* AcpiInitialize (NULL); */ break; - case CMD_TEST: - - AcpiDbExecuteTest (AcpiGbl_DbArgs[1]); - break; - case CMD_THREADS: AcpiDbCreateExecutionThreads (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], AcpiGbl_DbArgs[3]); break; - case CMD_TRACE: - - AcpiDbTrace (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], AcpiGbl_DbArgs[3]); - break; + /* Debug test commands. */ - case CMD_TREE: + case CMD_PREDEFINED: - AcpiDbDisplayCallingTree (); + AcpiDbCheckPredefinedNames (); break; - case CMD_TYPE: + case CMD_TEST: - AcpiDbDisplayObjectType (AcpiGbl_DbArgs[1]); + AcpiDbExecuteTest (AcpiGbl_DbArgs[1]); break; case CMD_UNLOAD: AcpiDbUnloadAcpiTable (AcpiGbl_DbArgs[1]); break; +#endif case CMD_EXIT: case CMD_QUIT: @@ -1153,7 +1181,9 @@ AcpiDbCommandDispatch ( AcpiDbgLevel = ACPI_DEBUG_DEFAULT; } +#ifdef ACPI_APPLICATION AcpiDbCloseDebugFile (); +#endif AcpiGbl_DbTerminateThreads = TRUE; return (AE_CTRL_TERMINATE); @@ -1322,6 +1352,10 @@ AcpiDbUserCommands ( } } + /* Shut down the debugger */ + + AcpiTerminateDebugger (); + /* * Only this thread (the original thread) should actually terminate the * subsystem, because all the semaphores are deleted during termination @@ -1329,5 +1363,3 @@ AcpiDbUserCommands ( Status = AcpiTerminate (); return (Status); } - -#endif /* ACPI_DEBUGGER */ diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c index f42496a399b7..ee13baef979c 100644 --- a/source/components/debugger/dbmethod.c +++ b/source/components/debugger/dbmethod.c @@ -46,15 +46,10 @@ #include "acdispat.h" #include "acnamesp.h" #include "acdebug.h" -#ifdef ACPI_DISASSEMBLER -#include "acdisasm.h" -#endif #include "acparser.h" #include "acpredef.h" -#ifdef ACPI_DEBUGGER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbmethod") @@ -229,12 +224,13 @@ AcpiDbSetMethodData ( if (Index > ACPI_METHOD_MAX_ARG) { - AcpiOsPrintf ("Arg%u - Invalid argument name\n", Index); + AcpiOsPrintf ("Arg%u - Invalid argument name\n", + Index); goto Cleanup; } - Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_ARG, Index, ObjDesc, - WalkState); + Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_ARG, + Index, ObjDesc, WalkState); if (ACPI_FAILURE (Status)) { goto Cleanup; @@ -252,12 +248,13 @@ AcpiDbSetMethodData ( if (Index > ACPI_METHOD_MAX_LOCAL) { - AcpiOsPrintf ("Local%u - Invalid local variable name\n", Index); + AcpiOsPrintf ("Local%u - Invalid local variable name\n", + Index); goto Cleanup; } - Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_LOCAL, Index, ObjDesc, - WalkState); + Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_LOCAL, + Index, ObjDesc, WalkState); if (ACPI_FAILURE (Status)) { goto Cleanup; @@ -398,14 +395,14 @@ AcpiDbDisassembleMethod ( Status = AcpiPsParseAml (WalkState); -#ifdef ACPI_DISASSEMBER +#ifdef ACPI_DISASSEMBLER (void) AcpiDmParseDeferredOps (Op); /* Now we can disassemble the method */ - AcpiGbl_DbOpt_Verbose = FALSE; + AcpiGbl_DmOpt_Verbose = FALSE; AcpiDmDisassemble (NULL, Op, 0); - AcpiGbl_DbOpt_Verbose = TRUE; + AcpiGbl_DmOpt_Verbose = TRUE; #endif AcpiPsDeleteParseTree (Op); @@ -417,5 +414,3 @@ AcpiDbDisassembleMethod ( AcpiUtReleaseOwnerId (&ObjDesc->Method.OwnerId); return (AE_OK); } - -#endif /* ACPI_DEBUGGER */ diff --git a/source/components/debugger/dbnames.c b/source/components/debugger/dbnames.c index 716fd3ce5cb6..6b41dc6ea2a7 100644 --- a/source/components/debugger/dbnames.c +++ b/source/components/debugger/dbnames.c @@ -48,8 +48,6 @@ #include "acpredef.h" -#ifdef ACPI_DEBUGGER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbnames") @@ -78,6 +76,13 @@ AcpiDbWalkForSpecificObjects ( void **ReturnValue); static ACPI_STATUS +AcpiDbWalkForObjectCounts ( + ACPI_HANDLE ObjHandle, + UINT32 NestingLevel, + void *Context, + void **ReturnValue); + +static ACPI_STATUS AcpiDbIntegrityWalk ( ACPI_HANDLE ObjHandle, UINT32 NestingLevel, @@ -125,7 +130,13 @@ static ACPI_DB_ARGUMENT_INFO AcpiDbObjectTypes [] = {"BANKFIELDS"}, {"INDEXFIELDS"}, {"REFERENCES"}, - {"ALIAS"}, + {"ALIASES"}, + {"METHODALIASES"}, + {"NOTIFY"}, + {"ADDRESSHANDLER"}, + {"RESOURCE"}, + {"RESOURCEFIELD"}, + {"SCOPES"}, {NULL} /* Must be null terminated */ }; @@ -163,8 +174,8 @@ AcpiDbSetScope ( { /* Validate new scope from the root */ - Status = AcpiNsGetNode (AcpiGbl_RootNode, Name, ACPI_NS_NO_UPSEARCH, - &Node); + Status = AcpiNsGetNode (AcpiGbl_RootNode, Name, + ACPI_NS_NO_UPSEARCH, &Node); if (ACPI_FAILURE (Status)) { goto ErrorExit; @@ -176,8 +187,8 @@ AcpiDbSetScope ( { /* Validate new scope relative to old scope */ - Status = AcpiNsGetNode (AcpiGbl_DbScopeNode, Name, ACPI_NS_NO_UPSEARCH, - &Node); + Status = AcpiNsGetNode (AcpiGbl_DbScopeNode, Name, + ACPI_NS_NO_UPSEARCH, &Node); if (ACPI_FAILURE (Status)) { goto ErrorExit; @@ -187,14 +198,14 @@ AcpiDbSetScope ( /* Build the final pathname */ if (AcpiUtSafeStrcat (AcpiGbl_DbScopeBuf, sizeof (AcpiGbl_DbScopeBuf), - Name)) + Name)) { Status = AE_BUFFER_OVERFLOW; goto ErrorExit; } if (AcpiUtSafeStrcat (AcpiGbl_DbScopeBuf, sizeof (AcpiGbl_DbScopeBuf), - "\\")) + "\\")) { Status = AE_BUFFER_OVERFLOW; goto ErrorExit; @@ -334,8 +345,8 @@ AcpiDbDumpNamespaceByOwner ( /* Display the subtree */ AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); - AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth, OwnerId, - SubtreeEntry); + AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth, + OwnerId, SubtreeEntry); AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT); } @@ -374,7 +385,8 @@ AcpiDbWalkAndMatchName ( /* Wildcard support */ if ((RequestedName[i] != '?') && - (RequestedName[i] != ((ACPI_NAMESPACE_NODE *) ObjHandle)->Name.Ascii[i])) + (RequestedName[i] != ((ACPI_NAMESPACE_NODE *) + ObjHandle)->Name.Ascii[i])) { /* No match, just exit */ @@ -385,10 +397,11 @@ AcpiDbWalkAndMatchName ( /* Get the full pathname to this object */ Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, FALSE); + Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, TRUE); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle); + AcpiOsPrintf ("Could Not get pathname for object %p\n", + ObjHandle); } else { @@ -426,7 +439,7 @@ AcpiDbFindNameInNamespace ( char *AcpiNamePtr = AcpiName; - if (strlen (NameArg) > 4) + if (strlen (NameArg) > ACPI_NAME_SIZE) { AcpiOsPrintf ("Name must be no longer than 4 characters\n"); return (AE_OK); @@ -444,8 +457,8 @@ AcpiDbFindNameInNamespace ( /* Walk the namespace from the root */ - (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbWalkAndMatchName, NULL, AcpiName, NULL); + (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, AcpiDbWalkAndMatchName, NULL, AcpiName, NULL); AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT); return (AE_OK); @@ -546,8 +559,8 @@ AcpiDbCheckPredefinedNames ( /* Search all nodes in namespace */ - (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbWalkForPredefinedNames, NULL, (void *) &Count, NULL); + (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, AcpiDbWalkForPredefinedNames, NULL, (void *) &Count, NULL); AcpiOsPrintf ("Found %u predefined names in the namespace\n", Count); } @@ -555,6 +568,43 @@ AcpiDbCheckPredefinedNames ( /******************************************************************************* * + * FUNCTION: AcpiDbWalkForObjectCounts + * + * PARAMETERS: Callback from WalkNamespace + * + * RETURN: Status + * + * DESCRIPTION: Display short info about objects in the namespace + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDbWalkForObjectCounts ( + ACPI_HANDLE ObjHandle, + UINT32 NestingLevel, + void *Context, + void **ReturnValue) +{ + ACPI_OBJECT_INFO *Info = (ACPI_OBJECT_INFO *) Context; + ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; + + + if (Node->Type > ACPI_TYPE_NS_NODE_MAX) + { + AcpiOsPrintf ("[%4.4s]: Unknown object type %X\n", + Node->Name.Ascii, Node->Type); + } + else + { + Info->Types[Node->Type]++; + } + + return (AE_OK); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDbWalkForSpecificObjects * * PARAMETERS: Callback from WalkNamespace @@ -582,7 +632,7 @@ AcpiDbWalkForSpecificObjects ( /* Get and display the full pathname to this object */ Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, FALSE); + Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, TRUE); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle); @@ -619,7 +669,39 @@ AcpiDbDisplayObjects ( { ACPI_WALK_INFO Info; ACPI_OBJECT_TYPE Type; + ACPI_OBJECT_INFO *ObjectInfo; + UINT32 i; + UINT32 TotalObjects = 0; + + + /* No argument means display summary/count of all object types */ + if (!ObjTypeArg) + { + ObjectInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_OBJECT_INFO)); + + /* Walk the namespace from the root */ + + (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, AcpiDbWalkForObjectCounts, NULL, + (void *) ObjectInfo, NULL); + + AcpiOsPrintf ("\nSummary of namespace objects:\n\n"); + + for (i = 0; i < ACPI_TOTAL_TYPES; i++) + { + AcpiOsPrintf ("%8u %s\n", ObjectInfo->Types[i], + AcpiUtGetTypeName (i)); + + TotalObjects += ObjectInfo->Types[i]; + } + + AcpiOsPrintf ("\n%8u Total namespace objects\n\n", + TotalObjects); + + ACPI_FREE (ObjectInfo); + return (AE_OK); + } /* Get the object type */ @@ -645,7 +727,7 @@ AcpiDbDisplayObjects ( /* Walk the namespace from the root */ (void) AcpiWalkNamespace (Type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbWalkForSpecificObjects, NULL, (void *) &Info, NULL); + AcpiDbWalkForSpecificObjects, NULL, (void *) &Info, NULL); AcpiOsPrintf ( "\nFound %u objects of type [%s] in the current ACPI Namespace\n", @@ -689,9 +771,11 @@ AcpiDbIntegrityWalk ( { if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED) { - AcpiOsPrintf ("Invalid Descriptor Type for Node %p [%s] - is %2.2X should be %2.2X\n", - Node, AcpiUtGetDescriptorName (Node), ACPI_GET_DESCRIPTOR_TYPE (Node), - ACPI_DESC_TYPE_NAMED); + AcpiOsPrintf ( + "Invalid Descriptor Type for Node %p [%s] - " + "is %2.2X should be %2.2X\n", + Node, AcpiUtGetDescriptorName (Node), + ACPI_GET_DESCRIPTOR_TYPE (Node), ACPI_DESC_TYPE_NAMED); return (AE_OK); } @@ -754,8 +838,8 @@ AcpiDbCheckIntegrity ( /* Search all nodes in namespace */ - (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbIntegrityWalk, NULL, (void *) &Info, NULL); + (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, AcpiDbIntegrityWalk, NULL, (void *) &Info, NULL); AcpiOsPrintf ("Verified %u namespace nodes with %u Objects\n", Info.Nodes, Info.Objects); @@ -835,8 +919,9 @@ AcpiDbFindReferences ( /* Search all nodes in namespace */ - (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbWalkForReferences, NULL, (void *) ObjDesc, NULL); + (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, AcpiDbWalkForReferences, NULL, + (void *) ObjDesc, NULL); } @@ -886,10 +971,11 @@ AcpiDbBusWalk ( /* Get the full path to this device object */ Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, FALSE); + Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, TRUE); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle); + AcpiOsPrintf ("Could Not get pathname for object %p\n", + ObjHandle); return (AE_OK); } @@ -918,7 +1004,8 @@ AcpiDbBusWalk ( if (Info->Valid & ACPI_VALID_ADR) { - AcpiOsPrintf ("_ADR: %8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Info->Address)); + AcpiOsPrintf ("_ADR: %8.8X%8.8X\n", + ACPI_FORMAT_UINT64 (Info->Address)); } else { @@ -979,8 +1066,6 @@ AcpiDbGetBusInfo ( { /* Search all nodes in namespace */ - (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbBusWalk, NULL, NULL, NULL); + (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, AcpiDbBusWalk, NULL, NULL, NULL); } - -#endif /* ACPI_DEBUGGER */ diff --git a/source/components/debugger/dbobject.c b/source/components/debugger/dbobject.c index c7447af6d9d8..eef1b9e4f2f3 100644 --- a/source/components/debugger/dbobject.c +++ b/source/components/debugger/dbobject.c @@ -45,16 +45,12 @@ #include "accommon.h" #include "acnamesp.h" #include "acdebug.h" -#ifdef ACPI_DISASSEMBLER -#include "acdisasm.h" -#endif -#ifdef ACPI_DEBUGGER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbobject") + /* Local prototypes */ static void @@ -148,7 +144,8 @@ AcpiDbDecodeInternalObject ( if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) { - AcpiOsPrintf (" %p [%s]", ObjDesc, AcpiUtGetDescriptorName (ObjDesc)); + AcpiOsPrintf (" %p [%s]", ObjDesc, + AcpiUtGetDescriptorName (ObjDesc)); return; } @@ -159,13 +156,13 @@ AcpiDbDecodeInternalObject ( case ACPI_TYPE_INTEGER: AcpiOsPrintf (" %8.8X%8.8X", - ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); + ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); break; case ACPI_TYPE_STRING: AcpiOsPrintf ("(%u) \"%.24s", - ObjDesc->String.Length, ObjDesc->String.Pointer); + ObjDesc->String.Length, ObjDesc->String.Pointer); if (ObjDesc->String.Length > 24) { @@ -212,7 +209,7 @@ AcpiDbDecodeNode ( { AcpiOsPrintf ("<Node> Name %4.4s", - AcpiUtGetNodeName (Node)); + AcpiUtGetNodeName (Node)); if (Node->Flags & ANOBJ_METHOD_ARG) { @@ -315,7 +312,7 @@ AcpiDbDisplayInternalObject ( if (WalkState) { ObjDesc = WalkState->LocalVariables - [ObjDesc->Reference.Value].Object; + [ObjDesc->Reference.Value].Object; AcpiOsPrintf ("%p", ObjDesc); AcpiDbDecodeInternalObject (ObjDesc); } @@ -327,7 +324,7 @@ AcpiDbDisplayInternalObject ( if (WalkState) { ObjDesc = WalkState->Arguments - [ObjDesc->Reference.Value].Object; + [ObjDesc->Reference.Value].Object; AcpiOsPrintf ("%p", ObjDesc); AcpiDbDecodeInternalObject (ObjDesc); } @@ -368,7 +365,8 @@ AcpiDbDisplayInternalObject ( if (!ObjDesc->Reference.Object) { - AcpiOsPrintf ("Uninitialized reference subobject pointer"); + AcpiOsPrintf ( + "Uninitialized reference subobject pointer"); break; } @@ -377,10 +375,12 @@ AcpiDbDisplayInternalObject ( switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc->Reference.Object)) { case ACPI_DESC_TYPE_NAMED: + AcpiDbDecodeNode (ObjDesc->Reference.Object); break; case ACPI_DESC_TYPE_OPERAND: + AcpiDbDecodeInternalObject (ObjDesc->Reference.Object); break; @@ -449,6 +449,7 @@ AcpiDbDecodeLocals ( ObjDesc = WalkState->MethodDesc; Node = WalkState->MethodNode; + if (!Node) { AcpiOsPrintf ( @@ -463,7 +464,7 @@ AcpiDbDecodeLocals ( } AcpiOsPrintf ("Local Variables for method [%4.4s]:\n", - AcpiUtGetNodeName (Node)); + AcpiUtGetNodeName (Node)); for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++) { @@ -497,6 +498,7 @@ AcpiDbDecodeArguments ( ObjDesc = WalkState->MethodDesc; Node = WalkState->MethodNode; + if (!Node) { AcpiOsPrintf ( @@ -511,8 +513,10 @@ AcpiDbDecodeArguments ( } AcpiOsPrintf ( - "Arguments for Method [%4.4s]: (%X arguments defined, max concurrency = %X)\n", - AcpiUtGetNodeName (Node), ObjDesc->Method.ParamCount, ObjDesc->Method.SyncLevel); + "Arguments for Method [%4.4s]: " + "(%X arguments defined, max concurrency = %X)\n", + AcpiUtGetNodeName (Node), ObjDesc->Method.ParamCount, + ObjDesc->Method.SyncLevel); for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) { @@ -521,5 +525,3 @@ AcpiDbDecodeArguments ( AcpiDbDisplayInternalObject (ObjDesc, WalkState); } } - -#endif diff --git a/source/components/debugger/dbstats.c b/source/components/debugger/dbstats.c index 0f2c75f9b275..e1ff8bb00c3c 100644 --- a/source/components/debugger/dbstats.c +++ b/source/components/debugger/dbstats.c @@ -46,11 +46,11 @@ #include "acdebug.h" #include "acnamesp.h" -#ifdef ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbstats") + /* Local prototypes */ static void @@ -127,7 +127,8 @@ AcpiDbListInfo ( if (List->MaxDepth > 0) { AcpiOsPrintf ( - " Cache: [Depth MaxD Avail Size] %8.2X %8.2X %8.2X %8.2X\n", + " Cache: [Depth MaxD Avail Size] " + "%8.2X %8.2X %8.2X %8.2X\n", List->CurrentDepth, List->MaxDepth, List->MaxDepth - List->CurrentDepth, @@ -138,7 +139,8 @@ AcpiDbListInfo ( if (List->MaxDepth > 0) { AcpiOsPrintf ( - " Cache: [Requests Hits Misses ObjSize] %8.2X %8.2X %8.2X %8.2X\n", + " Cache: [Requests Hits Misses ObjSize] " + "%8.2X %8.2X %8.2X %8.2X\n", List->Requests, List->Hits, List->Requests - List->Hits, @@ -150,7 +152,8 @@ AcpiDbListInfo ( if (List->ObjectSize) { AcpiOsPrintf ( - " Mem: [Alloc Free Max CurSize Outstanding] %8.2X %8.2X %8.2X %8.2X %8.2X\n", + " Mem: [Alloc Free Max CurSize Outstanding] " + "%8.2X %8.2X %8.2X %8.2X %8.2X\n", List->TotalAllocated, List->TotalFreed, List->MaxOccupied, @@ -160,7 +163,8 @@ AcpiDbListInfo ( else { AcpiOsPrintf ( - " Mem: [Alloc Free Max CurSize Outstanding Total] %8.2X %8.2X %8.2X %8.2X %8.2X %8.2X\n", + " Mem: [Alloc Free Max CurSize Outstanding Total] " + "%8.2X %8.2X %8.2X %8.2X %8.2X %8.2X\n", List->TotalAllocated, List->TotalFreed, List->MaxOccupied, @@ -374,7 +378,7 @@ AcpiDbCountNamespaceObjects ( } (void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, FALSE, AcpiDbClassifyOneObject, NULL, NULL, NULL); + ACPI_UINT32_MAX, FALSE, AcpiDbClassifyOneObject, NULL, NULL, NULL); } @@ -532,7 +536,8 @@ AcpiDbDisplayStatistics ( case CMD_STAT_STACK: #if defined(ACPI_DEBUG_OUTPUT) - Temp = (UINT32) ACPI_PTR_DIFF (AcpiGbl_EntryStackPointer, AcpiGbl_LowestStackPointer); + Temp = (UINT32) ACPI_PTR_DIFF ( + AcpiGbl_EntryStackPointer, AcpiGbl_LowestStackPointer); AcpiOsPrintf ("\nSubsystem Stack Usage:\n\n"); AcpiOsPrintf ("Entry Stack Pointer %p\n", AcpiGbl_EntryStackPointer); @@ -550,5 +555,3 @@ AcpiDbDisplayStatistics ( AcpiOsPrintf ("\n"); return (AE_OK); } - -#endif /* ACPI_DEBUGGER */ diff --git a/source/components/debugger/dbtest.c b/source/components/debugger/dbtest.c index 8d68f535863d..840d371d11c0 100644 --- a/source/components/debugger/dbtest.c +++ b/source/components/debugger/dbtest.c @@ -47,7 +47,6 @@ #include "acnamesp.h" #include "acpredef.h" -#ifdef ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbtest") @@ -124,8 +123,8 @@ static ACPI_DB_ARGUMENT_INFO AcpiDbTestTypes [] = * used to read and write the various namespace objects. The point * is to force the AML interpreter do all of the work. */ -#define ACPI_DB_READ_METHOD "\\_T98" -#define ACPI_DB_WRITE_METHOD "\\_T99" +#define ACPI_DB_READ_METHOD "\\_T98" +#define ACPI_DB_WRITE_METHOD "\\_T99" static ACPI_HANDLE ReadHandle = NULL; static ACPI_HANDLE WriteHandle = NULL; @@ -283,7 +282,7 @@ AcpiDbTestAllObjects ( /* Walk the entire namespace, testing each supported named data object */ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, AcpiDbTestOneObject, NULL, NULL, NULL); + ACPI_UINT32_MAX, AcpiDbTestOneObject, NULL, NULL, NULL); } @@ -695,7 +694,8 @@ AcpiDbTestBufferType ( goto Exit; } - if (memcmp (Temp1->Buffer.Pointer, Temp3->Buffer.Pointer, ByteLength)) + if (memcmp (Temp1->Buffer.Pointer, + Temp3->Buffer.Pointer, ByteLength)) { AcpiOsPrintf (" MISMATCH 3: While restoring original buffer"); } @@ -847,7 +847,8 @@ AcpiDbReadFromObject ( ReturnObj.Length = ACPI_ALLOCATE_BUFFER; AcpiGbl_MethodExecuting = TRUE; - Status = AcpiEvaluateObject (ReadHandle, NULL, &ParamObjects, &ReturnObj); + Status = AcpiEvaluateObject (ReadHandle, NULL, + &ParamObjects, &ReturnObj); AcpiGbl_MethodExecuting = FALSE; if (ACPI_FAILURE (Status)) @@ -885,8 +886,8 @@ AcpiDbReadFromObject ( AcpiOsPrintf (" Unsupported return object type, %s", AcpiUtGetTypeName (RetValue->Type)); - AcpiOsFree (ReturnObj.Pointer); + AcpiOsFree (ReturnObj.Pointer); return (AE_TYPE); } @@ -975,8 +976,9 @@ AcpiDbEvaluateAllPredefinedNames ( /* Search all nodes in namespace */ - (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbEvaluateOnePredefinedName, NULL, (void *) &Info, NULL); + (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, AcpiDbEvaluateOnePredefinedName, NULL, + (void *) &Info, NULL); AcpiOsPrintf ("Evaluated %u predefined names in the namespace\n", Info.Count); } @@ -1076,8 +1078,10 @@ AcpiDbEvaluateOnePredefinedName ( case ACPI_TYPE_STRING: - ThisParam->String.Pointer = "This is the default argument string"; - ThisParam->String.Length = strlen (ThisParam->String.Pointer); + ThisParam->String.Pointer = + "This is the default argument string"; + ThisParam->String.Length = + strlen (ThisParam->String.Pointer); break; case ACPI_TYPE_BUFFER: @@ -1116,7 +1120,8 @@ AcpiDbEvaluateOnePredefinedName ( Status = AcpiEvaluateObject (Node, NULL, &ParamObjects, &ReturnObj); - AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status)); + AcpiOsPrintf ("%-32s returned %s\n", + Pathname, AcpiFormatException (Status)); AcpiGbl_MethodExecuting = FALSE; ACPI_FREE (Pathname); @@ -1134,5 +1139,3 @@ AcpiDbEvaluateOnePredefinedName ( return (Status); } - -#endif /* ACPI_DEBUGGER */ diff --git a/source/components/debugger/dbutils.c b/source/components/debugger/dbutils.c index 4a7cf4144208..90fd949cf445 100644 --- a/source/components/debugger/dbutils.c +++ b/source/components/debugger/dbutils.c @@ -47,11 +47,10 @@ #include "acdebug.h" -#ifdef ACPI_DEBUGGER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbutils") + /* Local prototypes */ #ifdef ACPI_OBSOLETE_FUNCTIONS @@ -64,7 +63,7 @@ AcpiDbDumpBuffer ( UINT32 Address); #endif -static char *Converter = "0123456789ABCDEF"; +static char *Gbl_HexToAscii = "0123456789ABCDEF"; /******************************************************************************* @@ -127,7 +126,8 @@ AcpiDbSetOutputDestination ( AcpiGbl_DbOutputFlags = (UINT8) OutputFlags; - if ((OutputFlags & ACPI_DB_REDIRECTABLE_OUTPUT) && AcpiGbl_DbOutputToFile) + if ((OutputFlags & ACPI_DB_REDIRECTABLE_OUTPUT) && + AcpiGbl_DbOutputToFile) { AcpiDbgLevel = AcpiGbl_DbDebugLevel; } @@ -180,7 +180,7 @@ AcpiDbDumpExternalObject ( case ACPI_TYPE_INTEGER: AcpiOsPrintf ("[Integer] = %8.8X%8.8X\n", - ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); + ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); break; case ACPI_TYPE_STRING: @@ -199,8 +199,9 @@ AcpiDbDumpExternalObject ( { AcpiOsPrintf ("\n"); } - AcpiUtDebugDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), - ObjDesc->Buffer.Length, DB_BYTE_DISPLAY, _COMPONENT); + AcpiUtDebugDumpBuffer ( + ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), + ObjDesc->Buffer.Length, DB_BYTE_DISPLAY, _COMPONENT); } else { @@ -211,11 +212,12 @@ AcpiDbDumpExternalObject ( case ACPI_TYPE_PACKAGE: AcpiOsPrintf ("[Package] Contains %u Elements:\n", - ObjDesc->Package.Count); + ObjDesc->Package.Count); for (i = 0; i < ObjDesc->Package.Count; i++) { - AcpiDbDumpExternalObject (&ObjDesc->Package.Elements[i], Level+1); + AcpiDbDumpExternalObject ( + &ObjDesc->Package.Elements[i], Level+1); } break; @@ -335,12 +337,13 @@ AcpiDbLocalNsLookup ( * Lookup the name. * (Uses root node as the search starting point) */ - Status = AcpiNsLookup (NULL, InternalPath, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, - ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node); + Status = AcpiNsLookup (NULL, InternalPath, ACPI_TYPE_ANY, + ACPI_IMODE_EXECUTE, ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, + NULL, &Node); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not locate name: %s, %s\n", - Name, AcpiFormatException (Status)); + Name, AcpiFormatException (Status)); } ACPI_FREE (InternalPath); @@ -382,7 +385,7 @@ AcpiDbUint32ToHexString ( for (i = 7; i >= 0; i--) { - Buffer[i] = Converter [Value & 0x0F]; + Buffer[i] = Gbl_HexToAscii [Value & 0x0F]; Value = Value >> 4; } } @@ -504,8 +507,6 @@ AcpiDbDumpBuffer ( AcpiDbgLevel |= ACPI_LV_TABLES; AcpiUtDebugDumpBuffer (ACPI_TO_POINTER (Address), 64, DB_BYTE_DISPLAY, - ACPI_UINT32_MAX); + ACPI_UINT32_MAX); } #endif - -#endif /* ACPI_DEBUGGER */ diff --git a/source/components/debugger/dbxface.c b/source/components/debugger/dbxface.c index 6dcf1e54c8d0..a6a5a62dd9cf 100644 --- a/source/components/debugger/dbxface.c +++ b/source/components/debugger/dbxface.c @@ -45,12 +45,7 @@ #include "accommon.h" #include "amlcode.h" #include "acdebug.h" -#ifdef ACPI_DISASSEMBLER -#include "acdisasm.h" -#endif - -#ifdef ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbxface") @@ -142,7 +137,8 @@ AcpiDbStartCommand ( ACPI_DB_LINE_BUFFER_SIZE, NULL); if (ACPI_FAILURE (Status)) { - ACPI_EXCEPTION ((AE_INFO, Status, "While parsing command line")); + ACPI_EXCEPTION ((AE_INFO, Status, + "While parsing command line")); return (Status); } } @@ -196,7 +192,7 @@ AcpiDbSingleStep ( } AmlOffset = (UINT32) ACPI_PTR_DIFF (Op->Common.Aml, - WalkState->ParserState.AmlStart); + WalkState->ParserState.AmlStart); /* Check for single-step breakpoint */ @@ -400,7 +396,7 @@ AcpiDbSingleStep ( /******************************************************************************* * - * FUNCTION: AcpiDbInitialize + * FUNCTION: AcpiInitializeDebugger * * PARAMETERS: None * @@ -411,13 +407,13 @@ AcpiDbSingleStep ( ******************************************************************************/ ACPI_STATUS -AcpiDbInitialize ( +AcpiInitializeDebugger ( void) { ACPI_STATUS Status; - ACPI_FUNCTION_TRACE (DbInitialize); + ACPI_FUNCTION_TRACE (AcpiInitializeDebugger); /* Init globals */ @@ -430,8 +426,6 @@ AcpiDbInitialize ( AcpiGbl_DbConsoleDebugLevel = ACPI_NORMAL_DEFAULT | ACPI_LV_TABLES; AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT; - AcpiGbl_DbOpt_Disasm = FALSE; - AcpiGbl_DbOpt_Verbose = TRUE; AcpiGbl_DbOpt_NoIniMethods = FALSE; AcpiGbl_DbBuffer = AcpiOsAllocate (ACPI_DEBUG_BUFFER_SIZE); @@ -472,26 +466,25 @@ AcpiDbInitialize ( /* Create the debug execution thread to execute commands */ - Status = AcpiOsExecute (OSL_DEBUGGER_THREAD, AcpiDbExecuteThread, NULL); + Status = AcpiOsExecute (OSL_DEBUGGER_THREAD, + AcpiDbExecuteThread, NULL); if (ACPI_FAILURE (Status)) { - ACPI_EXCEPTION ((AE_INFO, Status, "Could not start debugger thread")); + ACPI_EXCEPTION ((AE_INFO, Status, + "Could not start debugger thread")); return_ACPI_STATUS (Status); } } - if (!AcpiGbl_DbOpt_Verbose) - { - AcpiGbl_DbOpt_Disasm = TRUE; - } - return_ACPI_STATUS (AE_OK); } +ACPI_EXPORT_SYMBOL (AcpiInitializeDebugger) + /******************************************************************************* * - * FUNCTION: AcpiDbTerminate + * FUNCTION: AcpiTerminateDebugger * * PARAMETERS: None * @@ -502,7 +495,7 @@ AcpiDbInitialize ( ******************************************************************************/ void -AcpiDbTerminate ( +AcpiTerminateDebugger ( void) { @@ -517,6 +510,8 @@ AcpiDbTerminate ( AcpiGbl_DbOutputFlags = ACPI_DB_DISABLE_OUTPUT; } +ACPI_EXPORT_SYMBOL (AcpiTerminateDebugger) + #ifdef ACPI_OBSOLETE_FUNCTIONS /******************************************************************************* @@ -546,5 +541,3 @@ AcpiDbMethodEnd ( AcpiDbStartCommand (WalkState, NULL); } #endif - -#endif /* ACPI_DEBUGGER */ diff --git a/source/components/disassembler/dmbuffer.c b/source/components/disassembler/dmbuffer.c index 2291bb2c8d22..7bab89fe4140 100644 --- a/source/components/disassembler/dmbuffer.c +++ b/source/components/disassembler/dmbuffer.c @@ -50,8 +50,6 @@ #include "acinterp.h" -#ifdef ACPI_DISASSEMBLER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dmbuffer") @@ -773,22 +771,19 @@ AcpiDmPldBuffer ( AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Reference", PldInfo->Reference); AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Rotation", PldInfo->Rotation); - if (ByteCount < ACPI_PLD_REV1_BUFFER_SIZE) - { - AcpiOsPrintf (ACPI_PLD_OUTPUT08P, "PLD_Order", PldInfo->Order); - } - else + if (ByteCount >= ACPI_PLD_REV2_BUFFER_SIZE) { AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Order", PldInfo->Order); - } - /* Fifth 32-bit dword */ + /* Fifth 32-bit dword */ - if (ByteCount >= ACPI_PLD_REV1_BUFFER_SIZE) - { - AcpiOsPrintf (ACPI_PLD_OUTPUT16, "PLD_VerticalOffset", PldInfo->VerticalOffset); + AcpiOsPrintf (ACPI_PLD_OUTPUT16, "PLD_VerticalOffset", PldInfo->VerticalOffset); AcpiOsPrintf (ACPI_PLD_OUTPUT16P, "PLD_HorizontalOffset", PldInfo->HorizontalOffset); } + else /* Rev 1 buffer */ + { + AcpiOsPrintf (ACPI_PLD_OUTPUT08P, "PLD_Order", PldInfo->Order); + } ACPI_FREE (PldInfo); } @@ -1030,5 +1025,3 @@ AcpiDmDecompressEisaId ( AcpiOsPrintf (" /* %s */", Info->Description); } } - -#endif diff --git a/source/components/disassembler/dmcstyle.c b/source/components/disassembler/dmcstyle.c index a6ec689e157e..04436a846c03 100644 --- a/source/components/disassembler/dmcstyle.c +++ b/source/components/disassembler/dmcstyle.c @@ -45,10 +45,8 @@ #include "accommon.h" #include "acparser.h" #include "amlcode.h" -#include "acdisasm.h" #include "acdebug.h" -#ifdef ACPI_DISASSEMBLER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dmcstyle") @@ -826,5 +824,3 @@ AcpiDmIsTargetAnOperand ( } return (TRUE); } - -#endif diff --git a/source/components/disassembler/dmnames.c b/source/components/disassembler/dmnames.c index fc6a2cc6c381..99ca38e20fe7 100644 --- a/source/components/disassembler/dmnames.c +++ b/source/components/disassembler/dmnames.c @@ -48,8 +48,6 @@ #include "acdisasm.h" -#ifdef ACPI_DISASSEMBLER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dmnames") @@ -414,6 +412,8 @@ AcpiDmValidateName ( char *Name, ACPI_PARSE_OBJECT *Op) { + ACPI_PARSE_OBJECT *TargetOp; + if ((!Name) || (!Op->Common.Parent)) @@ -427,9 +427,6 @@ AcpiDmValidateName ( " /**** Name not found or not accessible from this scope ****/ "); } - ACPI_PARSE_OBJECT *TargetOp; - - if ((!Name) || (!Op->Common.Parent)) { @@ -450,5 +447,3 @@ AcpiDmValidateName ( } } #endif - -#endif diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c index 35f9eef8251d..1d52cd794c3d 100644 --- a/source/components/disassembler/dmopcode.c +++ b/source/components/disassembler/dmopcode.c @@ -45,12 +45,10 @@ #include "accommon.h" #include "acparser.h" #include "amlcode.h" -#include "acdisasm.h" #include "acinterp.h" #include "acnamesp.h" #include "acdebug.h" -#ifdef ACPI_DISASSEMBLER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dmopcode") @@ -978,5 +976,3 @@ AcpiDmDisassembleOneOp ( break; } } - -#endif /* ACPI_DISASSEMBLER */ diff --git a/source/components/disassembler/dmresrc.c b/source/components/disassembler/dmresrc.c index d1c3abc6f60b..a12f0a95b7bd 100644 --- a/source/components/disassembler/dmresrc.c +++ b/source/components/disassembler/dmresrc.c @@ -46,7 +46,6 @@ #include "amlcode.h" #include "acdisasm.h" -#ifdef ACPI_DISASSEMBLER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbresrc") @@ -444,5 +443,3 @@ AcpiDmIsResourceTemplate ( */ return (AE_OK); } - -#endif diff --git a/source/components/disassembler/dmresrcl.c b/source/components/disassembler/dmresrcl.c index 9cdb24c35bfc..9a02058f3eeb 100644 --- a/source/components/disassembler/dmresrcl.c +++ b/source/components/disassembler/dmresrcl.c @@ -46,8 +46,6 @@ #include "acdisasm.h" -#ifdef ACPI_DISASSEMBLER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbresrcl") @@ -1079,5 +1077,3 @@ AcpiDmVendorLargeDescriptor ( ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_LARGE_HEADER)), Length, Level); } - -#endif diff --git a/source/components/disassembler/dmresrcl2.c b/source/components/disassembler/dmresrcl2.c index a43a605c8327..76ef29975e39 100644 --- a/source/components/disassembler/dmresrcl2.c +++ b/source/components/disassembler/dmresrcl2.c @@ -46,8 +46,6 @@ #include "acdisasm.h" -#ifdef ACPI_DISASSEMBLER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbresrcl2") @@ -726,5 +724,3 @@ AcpiDmSerialBusDescriptor ( SerialBusResourceDispatch [Resource->CommonSerialBus.Type] ( Info, Resource, Length, Level); } - -#endif diff --git a/source/components/disassembler/dmresrcs.c b/source/components/disassembler/dmresrcs.c index 8924cf9dfc0e..d1165b16c297 100644 --- a/source/components/disassembler/dmresrcs.c +++ b/source/components/disassembler/dmresrcs.c @@ -46,8 +46,6 @@ #include "acdisasm.h" -#ifdef ACPI_DISASSEMBLER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbresrcs") @@ -368,5 +366,3 @@ AcpiDmVendorSmallDescriptor ( ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_SMALL_HEADER)), Length, Level); } - -#endif diff --git a/source/components/disassembler/dmutils.c b/source/components/disassembler/dmutils.c index cf8cf4a9f346..8958e0601012 100644 --- a/source/components/disassembler/dmutils.c +++ b/source/components/disassembler/dmutils.c @@ -50,7 +50,6 @@ #include <acnamesp.h> #endif -#ifdef ACPI_DISASSEMBLER #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dmutils") @@ -329,5 +328,3 @@ AcpiDmCommaIfFieldMember ( AcpiOsPrintf (", "); } } - -#endif diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c index 8ae0dc8d86d2..8cbc1c3f9a7e 100644 --- a/source/components/disassembler/dmwalk.c +++ b/source/components/disassembler/dmwalk.c @@ -45,12 +45,9 @@ #include "accommon.h" #include "acparser.h" #include "amlcode.h" -#include "acdisasm.h" #include "acdebug.h" -#ifdef ACPI_DISASSEMBLER - #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dmwalk") @@ -117,10 +114,11 @@ AcpiDmDisassemble ( return; } - Info.Flags = 0; - Info.Level = 0; - Info.Count = 0; + memset (&Info, 0, sizeof (ACPI_OP_WALK_INFO)); Info.WalkState = WalkState; + Info.StartAml = Op->Common.Aml - sizeof (ACPI_TABLE_HEADER); + Info.AmlOffset = Op->Common.Aml - Info.StartAml; + AcpiDmWalkParseTree (Op, AcpiDmDescendingOp, AcpiDmAscendingOp, &Info); return; } @@ -415,20 +413,40 @@ AcpiDmDescendingOp ( UINT32 AmlOffset; - if (AcpiGbl_DbOpt_Verbose && AcpiGbl_PreviousOp) + OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); + + /* Listing support to dump the AML code after the ASL statement */ + + if (AcpiGbl_DmOpt_Listing) { - /* Dump the entire statement in AML byte code */ + /* We only care about these classes of objects */ - if (Op->Common.Aml > AcpiGbl_PreviousOp->Common.Aml) + if ((OpInfo->Class == AML_CLASS_NAMED_OBJECT) || + (OpInfo->Class == AML_CLASS_CONTROL) || + (OpInfo->Class == AML_CLASS_CREATE) || + ((OpInfo->Class == AML_CLASS_EXECUTE) && (!Op->Common.Next))) { - AcpiOsPrintf ("\n"); - AcpiUtDumpBuffer (AcpiGbl_PreviousOp->Common.Aml, - (Op->Common.Aml - AcpiGbl_PreviousOp->Common.Aml), - DB_BYTE_DISPLAY, 0); - AcpiDmIndent (Level); + if (AcpiGbl_DmOpt_Listing && Info->PreviousAml) + { + /* Dump the AML byte code for the previous Op */ + + if (Op->Common.Aml > Info->PreviousAml) + { + AcpiOsPrintf ("\n"); + AcpiUtDumpBuffer ( + (Info->StartAml + Info->AmlOffset), + (Op->Common.Aml - Info->PreviousAml), + DB_BYTE_DISPLAY, + Info->AmlOffset); + AcpiOsPrintf ("\n"); + } + + Info->AmlOffset = (Op->Common.Aml - Info->StartAml); + } + + Info->PreviousAml = Op->Common.Aml; } } - AcpiGbl_PreviousOp = Op; if (Op->Common.DisasmFlags & ACPI_PARSEOP_IGNORE) { @@ -447,10 +465,13 @@ AcpiDmDescendingOp ( { AmlOffset = (UINT32) ACPI_PTR_DIFF (Op->Common.Aml, Info->WalkState->ParserState.AmlStart); - VERBOSE_PRINT ((DB_FULL_OP_INFO, - (Info->WalkState->MethodNode ? - Info->WalkState->MethodNode->Name.Ascii : " "), - AmlOffset, (UINT32) Op->Common.AmlOpcode)); + if (AcpiGbl_DmOpt_Verbose) + { + AcpiOsPrintf (DB_FULL_OP_INFO, + (Info->WalkState->MethodNode ? + Info->WalkState->MethodNode->Name.Ascii : " "), + AmlOffset, (UINT32) Op->Common.AmlOpcode); + } } if (Op->Common.AmlOpcode == AML_SCOPE_OP) @@ -541,8 +562,6 @@ AcpiDmDescendingOp ( /* Start the opcode argument list if necessary */ - OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - if ((OpInfo->Flags & AML_HAS_ARGS) || (Op->Common.AmlOpcode == AML_EVENT_OP)) { @@ -582,7 +601,7 @@ AcpiDmDescendingOp ( if (Op->Common.AmlOpcode != AML_INT_NAMEDFIELD_OP) { - if (AcpiGbl_DbOpt_Verbose) + if (AcpiGbl_DmOpt_Verbose) { (void) AcpiPsDisplayObjectPathname (NULL, Op); } @@ -1046,5 +1065,3 @@ AcpiDmAscendingOp ( return (AE_OK); } - -#endif /* ACPI_DISASSEMBLER */ diff --git a/source/components/dispatcher/dscontrol.c b/source/components/dispatcher/dscontrol.c index 03ba14c5b271..fed1f4a9ed3f 100644 --- a/source/components/dispatcher/dscontrol.c +++ b/source/components/dispatcher/dscontrol.c @@ -221,7 +221,7 @@ AcpiDsExecEndControlOp ( * loop does not implement a timeout. */ ControlState->Control.LoopCount++; - if (ControlState->Control.LoopCount > ACPI_MAX_LOOP_ITERATIONS) + if (ControlState->Control.LoopCount > AcpiGbl_MaxLoopIterations) { Status = AE_AML_INFINITE_LOOP; break; diff --git a/source/components/dispatcher/dsdebug.c b/source/components/dispatcher/dsdebug.c index 527bbf7461d2..b28f44362087 100644 --- a/source/components/dispatcher/dsdebug.c +++ b/source/components/dispatcher/dsdebug.c @@ -96,7 +96,7 @@ AcpiDsPrintNodePathname ( Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiNsHandleToPathname (Node, &Buffer, FALSE); + Status = AcpiNsHandleToPathname (Node, &Buffer, TRUE); if (ACPI_SUCCESS (Status)) { if (Message) diff --git a/source/components/dispatcher/dsinit.c b/source/components/dispatcher/dsinit.c index aabd30b29448..b3a9bdcf45d7 100644 --- a/source/components/dispatcher/dsinit.c +++ b/source/components/dispatcher/dsinit.c @@ -255,10 +255,19 @@ AcpiDsInitializeObjects ( return_ACPI_STATUS (Status); } + /* DSDT is always the first AML table */ + + if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT)) + { + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "\nInitializing Namespace objects:\n")); + } + + /* Summary of objects initialized */ + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, - "Table [%4.4s] (id %4.4X) - %4u Objects with %3u Devices, " - "%3u Regions, %3u Methods (%u/%u/%u Serial/Non/Cvt)\n", - Table->Signature, OwnerId, Info.ObjectCount, Info.DeviceCount, + "Table [%4.4s:%8.8s] (id %.2X) - %4u Objects with %3u Devices, " + "%3u Regions, %4u Methods (%u/%u/%u Serial/Non/Cvt)\n", + Table->Signature, Table->OemTableId, OwnerId, Info.ObjectCount, Info.DeviceCount, Info.OpRegionCount, Info.MethodCount, Info.SerialMethodCount, Info.NonSerialMethodCount, Info.SerializedMethodCount)); diff --git a/source/components/dispatcher/dsopcode.c b/source/components/dispatcher/dsopcode.c index afe1fe64d4ab..ede5f416b971 100644 --- a/source/components/dispatcher/dsopcode.c +++ b/source/components/dispatcher/dsopcode.c @@ -513,8 +513,8 @@ AcpiDsEvalTableRegionOperands ( ACPI_OPERAND_OBJECT **Operand; ACPI_NAMESPACE_NODE *Node; ACPI_PARSE_OBJECT *NextOp; - UINT32 TableIndex; ACPI_TABLE_HEADER *Table; + UINT32 TableIndex; ACPI_FUNCTION_TRACE_PTR (DsEvalTableRegionOperands, Op); @@ -540,6 +540,8 @@ AcpiDsEvalTableRegionOperands ( return_ACPI_STATUS (Status); } + Operand = &WalkState->Operands[0]; + /* * Resolve the Signature string, OemId string, * and OemTableId string operands @@ -548,49 +550,57 @@ AcpiDsEvalTableRegionOperands ( ACPI_WALK_OPERANDS, WalkState); if (ACPI_FAILURE (Status)) { - return_ACPI_STATUS (Status); + goto Cleanup; } - Operand = &WalkState->Operands[0]; - /* Find the ACPI table */ - Status = AcpiTbFindTable (Operand[0]->String.Pointer, - Operand[1]->String.Pointer, Operand[2]->String.Pointer, - &TableIndex); + Status = AcpiTbFindTable ( + Operand[0]->String.Pointer, + Operand[1]->String.Pointer, + Operand[2]->String.Pointer, &TableIndex); if (ACPI_FAILURE (Status)) { - return_ACPI_STATUS (Status); + if (Status == AE_NOT_FOUND) + { + ACPI_ERROR ((AE_INFO, + "ACPI Table [%4.4s] OEM:(%s, %s) not found in RSDT/XSDT", + Operand[0]->String.Pointer, + Operand[1]->String.Pointer, + Operand[2]->String.Pointer)); + } + goto Cleanup; } - AcpiUtRemoveReference (Operand[0]); - AcpiUtRemoveReference (Operand[1]); - AcpiUtRemoveReference (Operand[2]); - Status = AcpiGetTableByIndex (TableIndex, &Table); if (ACPI_FAILURE (Status)) { - return_ACPI_STATUS (Status); + goto Cleanup; } ObjDesc = AcpiNsGetAttachedObject (Node); if (!ObjDesc) { - return_ACPI_STATUS (AE_NOT_EXIST); + Status = AE_NOT_EXIST; + goto Cleanup; } ObjDesc->Region.Address = ACPI_PTR_TO_PHYSADDR (Table); ObjDesc->Region.Length = Table->Length; ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n", - ObjDesc, - ACPI_FORMAT_UINT64 (ObjDesc->Region.Address), + ObjDesc, ACPI_FORMAT_UINT64 (ObjDesc->Region.Address), ObjDesc->Region.Length)); /* Now the address and length are valid for this opregion */ ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID; +Cleanup: + AcpiUtRemoveReference (Operand[0]); + AcpiUtRemoveReference (Operand[1]); + AcpiUtRemoveReference (Operand[2]); + return_ACPI_STATUS (Status); } diff --git a/source/components/events/evregion.c b/source/components/events/evregion.c index 638950f5e90c..298a1dbf535e 100644 --- a/source/components/events/evregion.c +++ b/source/components/events/evregion.c @@ -660,10 +660,17 @@ AcpiEvExecuteRegMethods ( ACPI_ADR_SPACE_TYPE SpaceId) { ACPI_STATUS Status; + ACPI_REG_WALK_INFO Info; ACPI_FUNCTION_TRACE (EvExecuteRegMethods); + Info.SpaceId = SpaceId; + Info.RegRunCount = 0; + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, + " Running _REG methods for SpaceId %s\n", + AcpiUtGetRegionName (Info.SpaceId))); /* * Run all _REG methods for all Operation Regions for this space ID. This @@ -672,8 +679,7 @@ AcpiEvExecuteRegMethods ( * regions of this Space ID before we can run any _REG methods) */ Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX, - ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL, - &SpaceId, NULL); + ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL, &Info, NULL); /* Special case for EC: handle "orphan" _REG methods with no region */ @@ -682,6 +688,10 @@ AcpiEvExecuteRegMethods ( AcpiEvOrphanEcRegMethod (Node); } + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, + " Executed %u _REG methods for SpaceId %s\n", + Info.RegRunCount, AcpiUtGetRegionName (Info.SpaceId))); + return_ACPI_STATUS (Status); } @@ -705,11 +715,11 @@ AcpiEvRegRun ( { ACPI_OPERAND_OBJECT *ObjDesc; ACPI_NAMESPACE_NODE *Node; - ACPI_ADR_SPACE_TYPE SpaceId; ACPI_STATUS Status; + ACPI_REG_WALK_INFO *Info; - SpaceId = *ACPI_CAST_PTR (ACPI_ADR_SPACE_TYPE, Context); + Info = ACPI_CAST_PTR (ACPI_REG_WALK_INFO, Context); /* Convert and validate the device handle */ @@ -741,13 +751,14 @@ AcpiEvRegRun ( /* Object is a Region */ - if (ObjDesc->Region.SpaceId != SpaceId) + if (ObjDesc->Region.SpaceId != Info->SpaceId) { /* This region is for a different address space, just ignore it */ return (AE_OK); } + Info->RegRunCount++; Status = AcpiEvExecuteRegMethod (ObjDesc, ACPI_REG_CONNECT); return (Status); } diff --git a/source/components/executer/exconfig.c b/source/components/executer/exconfig.c index 85389dde258b..361367d67914 100644 --- a/source/components/executer/exconfig.c +++ b/source/components/executer/exconfig.c @@ -178,15 +178,6 @@ AcpiExLoadTableOp ( ACPI_FUNCTION_TRACE (ExLoadTableOp); - /* Validate lengths for the Signature, OemId, and OemTableId strings */ - - if ((Operand[0]->String.Length > ACPI_NAME_SIZE) || - (Operand[1]->String.Length > ACPI_OEM_ID_SIZE) || - (Operand[2]->String.Length > ACPI_OEM_TABLE_ID_SIZE)) - { - return_ACPI_STATUS (AE_AML_STRING_LIMIT); - } - /* Find the ACPI table in the RSDT/XSDT */ Status = AcpiTbFindTable ( diff --git a/source/components/executer/exdump.c b/source/components/executer/exdump.c index 3142e62c088b..f64c6ff42612 100644 --- a/source/components/executer/exdump.c +++ b/source/components/executer/exdump.c @@ -1040,7 +1040,7 @@ AcpiExDumpReferenceObj ( AcpiOsPrintf (" %p ", ObjDesc->Reference.Node); Status = AcpiNsHandleToPathname (ObjDesc->Reference.Node, - &RetBuf, FALSE); + &RetBuf, TRUE); if (ACPI_FAILURE (Status)) { AcpiOsPrintf (" Could not convert name to pathname\n"); diff --git a/source/components/executer/exresnte.c b/source/components/executer/exresnte.c index 63b37b012bb6..0aa52629e85e 100644 --- a/source/components/executer/exresnte.c +++ b/source/components/executer/exresnte.c @@ -134,7 +134,7 @@ AcpiExResolveNodeToValue ( { ACPI_ERROR ((AE_INFO, "No object attached to node [%4.4s] %p", Node->Name.Ascii, Node)); - return_ACPI_STATUS (AE_AML_NO_OPERAND); + return_ACPI_STATUS (AE_AML_UNINITIALIZED_NODE); } /* diff --git a/source/components/executer/exresolv.c b/source/components/executer/exresolv.c index f97263c33f6c..868c90d07e5c 100644 --- a/source/components/executer/exresolv.c +++ b/source/components/executer/exresolv.c @@ -351,8 +351,8 @@ AcpiExResolveMultiple ( ACPI_OBJECT_TYPE *ReturnType, ACPI_OPERAND_OBJECT **ReturnDesc) { - ACPI_OPERAND_OBJECT *ObjDesc = (void *) Operand; - ACPI_NAMESPACE_NODE *Node; + ACPI_OPERAND_OBJECT *ObjDesc = ACPI_CAST_PTR (void, Operand); + ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Operand); ACPI_OBJECT_TYPE Type; ACPI_STATUS Status; @@ -372,7 +372,7 @@ AcpiExResolveMultiple ( case ACPI_DESC_TYPE_NAMED: Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type; - ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc); + ObjDesc = AcpiNsGetAttachedObject (Node); /* If we had an Alias node, use the attached object for type info */ @@ -381,6 +381,14 @@ AcpiExResolveMultiple ( Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type; ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc); } + + if (!ObjDesc) + { + ACPI_ERROR ((AE_INFO, + "[%4.4s] Node is unresolved or uninitialized", + AcpiUtGetNodeName (Node))); + return_ACPI_STATUS (AE_AML_UNINITIALIZED_NODE); + } break; default: diff --git a/source/components/hardware/hwxfsleep.c b/source/components/hardware/hwxfsleep.c index 1642aa3e0d0d..892c4a092d23 100644 --- a/source/components/hardware/hwxfsleep.c +++ b/source/components/hardware/hwxfsleep.c @@ -169,21 +169,9 @@ AcpiSetFirmwareWakingVector ( ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector); - /* If Hardware Reduced flag is set, there is no FACS */ - - if (AcpiGbl_ReducedHardware) - { - return_ACPI_STATUS (AE_OK); - } - - if (AcpiGbl_Facs32) - { - (void) AcpiHwSetFirmwareWakingVector (AcpiGbl_Facs32, - PhysicalAddress, PhysicalAddress64); - } - if (AcpiGbl_Facs64) + if (AcpiGbl_FACS) { - (void) AcpiHwSetFirmwareWakingVector (AcpiGbl_Facs64, + (void) AcpiHwSetFirmwareWakingVector (AcpiGbl_FACS, PhysicalAddress, PhysicalAddress64); } diff --git a/source/components/namespace/nseval.c b/source/components/namespace/nseval.c index 6ab6a93a4771..bc7cdcfcc688 100644 --- a/source/components/namespace/nseval.c +++ b/source/components/namespace/nseval.c @@ -284,6 +284,7 @@ AcpiNsEvaluate ( if (ACPI_FAILURE (Status)) { + Info->ReturnObject = NULL; goto Cleanup; } @@ -489,7 +490,8 @@ AcpiNsExecModuleCode ( Status = AcpiNsEvaluate (Info); - ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "Executed module-level code at %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_INIT_NAMES, + "Executed module-level code at %p\n", MethodObj->Method.AmlStart)); /* Delete a possible implicit return value (in slack mode) */ diff --git a/source/components/namespace/nsload.c b/source/components/namespace/nsload.c index b6f85ba031ad..f893348e9670 100644 --- a/source/components/namespace/nsload.c +++ b/source/components/namespace/nsload.c @@ -128,7 +128,21 @@ AcpiNsLoadTable ( } else { - (void) AcpiTbReleaseOwnerId (TableIndex); + /* + * On error, delete any namespace objects created by this table. + * We cannot initialize these objects, so delete them. There are + * a couple of expecially bad cases: + * AE_ALREADY_EXISTS - namespace collision. + * AE_NOT_FOUND - the target of a Scope operator does not + * exist. This target of Scope must already exist in the + * namespace, as per the ACPI specification. + */ + (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); + AcpiNsDeleteNamespaceByOwner ( + AcpiGbl_RootTableList.Tables[TableIndex].OwnerId); + AcpiTbReleaseOwnerId (TableIndex); + + return_ACPI_STATUS (Status); } Unlock: diff --git a/source/components/namespace/nsutils.c b/source/components/namespace/nsutils.c index 83d75d0207ed..35a96c1b4b02 100644 --- a/source/components/namespace/nsutils.c +++ b/source/components/namespace/nsutils.c @@ -90,7 +90,7 @@ AcpiNsPrintNodePathname ( Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiNsHandleToPathname (Node, &Buffer, FALSE); + Status = AcpiNsHandleToPathname (Node, &Buffer, TRUE); if (ACPI_SUCCESS (Status)) { if (Message) @@ -697,6 +697,24 @@ AcpiNsTerminate ( ACPI_FUNCTION_TRACE (NsTerminate); +#ifdef ACPI_EXEC_APP + { + ACPI_OPERAND_OBJECT *Prev; + ACPI_OPERAND_OBJECT *Next; + + /* Delete any module-level code blocks */ + + Next = AcpiGbl_ModuleCodeList; + while (Next) + { + Prev = Next; + Next = Next->Method.Mutex; + Prev->Method.Mutex = NULL; /* Clear the Mutex (cheated) field */ + AcpiUtRemoveReference (Prev); + } + } +#endif + /* * Free the entire namespace -- all nodes and all objects * attached to the nodes diff --git a/source/components/parser/psloop.c b/source/components/parser/psloop.c index 7c079444bb11..244037fac11f 100644 --- a/source/components/parser/psloop.c +++ b/source/components/parser/psloop.c @@ -318,6 +318,9 @@ AcpiPsLinkModuleCode ( ACPI_NAMESPACE_NODE *ParentNode; + ACPI_FUNCTION_TRACE (PsLinkModuleCode); + + /* Get the tail of the list */ Prev = Next = AcpiGbl_ModuleCodeList; @@ -339,9 +342,12 @@ AcpiPsLinkModuleCode ( MethodObj = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); if (!MethodObj) { - return; + return_VOID; } + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, + "Create/Link new code block: %p\n", MethodObj)); + if (ParentOp->Common.Node) { ParentNode = ParentOp->Common.Node; @@ -374,8 +380,13 @@ AcpiPsLinkModuleCode ( } else { + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, + "Appending to existing code block: %p\n", Prev)); + Prev->Method.AmlLength += AmlLength; } + + return_VOID; } /******************************************************************************* diff --git a/source/components/resources/rsdump.c b/source/components/resources/rsdump.c index 9b4ab99ee9ec..666331728329 100644 --- a/source/components/resources/rsdump.c +++ b/source/components/resources/rsdump.c @@ -51,7 +51,6 @@ /* * All functions in this module are used by the AML Debugger only */ -#if defined(ACPI_DEBUGGER) /* Local prototypes */ @@ -667,5 +666,3 @@ AcpiRsDumpWordList ( "Word", i, Data[i]); } } - -#endif diff --git a/source/components/tables/tbfadt.c b/source/components/tables/tbfadt.c index 871eb880ae9f..bcbf576bc368 100644 --- a/source/components/tables/tbfadt.c +++ b/source/components/tables/tbfadt.c @@ -376,7 +376,7 @@ AcpiTbParseFadt ( /* Obtain the DSDT and FACS tables via their addresses within the FADT */ AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XDsdt, - ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT); + ACPI_SIG_DSDT, &AcpiGbl_DsdtIndex); /* If Hardware Reduced flag is set, there is no FACS */ @@ -385,12 +385,12 @@ AcpiTbParseFadt ( if (AcpiGbl_FADT.Facs) { AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.Facs, - ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS); + ACPI_SIG_FACS, &AcpiGbl_FacsIndex); } if (AcpiGbl_FADT.XFacs) { AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs, - ACPI_SIG_FACS, ACPI_TABLE_INDEX_X_FACS); + ACPI_SIG_FACS, &AcpiGbl_XFacsIndex); } } } diff --git a/source/components/tables/tbfind.c b/source/components/tables/tbfind.c index af790924105c..4d360ae8bee3 100644 --- a/source/components/tables/tbfind.c +++ b/source/components/tables/tbfind.c @@ -73,14 +73,29 @@ AcpiTbFindTable ( char *OemTableId, UINT32 *TableIndex) { - UINT32 i; ACPI_STATUS Status; ACPI_TABLE_HEADER Header; + UINT32 i; ACPI_FUNCTION_TRACE (TbFindTable); + /* Validate the input table signature */ + + if (!AcpiIsValidSignature (Signature)) + { + return_ACPI_STATUS (AE_BAD_SIGNATURE); + } + + /* Don't allow the OEM strings to be too long */ + + if ((strlen (OemId) > ACPI_OEM_ID_SIZE) || + (strlen (OemTableId) > ACPI_OEM_TABLE_ID_SIZE)) + { + return_ACPI_STATUS (AE_AML_STRING_LIMIT); + } + /* Normalize the input strings */ memset (&Header, 0, sizeof (ACPI_TABLE_HEADER)); diff --git a/source/components/tables/tbinstal.c b/source/components/tables/tbinstal.c index c797efb808d3..a98a68989ec4 100644 --- a/source/components/tables/tbinstal.c +++ b/source/components/tables/tbinstal.c @@ -108,9 +108,9 @@ AcpiTbCompareTables ( * * FUNCTION: AcpiTbInstallTableWithOverride * - * PARAMETERS: TableIndex - Index into root table array - * NewTableDesc - New table descriptor to install + * PARAMETERS: NewTableDesc - New table descriptor to install * Override - Whether override should be performed + * TableIndex - Where the table index is returned * * RETURN: None * @@ -123,12 +123,16 @@ AcpiTbCompareTables ( void AcpiTbInstallTableWithOverride ( - UINT32 TableIndex, ACPI_TABLE_DESC *NewTableDesc, - BOOLEAN Override) + BOOLEAN Override, + UINT32 *TableIndex) { + UINT32 i; + ACPI_STATUS Status; + - if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount) + Status = AcpiTbGetNextTableDescriptor (&i, NULL); + if (ACPI_FAILURE (Status)) { return; } @@ -145,14 +149,18 @@ AcpiTbInstallTableWithOverride ( AcpiTbOverrideTable (NewTableDesc); } - AcpiTbInitTableDescriptor (&AcpiGbl_RootTableList.Tables[TableIndex], + AcpiTbInitTableDescriptor (&AcpiGbl_RootTableList.Tables[i], NewTableDesc->Address, NewTableDesc->Flags, NewTableDesc->Pointer); AcpiTbPrintTableHeader (NewTableDesc->Address, NewTableDesc->Pointer); + /* This synchronizes AcpiGbl_DsdtIndex */ + + *TableIndex = i; + /* Set the global integer width (based upon revision of the DSDT) */ - if (TableIndex == ACPI_TABLE_INDEX_DSDT) + if (i == AcpiGbl_DsdtIndex) { AcpiUtSetIntegerWidth (NewTableDesc->Pointer->Revision); } @@ -166,7 +174,7 @@ AcpiTbInstallTableWithOverride ( * PARAMETERS: Address - Physical address of DSDT or FACS * Signature - Table signature, NULL if no need to * match - * TableIndex - Index into root table array + * TableIndex - Where the table index is returned * * RETURN: Status * @@ -179,7 +187,7 @@ ACPI_STATUS AcpiTbInstallFixedTable ( ACPI_PHYSICAL_ADDRESS Address, char *Signature, - UINT32 TableIndex) + UINT32 *TableIndex) { ACPI_TABLE_DESC NewTableDesc; ACPI_STATUS Status; @@ -214,7 +222,9 @@ AcpiTbInstallFixedTable ( goto ReleaseAndExit; } - AcpiTbInstallTableWithOverride (TableIndex, &NewTableDesc, TRUE); + /* Add the table to the global root table list */ + + AcpiTbInstallTableWithOverride (&NewTableDesc, TRUE, TableIndex); ReleaseAndExit: @@ -375,14 +385,7 @@ AcpiTbInstallStandardTable ( /* Add the table to the global root table list */ - Status = AcpiTbGetNextTableDescriptor (&i, NULL); - if (ACPI_FAILURE (Status)) - { - goto ReleaseAndExit; - } - - *TableIndex = i; - AcpiTbInstallTableWithOverride (i, &NewTableDesc, Override); + AcpiTbInstallTableWithOverride (&NewTableDesc, Override, TableIndex); ReleaseAndExit: diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c index df1e053fbfe8..988a3b18f637 100644 --- a/source/components/tables/tbutils.c +++ b/source/components/tables/tbutils.c @@ -75,6 +75,8 @@ ACPI_STATUS AcpiTbInitializeFacs ( void) { + ACPI_TABLE_FACS *Facs; + /* If Hardware Reduced flag is set, there is no FACS */ @@ -83,19 +85,18 @@ AcpiTbInitializeFacs ( AcpiGbl_FACS = NULL; return (AE_OK); } - - (void) AcpiGetTableByIndex (ACPI_TABLE_INDEX_FACS, - ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_Facs32)); - (void) AcpiGetTableByIndex (ACPI_TABLE_INDEX_X_FACS, - ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_Facs64)); - - if (AcpiGbl_Facs64 && (!AcpiGbl_Facs32 || !AcpiGbl_Use32BitFacsAddresses)) + else if (AcpiGbl_FADT.XFacs && + (!AcpiGbl_FADT.Facs || !AcpiGbl_Use32BitFacsAddresses)) { - AcpiGbl_FACS = AcpiGbl_Facs64; + (void) AcpiGetTableByIndex (AcpiGbl_XFacsIndex, + ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Facs)); + AcpiGbl_FACS = Facs; } - else if (AcpiGbl_Facs32) + else if (AcpiGbl_FADT.Facs) { - AcpiGbl_FACS = AcpiGbl_Facs32; + (void) AcpiGetTableByIndex (AcpiGbl_FacsIndex, + ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Facs)); + AcpiGbl_FACS = Facs; } /* If there is no FACS, just continue. There was already an error msg */ @@ -206,7 +207,7 @@ AcpiTbCopyDsdt ( AcpiTbUninstallTable (TableDesc); AcpiTbInitTableDescriptor ( - &AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT], + &AcpiGbl_RootTableList.Tables[AcpiGbl_DsdtIndex], ACPI_PTR_TO_PHYSADDR (NewTable), ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, NewTable); @@ -400,13 +401,6 @@ AcpiTbParseRootTable ( TableEntrySize); TableEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER)); - /* - * First three entries in the table array are reserved for the DSDT - * and 32bit/64bit FACS, which are not actually present in the - * RSDT/XSDT - they come from the FADT - */ - AcpiGbl_RootTableList.CurrentTableCount = 3; - /* Initialize the root table array from the RSDT/XSDT */ for (i = 0; i < TableCount; i++) @@ -441,3 +435,43 @@ NextTable: return_ACPI_STATUS (AE_OK); } + + +/******************************************************************************* + * + * FUNCTION: AcpiIsValidSignature + * + * PARAMETERS: Signature - Sig string to be validated + * + * RETURN: TRUE if signature is correct length and has valid characters + * + * DESCRIPTION: Validate an ACPI table signature. + * + ******************************************************************************/ + +BOOLEAN +AcpiIsValidSignature ( + char *Signature) +{ + UINT32 i; + + + /* Validate the signature length */ + + if (strlen (Signature) != ACPI_NAME_SIZE) + { + return (FALSE); + } + + /* Validate each character in the signature */ + + for (i = 0; i < ACPI_NAME_SIZE; i++) + { + if (!AcpiUtValidAcpiChar (Signature[i], i)) + { + return (FALSE); + } + } + + return (TRUE); +} diff --git a/source/components/tables/tbxfload.c b/source/components/tables/tbxfload.c index 19c31e71cf94..bd5f7d7bc41f 100644 --- a/source/components/tables/tbxfload.c +++ b/source/components/tables/tbxfload.c @@ -51,12 +51,6 @@ #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbxfload") -/* Local prototypes */ - -static ACPI_STATUS -AcpiTbLoadNamespace ( - void); - /******************************************************************************* * @@ -83,6 +77,14 @@ AcpiLoadTables ( /* Load the namespace from the tables */ Status = AcpiTbLoadNamespace (); + + /* Don't let single failures abort the load */ + + if (Status == AE_CTRL_TERMINATE) + { + Status = AE_OK; + } + if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, @@ -108,13 +110,16 @@ ACPI_EXPORT_SYMBOL_INIT (AcpiLoadTables) * ******************************************************************************/ -static ACPI_STATUS +ACPI_STATUS AcpiTbLoadNamespace ( void) { ACPI_STATUS Status; UINT32 i; ACPI_TABLE_HEADER *NewDsdt; + ACPI_TABLE_DESC *Table; + UINT32 TablesLoaded = 0; + UINT32 TablesFailed = 0; ACPI_FUNCTION_TRACE (TbLoadNamespace); @@ -126,12 +131,11 @@ AcpiTbLoadNamespace ( * Load the namespace. The DSDT is required, but any SSDT and * PSDT tables are optional. Verify the DSDT. */ + Table = &AcpiGbl_RootTableList.Tables[AcpiGbl_DsdtIndex]; + if (!AcpiGbl_RootTableList.CurrentTableCount || - !ACPI_COMPARE_NAME ( - &(AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Signature), - ACPI_SIG_DSDT) || - ACPI_FAILURE (AcpiTbValidateTable ( - &AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT]))) + !ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_DSDT) || + ACPI_FAILURE (AcpiTbValidateTable (Table))) { Status = AE_NO_ACPI_TABLES; goto UnlockAndExit; @@ -143,7 +147,7 @@ AcpiTbLoadNamespace ( * array can change dynamically as tables are loaded at run-time. Note: * .Pointer field is not validated until after call to AcpiTbValidateTable. */ - AcpiGbl_DSDT = AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer; + AcpiGbl_DSDT = Table->Pointer; /* * Optionally copy the entire DSDT to local memory (instead of simply @@ -153,7 +157,7 @@ AcpiTbLoadNamespace ( */ if (AcpiGbl_CopyDsdtLocally) { - NewDsdt = AcpiTbCopyDsdt (ACPI_TABLE_INDEX_DSDT); + NewDsdt = AcpiTbCopyDsdt (AcpiGbl_DsdtIndex); if (NewDsdt) { AcpiGbl_DSDT = NewDsdt; @@ -171,10 +175,15 @@ AcpiTbLoadNamespace ( /* Load and parse tables */ - Status = AcpiNsLoadTable (ACPI_TABLE_INDEX_DSDT, AcpiGbl_RootNode); + Status = AcpiNsLoadTable (AcpiGbl_DsdtIndex, AcpiGbl_RootNode); if (ACPI_FAILURE (Status)) { - return_ACPI_STATUS (Status); + ACPI_EXCEPTION ((AE_INFO, Status, "[DSDT] table load failed")); + TablesFailed++; + } + else + { + TablesLoaded++; } /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */ @@ -182,15 +191,13 @@ AcpiTbLoadNamespace ( (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) { + Table = &AcpiGbl_RootTableList.Tables[i]; + if (!AcpiGbl_RootTableList.Tables[i].Address || - (!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), - ACPI_SIG_SSDT) && - !ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), - ACPI_SIG_PSDT) && - !ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), - ACPI_SIG_OSDT)) || - ACPI_FAILURE (AcpiTbValidateTable ( - &AcpiGbl_RootTableList.Tables[i]))) + (!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_SSDT) && + !ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_PSDT) && + !ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_OSDT)) || + ACPI_FAILURE (AcpiTbValidateTable (Table))) { continue; } @@ -198,11 +205,41 @@ AcpiTbLoadNamespace ( /* Ignore errors while loading tables, get as many as possible */ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - (void) AcpiNsLoadTable (i, AcpiGbl_RootNode); + Status = AcpiNsLoadTable (i, AcpiGbl_RootNode); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, "(%4.4s:%8.8s) while loading table", + Table->Signature.Ascii, Table->Pointer->OemTableId)); + TablesFailed++; + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, + "Table [%4.4s:%8.8s] (id FF) - Table namespace load failed\n\n", + Table->Signature.Ascii, Table->Pointer->OemTableId)); + } + else + { + TablesLoaded++; + } + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); } - ACPI_INFO ((AE_INFO, "All ACPI Tables successfully acquired")); + if (!TablesFailed) + { + ACPI_INFO ((AE_INFO, + "%u ACPI AML tables successfully acquired and loaded", + TablesLoaded)); + } + else + { + ACPI_ERROR ((AE_INFO, + "%u table load failures, %u successful", + TablesFailed, TablesLoaded)); + + /* Indicate at least one failure */ + + Status = AE_CTRL_TERMINATE; + } UnlockAndExit: (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); diff --git a/source/components/utilities/utfileio.c b/source/components/utilities/utfileio.c index 1e524fb0fcaa..0180efea08bb 100644 --- a/source/components/utilities/utfileio.c +++ b/source/components/utilities/utfileio.c @@ -341,7 +341,8 @@ AcpiUtReadTableFromFile ( /* Get the entire file */ - fprintf (stderr, "Reading ACPI table from file %10s - Length %.8u (0x%06X)\n", + fprintf (stderr, + "Reading ACPI table from file %12s - Length %.8u (0x%06X)\n", Filename, FileSize, FileSize); Status = AcpiUtReadTable (File, Table, &TableLength); diff --git a/source/components/utilities/utinit.c b/source/components/utilities/utinit.c index 5ac47bec03cf..8f8eaaad92b9 100644 --- a/source/components/utilities/utinit.c +++ b/source/components/utilities/utinit.c @@ -227,6 +227,7 @@ AcpiUtInitGlobals ( AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING; AcpiGbl_OsiMutex = NULL; AcpiGbl_RegMethodsExecuted = FALSE; + AcpiGbl_MaxLoopIterations = 0xFFFF; /* Hardware oriented */ diff --git a/source/components/utilities/utmisc.c b/source/components/utilities/utmisc.c index a171aef2ec70..3ab7f16ade78 100644 --- a/source/components/utilities/utmisc.c +++ b/source/components/utilities/utmisc.c @@ -84,7 +84,7 @@ AcpiUtIsPciRootBridge ( } -#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP) +#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_NAMES_APP) /******************************************************************************* * * FUNCTION: AcpiUtIsAmlTable @@ -418,7 +418,7 @@ AcpiUtDisplayInitPathname ( /* Get the full pathname to the node */ Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, FALSE); + Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, TRUE); if (ACPI_FAILURE (Status)) { return; diff --git a/source/components/utilities/utxface.c b/source/components/utilities/utxface.c index 2c6ff38c8d9a..d41c93a18f86 100644 --- a/source/components/utilities/utxface.c +++ b/source/components/utilities/utxface.c @@ -99,14 +99,6 @@ AcpiTerminate ( AcpiUtMutexTerminate (); - -#ifdef ACPI_DEBUGGER - - /* Shut down the debugger */ - - AcpiDbTerminate (); -#endif - /* Now we can shutdown the OS-dependent layer */ Status = AcpiOsTerminate (); @@ -604,7 +596,7 @@ AcpiDecodePldBuffer ( /* Parameter validation */ - if (!InBuffer || !ReturnBuffer || (Length < 16)) + if (!InBuffer || !ReturnBuffer || (Length < ACPI_PLD_REV1_BUFFER_SIZE)) { return (AE_BAD_PARAMETER); } @@ -656,7 +648,7 @@ AcpiDecodePldBuffer ( PldInfo->Rotation = ACPI_PLD_GET_ROTATION (&Dword); PldInfo->Order = ACPI_PLD_GET_ORDER (&Dword); - if (Length >= ACPI_PLD_BUFFER_SIZE) + if (Length >= ACPI_PLD_REV2_BUFFER_SIZE) { /* Fifth 32-bit DWord (Revision 2 of _PLD) */ diff --git a/source/components/utilities/utxfinit.c b/source/components/utilities/utxfinit.c index 701b171f68e2..7502c61f0789 100644 --- a/source/components/utilities/utxfinit.c +++ b/source/components/utilities/utxfinit.c @@ -132,17 +132,6 @@ AcpiInitializeSubsystem ( return_ACPI_STATUS (Status); } - /* If configured, initialize the AML debugger */ - -#ifdef ACPI_DEBUGGER - Status = AcpiDbInitialize (); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, "During Debugger initialization")); - return_ACPI_STATUS (Status); - } -#endif - return_ACPI_STATUS (AE_OK); } diff --git a/source/include/acbuffer.h b/source/include/acbuffer.h index 37f4170884d8..e52bc7d2c3e0 100644 --- a/source/include/acbuffer.h +++ b/source/include/acbuffer.h @@ -157,6 +157,7 @@ typedef struct acpi_pld_info * (Intended for BIOS use only) */ #define ACPI_PLD_REV1_BUFFER_SIZE 16 /* For Revision 1 of the buffer (From ACPI spec) */ +#define ACPI_PLD_REV2_BUFFER_SIZE 20 /* For Revision 2 of the buffer (From ACPI spec) */ #define ACPI_PLD_BUFFER_SIZE 20 /* For Revision 2 of the buffer (From ACPI spec) */ /* First 32-bit dword, bits 0:32 */ diff --git a/source/include/acconfig.h b/source/include/acconfig.h index 46dbc31109cb..8441551c1c68 100644 --- a/source/include/acconfig.h +++ b/source/include/acconfig.h @@ -138,10 +138,6 @@ #define ACPI_ROOT_TABLE_SIZE_INCREMENT 4 -/* Maximum number of While() loop iterations before forced abort */ - -#define ACPI_MAX_LOOP_ITERATIONS 0xFFFF - /* Maximum sleep allowed via Sleep() operator */ #define ACPI_MAX_SLEEP 2000 /* 2000 millisec == two seconds */ diff --git a/source/include/acdebug.h b/source/include/acdebug.h index 8b6ac8956ad4..faf3c136df3d 100644 --- a/source/include/acdebug.h +++ b/source/include/acdebug.h @@ -44,6 +44,12 @@ #ifndef __ACDEBUG_H__ #define __ACDEBUG_H__ +/* The debugger is used in conjunction with the disassembler most of time */ + +#ifdef ACPI_DISASSEMBLER +#include "acdisasm.h" +#endif + #define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */ @@ -77,9 +83,6 @@ typedef struct acpi_db_execute_walk #define PARAM_LIST(pl) pl -#define DBTEST_OUTPUT_LEVEL(lvl) if (AcpiGbl_DbOpt_Verbose) -#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\ - AcpiOsPrintf PARAM_LIST(fp);} #define EX_NO_SINGLE_STEP 1 #define EX_SINGLE_STEP 2 @@ -89,14 +92,6 @@ typedef struct acpi_db_execute_walk * dbxface - external debugger interfaces */ ACPI_STATUS -AcpiDbInitialize ( - void); - -void -AcpiDbTerminate ( - void); - -ACPI_STATUS AcpiDbSingleStep ( ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h index 180f8e64ddf0..f362430bed09 100644 --- a/source/include/acdisasm.h +++ b/source/include/acdisasm.h @@ -186,13 +186,16 @@ typedef struct acpi_dmtable_data typedef struct acpi_op_walk_info { + ACPI_WALK_STATE *WalkState; + ACPI_PARSE_OBJECT *MappingOp; + UINT8 *PreviousAml; + UINT8 *StartAml; UINT32 Level; UINT32 LastLevel; UINT32 Count; UINT32 BitOffset; UINT32 Flags; - ACPI_WALK_STATE *WalkState; - ACPI_PARSE_OBJECT *MappingOp; + UINT32 AmlOffset; } ACPI_OP_WALK_INFO; diff --git a/source/include/acexcep.h b/source/include/acexcep.h index 7a3fdcb8eaff..714e3b1bf3e4 100644 --- a/source/include/acexcep.h +++ b/source/include/acexcep.h @@ -197,8 +197,9 @@ typedef struct acpi_exception_info #define AE_AML_BAD_RESOURCE_LENGTH EXCEP_AML (0x001F) #define AE_AML_ILLEGAL_ADDRESS EXCEP_AML (0x0020) #define AE_AML_INFINITE_LOOP EXCEP_AML (0x0021) +#define AE_AML_UNINITIALIZED_NODE EXCEP_AML (0x0022) -#define AE_CODE_AML_MAX 0x0021 +#define AE_CODE_AML_MAX 0x0022 /* @@ -322,7 +323,8 @@ static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Aml[] = EXCEP_TXT ("AE_AML_CIRCULAR_REFERENCE", "Two references refer to each other"), EXCEP_TXT ("AE_AML_BAD_RESOURCE_LENGTH", "The length of a Resource Descriptor in the AML is incorrect"), EXCEP_TXT ("AE_AML_ILLEGAL_ADDRESS", "A memory, I/O, or PCI configuration address is invalid"), - EXCEP_TXT ("AE_AML_INFINITE_LOOP", "An apparent infinite AML While loop, method was aborted") + EXCEP_TXT ("AE_AML_INFINITE_LOOP", "An apparent infinite AML While loop, method was aborted"), + EXCEP_TXT ("AE_AML_UNINITIALIZED_NODE", "A namespace node is uninitialized or unresolved") }; static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Ctrl[] = diff --git a/source/include/acglobal.h b/source/include/acglobal.h index eaa364d4e45c..08d60fd7b7d9 100644 --- a/source/include/acglobal.h +++ b/source/include/acglobal.h @@ -59,11 +59,12 @@ ACPI_GLOBAL (ACPI_TABLE_LIST, AcpiGbl_RootTableList); ACPI_GLOBAL (ACPI_TABLE_HEADER *, AcpiGbl_DSDT); ACPI_GLOBAL (ACPI_TABLE_HEADER, AcpiGbl_OriginalDsdtHeader); +ACPI_INIT_GLOBAL (UINT32, AcpiGbl_DsdtIndex, ACPI_INVALID_TABLE_INDEX); +ACPI_INIT_GLOBAL (UINT32, AcpiGbl_FacsIndex, ACPI_INVALID_TABLE_INDEX); +ACPI_INIT_GLOBAL (UINT32, AcpiGbl_XFacsIndex, ACPI_INVALID_TABLE_INDEX); #if (!ACPI_REDUCED_HARDWARE) ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS); -ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_Facs32); -ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_Facs64); #endif /* !ACPI_REDUCED_HARDWARE */ @@ -240,6 +241,10 @@ ACPI_INIT_GLOBAL (UINT32, AcpiGbl_NestingLevel, 0); ACPI_GLOBAL (ACPI_THREAD_STATE *, AcpiGbl_CurrentWalkList); +/* Maximum number of While() loop iterations before forced abort */ + +ACPI_GLOBAL (UINT16, AcpiGbl_MaxLoopIterations); + /* Control method single step flag */ ACPI_GLOBAL (UINT8, AcpiGbl_CmSingleStep); @@ -311,10 +316,10 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE); ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ForceAmlDisassembly, FALSE); -ACPI_INIT_GLOBAL (ACPI_PARSE_OBJECT *, AcpiGbl_PreviousOp, NULL); +ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Verbose, TRUE); -ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_Disasm); -ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_Verbose); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Disasm); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Listing); ACPI_GLOBAL (BOOLEAN, AcpiGbl_NumExternalMethods); ACPI_GLOBAL (UINT32, AcpiGbl_ResolvedExternalMethods); ACPI_GLOBAL (ACPI_EXTERNAL_LIST *, AcpiGbl_ExternalList); @@ -349,8 +354,8 @@ ACPI_GLOBAL (char, AcpiGbl_DbDebugFilename[ACPI_DB_LINE_BUF /* * Statistic globals */ -ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCount[ACPI_TYPE_NS_NODE_MAX+1]); -ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCount[ACPI_TYPE_NS_NODE_MAX+1]); +ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCount[ACPI_TOTAL_TYPES]); +ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCount[ACPI_TOTAL_TYPES]); ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCountMisc); ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCountMisc); ACPI_GLOBAL (UINT32, AcpiGbl_NumNodes); diff --git a/source/include/aclocal.h b/source/include/aclocal.h index 7f62cc8d1c09..ea3d21924da4 100644 --- a/source/include/aclocal.h +++ b/source/include/aclocal.h @@ -238,11 +238,9 @@ typedef struct acpi_table_list #define ACPI_ROOT_ALLOW_RESIZE (2) -/* Predefined (fixed) table indexes */ +/* Predefined table indexes */ -#define ACPI_TABLE_INDEX_DSDT (0) -#define ACPI_TABLE_INDEX_FACS (1) -#define ACPI_TABLE_INDEX_X_FACS (2) +#define ACPI_INVALID_TABLE_INDEX (0xFFFFFFFF) typedef struct acpi_find_context @@ -465,6 +463,16 @@ typedef struct acpi_simple_repair_info #define ACPI_NUM_RTYPES 5 /* Number of actual object types */ +/* Info for running the _REG methods */ + +typedef struct acpi_reg_walk_info +{ + ACPI_ADR_SPACE_TYPE SpaceId; + UINT32 RegRunCount; + +} ACPI_REG_WALK_INFO; + + /***************************************************************************** * * Event typedefs and structs @@ -1319,6 +1327,13 @@ typedef struct acpi_integrity_info #define ACPI_DB_DUPLICATE_OUTPUT 0x03 +typedef struct acpi_object_info +{ + UINT32 Types[ACPI_TOTAL_TYPES]; + +} ACPI_OBJECT_INFO; + + /***************************************************************************** * * Debug diff --git a/source/include/acpixf.h b/source/include/acpixf.h index 7eb0cb7b3fd1..888d6b290f0d 100644 --- a/source/include/acpixf.h +++ b/source/include/acpixf.h @@ -46,7 +46,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20150717 +#define ACPI_CA_VERSION 0x20150818 #include "acconfig.h" #include "actypes.h" @@ -1208,4 +1208,12 @@ AcpiLogError ( const char *Format, ...)) +ACPI_STATUS +AcpiInitializeDebugger ( + void); + +void +AcpiTerminateDebugger ( + void); + #endif /* __ACXFACE_H__ */ diff --git a/source/include/actables.h b/source/include/actables.h index 3eb02d34a151..0f8fdd505374 100644 --- a/source/include/actables.h +++ b/source/include/actables.h @@ -236,18 +236,30 @@ AcpiTbCopyDsdt ( void AcpiTbInstallTableWithOverride ( - UINT32 TableIndex, ACPI_TABLE_DESC *NewTableDesc, - BOOLEAN Override); + BOOLEAN Override, + UINT32 *TableIndex); ACPI_STATUS AcpiTbInstallFixedTable ( ACPI_PHYSICAL_ADDRESS Address, char *Signature, - UINT32 TableIndex); + UINT32 *TableIndex); ACPI_STATUS AcpiTbParseRootTable ( ACPI_PHYSICAL_ADDRESS RsdpAddress); +BOOLEAN +AcpiIsValidSignature ( + char *Signature); + + +/* + * tbxfload + */ +ACPI_STATUS +AcpiTbLoadNamespace ( + void); + #endif /* __ACTABLES_H__ */ diff --git a/source/include/actypes.h b/source/include/actypes.h index dbc8e3a7c95b..cbae6f0d69b9 100644 --- a/source/include/actypes.h +++ b/source/include/actypes.h @@ -674,6 +674,7 @@ typedef UINT32 ACPI_OBJECT_TYPE; #define ACPI_TYPE_DEBUG_OBJECT 0x10 #define ACPI_TYPE_EXTERNAL_MAX 0x10 +#define ACPI_NUM_TYPES (ACPI_TYPE_EXTERNAL_MAX + 1) /* * These are object types that do not map directly to the ACPI @@ -695,6 +696,7 @@ typedef UINT32 ACPI_OBJECT_TYPE; #define ACPI_TYPE_LOCAL_SCOPE 0x1B /* 1 Name, multiple ObjectList Nodes */ #define ACPI_TYPE_NS_NODE_MAX 0x1B /* Last typecode used within a NS Node */ +#define ACPI_TOTAL_TYPES (ACPI_TYPE_NS_NODE_MAX + 1) /* * These are special object types that never appear in diff --git a/source/include/acutils.h b/source/include/acutils.h index 9a05b381d1ec..1699c4ed7605 100644 --- a/source/include/acutils.h +++ b/source/include/acutils.h @@ -742,7 +742,7 @@ BOOLEAN AcpiUtIsPciRootBridge ( char *Id); -#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP) +#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_NAMES_APP) BOOLEAN AcpiUtIsAmlTable ( ACPI_TABLE_HEADER *Table); diff --git a/source/include/platform/acenv.h b/source/include/platform/acenv.h index 2a502adc4366..6150f2b5f646 100644 --- a/source/include/platform/acenv.h +++ b/source/include/platform/acenv.h @@ -71,13 +71,14 @@ #ifdef ACPI_ASL_COMPILER #define ACPI_APPLICATION -#define ACPI_DISASSEMBLER #define ACPI_DEBUG_OUTPUT #define ACPI_CONSTANT_EVAL_ONLY #define ACPI_LARGE_NAMESPACE_NODE #define ACPI_DATA_TABLE_DISASSEMBLY #define ACPI_SINGLE_THREADED #define ACPI_32BIT_PHYSICAL_ADDRESS + +#define ACPI_DISASSEMBLER 1 #endif /* AcpiExec configuration. Multithreaded with full AML debugger */ @@ -90,8 +91,8 @@ #endif /* - * AcpiBin/AcpiDump/AcpiHelp/AcpiNames/AcpiSrc/AcpiXtract/Example configuration. - * All single threaded. + * AcpiBin/AcpiDump/AcpiHelp/AcpiNames/AcpiSrc/AcpiXtract/Example + * configuration. All single threaded. */ #if (defined ACPI_BIN_APP) || \ (defined ACPI_DUMP_APP) || \ @@ -124,7 +125,7 @@ #define ACPI_USE_NATIVE_RSDP_POINTER #endif -/* AcpiDump configuration. Native mapping used if provied by OSPMs */ +/* AcpiDump configuration. Native mapping used if provided by the host */ #ifdef ACPI_DUMP_APP #define ACPI_USE_NATIVE_MEMORY_MAPPING @@ -142,6 +143,7 @@ #ifdef ACPI_LIBRARY #define ACPI_USE_LOCAL_CACHE +#define ACPI_FULL_DEBUG #endif /* Common for all ACPICA applications */ @@ -151,15 +153,14 @@ #define ACPI_USE_LOCAL_CACHE #endif -/* Common debug support */ +/* Common debug/disassembler support */ #ifdef ACPI_FULL_DEBUG -#define ACPI_DEBUGGER #define ACPI_DEBUG_OUTPUT -#define ACPI_DISASSEMBLER +#define ACPI_DEBUGGER 1 +#define ACPI_DISASSEMBLER 1 #endif - /*! [Begin] no source code translation */ /****************************************************************************** @@ -326,8 +327,8 @@ * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and * the standard header files may be used. * - * The ACPICA subsystem only uses low level C library functions that do not call - * operating system services and may therefore be inlined in the code. + * The ACPICA subsystem only uses low level C library functions that do not + * call operating system services and may therefore be inlined in the code. * * It may be necessary to tailor these include files to the target * generation environment. diff --git a/source/include/platform/acmsvc.h b/source/include/platform/acmsvc.h index c507170b7c72..8bcab84c43a7 100644 --- a/source/include/platform/acmsvc.h +++ b/source/include/platform/acmsvc.h @@ -47,6 +47,13 @@ /* Note: do not include any C library headers here */ /* + * Note: MSVC project files should define ACPI_DEBUGGER and ACPI_DISASSEMBLER + * as appropriate to enable editor functions like "Find all references". + * The editor isn't smart enough to dig through the include files to find + * out if these are actually defined. + */ + +/* * Map low I/O functions for MS. This allows us to disable MS language * extensions for maximum portability. */ diff --git a/source/tools/acpiexec/aeexec.c b/source/tools/acpiexec/aeexec.c index 28ac7afb25f5..518c20e94520 100644 --- a/source/tools/acpiexec/aeexec.c +++ b/source/tools/acpiexec/aeexec.c @@ -665,7 +665,8 @@ AeMiscellaneousTests ( ReturnBuf.Length = 32; ReturnBuf.Pointer = Buffer; - Status = AcpiGetName (ACPI_ROOT_OBJECT, ACPI_FULL_PATHNAME, &ReturnBuf); + Status = AcpiGetName (ACPI_ROOT_OBJECT, + ACPI_FULL_PATHNAME_NO_TRAILING, &ReturnBuf); AE_CHECK_OK (AcpiGetName, Status); /* Get Devices */ diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c index 026e5fb9ae39..6e839e9a27dc 100644 --- a/source/tools/acpiexec/aemain.c +++ b/source/tools/acpiexec/aemain.c @@ -90,12 +90,13 @@ BOOLEAN AcpiGbl_DbOpt_NoRegionSupport = FALSE; UINT8 AcpiGbl_UseHwReducedFadt = FALSE; BOOLEAN AcpiGbl_DoInterfaceTests = FALSE; BOOLEAN AcpiGbl_LoadTestTables = FALSE; +BOOLEAN AcpiGbl_AeLoadOnly = FALSE; static UINT8 AcpiGbl_ExecutionMode = AE_MODE_COMMAND_LOOP; static char BatchBuffer[AE_BUFFER_SIZE]; /* Batch command buffer */ static AE_TABLE_DESC *AeTableListHead = NULL; #define ACPIEXEC_NAME "AML Execution/Debug Utility" -#define AE_SUPPORTED_OPTIONS "?b:d:e:f^ghm^orv^:x:" +#define AE_SUPPORTED_OPTIONS "?b:d:e:f^ghi:lm^rv^:x:" /* Stubs for the disassembler */ @@ -158,8 +159,12 @@ usage ( ACPI_OPTION ("-et", "Enable debug semaphore timeout"); printf ("\n"); + ACPI_OPTION ("-fi <File>", "Specify namespace initialization file"); ACPI_OPTION ("-fv <Value>", "Operation Region initialization fill value"); - ACPI_OPTION ("-fi <file>", "Specify namespace initialization file"); + printf ("\n"); + + ACPI_OPTION ("-i <Count>", "Maximum iterations for AML while loops"); + ACPI_OPTION ("-l", "Load tables and namespace only"); ACPI_OPTION ("-r", "Use hardware-reduced FADT V5"); ACPI_OPTION ("-v", "Display version information"); ACPI_OPTION ("-vi", "Verbose initialization output"); @@ -189,6 +194,7 @@ AeDoOptions ( char **argv) { int j; + UINT32 Temp; while ((j = AcpiGetopt (argc, argv, AE_SUPPORTED_OPTIONS)) != ACPI_OPT_END) switch (j) @@ -332,6 +338,25 @@ AeDoOptions ( usage(); return (0); + case 'i': + + Temp = strtoul (AcpiGbl_Optarg, NULL, 0); + if (!Temp || (Temp > ACPI_UINT16_MAX)) + { + printf ("%s: Invalid max loops value\n", AcpiGbl_Optarg); + return (1); + } + + AcpiGbl_MaxLoopIterations = (UINT16) Temp; + printf ("Max Loop Iterations is %u (0x%X)\n", + AcpiGbl_MaxLoopIterations, AcpiGbl_MaxLoopIterations); + break; + + case 'l': + + AcpiGbl_AeLoadOnly = TRUE; + break; + case 'm': AcpiGbl_ExecutionMode = AE_MODE_BATCH_SINGLE; @@ -349,11 +374,6 @@ AeDoOptions ( } break; - case 'o': - - AcpiGbl_DbOpt_Disasm = TRUE; - break; - case 'r': AcpiGbl_UseHwReducedFadt = TRUE; @@ -444,6 +464,20 @@ main ( goto ErrorExit; } + /* ACPICA runtime configuration */ + + AcpiGbl_MaxLoopIterations = 400; + + + /* Initialize the AML debugger */ + + Status = AcpiInitializeDebugger (); + AE_CHECK_OK (AcpiInitializeDebugger, Status); + if (ACPI_FAILURE (Status)) + { + goto ErrorExit; + } + printf (ACPI_COMMON_SIGNON (ACPIEXEC_NAME)); if (argc < 2) { @@ -478,7 +512,7 @@ main ( Status = AcpiUtReadTableFromFile (argv[AcpiGbl_Optind], &Table); if (ACPI_FAILURE (Status)) { - printf ("**** Could not get table from file %s, %s\n", + fprintf (stderr, "**** Could not get table from file %s, %s\n", argv[AcpiGbl_Optind], AcpiFormatException (Status)); goto ErrorExit; } @@ -488,9 +522,9 @@ main ( if (!ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FADT) && !AcpiUtIsAmlTable (Table)) { - ACPI_INFO ((AE_INFO, - "Table [%4.4s] is not an AML table, ignoring", - Table->Signature)); + fprintf (stderr, " %s: [%4.4s] is not an AML table - ignoring\n", + argv[AcpiGbl_Optind], Table->Signature); + AcpiOsFree (Table); } else @@ -519,6 +553,17 @@ main ( } Status = AeInstallTables (); + + /* + * Exit namespace initialization for the "load namespace only" option. + * No control methods will be executed. However, still enter the + * the debugger. + */ + if (AcpiGbl_AeLoadOnly) + { + goto EnterDebugger; + } + if (ACPI_FAILURE (Status)) { printf ("**** Could not load ACPI tables, %s\n", @@ -602,6 +647,10 @@ EnterDebugger: case AE_MODE_BATCH_SINGLE: AcpiDbExecute (BatchBuffer, NULL, NULL, EX_NO_SINGLE_STEP); + + /* Shut down the debugger */ + + AcpiTerminateDebugger (); Status = AcpiTerminate (); break; } @@ -666,6 +715,9 @@ AcpiDbRunBatchMode ( } } + /* Shut down the debugger */ + + AcpiTerminateDebugger (); Status = AcpiTerminate (); return (Status); } diff --git a/source/tools/acpiexec/aetables.c b/source/tools/acpiexec/aetables.c index ebb6aeb0e8d6..75dea6127327 100644 --- a/source/tools/acpiexec/aetables.c +++ b/source/tools/acpiexec/aetables.c @@ -87,7 +87,6 @@ static ACPI_TABLE_XSDT *LocalXSDT; #define BASE_XSDT_SIZE ((BASE_XSDT_TABLES) * sizeof (UINT64)) #define ACPI_MAX_INIT_TABLES (32) -static ACPI_TABLE_DESC Tables[ACPI_MAX_INIT_TABLES]; /****************************************************************************** @@ -155,7 +154,13 @@ AeInitializeTableHeader ( strncpy (Header->OemId, "Intel", ACPI_OEM_ID_SIZE); strncpy (Header->OemTableId, "AcpiExec", ACPI_OEM_TABLE_ID_SIZE); strncpy (Header->AslCompilerId, "INTL", ACPI_NAME_SIZE); - Header->AslCompilerRevision = 0x20131218; + Header->AslCompilerRevision = ACPI_CA_VERSION; + + /* Set the checksum, must set to zero first */ + + Header->Checksum = 0; + Header->Checksum = (UINT8) -AcpiTbChecksum ( + (void *) Header, Header->Length); } @@ -216,8 +221,6 @@ AeBuildLocalTables ( } memset (LocalXSDT, 0, XsdtSize); - AeInitializeTableHeader ((void *) LocalXSDT, ACPI_SIG_XSDT, XsdtSize); - LocalXSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (&LocalFADT); NextIndex = 1; @@ -307,9 +310,7 @@ AeBuildLocalTables ( /* Set checksums for both XSDT and RSDP */ - LocalXSDT->Header.Checksum = 0; - LocalXSDT->Header.Checksum = (UINT8) -AcpiTbChecksum ( - (void *) LocalXSDT, LocalXSDT->Header.Length); + AeInitializeTableHeader ((void *) LocalXSDT, ACPI_SIG_XSDT, XsdtSize); LocalRSDP.Checksum = 0; LocalRSDP.Checksum = (UINT8) -AcpiTbChecksum ( @@ -334,8 +335,8 @@ AeBuildLocalTables ( if (ExternalFadt) { /* - * Use the external FADT, but we must update the DSDT/FACS addresses - * as well as the checksum + * Use the external FADT, but we must update the DSDT/FACS + * addresses as well as the checksum */ ExternalFadt->Dsdt = (UINT32) DsdtAddress; if (!AcpiGbl_ReducedHardware) @@ -343,19 +344,24 @@ AeBuildLocalTables ( ExternalFadt->Facs = ACPI_PTR_TO_PHYSADDR (&LocalFACS); } - /* Is there room in the FADT for the XDsdst and XFacs 64-bit pointers? */ - - if (ExternalFadt->Header.Length > ACPI_PTR_DIFF (&ExternalFadt->XDsdt, ExternalFadt)) + /* + * If there room in the FADT for the XDsdt and XFacs 64-bit + * pointers, use them. + */ + if (ExternalFadt->Header.Length > ACPI_PTR_DIFF ( + &ExternalFadt->XDsdt, ExternalFadt)) { - ExternalFadt->XDsdt = DsdtAddress; + ExternalFadt->Dsdt = 0; + ExternalFadt->Facs = 0; + ExternalFadt->XDsdt = DsdtAddress; if (!AcpiGbl_ReducedHardware) { ExternalFadt->XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS); } } - /* Complete the FADT with the checksum */ + /* Complete the external FADT with the checksum */ ExternalFadt->Header.Checksum = 0; ExternalFadt->Header.Checksum = (UINT8) -AcpiTbChecksum ( @@ -364,12 +370,8 @@ AeBuildLocalTables ( else if (AcpiGbl_UseHwReducedFadt) { memcpy (&LocalFADT, HwReducedFadtCode, ACPI_FADT_V5_SIZE); - LocalFADT.Dsdt = (UINT32) DsdtAddress; + LocalFADT.Dsdt = 0; LocalFADT.XDsdt = DsdtAddress; - - LocalFADT.Header.Checksum = 0; - LocalFADT.Header.Checksum = (UINT8) -AcpiTbChecksum ( - (void *) &LocalFADT, LocalFADT.Header.Length); } else { @@ -377,7 +379,6 @@ AeBuildLocalTables ( * Build a local FADT so we can test the hardware/event init */ LocalFADT.Header.Revision = 5; - AeInitializeTableHeader ((void *) &LocalFADT, ACPI_SIG_FADT, sizeof (ACPI_TABLE_FADT)); /* Setup FADT header and DSDT/FACS addresses */ @@ -413,15 +414,13 @@ AeBuildLocalTables ( LocalFADT.XPm1bEventBlock.SpaceId = ACPI_ADR_SPACE_SYSTEM_IO; LocalFADT.XPm1bEventBlock.Address = LocalFADT.Pm1bEventBlock; - LocalFADT.XPm1bEventBlock.BitWidth = (UINT8) ACPI_MUL_8 (LocalFADT.Pm1EventLength); - - /* Complete the FADT with the checksum */ - - LocalFADT.Header.Checksum = 0; - LocalFADT.Header.Checksum = (UINT8) -AcpiTbChecksum ( - (void *) &LocalFADT, LocalFADT.Header.Length); + LocalFADT.XPm1bEventBlock.BitWidth = (UINT8) + ACPI_MUL_8 (LocalFADT.Pm1EventLength); } + AeInitializeTableHeader ((void *) &LocalFADT, + ACPI_SIG_FADT, sizeof (ACPI_TABLE_FADT)); + /* Build a FACS */ memset (&LocalFACS, 0, sizeof (ACPI_TABLE_FACS)); @@ -443,6 +442,8 @@ AeBuildLocalTables ( LocalTEST.Revision = 1; LocalTEST.Length = sizeof (ACPI_TABLE_HEADER); + + LocalTEST.Checksum = 0; LocalTEST.Checksum = (UINT8) -AcpiTbChecksum ( (void *) &LocalTEST, LocalTEST.Length); @@ -455,6 +456,8 @@ AeBuildLocalTables ( LocalBADTABLE.Revision = 1; LocalBADTABLE.Length = sizeof (ACPI_TABLE_HEADER); + + LocalBADTABLE.Checksum = 0; LocalBADTABLE.Checksum = (UINT8) -AcpiTbChecksum ( (void *) &LocalBADTABLE, LocalBADTABLE.Length); } @@ -482,14 +485,12 @@ AeInstallTables ( ACPI_STATUS Status; ACPI_TABLE_HEADER Header; ACPI_TABLE_HEADER *Table; + UINT32 i; - Status = AcpiInitializeTables (Tables, ACPI_MAX_INIT_TABLES, TRUE); + Status = AcpiInitializeTables (NULL, ACPI_MAX_INIT_TABLES, TRUE); AE_CHECK_OK (AcpiInitializeTables, Status); - Status = AcpiReallocateRootTable (); - AE_CHECK_OK (AcpiReallocateRootTable, Status); - Status = AcpiLoadTables (); AE_CHECK_OK (AcpiLoadTables, Status); @@ -536,6 +537,18 @@ AeInstallTables ( AE_CHECK_STATUS (AcpiGetTable, Status, AE_NOT_FOUND); } + /* Check that we can get all of the ACPI tables */ + + for (i = 0; ; i++) + { + Status = AcpiGetTableByIndex (i, &Table); + if ((Status == AE_BAD_PARAMETER) || !Table) + { + break; + } + AE_CHECK_OK (AcpiGetTableByIndex, Status); + } + return (AE_OK); } diff --git a/source/tools/acpihelp/ahdecode.c b/source/tools/acpihelp/ahdecode.c index 7e6d7c8b7427..8684c6a1c042 100644 --- a/source/tools/acpihelp/ahdecode.c +++ b/source/tools/acpihelp/ahdecode.c @@ -170,7 +170,7 @@ AhFindPredefinedNames ( strncpy (&Name[1], NamePrefix, 7); Length = strlen (Name); - if (Length > 4) + if (Length > ACPI_NAME_SIZE) { printf ("%.8s: Predefined name must be 4 characters maximum\n", Name); return; diff --git a/source/tools/acpinames/acpinames.h b/source/tools/acpinames/acpinames.h index c38b2a004fce..62d006974f92 100644 --- a/source/tools/acpinames/acpinames.h +++ b/source/tools/acpinames/acpinames.h @@ -47,10 +47,12 @@ #include "acpi.h" #include "accommon.h" #include "acapps.h" +#include "acutils.h" #include "../acpiexec/aecommon.h" #include <stdio.h> #define ACPI_MAX_INIT_TABLES (32) +extern BOOLEAN AcpiGbl_NsLoadOnly; #endif diff --git a/source/tools/acpinames/anmain.c b/source/tools/acpinames/anmain.c index 0ebfdf6dbc18..a613ac2613c3 100644 --- a/source/tools/acpinames/anmain.c +++ b/source/tools/acpinames/anmain.c @@ -42,18 +42,35 @@ */ #include "acpinames.h" +#include "actables.h" #define _COMPONENT ACPI_TOOLS ACPI_MODULE_NAME ("anmain") -extern ACPI_TABLE_DESC Tables[]; +/* Local prototypes */ +static int +NsDumpEntireNamespace ( + UINT32 TableCount); + +/* + * Main routine for the ACPI user-space namespace utility. + * + * Portability note: The utility depends upon the host for command-line + * wildcard support - it is not implemented locally. For example: + * + * Linux/Unix systems: Shell expands wildcards automatically. + * + * Windows: The setargv.obj module must be linked in to automatically + * expand wildcards. + */ static AE_TABLE_DESC *AeTableListHead = NULL; +BOOLEAN AcpiGbl_NsLoadOnly = FALSE; #define AN_UTILITY_NAME "ACPI Namespace Dump Utility" -#define AN_SUPPORTED_OPTIONS "?hv" +#define AN_SUPPORTED_OPTIONS "?hlvx:" /****************************************************************************** @@ -75,7 +92,9 @@ usage ( ACPI_USAGE_HEADER ("AcpiNames [options] AMLfile"); ACPI_OPTION ("-?", "Display this message"); + ACPI_OPTION ("-l", "Load namespace only, no display"); ACPI_OPTION ("-v", "Display version information"); + ACPI_OPTION ("-x <DebugLevel>", "Debug output level"); } @@ -94,45 +113,12 @@ usage ( static int NsDumpEntireNamespace ( - char *AmlFilename) + UINT32 TableCount) { ACPI_STATUS Status; - ACPI_TABLE_HEADER *Table = NULL; - UINT32 TableCount = 0; - AE_TABLE_DESC *TableDesc; ACPI_HANDLE Handle; - /* Open the binary AML file and read the entire table */ - - Status = AcpiUtReadTableFromFile (AmlFilename, &Table); - if (ACPI_FAILURE (Status)) - { - printf ("**** Could not get input table %s, %s\n", AmlFilename, - AcpiFormatException (Status)); - return (-1); - } - - /* Table must be a DSDT. SSDTs are not currently supported */ - - if (!ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT)) - { - printf ("**** Input table signature is [%4.4s], must be [DSDT]\n", - Table->Signature); - return (-1); - } - - /* - * Allocate and link a table descriptor (allows for future expansion to - * multiple input files) - */ - TableDesc = AcpiOsAllocate (sizeof (AE_TABLE_DESC)); - TableDesc->Table = Table; - TableDesc->Next = AeTableListHead; - AeTableListHead = TableDesc; - - TableCount++; - /* * Build a local XSDT with all tables. Normally, here is where the * RSDP search is performed to find the ACPI tables @@ -145,7 +131,7 @@ NsDumpEntireNamespace ( /* Initialize table manager, get XSDT */ - Status = AcpiInitializeTables (Tables, ACPI_MAX_INIT_TABLES, TRUE); + Status = AcpiInitializeTables (NULL, ACPI_MAX_INIT_TABLES, TRUE); if (ACPI_FAILURE (Status)) { printf ("**** Could not initialize ACPI table manager, %s\n", @@ -153,26 +139,29 @@ NsDumpEntireNamespace ( return (-1); } - /* Reallocate root table to dynamic memory */ + /* Load the ACPI namespace */ - Status = AcpiReallocateRootTable (); - if (ACPI_FAILURE (Status)) + Status = AcpiTbLoadNamespace (); + if (Status == AE_CTRL_TERMINATE) { - printf ("**** Could not reallocate root table, %s\n", - AcpiFormatException (Status)); + /* At least one table load failed -- terminate with error */ + return (-1); } - /* Load the ACPI namespace */ - - Status = AcpiLoadTables (); if (ACPI_FAILURE (Status)) { - printf ("**** Could not load ACPI tables, %s\n", + printf ("**** While creating namespace, %s\n", AcpiFormatException (Status)); return (-1); } + if (AcpiGbl_NsLoadOnly) + { + printf ("**** Namespace successfully loaded\n"); + return (0); + } + /* * Enable ACPICA. These calls don't do much for this * utility, since we only dump the namespace. There is no @@ -236,7 +225,10 @@ main ( int argc, char **argv) { + AE_TABLE_DESC *TableDesc; + ACPI_TABLE_HEADER *Table = NULL; ACPI_STATUS Status; + UINT32 TableCount; int j; @@ -244,7 +236,7 @@ main ( /* Init debug globals and ACPICA */ - AcpiDbgLevel = ACPI_LV_TABLES; + AcpiDbgLevel = ACPI_NORMAL_DEFAULT | ACPI_LV_TABLES; AcpiDbgLayer = 0xFFFFFFFF; Status = AcpiInitializeSubsystem (); @@ -265,10 +257,21 @@ main ( while ((j = AcpiGetopt (argc, argv, AN_SUPPORTED_OPTIONS)) != ACPI_OPT_END) switch(j) { + case 'l': + + AcpiGbl_NsLoadOnly = TRUE; + break; + case 'v': /* -v: (Version): signon already emitted, just exit */ return (0); + case 'x': + + AcpiDbgLevel = strtoul (AcpiGbl_Optarg, NULL, 0); + printf ("Debug Level: 0x%8.8X\n", AcpiDbgLevel); + break; + case '?': case 'h': default: @@ -277,9 +280,52 @@ main ( return (0); } + TableCount = 0; + + /* Get each of the ACPI table files on the command line */ + + while (argv[AcpiGbl_Optind]) + { + /* Get one entire table */ + + Status = AcpiUtReadTableFromFile (argv[AcpiGbl_Optind], &Table); + if (ACPI_FAILURE (Status)) + { + fprintf (stderr, "**** Could not get table from file %s, %s\n", + argv[AcpiGbl_Optind], AcpiFormatException (Status)); + return (-1); + } + + /* Ignore non-AML tables, we can't use them. Except for an FADT */ + + if (!ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FADT) && + !AcpiUtIsAmlTable (Table)) + { + fprintf (stderr, " %s: [%4.4s] is not an AML table - ignoring\n", + argv[AcpiGbl_Optind], Table->Signature); + + AcpiOsFree (Table); + } + else + { + /* Allocate and link a table descriptor */ + + TableDesc = AcpiOsAllocate (sizeof (AE_TABLE_DESC)); + TableDesc->Table = Table; + TableDesc->Next = AeTableListHead; + AeTableListHead = TableDesc; + + TableCount++; + } + + AcpiGbl_Optind++; + } + + printf ("\n"); + /* * The next argument is the filename for the DSDT or SSDT. * Open the file, build namespace and dump it. */ - return (NsDumpEntireNamespace (argv[AcpiGbl_Optind])); + return (NsDumpEntireNamespace (TableCount)); } diff --git a/source/tools/acpinames/anstubs.c b/source/tools/acpinames/anstubs.c index f8b1d2d6ae82..ed165a9f68d4 100644 --- a/source/tools/acpinames/anstubs.c +++ b/source/tools/acpinames/anstubs.c @@ -85,6 +85,14 @@ AcpiUtCopyIobjectToIobject ( return (AE_NOT_IMPLEMENTED); } +/* Hardware */ + +UINT32 +AcpiHwGetMode ( + void) +{ + return (0); +} /* Event manager */ @@ -110,6 +118,20 @@ AcpiEvInitializeRegion ( return (AE_OK); } +ACPI_STATUS +AcpiEvInstallXruptHandlers ( + void) +{ + return (AE_OK); +} + +ACPI_STATUS +AcpiEvInitializeEvents ( + void) +{ + return (AE_OK); +} + /* AML Interpreter */ @@ -132,13 +154,6 @@ AcpiExWriteDataToField ( } ACPI_STATUS -AcpiExPrepFieldValue ( - ACPI_CREATE_FIELD_INFO *Info) -{ - return (AE_OK); -} - -ACPI_STATUS AcpiExStoreObjectToNode ( ACPI_OPERAND_OBJECT *SourceDesc, ACPI_NAMESPACE_NODE *Node, @@ -222,9 +237,16 @@ AcpiExTracePoint ( /* Dispatcher */ ACPI_STATUS -AcpiDsInitializeObjects ( - UINT32 TableIndex, - ACPI_NAMESPACE_NODE *StartNode) +AcpiDsAutoSerializeMethod ( + ACPI_NAMESPACE_NODE *Node, + ACPI_OPERAND_OBJECT *ObjDesc) +{ + return (AE_OK); +} + +ACPI_STATUS +AcpiDsInitializeRegion ( + ACPI_HANDLE ObjHandle) { return (AE_OK); } diff --git a/source/tools/acpinames/antables.c b/source/tools/acpinames/antables.c index 9646ba4974f7..1dbf692992cf 100644 --- a/source/tools/acpinames/antables.c +++ b/source/tools/acpinames/antables.c @@ -48,6 +48,13 @@ /* Local prototypes */ +static void +AeInitializeTableHeader ( + ACPI_TABLE_HEADER *Header, + char *Signature, + UINT32 Length); + + /* Non-AML tables that are constructed locally and installed */ static ACPI_TABLE_RSDP LocalRSDP; @@ -69,7 +76,43 @@ static ACPI_TABLE_XSDT *LocalXSDT; #define BASE_XSDT_SIZE (sizeof (ACPI_TABLE_XSDT) + \ ((BASE_XSDT_TABLES -1) * sizeof (UINT64))) -ACPI_TABLE_DESC Tables[ACPI_MAX_INIT_TABLES]; + +/****************************************************************************** + * + * FUNCTION: AeInitializeTableHeader + * + * PARAMETERS: Header - A valid standard ACPI table header + * Signature - Signature to insert + * Length - Length of the table + * + * RETURN: None. Header is modified. + * + * DESCRIPTION: Initialize the table header for a local ACPI table. + * + *****************************************************************************/ + +static void +AeInitializeTableHeader ( + ACPI_TABLE_HEADER *Header, + char *Signature, + UINT32 Length) +{ + + ACPI_MOVE_NAME (Header->Signature, Signature); + Header->Length = Length; + + Header->OemRevision = 0x1001; + strncpy (Header->OemId, "Intel", ACPI_OEM_ID_SIZE); + strncpy (Header->OemTableId, "AcpiName", ACPI_OEM_TABLE_ID_SIZE); + strncpy (Header->AslCompilerId, "INTL", ACPI_NAME_SIZE); + Header->AslCompilerRevision = ACPI_CA_VERSION; + + /* Set the checksum, must set to zero first */ + + Header->Checksum = 0; + Header->Checksum = (UINT8) -AcpiTbChecksum ( + (void *) Header, Header->Length); +} /****************************************************************************** @@ -99,9 +142,9 @@ AeBuildLocalTables ( /* - * Update the table count. For DSDT, it is not put into the XSDT. For - * FADT, this is already accounted for since we usually install a - * local FADT. + * Update the table count. For the DSDT, it is not put into the XSDT. + * For the FADT, this table is already accounted for since we usually + * install a local FADT. */ NextTable = TableList; while (NextTable) @@ -125,15 +168,14 @@ AeBuildLocalTables ( } memset (LocalXSDT, 0, XsdtSize); - ACPI_MOVE_NAME (LocalXSDT->Header.Signature, ACPI_SIG_XSDT); - LocalXSDT->Header.Length = XsdtSize; - LocalXSDT->Header.Revision = 1; - LocalXSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (&LocalFADT); /* * Install the user tables. The DSDT must be installed in the FADT. * All other tables are installed directly into the XSDT. + * + * Note: The tables are loaded in reverse order from the incoming + * input, which makes it match the command line order. */ NextIndex = BASE_XSDT_TABLES; NextTable = TableList; @@ -158,32 +200,35 @@ AeBuildLocalTables ( else if (ACPI_COMPARE_NAME (NextTable->Table->Signature, ACPI_SIG_FADT)) { ExternalFadt = ACPI_CAST_PTR (ACPI_TABLE_FADT, NextTable->Table); - LocalXSDT->TableOffsetEntry[2] = ACPI_PTR_TO_PHYSADDR (NextTable->Table); + LocalXSDT->TableOffsetEntry[0] = ACPI_PTR_TO_PHYSADDR (NextTable->Table); } else { /* Install the table in the XSDT */ - LocalXSDT->TableOffsetEntry[NextIndex] = ACPI_PTR_TO_PHYSADDR (NextTable->Table); + LocalXSDT->TableOffsetEntry[TableCount - NextIndex + 1] = + ACPI_PTR_TO_PHYSADDR (NextTable->Table); NextIndex++; } NextTable = NextTable->Next; } - /* Build an RSDP */ + /* Build an RSDP. Contains a valid XSDT only, no RSDT */ memset (&LocalRSDP, 0, sizeof (ACPI_TABLE_RSDP)); ACPI_MAKE_RSDP_SIG (LocalRSDP.Signature); - memcpy (LocalRSDP.OemId, "I_TEST", 6); + memcpy (LocalRSDP.OemId, "Intel", 6); + LocalRSDP.Revision = 2; LocalRSDP.XsdtPhysicalAddress = ACPI_PTR_TO_PHYSADDR (LocalXSDT); LocalRSDP.Length = sizeof (ACPI_TABLE_XSDT); /* Set checksums for both XSDT and RSDP */ - LocalXSDT->Header.Checksum = (UINT8) -AcpiTbChecksum ( - (void *) LocalXSDT, LocalXSDT->Header.Length); + AeInitializeTableHeader ((void *) LocalXSDT, ACPI_SIG_XSDT, XsdtSize); + + LocalRSDP.Checksum = 0; LocalRSDP.Checksum = (UINT8) -AcpiTbChecksum ( (void *) &LocalRSDP, ACPI_RSDP_CHECKSUM_LENGTH); @@ -192,21 +237,36 @@ AeBuildLocalTables ( return (AE_SUPPORT); } + /* + * Build an FADT. There are two options for the FADT: + * 1) Incoming external FADT specified on the command line + * 2) A fully featured local FADT + */ + memset (&LocalFADT, 0, sizeof (ACPI_TABLE_FADT)); + if (ExternalFadt) { /* - * Use the external FADT, but we must update the DSDT/FACS addresses - * as well as the checksum + * Use the external FADT, but we must update the DSDT/FACS + * addresses as well as the checksum */ ExternalFadt->Dsdt = (UINT32) DsdtAddress; ExternalFadt->Facs = ACPI_PTR_TO_PHYSADDR (&LocalFACS); - if (ExternalFadt->Header.Length > ACPI_PTR_DIFF (&ExternalFadt->XDsdt, ExternalFadt)) + /* + * If there room in the FADT for the XDsdt and XFacs 64-bit + * pointers, use them. + */ + if (ExternalFadt->Header.Length > ACPI_PTR_DIFF ( + &ExternalFadt->XDsdt, ExternalFadt)) { + ExternalFadt->Dsdt = 0; + ExternalFadt->Facs = 0; ExternalFadt->XDsdt = DsdtAddress; ExternalFadt->XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS); } - /* Complete the FADT with the checksum */ + + /* Complete the external FADT with the checksum */ ExternalFadt->Header.Checksum = 0; ExternalFadt->Header.Checksum = (UINT8) -AcpiTbChecksum ( @@ -217,8 +277,7 @@ AeBuildLocalTables ( /* * Build a local FADT so we can test the hardware/event init */ - memset (&LocalFADT, 0, sizeof (ACPI_TABLE_FADT)); - ACPI_MOVE_NAME (LocalFADT.Header.Signature, ACPI_SIG_FADT); + LocalFADT.Header.Revision = 5; /* Setup FADT header and DSDT/FACS addresses */ @@ -228,9 +287,6 @@ AeBuildLocalTables ( LocalFADT.XDsdt = DsdtAddress; LocalFADT.XFacs = ACPI_PTR_TO_PHYSADDR (&LocalFACS); - LocalFADT.Header.Revision = 3; - LocalFADT.Header.Length = sizeof (ACPI_TABLE_FADT); - /* Miscellaneous FADT fields */ LocalFADT.Gpe0BlockLength = 16; @@ -257,15 +313,13 @@ AeBuildLocalTables ( LocalFADT.XPm1bEventBlock.SpaceId = ACPI_ADR_SPACE_SYSTEM_IO; LocalFADT.XPm1bEventBlock.Address = LocalFADT.Pm1bEventBlock; - LocalFADT.XPm1bEventBlock.BitWidth = (UINT8) ACPI_MUL_8 (LocalFADT.Pm1EventLength); - - /* Complete the FADT with the checksum */ - - LocalFADT.Header.Checksum = 0; - LocalFADT.Header.Checksum = (UINT8) -AcpiTbChecksum ( - (void *) &LocalFADT, LocalFADT.Header.Length); + LocalFADT.XPm1bEventBlock.BitWidth = (UINT8) + ACPI_MUL_8 (LocalFADT.Pm1EventLength); } + AeInitializeTableHeader ((void *) &LocalFADT, + ACPI_SIG_FADT, sizeof (ACPI_TABLE_FADT)); + /* Build a FACS */ memset (&LocalFACS, 0, sizeof (ACPI_TABLE_FACS)); @@ -273,7 +327,6 @@ AeBuildLocalTables ( LocalFACS.Length = sizeof (ACPI_TABLE_FACS); LocalFACS.GlobalLock = 0x11AA0011; - return (AE_OK); } diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c index 6cc27131dda3..8781c80e2595 100644 --- a/source/tools/acpisrc/astable.c +++ b/source/tools/acpisrc/astable.c @@ -296,6 +296,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_OBJECT_HANDLER", SRC_TYPE_SIMPLE}, {"ACPI_OBJECT_INDEX_FIELD", SRC_TYPE_STRUCT}, {"ACPI_OBJECT_INTEGER", SRC_TYPE_STRUCT}, + {"ACPI_OBJECT_INFO", SRC_TYPE_STRUCT}, {"ACPI_OBJECT_LIST", SRC_TYPE_STRUCT}, {"ACPI_OBJECT_METHOD", SRC_TYPE_STRUCT}, {"ACPI_OBJECT_MUTEX", SRC_TYPE_STRUCT}, @@ -351,6 +352,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { {"ACPI_RASF_SHARED_MEMORY", SRC_TYPE_STRUCT}, {"ACPI_REPAIR_FUNCTION", SRC_TYPE_SIMPLE}, {"ACPI_REPAIR_INFO", SRC_TYPE_STRUCT}, + {"ACPI_REG_WALK_INFO", SRC_TYPE_STRUCT}, {"ACPI_RESOURCE", SRC_TYPE_STRUCT}, {"ACPI_RESOURCE_HANDLER", SRC_TYPE_SIMPLE}, {"ACPI_RESOURCE_ADDRESS", SRC_TYPE_STRUCT}, |