diff options
Diffstat (limited to 'source/components')
| -rw-r--r-- | source/components/debugger/dbinput.c | 10 | ||||
| -rw-r--r-- | source/components/debugger/dbmethod.c | 7 | ||||
| -rw-r--r-- | source/components/debugger/dbxface.c | 10 | ||||
| -rw-r--r-- | source/components/dispatcher/dsfield.c | 26 | ||||
| -rw-r--r-- | source/components/hardware/hwregs.c | 11 | ||||
| -rw-r--r-- | source/components/hardware/hwsleep.c | 19 | ||||
| -rw-r--r-- | source/components/namespace/nsaccess.c | 16 | ||||
| -rw-r--r-- | source/components/parser/psloop.c | 41 | ||||
| -rw-r--r-- | source/components/tables/tbdata.c | 4 | ||||
| -rw-r--r-- | source/components/utilities/utdelete.c | 7 | ||||
| -rw-r--r-- | source/components/utilities/uterror.c | 6 | ||||
| -rw-r--r-- | source/components/utilities/utstrsuppt.c | 30 | ||||
| -rw-r--r-- | source/components/utilities/utstrtoul64.c | 2 |
13 files changed, 160 insertions, 29 deletions
diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c index 75e7a37f5385..0daca95b7e65 100644 --- a/source/components/debugger/dbinput.c +++ b/source/components/debugger/dbinput.c @@ -969,7 +969,11 @@ AcpiDbCommandDispatch ( case CMD_DISASSEMBLE: case CMD_DISASM: +#ifdef ACPI_DISASSEMBLER (void) AcpiDbDisassembleMethod (AcpiGbl_DbArgs[1]); +#else + AcpiOsPrintf ("The AML Disassembler is not configured/present\n"); +#endif break; case CMD_DUMP: @@ -1083,7 +1087,11 @@ AcpiDbCommandDispatch ( case CMD_LIST: - AcpiDbDisassembleAml (AcpiGbl_DbArgs[1], Op); +#ifdef ACPI_DISASSEMBLER + AcpiDbDisassembleAml (AcpiGbl_DbArgs[1], Op);; +#else + AcpiOsPrintf ("The AML Disassembler is not configured/present\n"); +#endif break; case CMD_LOCKS: diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c index d6c6aa55bf6a..a030823c2ac7 100644 --- a/source/components/debugger/dbmethod.c +++ b/source/components/debugger/dbmethod.c @@ -393,6 +393,7 @@ Cleanup: } +#ifdef ACPI_DISASSEMBLER /******************************************************************************* * * FUNCTION: AcpiDbDisassembleAml @@ -426,9 +427,7 @@ AcpiDbDisassembleAml ( NumStatements = strtoul (Statements, NULL, 0); } -#ifdef ACPI_DISASSEMBLER AcpiDmDisassemble (NULL, Op, NumStatements); -#endif } @@ -511,8 +510,6 @@ AcpiDbDisassembleMethod ( WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE; Status = AcpiPsParseAml (WalkState); - -#ifdef ACPI_DISASSEMBLER (void) AcpiDmParseDeferredOps (Op); /* Now we can disassemble the method */ @@ -520,7 +517,6 @@ AcpiDbDisassembleMethod ( AcpiGbl_DmOpt_Verbose = FALSE; AcpiDmDisassemble (NULL, Op, 0); AcpiGbl_DmOpt_Verbose = TRUE; -#endif AcpiPsDeleteParseTree (Op); @@ -531,6 +527,7 @@ AcpiDbDisassembleMethod ( AcpiUtReleaseOwnerId (&ObjDesc->Method.OwnerId); return (AE_OK); } +#endif /******************************************************************************* diff --git a/source/components/debugger/dbxface.c b/source/components/debugger/dbxface.c index 0b964f69ff5f..c661b248b75e 100644 --- a/source/components/debugger/dbxface.c +++ b/source/components/debugger/dbxface.c @@ -154,6 +154,7 @@ #include "amlcode.h" #include "acdebug.h" #include "acinterp.h" +#include "acparser.h" #define _COMPONENT ACPI_CA_DEBUGGER @@ -435,10 +436,17 @@ AcpiDbSingleStep ( } } - /* Now we can display it */ + /* Now we can disassemble and display it */ #ifdef ACPI_DISASSEMBLER AcpiDmDisassemble (WalkState, DisplayOp, ACPI_UINT32_MAX); +#else + /* + * The AML Disassembler is not configured - at least we can + * display the opcode value and name + */ + AcpiOsPrintf ("AML Opcode: %4.4X %s\n", Op->Common.AmlOpcode, + AcpiPsGetOpcodeName (Op->Common.AmlOpcode)); #endif if ((Op->Common.AmlOpcode == AML_IF_OP) || diff --git a/source/components/dispatcher/dsfield.c b/source/components/dispatcher/dsfield.c index df770c1c07b3..3db39fb8b25d 100644 --- a/source/components/dispatcher/dsfield.c +++ b/source/components/dispatcher/dsfield.c @@ -157,6 +157,10 @@ #include "acnamesp.h" #include "acparser.h" +#ifdef ACPI_EXEC_APP +#include "aecommon.h" +#endif + #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dsfield") @@ -430,6 +434,13 @@ AcpiDsGetFieldNames ( UINT64 Position; ACPI_PARSE_OBJECT *Child; +#ifdef ACPI_EXEC_APP + UINT64 Value = 0; + ACPI_OPERAND_OBJECT *ResultDesc; + ACPI_OPERAND_OBJECT *ObjDesc; + char *NamePath; +#endif + ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info); @@ -564,6 +575,18 @@ AcpiDsGetFieldNames ( { return_ACPI_STATUS (Status); } +#ifdef ACPI_EXEC_APP + NamePath = AcpiNsGetExternalPathname (Info->FieldNode); + ObjDesc = AcpiUtCreateIntegerObject (Value); + if (ACPI_SUCCESS (AeLookupInitFileEntry (NamePath, &Value))) + { + AcpiExWriteDataToField (ObjDesc, + AcpiNsGetAttachedObject (Info->FieldNode), + &ResultDesc); + } + AcpiUtRemoveReference (ObjDesc); + ACPI_FREE (NamePath); +#endif } } @@ -756,6 +779,9 @@ AcpiDsInitFieldObjects ( Flags |= ACPI_NS_TEMPORARY; } +#ifdef ACPI_EXEC_APP + Flags |= ACPI_NS_OVERRIDE_IF_FOUND; +#endif /* * Walk the list of entries in the FieldList * Note: FieldList can be of zero length. In this case, Arg will be NULL. diff --git a/source/components/hardware/hwregs.c b/source/components/hardware/hwregs.c index c0deed339797..ec106847ba3a 100644 --- a/source/components/hardware/hwregs.c +++ b/source/components/hardware/hwregs.c @@ -724,13 +724,20 @@ AcpiHwRegisterRead ( case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ Status = AcpiHwRead (&Value64, &AcpiGbl_FADT.XPm2ControlBlock); - Value = (UINT32) Value64; + if (ACPI_SUCCESS (Status)) + { + Value = (UINT32) Value64; + } break; case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ Status = AcpiHwRead (&Value64, &AcpiGbl_FADT.XPmTimerBlock); - Value = (UINT32) Value64; + if (ACPI_SUCCESS (Status)) + { + Value = (UINT32) Value64; + } + break; case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ diff --git a/source/components/hardware/hwsleep.c b/source/components/hardware/hwsleep.c index fe111872cec0..7e435acecba0 100644 --- a/source/components/hardware/hwsleep.c +++ b/source/components/hardware/hwsleep.c @@ -198,17 +198,28 @@ AcpiHwLegacySleep ( return_ACPI_STATUS (Status); } - /* - * 1) Disable all GPEs - * 2) Enable all wakeup GPEs - */ + /* Disable all GPEs */ + Status = AcpiHwDisableAllGpes (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } + /* + * If the target sleep state is S5, clear all GPEs and fixed events too + */ + if (SleepState == ACPI_STATE_S5) + { + Status = AcpiHwClearAcpiStatus(); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } AcpiGbl_SystemAwakeAndRunning = FALSE; + /* Enable all wakeup GPEs */ + Status = AcpiHwEnableAllWakeupGpes (); if (ACPI_FAILURE (Status)) { diff --git a/source/components/namespace/nsaccess.c b/source/components/namespace/nsaccess.c index bf530d483025..af97c51feff5 100644 --- a/source/components/namespace/nsaccess.c +++ b/source/components/namespace/nsaccess.c @@ -724,6 +724,15 @@ AcpiNsLookup ( CurrentNode)); } +#ifdef ACPI_EXEC_APP + if ((Status == AE_ALREADY_EXISTS) && + (ThisNode->Flags & ANOBJ_NODE_EARLY_INIT)) + { + ThisNode->Flags &= ~ANOBJ_NODE_EARLY_INIT; + Status = AE_OK; + } +#endif + #ifdef ACPI_ASL_COMPILER /* * If this ACPI name already exists within the namespace as an @@ -845,6 +854,13 @@ AcpiNsLookup ( } } +#ifdef ACPI_EXEC_APP + if (Flags & ACPI_NS_EARLY_INIT) + { + ThisNode->Flags |= ANOBJ_NODE_EARLY_INIT; + } +#endif + *ReturnNode = ThisNode; return_ACPI_STATUS (AE_OK); } diff --git a/source/components/parser/psloop.c b/source/components/parser/psloop.c index fd6773c149c3..ef517b54d0bf 100644 --- a/source/components/parser/psloop.c +++ b/source/components/parser/psloop.c @@ -164,6 +164,7 @@ #include "acdispat.h" #include "amlcode.h" #include "acconvert.h" +#include "acnamesp.h" #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psloop") @@ -645,6 +646,18 @@ AcpiPsParseLoop ( Status = AcpiPsCreateOp (WalkState, AmlOpStart, &Op); if (ACPI_FAILURE (Status)) { + /* + * ACPI_PARSE_MODULE_LEVEL means that we are loading a table by + * executing it as a control method. However, if we encounter + * an error while loading the table, we need to keep trying to + * load the table rather than aborting the table load. Set the + * status to AE_OK to proceed with the table load. + */ + if ((WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) && + Status == AE_ALREADY_EXISTS) + { + Status = AE_OK; + } if (Status == AE_CTRL_PARSE_CONTINUE) { continue; @@ -665,18 +678,20 @@ AcpiPsParseLoop ( { return_ACPI_STATUS (Status); } - if (WalkState->Opcode == AML_SCOPE_OP) + if (AcpiNsOpensScope ( + AcpiPsGetOpcodeInfo (WalkState->Opcode)->ObjectType)) { /* - * If the scope op fails to parse, skip the body of the - * scope op because the parse failure indicates that the - * device may not exist. + * If the scope/device op fails to parse, skip the body of + * the scope op because the parse failure indicates that + * the device may not exist. */ + ACPI_ERROR ((AE_INFO, "Skip parsing opcode %s", + AcpiPsGetOpcodeName (WalkState->Opcode))); WalkState->ParserState.Aml = WalkState->Aml + 1; WalkState->ParserState.Aml = AcpiPsGetNextPackageEnd(&WalkState->ParserState); WalkState->Aml = WalkState->ParserState.Aml; - ACPI_ERROR ((AE_INFO, "Skipping Scope block")); } continue; @@ -834,6 +849,22 @@ AcpiPsParseLoop ( { Status = AE_OK; } + else if ((WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) && + (ACPI_AML_EXCEPTION(Status) || Status == AE_ALREADY_EXISTS || + Status == AE_NOT_FOUND)) + { + /* + * ACPI_PARSE_MODULE_LEVEL flag means that we are currently + * loading a table by executing it as a control method. + * However, if we encounter an error while loading the table, + * we need to keep trying to load the table rather than + * aborting the table load (setting the status to AE_OK + * continues the table load). If we get a failure at this + * point, it means that the dispatcher got an error while + * trying to execute the Op. + */ + Status = AE_OK; + } } Status = AcpiPsCompleteOp (WalkState, &Op, Status); diff --git a/source/components/tables/tbdata.c b/source/components/tables/tbdata.c index 61a2d340d56d..7b44fc74eb23 100644 --- a/source/components/tables/tbdata.c +++ b/source/components/tables/tbdata.c @@ -711,9 +711,9 @@ AcpiTbVerifyTempTable ( { if (Status != AE_CTRL_TERMINATE) { - ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY, + ACPI_EXCEPTION ((AE_INFO, Status, "%4.4s 0x%8.8X%8.8X" - " Table is duplicated", + " Table is already loaded", AcpiUtValidNameseg (TableDesc->Signature.Ascii) ? TableDesc->Signature.Ascii : "????", ACPI_FORMAT_UINT64 (TableDesc->Address))); diff --git a/source/components/utilities/utdelete.c b/source/components/utilities/utdelete.c index 4565d8fa5ae3..da2e31ff9fd5 100644 --- a/source/components/utilities/utdelete.c +++ b/source/components/utilities/utdelete.c @@ -520,6 +520,7 @@ AcpiUtUpdateRefCount ( UINT16 OriginalCount; UINT16 NewCount = 0; ACPI_CPU_FLAGS LockFlags; + char *Message; ACPI_FUNCTION_NAME (UtUpdateRefCount); @@ -560,6 +561,7 @@ AcpiUtUpdateRefCount ( "Obj %p Type %.2X [%s] Refs %.2X [Incremented]\n", Object, Object->Common.Type, AcpiUtGetObjectTypeName (Object), NewCount)); + Message = "Incremement"; break; case REF_DECREMENT: @@ -591,6 +593,7 @@ AcpiUtUpdateRefCount ( { AcpiUtDeleteInternalObj (Object); } + Message = "Decrement"; break; default: @@ -608,8 +611,8 @@ AcpiUtUpdateRefCount ( if (NewCount > ACPI_MAX_REFERENCE_COUNT) { ACPI_WARNING ((AE_INFO, - "Large Reference Count (0x%X) in object %p, Type=0x%.2X", - NewCount, Object, Object->Common.Type)); + "Large Reference Count (0x%X) in object %p, Type=0x%.2X Operation=%s", + NewCount, Object, Object->Common.Type, Message)); } } diff --git a/source/components/utilities/uterror.c b/source/components/utilities/uterror.c index eca92f3b1b5c..67c22330f069 100644 --- a/source/components/utilities/uterror.c +++ b/source/components/utilities/uterror.c @@ -352,19 +352,19 @@ AcpiUtPrefixedNamespaceError ( { case AE_ALREADY_EXISTS: - AcpiOsPrintf ("\n" ACPI_MSG_BIOS_ERROR); + AcpiOsPrintf (ACPI_MSG_BIOS_ERROR); Message = "Failure creating"; break; case AE_NOT_FOUND: - AcpiOsPrintf ("\n" ACPI_MSG_BIOS_ERROR); + AcpiOsPrintf (ACPI_MSG_BIOS_ERROR); Message = "Could not resolve"; break; default: - AcpiOsPrintf ("\n" ACPI_MSG_ERROR); + AcpiOsPrintf (ACPI_MSG_ERROR); Message = "Failure resolving"; break; } diff --git a/source/components/utilities/utstrsuppt.c b/source/components/utilities/utstrsuppt.c index 2e7232a3b05f..b482da21db5e 100644 --- a/source/components/utilities/utstrsuppt.c +++ b/source/components/utilities/utstrsuppt.c @@ -419,15 +419,39 @@ BOOLEAN AcpiUtDetectHexPrefix ( char **String) { + char *InitialPosition = *String; + AcpiUtRemoveHexPrefix (String); + if (*String != InitialPosition) + { + return (TRUE); /* String is past leading 0x */ + } + + return (FALSE); /* Not a hex string */ +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtRemoveHexPrefix + * + * PARAMETERS: String - Pointer to input ASCII string + * + * RETURN: none + * + * DESCRIPTION: Remove a hex "0x" prefix + * + ******************************************************************************/ + +void +AcpiUtRemoveHexPrefix ( + char **String) +{ if ((**String == ACPI_ASCII_ZERO) && (tolower ((int) *(*String + 1)) == 'x')) { *String += 2; /* Go past the leading 0x */ - return (TRUE); } - - return (FALSE); /* Not a hex string */ } diff --git a/source/components/utilities/utstrtoul64.c b/source/components/utilities/utstrtoul64.c index 5bbf24fd8014..77190e107991 100644 --- a/source/components/utilities/utstrtoul64.c +++ b/source/components/utilities/utstrtoul64.c @@ -383,7 +383,7 @@ AcpiUtImplicitStrtoul64 ( * implicit conversions, and the "0x" prefix is "not allowed". * However, allow a "0x" prefix as an ACPI extension. */ - AcpiUtDetectHexPrefix (&String); + AcpiUtRemoveHexPrefix (&String); if (!AcpiUtRemoveLeadingZeros (&String)) { |
