diff options
author | jkim <jkim@FreeBSD.org> | 2013-05-17 23:13:40 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2013-05-17 23:13:40 +0000 |
commit | af69f95bba3597db53a980597cfd371c9f6ee7cf (patch) | |
tree | 740dae2325e162bb086ea6e7e5d481c4b669e232 /source/components | |
parent | 00f95aec269522bc092cf85fe57fcfc19efecec9 (diff) | |
download | FreeBSD-src-af69f95bba3597db53a980597cfd371c9f6ee7cf.zip FreeBSD-src-af69f95bba3597db53a980597cfd371c9f6ee7cf.tar.gz |
Import ACPICA 20130517.
Diffstat (limited to 'source/components')
102 files changed, 1531 insertions, 1242 deletions
diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c index 3a1afa2..5700441 100644 --- a/source/components/debugger/dbcmds.c +++ b/source/components/debugger/dbcmds.c @@ -361,22 +361,27 @@ AcpiDbDisplayTableInfo ( switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) { case ACPI_TABLE_ORIGIN_UNKNOWN: + AcpiOsPrintf ("Unknown "); break; case ACPI_TABLE_ORIGIN_MAPPED: + AcpiOsPrintf ("Mapped "); break; case ACPI_TABLE_ORIGIN_ALLOCATED: + AcpiOsPrintf ("Allocated "); break; case ACPI_TABLE_ORIGIN_OVERRIDE: + AcpiOsPrintf ("Override "); break; default: + AcpiOsPrintf ("INVALID "); break; } diff --git a/source/components/debugger/dbconvert.c b/source/components/debugger/dbconvert.c index e30aba0..098a9719 100644 --- a/source/components/debugger/dbconvert.c +++ b/source/components/debugger/dbconvert.c @@ -304,20 +304,24 @@ AcpiDbConvertToObject ( switch (Type) { case ACPI_TYPE_STRING: + Object->Type = ACPI_TYPE_STRING; Object->String.Pointer = String; Object->String.Length = (UINT32) ACPI_STRLEN (String); break; case ACPI_TYPE_BUFFER: + Status = AcpiDbConvertToBuffer (String, Object); break; case ACPI_TYPE_PACKAGE: + Status = AcpiDbConvertToPackage (String, Object); break; default: + Object->Type = ACPI_TYPE_INTEGER; Status = AcpiUtStrtoul64 (String, 16, &Object->Integer.Value); break; diff --git a/source/components/debugger/dbdisply.c b/source/components/debugger/dbdisply.c index 9fc9cf5..c453d57 100644 --- a/source/components/debugger/dbdisply.c +++ b/source/components/debugger/dbdisply.c @@ -265,7 +265,6 @@ AcpiDbDecodeAndDisplayObject ( Node = ObjPtr; goto DumpNode; - case ACPI_DESC_TYPE_OPERAND: /* This is a ACPI OPERAND OBJECT */ @@ -282,7 +281,6 @@ AcpiDbDecodeAndDisplayObject ( AcpiExDumpObjectDescriptor (ObjPtr, 1); break; - case ACPI_DESC_TYPE_PARSER: /* This is a Parser Op object */ @@ -299,7 +297,6 @@ AcpiDbDecodeAndDisplayObject ( AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr); break; - default: /* Is not a recognizeable object */ @@ -446,6 +443,7 @@ AcpiDbDisplayMethodInfo ( switch (OpInfo->Class) { case AML_CLASS_ARGUMENT: + if (CountRemaining) { NumRemainingOperands++; @@ -455,11 +453,13 @@ AcpiDbDisplayMethodInfo ( break; case AML_CLASS_UNKNOWN: + /* Bad opcode or ASCII character */ continue; default: + if (CountRemaining) { NumRemainingOperators++; @@ -931,15 +931,21 @@ AcpiDbDisplayGpes ( switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) { case ACPI_GPE_DISPATCH_NONE: + AcpiOsPrintf ("NotUsed"); break; + case ACPI_GPE_DISPATCH_METHOD: + AcpiOsPrintf ("Method"); break; case ACPI_GPE_DISPATCH_HANDLER: + AcpiOsPrintf ("Handler"); break; + case ACPI_GPE_DISPATCH_NOTIFY: + Count = 0; Notify = GpeEventInfo->Dispatch.NotifyList; while (Notify) @@ -949,7 +955,9 @@ AcpiDbDisplayGpes ( } AcpiOsPrintf ("Implicit Notify on %u devices", Count); break; + default: + AcpiOsPrintf ("UNKNOWN: %X", GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK); break; diff --git a/source/components/debugger/dbexec.c b/source/components/debugger/dbexec.c index 3b5f651..dff3c79 100644 --- a/source/components/debugger/dbexec.c +++ b/source/components/debugger/dbexec.c @@ -109,6 +109,7 @@ AcpiDbDeleteObjects ( switch (Objects[i].Type) { case ACPI_TYPE_BUFFER: + ACPI_FREE (Objects[i].Buffer.Pointer); break; @@ -125,6 +126,7 @@ AcpiDbDeleteObjects ( break; default: + break; } } diff --git a/source/components/debugger/dbhistry.c b/source/components/debugger/dbhistry.c index c3933d3..ff11604 100644 --- a/source/components/debugger/dbhistry.c +++ b/source/components/debugger/dbhistry.c @@ -54,12 +54,12 @@ #define HI_NO_HISTORY 0 #define HI_RECORD_HISTORY 1 -#define HISTORY_SIZE 20 +#define HISTORY_SIZE 40 typedef struct HistoryInfo { - char Command[80]; + char *Command; UINT32 CmdNum; } HISTORY_INFO; @@ -88,13 +88,35 @@ void AcpiDbAddToHistory ( char *CommandLine) { + UINT16 CmdLen; + UINT16 BufferLen; /* Put command into the next available slot */ + CmdLen = (UINT16) ACPI_STRLEN (CommandLine); + if (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command != NULL) + { + BufferLen = (UINT16) ACPI_STRLEN ( + AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command); + if (CmdLen > BufferLen) + { + AcpiOsFree (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex]. + Command); + AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command = + AcpiOsAllocate (CmdLen + 1); + } + } + else + { + AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command = + AcpiOsAllocate (CmdLen + 1); + } + ACPI_STRCPY (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command, CommandLine); - AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].CmdNum = AcpiGbl_NextCmdNum; + AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].CmdNum = + AcpiGbl_NextCmdNum; /* Adjust indexes */ @@ -148,8 +170,12 @@ AcpiDbDisplayHistory ( for (i = 0; i < AcpiGbl_NumHistory; i++) { - AcpiOsPrintf ("%ld %s\n", AcpiGbl_HistoryBuffer[HistoryIndex].CmdNum, - AcpiGbl_HistoryBuffer[HistoryIndex].Command); + if (AcpiGbl_HistoryBuffer[HistoryIndex].Command) + { + AcpiOsPrintf ("%3ld %s\n", + AcpiGbl_HistoryBuffer[HistoryIndex].CmdNum, + AcpiGbl_HistoryBuffer[HistoryIndex].Command); + } HistoryIndex++; if (HistoryIndex >= HISTORY_SIZE) @@ -199,7 +225,7 @@ AcpiDbGetFromHistory ( { if (AcpiGbl_HistoryBuffer[HistoryIndex].CmdNum == CmdNum) { - /* Found the commnad, return it */ + /* Found the command, return it */ return (AcpiGbl_HistoryBuffer[HistoryIndex].Command); } diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c index d891872..1e3ebff 100644 --- a/source/components/debugger/dbinput.c +++ b/source/components/debugger/dbinput.c @@ -753,6 +753,7 @@ AcpiDbCommandDispatch ( switch (CommandIndex) { case CMD_NULL: + if (Op) { return (AE_OK); @@ -768,41 +769,50 @@ AcpiDbCommandDispatch ( case CMD_ARGS: case CMD_ARGUMENTS: + AcpiDbDisplayArguments (); break; case CMD_BATCH: + AcpiDbBatchExecute (AcpiGbl_DbArgs[1]); break; case CMD_BREAKPOINT: + AcpiDbSetMethodBreakpoint (AcpiGbl_DbArgs[1], WalkState, Op); break; case CMD_BUSINFO: + AcpiDbGetBusInfo (); break; case CMD_CALL: + AcpiDbSetMethodCallBreakpoint (Op); Status = AE_OK; break; case CMD_CLOSE: + AcpiDbCloseDebugFile (); break; case CMD_DEBUG: + AcpiDbExecute (AcpiGbl_DbArgs[1], &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_SINGLE_STEP); break; case CMD_DISASSEMBLE: case CMD_DISASM: + (void) AcpiDbDisassembleMethod (AcpiGbl_DbArgs[1]); break; case CMD_DUMP: + AcpiDbDecodeAndDisplayObject (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); break; @@ -819,45 +829,55 @@ AcpiDbCommandDispatch ( break; case CMD_EVENT: + AcpiOsPrintf ("Event command not implemented\n"); break; case CMD_EVALUATE: case CMD_EXECUTE: + AcpiDbExecute (AcpiGbl_DbArgs[1], &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_NO_SINGLE_STEP); break; case CMD_FIND: + Status = AcpiDbFindNameInNamespace (AcpiGbl_DbArgs[1]); break; case CMD_GO: + 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 (); break; case CMD_HELP: case CMD_HELP2: + AcpiDbDisplayHelp (AcpiGbl_DbArgs[1]); break; case CMD_HISTORY: + AcpiDbDisplayHistory (); break; - case CMD_HISTORY_EXE: + case CMD_HISTORY_EXE: /* ! command */ + CommandLine = AcpiDbGetFromHistory (AcpiGbl_DbArgs[1]); if (!CommandLine) { @@ -867,7 +887,8 @@ AcpiDbCommandDispatch ( Status = AcpiDbCommandDispatch (CommandLine, WalkState, Op); return (Status); - case CMD_HISTORY_LAST: + case CMD_HISTORY_LAST: /* !! command */ + CommandLine = AcpiDbGetFromHistory (NULL); if (!CommandLine) { @@ -878,14 +899,17 @@ AcpiDbCommandDispatch ( return (Status); case CMD_INFORMATION: + AcpiDbDisplayMethodInfo (Op); break; case CMD_INTEGRITY: + AcpiDbCheckIntegrity (); break; case CMD_INTO: + if (Op) { AcpiGbl_CmSingleStep = TRUE; @@ -894,6 +918,7 @@ AcpiDbCommandDispatch ( break; case CMD_LEVEL: + if (ParamCount == 0) { AcpiOsPrintf ("Current debug level for file output is: %8.8lX\n", @@ -921,96 +946,119 @@ AcpiDbCommandDispatch ( break; case CMD_LIST: + AcpiDbDisassembleAml (AcpiGbl_DbArgs[1], Op); break; case CMD_LOAD: + Status = AcpiDbGetTableFromFile (AcpiGbl_DbArgs[1], NULL); break; case CMD_LOCKS: + AcpiDbDisplayLocks (); break; case CMD_LOCALS: + AcpiDbDisplayLocals (); break; case CMD_METHODS: + Status = AcpiDbDisplayObjects ("METHOD", AcpiGbl_DbArgs[1]); break; case CMD_NAMESPACE: + AcpiDbDumpNamespace (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); break; case CMD_NOTIFY: + Temp = ACPI_STRTOUL (AcpiGbl_DbArgs[2], NULL, 0); AcpiDbSendNotify (AcpiGbl_DbArgs[1], Temp); break; case CMD_OBJECT: + AcpiUtStrupr (AcpiGbl_DbArgs[1]); 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]); break; case CMD_OWNER: + AcpiDbDumpNamespaceByOwner (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); break; case CMD_PREDEFINED: + AcpiDbCheckPredefinedNames (); break; case CMD_PREFIX: + AcpiDbSetScope (AcpiGbl_DbArgs[1]); break; case CMD_REFERENCES: + AcpiDbFindReferences (AcpiGbl_DbArgs[1]); break; case CMD_RESOURCES: + AcpiDbDisplayResources (AcpiGbl_DbArgs[1]); break; case CMD_RESULTS: + AcpiDbDisplayResults (); 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]); break; case CMD_STOP: + return (AE_NOT_IMPLEMENTED); case CMD_TABLES: + AcpiDbDisplayTableInfo (AcpiGbl_DbArgs[1]); break; case CMD_TEMPLATE: + AcpiDbDisplayTemplate (AcpiGbl_DbArgs[1]); break; case CMD_TERMINATE: + AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); AcpiUtSubsystemShutdown (); @@ -1023,28 +1071,34 @@ AcpiDbCommandDispatch ( break; case CMD_THREADS: + AcpiDbCreateExecutionThreads (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], AcpiGbl_DbArgs[3]); break; case CMD_TRACE: + (void) AcpiDebugTrace (AcpiGbl_DbArgs[1],0,0,1); break; case CMD_TREE: + AcpiDbDisplayCallingTree (); break; case CMD_TYPE: + AcpiDbDisplayObjectType (AcpiGbl_DbArgs[1]); break; case CMD_UNLOAD: + AcpiDbUnloadAcpiTable (AcpiGbl_DbArgs[1]); break; case CMD_EXIT: case CMD_QUIT: + if (Op) { AcpiOsPrintf ("Method execution terminated\n"); @@ -1062,6 +1116,7 @@ AcpiDbCommandDispatch ( case CMD_NOT_FOUND: default: + AcpiOsPrintf ("Unknown Command\n"); return (AE_CTRL_TRUE); } diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c index 6b25f62..fe1c3d5 100644 --- a/source/components/debugger/dbmethod.c +++ b/source/components/debugger/dbmethod.c @@ -271,6 +271,7 @@ AcpiDbSetMethodData ( break; default: + break; } @@ -501,25 +502,30 @@ AcpiDbWalkForExecute ( switch (ArgType) { case ACPI_TYPE_INTEGER: + ThisParam->Integer.Value = 1; break; case ACPI_TYPE_STRING: + ThisParam->String.Pointer = "This is the default argument string"; ThisParam->String.Length = ACPI_STRLEN (ThisParam->String.Pointer); break; case ACPI_TYPE_BUFFER: + ThisParam->Buffer.Pointer = (UINT8 *) Params; /* just a garbage buffer */ ThisParam->Buffer.Length = 48; break; case ACPI_TYPE_PACKAGE: + ThisParam->Package.Elements = NULL; ThisParam->Package.Count = 0; break; default: + AcpiOsPrintf ("%s: Unsupported argument type: %u\n", Pathname, ArgType); break; diff --git a/source/components/debugger/dbnames.c b/source/components/debugger/dbnames.c index bbe6896..b414a40 100644 --- a/source/components/debugger/dbnames.c +++ b/source/components/debugger/dbnames.c @@ -671,7 +671,7 @@ AcpiDbIntegrityWalk ( return (AE_OK); } - if (!AcpiUtValidAcpiName (Node->Name.Integer)) + if (!AcpiUtValidAcpiName (Node->Name.Ascii)) { AcpiOsPrintf ("Invalid AcpiName for Node %p\n", Node); return (AE_OK); diff --git a/source/components/debugger/dbstats.c b/source/components/debugger/dbstats.c index d9226f9..181efbf 100644 --- a/source/components/debugger/dbstats.c +++ b/source/components/debugger/dbstats.c @@ -267,6 +267,7 @@ AcpiDbEnumerateObject ( break; default: + break; } } @@ -479,7 +480,6 @@ AcpiDbDisplayStatistics ( } break; - case CMD_STAT_SIZES: AcpiOsPrintf ("\nInternal object sizes:\n\n"); @@ -530,7 +530,6 @@ AcpiDbDisplayStatistics ( AcpiOsPrintf ("Notify Info %3d\n", sizeof (ACPI_NOTIFY_INFO)); break; - case CMD_STAT_STACK: #if defined(ACPI_DEBUG_OUTPUT) @@ -545,6 +544,7 @@ AcpiDbDisplayStatistics ( break; default: + break; } diff --git a/source/components/debugger/dbutils.c b/source/components/debugger/dbutils.c index 83d60d5..268a496 100644 --- a/source/components/debugger/dbutils.c +++ b/source/components/debugger/dbutils.c @@ -179,14 +179,12 @@ AcpiDbDumpExternalObject ( AcpiOsPrintf ("[Null Object] (Type=0)\n"); break; - case ACPI_TYPE_INTEGER: AcpiOsPrintf ("[Integer] = %8.8X%8.8X\n", ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); break; - case ACPI_TYPE_STRING: AcpiOsPrintf ("[String] Length %.2X = ", ObjDesc->String.Length); @@ -194,7 +192,6 @@ AcpiDbDumpExternalObject ( AcpiOsPrintf ("\n"); break; - case ACPI_TYPE_BUFFER: AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length); @@ -213,7 +210,6 @@ AcpiDbDumpExternalObject ( } break; - case ACPI_TYPE_PACKAGE: AcpiOsPrintf ("[Package] Contains %u Elements:\n", @@ -225,26 +221,22 @@ AcpiDbDumpExternalObject ( } break; - case ACPI_TYPE_LOCAL_REFERENCE: AcpiOsPrintf ("[Object Reference] = "); AcpiDmDisplayInternalObject (ObjDesc->Reference.Handle, NULL); break; - case ACPI_TYPE_PROCESSOR: AcpiOsPrintf ("[Processor]\n"); break; - case ACPI_TYPE_POWER: AcpiOsPrintf ("[Power Resource]\n"); break; - default: AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc->Type); diff --git a/source/components/debugger/dbxface.c b/source/components/debugger/dbxface.c index a6a5423..3c1df5b 100644 --- a/source/components/debugger/dbxface.c +++ b/source/components/debugger/dbxface.c @@ -232,9 +232,11 @@ AcpiDbSingleStep ( { case AML_CLASS_UNKNOWN: case AML_CLASS_ARGUMENT: /* constants, literals, etc. do nothing */ + return (AE_OK); default: + /* All other opcodes -- continue */ break; } @@ -408,6 +410,9 @@ AcpiDbInitialize ( ACPI_STATUS Status; + ACPI_FUNCTION_TRACE (DbInitialize); + + /* Init globals */ AcpiGbl_DbBuffer = NULL; @@ -427,7 +432,7 @@ AcpiDbInitialize ( AcpiGbl_DbBuffer = AcpiOsAllocate (ACPI_DEBUG_BUFFER_SIZE); if (!AcpiGbl_DbBuffer) { - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } ACPI_MEMSET (AcpiGbl_DbBuffer, 0, ACPI_DEBUG_BUFFER_SIZE); @@ -450,14 +455,14 @@ AcpiDbInitialize ( if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get debugger mutex\n"); - return (Status); + return_ACPI_STATUS (Status); } Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get debugger mutex\n"); - return (Status); + return_ACPI_STATUS (Status); } /* Create the debug execution thread to execute commands */ @@ -465,8 +470,8 @@ AcpiDbInitialize ( Status = AcpiOsExecute (OSL_DEBUGGER_THREAD, AcpiDbExecuteThread, NULL); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Could not start debugger thread\n"); - return (Status); + ACPI_EXCEPTION ((AE_INFO, Status, "Could not start debugger thread")); + return_ACPI_STATUS (Status); } } @@ -476,7 +481,7 @@ AcpiDbInitialize ( AcpiGbl_DbOpt_stats = FALSE; } - return (AE_OK); + return_ACPI_STATUS (AE_OK); } @@ -500,6 +505,7 @@ AcpiDbTerminate ( if (AcpiGbl_DbBuffer) { AcpiOsFree (AcpiGbl_DbBuffer); + AcpiGbl_DbBuffer = NULL; } } diff --git a/source/components/disassembler/dmbuffer.c b/source/components/disassembler/dmbuffer.c index 89102ab..d0f57ce 100644 --- a/source/components/disassembler/dmbuffer.c +++ b/source/components/disassembler/dmbuffer.c @@ -194,7 +194,6 @@ AcpiDmByteList ( case ACPI_DASM_BUFFER: default: - /* * Not a resource, string, or unicode string. * Just dump the buffer diff --git a/source/components/disassembler/dmdeferred.c b/source/components/disassembler/dmdeferred.c index 7102ea7..38e4134 100644 --- a/source/components/disassembler/dmdeferred.c +++ b/source/components/disassembler/dmdeferred.c @@ -128,6 +128,7 @@ AcpiDmParseDeferredOps ( break; default: + ACPI_ERROR ((AE_INFO, "Unhandled deferred AML opcode [0x%.4X]", Op->Common.AmlOpcode)); break; @@ -265,6 +266,7 @@ AcpiDmDeferredParse ( break; default: + break; } diff --git a/source/components/disassembler/dmnames.c b/source/components/disassembler/dmnames.c index 22f045c..0fc7751 100644 --- a/source/components/disassembler/dmnames.c +++ b/source/components/disassembler/dmnames.c @@ -237,20 +237,24 @@ AcpiDmNamestring ( switch (ACPI_GET8 (Name)) { case 0: + SegCount = 0; break; case AML_DUAL_NAME_PREFIX: + SegCount = 2; Name++; break; case AML_MULTI_NAME_PREFIX_OP: + SegCount = (UINT32) ACPI_GET8 (Name + 1); Name += 2; break; default: + SegCount = 1; break; } diff --git a/source/components/disassembler/dmobject.c b/source/components/disassembler/dmobject.c index f6c681d..ab1d744 100644 --- a/source/components/disassembler/dmobject.c +++ b/source/components/disassembler/dmobject.c @@ -214,7 +214,6 @@ AcpiDmDecodeInternalObject ( ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); break; - case ACPI_TYPE_STRING: AcpiOsPrintf ("(%u) \"%.24s", @@ -230,7 +229,6 @@ AcpiDmDecodeInternalObject ( } break; - case ACPI_TYPE_BUFFER: AcpiOsPrintf ("(%u)", ObjDesc->Buffer.Length); @@ -240,7 +238,6 @@ AcpiDmDecodeInternalObject ( } break; - default: AcpiOsPrintf (" %p", ObjDesc); @@ -283,14 +280,17 @@ AcpiDmDecodeNode ( /* These types have no attached object */ case ACPI_TYPE_DEVICE: + AcpiOsPrintf (" Device"); break; case ACPI_TYPE_THERMAL: + AcpiOsPrintf (" Thermal Zone"); break; default: + AcpiDmDecodeInternalObject (AcpiNsGetAttachedObject (Node)); break; } @@ -335,13 +335,11 @@ AcpiDmDisplayInternalObject ( AcpiOsPrintf ("<Parser> "); break; - case ACPI_DESC_TYPE_NAMED: AcpiDmDecodeNode ((ACPI_NAMESPACE_NODE *) ObjDesc); break; - case ACPI_DESC_TYPE_OPERAND: Type = ObjDesc->Common.Type; @@ -375,7 +373,6 @@ AcpiDmDisplayInternalObject ( } break; - case ACPI_REFCLASS_ARG: AcpiOsPrintf ("%X ", ObjDesc->Reference.Value); @@ -388,7 +385,6 @@ AcpiDmDisplayInternalObject ( } break; - case ACPI_REFCLASS_INDEX: switch (ObjDesc->Reference.TargetType) @@ -420,7 +416,6 @@ AcpiDmDisplayInternalObject ( } break; - case ACPI_REFCLASS_REFOF: if (!ObjDesc->Reference.Object) @@ -446,20 +441,17 @@ AcpiDmDisplayInternalObject ( } break; - case ACPI_REFCLASS_NAME: AcpiDmDecodeNode (ObjDesc->Reference.Node); break; - case ACPI_REFCLASS_DEBUG: case ACPI_REFCLASS_TABLE: AcpiOsPrintf ("\n"); break; - default: /* Unknown reference class */ AcpiOsPrintf ("%2.2X\n", ObjDesc->Reference.Class); @@ -467,7 +459,6 @@ AcpiDmDisplayInternalObject ( } break; - default: AcpiOsPrintf ("<Obj> "); @@ -476,7 +467,6 @@ AcpiDmDisplayInternalObject ( } break; - default: AcpiOsPrintf ("<Not a valid ACPI Object Descriptor> [%s]", diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c index ad69531..490fa8c 100644 --- a/source/components/disassembler/dmopcode.c +++ b/source/components/disassembler/dmopcode.c @@ -121,6 +121,7 @@ AcpiDmPredefinedDescription ( switch (NameString[1]) { case 'A': + if ((NameString[2] == 'C') && (LastCharIsDigit)) { NameString = "_ACx"; @@ -132,6 +133,7 @@ AcpiDmPredefinedDescription ( break; case 'E': + if ((NameString[2] == 'J') && (LastCharIsDigit)) { NameString = "_EJx"; @@ -143,6 +145,7 @@ AcpiDmPredefinedDescription ( break; case 'L': + if (LastCharsAreHex) { NameString = "_Lxx"; @@ -150,6 +153,7 @@ AcpiDmPredefinedDescription ( break; case 'Q': + if (LastCharsAreHex) { NameString = "_Qxx"; @@ -157,6 +161,7 @@ AcpiDmPredefinedDescription ( break; case 'T': + if (NameString[2] == '_') { NameString = "_T_x"; @@ -164,6 +169,7 @@ AcpiDmPredefinedDescription ( break; case 'W': + if (LastCharsAreHex) { NameString = "_Wxx"; @@ -171,6 +177,7 @@ AcpiDmPredefinedDescription ( break; default: + break; } @@ -536,21 +543,26 @@ AcpiDmDisassembleOneOp ( return; case ACPI_DASM_LNOT_SUFFIX: + switch (Op->Common.AmlOpcode) { case AML_LEQUAL_OP: + AcpiOsPrintf ("LNotEqual"); break; case AML_LGREATER_OP: + AcpiOsPrintf ("LLessEqual"); break; case AML_LLESS_OP: + AcpiOsPrintf ("LGreaterEqual"); break; default: + break; } Op->Common.DisasmOpcode = 0; @@ -589,7 +601,6 @@ AcpiDmDisassembleOneOp ( AcpiOsPrintf ("0x%2.2X", (UINT32) Op->Common.Value.Integer); break; - case AML_WORD_OP: if (Op->Common.DisasmOpcode == ACPI_DASM_EISAID) @@ -602,7 +613,6 @@ AcpiDmDisassembleOneOp ( } break; - case AML_DWORD_OP: if (Op->Common.DisasmOpcode == ACPI_DASM_EISAID) @@ -615,22 +625,18 @@ AcpiDmDisassembleOneOp ( } break; - case AML_QWORD_OP: AcpiOsPrintf ("0x%8.8X%8.8X", ACPI_FORMAT_UINT64 (Op->Common.Value.Integer)); break; - case AML_STRING_OP: AcpiUtPrintString (Op->Common.Value.String, ACPI_UINT8_MAX); break; - case AML_BUFFER_OP: - /* * Determine the type of buffer. We can have one of the following: * @@ -680,7 +686,6 @@ AcpiDmDisassembleOneOp ( } break; - case AML_INT_STATICSTRING_OP: if (Op->Common.Value.String) @@ -693,13 +698,11 @@ AcpiDmDisassembleOneOp ( } break; - case AML_INT_NAMEPATH_OP: AcpiDmNamestring (Op->Common.Value.Name); break; - case AML_INT_NAMEDFIELD_OP: Length = AcpiDmDumpName (Op->Named.Name); @@ -710,7 +713,6 @@ AcpiDmDisassembleOneOp ( Info->BitOffset += (UINT32) Op->Common.Value.Integer; break; - case AML_INT_RESERVEDFIELD_OP: /* Offset() -- Must account for previous offsets */ @@ -730,7 +732,6 @@ AcpiDmDisassembleOneOp ( AcpiDmCommaIfFieldMember (Op); break; - case AML_INT_ACCESSFIELD_OP: case AML_INT_EXTACCESSFIELD_OP: @@ -748,9 +749,7 @@ AcpiDmDisassembleOneOp ( AcpiDmCommaIfFieldMember (Op); break; - case AML_INT_CONNECTION_OP: - /* * Two types of Connection() - one with a buffer object, the * other with a namestring that points to a buffer object. @@ -790,7 +789,6 @@ AcpiDmDisassembleOneOp ( AcpiDmByteList (Info, Op); break; - case AML_INT_METHODCALL_OP: Op = AcpiPsGetDepthNext (NULL, Op); @@ -799,7 +797,6 @@ AcpiDmDisassembleOneOp ( AcpiDmNamestring (Op->Common.Value.Name); break; - default: /* Just get the opcode name and print it */ diff --git a/source/components/disassembler/dmresrc.c b/source/components/disassembler/dmresrc.c index 5041e88..44111e1 100644 --- a/source/components/disassembler/dmresrc.c +++ b/source/components/disassembler/dmresrc.c @@ -337,6 +337,7 @@ AcpiDmResourceTemplate ( return; default: + break; } diff --git a/source/components/disassembler/dmresrcl.c b/source/components/disassembler/dmresrcl.c index 1b7c50b..e35b1b4 100644 --- a/source/components/disassembler/dmresrcl.c +++ b/source/components/disassembler/dmresrcl.c @@ -153,16 +153,19 @@ AcpiDmMemoryFields ( switch (Type) { case 16: + AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i], AcpiDmMemoryNames[i]); break; case 32: + AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i], AcpiDmMemoryNames[i]); break; default: + return; } } @@ -201,21 +204,25 @@ AcpiDmAddressFields ( switch (Type) { case 16: + AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i], AcpiDmAddressNames[i]); break; case 32: + AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i], AcpiDmAddressNames[i]); break; case 64: + AcpiDmDumpInteger64 (ACPI_CAST_PTR (UINT64, Source)[i], AcpiDmAddressNames[i]); break; default: + return; } } @@ -242,22 +249,27 @@ AcpiDmAddressPrefix ( switch (Type) { case ACPI_RESOURCE_TYPE_ADDRESS16: + AcpiOsPrintf ("Word"); break; case ACPI_RESOURCE_TYPE_ADDRESS32: + AcpiOsPrintf ("DWord"); break; case ACPI_RESOURCE_TYPE_ADDRESS64: + AcpiOsPrintf ("QWord"); break; case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64: + AcpiOsPrintf ("Extended"); break; default: + return; } } diff --git a/source/components/disassembler/dmresrcl2.c b/source/components/disassembler/dmresrcl2.c index 5db2062..1e26f61 100644 --- a/source/components/disassembler/dmresrcl2.c +++ b/source/components/disassembler/dmresrcl2.c @@ -376,14 +376,17 @@ AcpiDmGpioDescriptor ( switch (ConnectionType) { case AML_RESOURCE_GPIO_TYPE_INT: + AcpiDmGpioIntDescriptor (Resource, Length, Level); break; case AML_RESOURCE_GPIO_TYPE_IO: + AcpiDmGpioIoDescriptor (Resource, Length, Level); break; default: + AcpiOsPrintf ("Unknown GPIO type\n"); break; } @@ -443,6 +446,7 @@ AcpiDmDumpSerialBusVendorData ( break; default: + return; } diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c index 02c92a3..863471a 100644 --- a/source/components/disassembler/dmwalk.c +++ b/source/components/disassembler/dmwalk.c @@ -461,6 +461,7 @@ AcpiDmDescendingOp ( /* Fallthrough */ default: + AcpiDmIndent (Level); break; } @@ -699,7 +700,6 @@ AcpiDmDescendingOp ( AcpiDmFieldFlags (NextOp); break; - case AML_BUFFER_OP: /* The next op is the size parameter */ @@ -737,7 +737,6 @@ AcpiDmDescendingOp ( NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST; return (AE_OK); - case AML_VAR_PACKAGE_OP: case AML_IF_OP: case AML_WHILE_OP: @@ -751,7 +750,6 @@ AcpiDmDescendingOp ( } return (AE_OK); - case AML_PACKAGE_OP: /* The next op is the size parameter */ @@ -763,13 +761,11 @@ AcpiDmDescendingOp ( } return (AE_OK); - case AML_MATCH_OP: AcpiDmMatchOp (Op); break; - default: break; @@ -866,7 +862,6 @@ AcpiDmAscendingOp ( } break; - case BLOCK_BRACE: case (BLOCK_BRACE | BLOCK_PAREN): @@ -906,7 +901,6 @@ AcpiDmAscendingOp ( } break; - case BLOCK_NONE: default: diff --git a/source/components/dispatcher/dscontrol.c b/source/components/dispatcher/dscontrol.c index 39bb178..32efe10 100644 --- a/source/components/dispatcher/dscontrol.c +++ b/source/components/dispatcher/dscontrol.c @@ -86,7 +86,6 @@ AcpiDsExecBeginControlOp ( switch (Op->Common.AmlOpcode) { case AML_WHILE_OP: - /* * If this is an additional iteration of a while loop, continue. * There is no need to allocate a new control state. @@ -107,7 +106,6 @@ AcpiDsExecBeginControlOp ( /*lint -fallthrough */ case AML_IF_OP: - /* * IF/WHILE: Create a new control state to manage these * constructs. We need to manage these as a stack, in order @@ -150,6 +148,7 @@ AcpiDsExecBeginControlOp ( break; default: + break; } @@ -204,12 +203,10 @@ AcpiDsExecEndControlOp ( AcpiUtDeleteGenericState (ControlState); break; - case AML_ELSE_OP: break; - case AML_WHILE_OP: ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[WHILE_OP] Op=%p\n", Op)); @@ -252,7 +249,6 @@ AcpiDsExecEndControlOp ( AcpiUtDeleteGenericState (ControlState); break; - case AML_RETURN_OP: ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, @@ -348,12 +344,11 @@ AcpiDsExecEndControlOp ( Status = AE_CTRL_TERMINATE; break; - case AML_NOOP_OP: /* Just do nothing! */ - break; + break; case AML_BREAK_POINT_OP: @@ -373,11 +368,9 @@ AcpiDsExecEndControlOp ( "Executed AML Breakpoint opcode"); break; - case AML_BREAK_OP: case AML_CONTINUE_OP: /* ACPI 2.0 */ - /* Pop and delete control states until we find a while */ while (WalkState->ControlState && @@ -410,7 +403,6 @@ AcpiDsExecEndControlOp ( } break; - default: ACPI_ERROR ((AE_INFO, "Unknown control opcode=0x%X Op=%p", diff --git a/source/components/dispatcher/dsfield.c b/source/components/dispatcher/dsfield.c index ac2e847..2fb4f0e 100644 --- a/source/components/dispatcher/dsfield.c +++ b/source/components/dispatcher/dsfield.c @@ -599,21 +599,25 @@ AcpiDsInitFieldObjects ( switch (WalkState->Opcode) { case AML_FIELD_OP: + Arg = AcpiPsGetArg (Op, 2); Type = ACPI_TYPE_LOCAL_REGION_FIELD; break; case AML_BANK_FIELD_OP: + Arg = AcpiPsGetArg (Op, 4); Type = ACPI_TYPE_LOCAL_BANK_FIELD; break; case AML_INDEX_FIELD_OP: + Arg = AcpiPsGetArg (Op, 3); Type = ACPI_TYPE_LOCAL_INDEX_FIELD; break; default: + return_ACPI_STATUS (AE_BAD_PARAMETER); } diff --git a/source/components/dispatcher/dsinit.c b/source/components/dispatcher/dsinit.c index 65ff5cb..a00e1b4 100644 --- a/source/components/dispatcher/dsinit.c +++ b/source/components/dispatcher/dsinit.c @@ -128,20 +128,18 @@ AcpiDsInitOneObject ( Info->OpRegionCount++; break; - case ACPI_TYPE_METHOD: Info->MethodCount++; break; - case ACPI_TYPE_DEVICE: Info->DeviceCount++; break; - default: + break; } diff --git a/source/components/dispatcher/dsmthdat.c b/source/components/dispatcher/dsmthdat.c index ded1eb7..e5578f6 100644 --- a/source/components/dispatcher/dsmthdat.c +++ b/source/components/dispatcher/dsmthdat.c @@ -315,6 +315,7 @@ AcpiDsMethodDataGetNode ( break; default: + ACPI_ERROR ((AE_INFO, "Type %u is invalid", Type)); return_ACPI_STATUS (AE_TYPE); } @@ -472,7 +473,6 @@ AcpiDsMethodDataGetValue ( return_ACPI_STATUS (AE_AML_UNINITIALIZED_ARG); case ACPI_REFCLASS_LOCAL: - /* * No error message for this case, will be trapped again later to * detect and ignore cases of Store(LocalX,LocalX) diff --git a/source/components/dispatcher/dsobject.c b/source/components/dispatcher/dsobject.c index 870b9b1..77cc582 100644 --- a/source/components/dispatcher/dsobject.c +++ b/source/components/dispatcher/dsobject.c @@ -677,7 +677,6 @@ AcpiDsInitObjectFromOp ( switch (ObjDesc->Common.Type) { case ACPI_TYPE_BUFFER: - /* * Defer evaluation of Buffer TermArg operand */ @@ -687,9 +686,7 @@ AcpiDsInitObjectFromOp ( ObjDesc->Buffer.AmlLength = Op->Named.Length; break; - case ACPI_TYPE_PACKAGE: - /* * Defer evaluation of Package TermArg operand */ @@ -699,7 +696,6 @@ AcpiDsInitObjectFromOp ( ObjDesc->Package.AmlLength = Op->Named.Length; break; - case ACPI_TYPE_INTEGER: switch (OpInfo->Type) @@ -752,7 +748,6 @@ AcpiDsInitObjectFromOp ( } break; - case AML_TYPE_LITERAL: ObjDesc->Integer.Value = Op->Common.Value.Integer; @@ -770,8 +765,8 @@ AcpiDsInitObjectFromOp ( #endif break; - default: + ACPI_ERROR ((AE_INFO, "Unknown Integer type 0x%X", OpInfo->Type)); Status = AE_AML_OPERAND_TYPE; @@ -779,7 +774,6 @@ AcpiDsInitObjectFromOp ( } break; - case ACPI_TYPE_STRING: ObjDesc->String.Pointer = Op->Common.Value.String; @@ -792,11 +786,9 @@ AcpiDsInitObjectFromOp ( ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER; break; - case ACPI_TYPE_METHOD: break; - case ACPI_TYPE_LOCAL_REFERENCE: switch (OpInfo->Type) @@ -816,7 +808,6 @@ AcpiDsInitObjectFromOp ( #endif break; - case AML_TYPE_METHOD_ARGUMENT: /* Arg ID (0-6) is (AML opcode - base AML_ARG_OP) */ @@ -860,7 +851,6 @@ AcpiDsInitObjectFromOp ( } break; - default: ACPI_ERROR ((AE_INFO, "Unimplemented data type: 0x%X", diff --git a/source/components/dispatcher/dsopcode.c b/source/components/dispatcher/dsopcode.c index 8415bec..63c20a3 100644 --- a/source/components/dispatcher/dsopcode.c +++ b/source/components/dispatcher/dsopcode.c @@ -680,6 +680,7 @@ AcpiDsEvalDataObjectOperands ( break; default: + return_ACPI_STATUS (AE_AML_BAD_OPCODE); } diff --git a/source/components/dispatcher/dsutils.c b/source/components/dispatcher/dsutils.c index a7cc232..9fedbe6 100644 --- a/source/components/dispatcher/dsutils.c +++ b/source/components/dispatcher/dsutils.c @@ -264,7 +264,6 @@ AcpiDsIsResultUsed ( case AML_IF_OP: case AML_WHILE_OP: - /* * If we are executing the predicate AND this is the predicate op, * we will use the return value @@ -277,7 +276,9 @@ AcpiDsIsResultUsed ( break; default: + /* Ignore other control opcodes */ + break; } @@ -285,16 +286,13 @@ AcpiDsIsResultUsed ( goto ResultNotUsed; - case AML_CLASS_CREATE: - /* * These opcodes allow TermArg(s) as operands and therefore * the operands can be method calls. The result is used. */ goto ResultUsed; - case AML_CLASS_NAMED_OBJECT: if ((Op->Common.Parent->Common.AmlOpcode == AML_REGION_OP) || @@ -314,9 +312,7 @@ AcpiDsIsResultUsed ( goto ResultNotUsed; - default: - /* * In all other cases. the parent will actually use the return * object, so keep it. diff --git a/source/components/dispatcher/dswexec.c b/source/components/dispatcher/dswexec.c index 0336635..25de7f7 100644 --- a/source/components/dispatcher/dswexec.c +++ b/source/components/dispatcher/dswexec.c @@ -318,7 +318,6 @@ AcpiDsExecBeginOp ( Status = AcpiDsExecBeginControlOp (WalkState, Op); break; - case AML_CLASS_NAMED_OBJECT: if (WalkState->WalkType & ACPI_WALK_METHOD) @@ -350,14 +349,13 @@ AcpiDsExecBeginOp ( } break; - case AML_CLASS_EXECUTE: case AML_CLASS_CREATE: break; - default: + break; } @@ -441,7 +439,6 @@ AcpiDsExecEndOp ( } break; - case AML_CLASS_EXECUTE: /* Most operators with arguments */ /* Build resolved operand stack */ @@ -514,7 +511,6 @@ AcpiDsExecEndOp ( } break; - default: switch (OpType) @@ -527,9 +523,7 @@ AcpiDsExecEndOp ( break; - case AML_TYPE_METHOD_CALL: - /* * If the method is referenced from within a package * declaration, it is not a invocation of the method, just @@ -596,7 +590,6 @@ AcpiDsExecEndOp ( */ return_ACPI_STATUS (Status); - case AML_TYPE_CREATE_FIELD: ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, @@ -620,7 +613,6 @@ AcpiDsExecEndOp ( switch (Op->Common.Parent->Common.AmlOpcode) { case AML_NAME_OP: - /* * Put the Node on the object stack (Contains the ACPI Name * of this object) @@ -661,7 +653,6 @@ AcpiDsExecEndOp ( } break; - case AML_TYPE_NAMED_FIELD: case AML_TYPE_NAMED_COMPLEX: case AML_TYPE_NAMED_SIMPLE: @@ -708,14 +699,12 @@ AcpiDsExecEndOp ( } break; - case AML_TYPE_UNDEFINED: ACPI_ERROR ((AE_INFO, "Undefined opcode type Op=%p", Op)); return_ACPI_STATUS (AE_NOT_IMPLEMENTED); - case AML_TYPE_BOGUS: ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, @@ -723,7 +712,6 @@ AcpiDsExecEndOp ( WalkState->Opcode, Op)); break; - default: ACPI_ERROR ((AE_INFO, diff --git a/source/components/dispatcher/dswload.c b/source/components/dispatcher/dswload.c index 10ff07a..7050c87 100644 --- a/source/components/dispatcher/dswload.c +++ b/source/components/dispatcher/dswload.c @@ -81,6 +81,7 @@ AcpiDsInitCallbacks ( switch (PassNumber) { case 1: + WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE; WalkState->DescendingCallback = AcpiDsLoad1BeginOp; @@ -88,6 +89,7 @@ AcpiDsInitCallbacks ( break; case 2: + WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE; WalkState->DescendingCallback = AcpiDsLoad2BeginOp; @@ -95,6 +97,7 @@ AcpiDsInitCallbacks ( break; case 3: + #ifndef ACPI_NO_METHOD_EXECUTION WalkState->ParseFlags |= ACPI_PARSE_EXECUTE | ACPI_PARSE_DELETE_TREE; @@ -104,6 +107,7 @@ AcpiDsInitCallbacks ( break; default: + return (AE_BAD_PARAMETER); } @@ -174,7 +178,6 @@ AcpiDsLoad1BeginOp ( switch (WalkState->Opcode) { case AML_SCOPE_OP: - /* * The target name of the Scope() operator must exist at this point so * that we can actually open the scope to enter new names underneath it. @@ -221,7 +224,6 @@ AcpiDsLoad1BeginOp ( case ACPI_TYPE_INTEGER: case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: - /* * These types we will allow, but we will change the type. * This enables some existing code of the form: @@ -242,7 +244,6 @@ AcpiDsLoad1BeginOp ( break; case ACPI_TYPE_METHOD: - /* * Allow scope change to root during execution of module-level * code. Root is typed METHOD during this time. @@ -268,7 +269,6 @@ AcpiDsLoad1BeginOp ( } break; - default: /* * For all other named opcodes, we will enter the name into diff --git a/source/components/dispatcher/dswload2.c b/source/components/dispatcher/dswload2.c index a305564..07bd35e 100644 --- a/source/components/dispatcher/dswload2.c +++ b/source/components/dispatcher/dswload2.c @@ -496,7 +496,6 @@ AcpiDsLoad2EndOp ( Status = AcpiDsCreateBufferField (Op, WalkState); break; - case AML_TYPE_NAMED_FIELD: /* * If we are executing a method, initialize the field @@ -525,12 +524,12 @@ AcpiDsLoad2EndOp ( break; default: + /* All NAMED_FIELD opcodes must be handled above */ break; } break; - case AML_TYPE_NAMED_SIMPLE: Status = AcpiDsCreateOperands (WalkState, Arg); @@ -561,13 +560,13 @@ AcpiDsLoad2EndOp ( Status = AcpiExCreateEvent (WalkState); break; - case AML_ALIAS_OP: Status = AcpiExCreateAlias (WalkState); break; default: + /* Unknown opcode */ Status = AE_OK; @@ -652,13 +651,11 @@ AcpiDsLoad2EndOp ( } break; - case AML_NAME_OP: Status = AcpiDsCreateNode (WalkState, Node, Op); break; - case AML_METHOD_OP: /* * MethodOp PkgLength NameString MethodFlags TermList @@ -696,18 +693,17 @@ AcpiDsLoad2EndOp ( #endif /* ACPI_NO_METHOD_EXECUTION */ default: + /* All NAMED_COMPLEX opcodes must be handled above */ break; } break; - case AML_CLASS_INTERNAL: /* case AML_INT_NAMEPATH_OP: */ break; - case AML_CLASS_METHOD_CALL: ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, @@ -747,6 +743,7 @@ AcpiDsLoad2EndOp ( default: + break; } diff --git a/source/components/events/evglock.c b/source/components/events/evglock.c index 591bb7c..fffe8dd 100644 --- a/source/components/events/evglock.c +++ b/source/components/events/evglock.c @@ -144,6 +144,7 @@ AcpiEvRemoveGlobalLockHandler ( Status = AcpiRemoveFixedEventHandler (ACPI_EVENT_GLOBAL, AcpiEvGlobalLockHandler); + AcpiOsDeleteLock (AcpiGbl_GlobalLockPendingLock); return_ACPI_STATUS (Status); } diff --git a/source/components/events/evgpe.c b/source/components/events/evgpe.c index 47c8c75..9b80f08 100644 --- a/source/components/events/evgpe.c +++ b/source/components/events/evgpe.c @@ -578,7 +578,6 @@ AcpiEvAsynchExecuteGpeMethod ( switch (LocalGpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) { case ACPI_GPE_DISPATCH_NOTIFY: - /* * Implicit notify. * Dispatch a DEVICE_WAKE notify to the appropriate handler. @@ -631,6 +630,7 @@ AcpiEvAsynchExecuteGpeMethod ( break; default: + return_VOID; /* Should never happen */ } @@ -817,7 +817,6 @@ AcpiEvGpeDispatch ( case ACPI_GPE_DISPATCH_METHOD: case ACPI_GPE_DISPATCH_NOTIFY: - /* * Execute the method associated with the GPE * NOTE: Level-triggered GPEs are cleared after the method completes. @@ -833,7 +832,6 @@ AcpiEvGpeDispatch ( break; default: - /* * No handler or method to run! * 03/2010: This case should no longer be possible. We will not allow diff --git a/source/components/events/evgpeblk.c b/source/components/events/evgpeblk.c index 64c8194..ccbe6a61 100644 --- a/source/components/events/evgpeblk.c +++ b/source/components/events/evgpeblk.c @@ -420,6 +420,8 @@ AcpiEvCreateGpeBlock ( Status = AcpiEvInstallGpeBlock (GpeBlock, InterruptNumber); if (ACPI_FAILURE (Status)) { + ACPI_FREE (GpeBlock->RegisterInfo); + ACPI_FREE (GpeBlock->EventInfo); ACPI_FREE (GpeBlock); return_ACPI_STATUS (Status); } diff --git a/source/components/events/evgpeinit.c b/source/components/events/evgpeinit.c index af1ec64..44a1378 100644 --- a/source/components/events/evgpeinit.c +++ b/source/components/events/evgpeinit.c @@ -382,14 +382,17 @@ AcpiEvMatchGpeMethod ( switch (Name[1]) { case 'L': + Type = ACPI_GPE_LEVEL_TRIGGERED; break; case 'E': + Type = ACPI_GPE_EDGE_TRIGGERED; break; default: + /* Unknown method type, just ignore it */ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, diff --git a/source/components/events/evhandler.c b/source/components/events/evhandler.c index 355a248..9444b06 100644 --- a/source/components/events/evhandler.c +++ b/source/components/events/evhandler.c @@ -393,36 +393,43 @@ AcpiEvInstallSpaceHandler ( switch (SpaceId) { case ACPI_ADR_SPACE_SYSTEM_MEMORY: + Handler = AcpiExSystemMemorySpaceHandler; Setup = AcpiEvSystemMemoryRegionSetup; break; case ACPI_ADR_SPACE_SYSTEM_IO: + Handler = AcpiExSystemIoSpaceHandler; Setup = AcpiEvIoSpaceRegionSetup; break; case ACPI_ADR_SPACE_PCI_CONFIG: + Handler = AcpiExPciConfigSpaceHandler; Setup = AcpiEvPciConfigRegionSetup; break; case ACPI_ADR_SPACE_CMOS: + Handler = AcpiExCmosSpaceHandler; Setup = AcpiEvCmosRegionSetup; break; case ACPI_ADR_SPACE_PCI_BAR_TARGET: + Handler = AcpiExPciBarSpaceHandler; Setup = AcpiEvPciBarRegionSetup; break; case ACPI_ADR_SPACE_DATA_TABLE: + Handler = AcpiExDataTableSpaceHandler; Setup = NULL; break; default: + Status = AE_BAD_PARAMETER; goto UnlockAndExit; } diff --git a/source/components/events/evmisc.c b/source/components/events/evmisc.c index 1a971bf..1990a41 100644 --- a/source/components/events/evmisc.c +++ b/source/components/events/evmisc.c @@ -86,6 +86,7 @@ AcpiEvIsNotifyObject ( return (TRUE); default: + return (FALSE); } } @@ -306,6 +307,8 @@ AcpiEvTerminate ( ACPI_ERROR ((AE_INFO, "Could not remove Global Lock handler")); } + + AcpiGbl_EventsInitialized = FALSE; } /* Deallocate all handler objects installed within GPE info structs */ diff --git a/source/components/events/evrgnini.c b/source/components/events/evrgnini.c index 4bb7c9f..b8a632e 100644 --- a/source/components/events/evrgnini.c +++ b/source/components/events/evrgnini.c @@ -664,7 +664,9 @@ AcpiEvInitializeRegion ( break; default: + /* Ignore other objects */ + break; } diff --git a/source/components/events/evxfgpe.c b/source/components/events/evxfgpe.c index b8d7e37..1deff5b 100644 --- a/source/components/events/evxfgpe.c +++ b/source/components/events/evxfgpe.c @@ -250,14 +250,17 @@ AcpiSetGpe ( switch (Action) { case ACPI_GPE_ENABLE: + Status = AcpiEvEnableGpe (GpeEventInfo); break; case ACPI_GPE_DISABLE: + Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE); break; default: + Status = AE_BAD_PARAMETER; break; } @@ -487,14 +490,17 @@ AcpiSetGpeWakeMask ( switch (Action) { case ACPI_GPE_ENABLE: + ACPI_SET_BIT (GpeRegisterInfo->EnableForWake, (UINT8) RegisterBit); break; case ACPI_GPE_DISABLE: + ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForWake, (UINT8) RegisterBit); break; default: + ACPI_ERROR ((AE_INFO, "%u, Invalid action", Action)); Status = AE_BAD_PARAMETER; break; diff --git a/source/components/events/evxfregn.c b/source/components/events/evxfregn.c index 330de61..4b5b3d0 100644 --- a/source/components/events/evxfregn.c +++ b/source/components/events/evxfregn.c @@ -149,6 +149,7 @@ AcpiInstallAddressSpaceHandler ( break; default: + break; } diff --git a/source/components/executer/exconfig.c b/source/components/executer/exconfig.c index 7d72a5f..3e9f12b 100644 --- a/source/components/executer/exconfig.c +++ b/source/components/executer/exconfig.c @@ -483,7 +483,6 @@ AcpiExLoadOp ( TableDesc.Address = ObjDesc->Region.Address; break; - case ACPI_TYPE_BUFFER: /* Buffer or resolved RegionField */ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, @@ -526,8 +525,8 @@ AcpiExLoadOp ( TableDesc.Address = ACPI_TO_INTEGER (TableDesc.Pointer); break; - default: + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } diff --git a/source/components/executer/exconvrt.c b/source/components/executer/exconvrt.c index 2ba2e3e..6f803c0 100644 --- a/source/components/executer/exconvrt.c +++ b/source/components/executer/exconvrt.c @@ -114,6 +114,7 @@ AcpiExConvertToInteger ( break; default: + return_ACPI_STATUS (AE_TYPE); } @@ -133,7 +134,6 @@ AcpiExConvertToInteger ( switch (ObjDesc->Common.Type) { case ACPI_TYPE_STRING: - /* * Convert string to an integer - for most cases, the string must be * hexadecimal as per the ACPI specification. The only exception (as @@ -147,7 +147,6 @@ AcpiExConvertToInteger ( } break; - case ACPI_TYPE_BUFFER: /* Check for zero-length buffer */ @@ -179,10 +178,10 @@ AcpiExConvertToInteger ( } break; - default: /* No other types can get here */ + break; } @@ -242,7 +241,6 @@ AcpiExConvertToBuffer ( case ACPI_TYPE_INTEGER: - /* * Create a new Buffer object. * Need enough space for one integer @@ -261,9 +259,7 @@ AcpiExConvertToBuffer ( AcpiGbl_IntegerByteWidth); break; - case ACPI_TYPE_STRING: - /* * Create a new Buffer object * Size will be the string length @@ -287,8 +283,8 @@ AcpiExConvertToBuffer ( ObjDesc->String.Length); break; - default: + return_ACPI_STATUS (AE_TYPE); } @@ -344,15 +340,18 @@ AcpiExConvertToAscii ( switch (DataWidth) { case 1: + DecimalLength = ACPI_MAX8_DECIMAL_DIGITS; break; case 4: + DecimalLength = ACPI_MAX32_DECIMAL_DIGITS; break; case 8: default: + DecimalLength = ACPI_MAX64_DECIMAL_DIGITS; break; } @@ -461,7 +460,6 @@ AcpiExConvertToString ( *ResultDesc = ObjDesc; return_ACPI_STATUS (AE_OK); - case ACPI_TYPE_INTEGER: switch (Type) @@ -505,7 +503,6 @@ AcpiExConvertToString ( NewBuf [StringLength] = 0; break; - case ACPI_TYPE_BUFFER: /* Setup string length, base, and separator */ @@ -604,6 +601,7 @@ AcpiExConvertToString ( break; default: + return_ACPI_STATUS (AE_TYPE); } @@ -663,6 +661,7 @@ AcpiExConvertToTargetType ( break; default: + /* No conversion allowed for these types */ if (DestinationType != SourceDesc->Common.Type) @@ -676,7 +675,6 @@ AcpiExConvertToTargetType ( } break; - case ARGI_TARGETREF: switch (DestinationType) @@ -693,7 +691,6 @@ AcpiExConvertToTargetType ( 16); break; - case ACPI_TYPE_STRING: /* * The operand must be a String. We can convert an @@ -703,7 +700,6 @@ AcpiExConvertToTargetType ( ACPI_IMPLICIT_CONVERT_HEX); break; - case ACPI_TYPE_BUFFER: /* * The operand must be a Buffer. We can convert an @@ -712,8 +708,8 @@ AcpiExConvertToTargetType ( Status = AcpiExConvertToBuffer (SourceDesc, ResultDesc); break; - default: + ACPI_ERROR ((AE_INFO, "Bad destination type during conversion: 0x%X", DestinationType)); Status = AE_AML_INTERNAL; @@ -721,15 +717,14 @@ AcpiExConvertToTargetType ( } break; - case ARGI_REFERENCE: /* * CreateXxxxField cases - we are storing the field object into the name */ break; - default: + ACPI_ERROR ((AE_INFO, "Unknown Target type ID 0x%X AmlOpcode 0x%X DestType %s", GET_CURRENT_ARG_TYPE (WalkState->OpInfo->RuntimeArgs), diff --git a/source/components/executer/excreate.c b/source/components/executer/excreate.c index 822f2a5..376e1fd 100644 --- a/source/components/executer/excreate.c +++ b/source/components/executer/excreate.c @@ -113,7 +113,6 @@ AcpiExCreateAlias ( case ACPI_TYPE_BUFFER: case ACPI_TYPE_PACKAGE: case ACPI_TYPE_BUFFER_FIELD: - /* * These types open a new scope, so we need the NS node in order to access * any children. @@ -123,7 +122,6 @@ AcpiExCreateAlias ( case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_THERMAL: case ACPI_TYPE_LOCAL_SCOPE: - /* * The new alias has the type ALIAS and points to the original * NS node, not the object itself. @@ -133,7 +131,6 @@ AcpiExCreateAlias ( break; case ACPI_TYPE_METHOD: - /* * Control method aliases need to be differentiated */ diff --git a/source/components/executer/exdebug.c b/source/components/executer/exdebug.c index 923d2ce..9db779f 100644 --- a/source/components/executer/exdebug.c +++ b/source/components/executer/exdebug.c @@ -208,6 +208,7 @@ AcpiExDoDebugObject ( return_VOID; default: + break; } @@ -241,6 +242,7 @@ AcpiExDoDebugObject ( break; default: + AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object, Level+4, 0); break; diff --git a/source/components/executer/exdump.c b/source/components/executer/exdump.c index 48ff6e3..333168ec 100644 --- a/source/components/executer/exdump.c +++ b/source/components/executer/exdump.c @@ -380,6 +380,7 @@ AcpiExDumpObject ( switch (Info->Opcode) { case ACPI_EXD_INIT: + break; case ACPI_EXD_TYPE: @@ -541,19 +542,16 @@ AcpiExDumpOperand ( AcpiOsPrintf ("\n"); break; - case ACPI_REFCLASS_INDEX: AcpiOsPrintf ("%p\n", ObjDesc->Reference.Object); break; - case ACPI_REFCLASS_TABLE: AcpiOsPrintf ("Table Index %X\n", ObjDesc->Reference.Value); break; - case ACPI_REFCLASS_REFOF: AcpiOsPrintf ("%p [%s]\n", ObjDesc->Reference.Object, @@ -561,20 +559,17 @@ AcpiExDumpOperand ( ObjDesc->Reference.Object)->Common.Type)); break; - case ACPI_REFCLASS_NAME: AcpiOsPrintf ("- [%4.4s]\n", ObjDesc->Reference.Node->Name.Ascii); break; - case ACPI_REFCLASS_ARG: case ACPI_REFCLASS_LOCAL: AcpiOsPrintf ("%X\n", ObjDesc->Reference.Value); break; - default: /* Unknown reference class */ AcpiOsPrintf ("%2.2X\n", ObjDesc->Reference.Class); @@ -582,7 +577,6 @@ AcpiExDumpOperand ( } break; - case ACPI_TYPE_BUFFER: AcpiOsPrintf ("Buffer length %.2X @ %p\n", @@ -604,14 +598,12 @@ AcpiExDumpOperand ( } break; - case ACPI_TYPE_INTEGER: AcpiOsPrintf ("Integer %8.8X%8.8X\n", ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); break; - case ACPI_TYPE_PACKAGE: AcpiOsPrintf ("Package [Len %X] ElementArray %p\n", @@ -632,7 +624,6 @@ AcpiExDumpOperand ( } break; - case ACPI_TYPE_REGION: AcpiOsPrintf ("Region %s (%X)", @@ -655,7 +646,6 @@ AcpiExDumpOperand ( } break; - case ACPI_TYPE_STRING: AcpiOsPrintf ("String length %X @ %p ", @@ -666,13 +656,11 @@ AcpiExDumpOperand ( AcpiOsPrintf ("\n"); break; - case ACPI_TYPE_LOCAL_BANK_FIELD: AcpiOsPrintf ("BankField\n"); break; - case ACPI_TYPE_LOCAL_REGION_FIELD: AcpiOsPrintf ("RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at " @@ -687,13 +675,11 @@ AcpiExDumpOperand ( AcpiExDumpOperand (ObjDesc->Field.RegionObj, Depth+1); break; - case ACPI_TYPE_LOCAL_INDEX_FIELD: AcpiOsPrintf ("IndexField\n"); break; - case ACPI_TYPE_BUFFER_FIELD: AcpiOsPrintf ("BufferField: %X bits at byte %X bit %X of\n", @@ -716,13 +702,11 @@ AcpiExDumpOperand ( } break; - case ACPI_TYPE_EVENT: AcpiOsPrintf ("Event\n"); break; - case ACPI_TYPE_METHOD: AcpiOsPrintf ("Method(%X) @ %p:%X\n", @@ -731,38 +715,33 @@ AcpiExDumpOperand ( ObjDesc->Method.AmlLength); break; - case ACPI_TYPE_MUTEX: AcpiOsPrintf ("Mutex\n"); break; - case ACPI_TYPE_DEVICE: AcpiOsPrintf ("Device\n"); break; - case ACPI_TYPE_POWER: AcpiOsPrintf ("Power\n"); break; - case ACPI_TYPE_PROCESSOR: AcpiOsPrintf ("Processor\n"); break; - case ACPI_TYPE_THERMAL: AcpiOsPrintf ("Thermal\n"); break; - default: + /* Unknown Type */ AcpiOsPrintf ("Unknown Type %X\n", ObjDesc->Common.Type); @@ -1005,7 +984,6 @@ AcpiExDumpPackageObj ( ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); break; - case ACPI_TYPE_STRING: AcpiOsPrintf ("[String] Value: "); @@ -1013,7 +991,6 @@ AcpiExDumpPackageObj ( AcpiOsPrintf ("\n"); break; - case ACPI_TYPE_BUFFER: AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length); @@ -1028,7 +1005,6 @@ AcpiExDumpPackageObj ( } break; - case ACPI_TYPE_PACKAGE: AcpiOsPrintf ("[Package] Contains %u Elements:\n", @@ -1040,7 +1016,6 @@ AcpiExDumpPackageObj ( } break; - case ACPI_TYPE_LOCAL_REFERENCE: AcpiOsPrintf ("[Object Reference] Type [%s] %2.2X", @@ -1049,7 +1024,6 @@ AcpiExDumpPackageObj ( AcpiExDumpReferenceObj (ObjDesc); break; - default: AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc->Common.Type); diff --git a/source/components/executer/exfield.c b/source/components/executer/exfield.c index 18021c5..2b4f5f7 100644 --- a/source/components/executer/exfield.c +++ b/source/components/executer/exfield.c @@ -360,21 +360,25 @@ AcpiExWriteDataToField ( switch (SourceDesc->Common.Type) { case ACPI_TYPE_INTEGER: + Buffer = &SourceDesc->Integer.Value; Length = sizeof (SourceDesc->Integer.Value); break; case ACPI_TYPE_BUFFER: + Buffer = SourceDesc->Buffer.Pointer; Length = SourceDesc->Buffer.Length; break; case ACPI_TYPE_STRING: + Buffer = SourceDesc->String.Pointer; Length = SourceDesc->String.Length; break; default: + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } diff --git a/source/components/executer/exfldio.c b/source/components/executer/exfldio.c index 85da123..cd3c40f 100644 --- a/source/components/executer/exfldio.c +++ b/source/components/executer/exfldio.c @@ -480,9 +480,7 @@ AcpiExFieldDatumIo ( Status = AE_OK; break; - case ACPI_TYPE_LOCAL_BANK_FIELD: - /* * Ensure that the BankValue is not beyond the capacity of * the register @@ -512,7 +510,6 @@ AcpiExFieldDatumIo ( /*lint -fallthrough */ - case ACPI_TYPE_LOCAL_REGION_FIELD: /* * For simple RegionFields, we just directly access the owning @@ -522,10 +519,7 @@ AcpiExFieldDatumIo ( ReadWrite); break; - case ACPI_TYPE_LOCAL_INDEX_FIELD: - - /* * Ensure that the IndexValue is not beyond the capacity of * the register @@ -575,7 +569,6 @@ AcpiExFieldDatumIo ( } break; - default: ACPI_ERROR ((AE_INFO, "Wrong object type in field I/O %u", diff --git a/source/components/executer/exmisc.c b/source/components/executer/exmisc.c index e527514..7520c9b 100644 --- a/source/components/executer/exmisc.c +++ b/source/components/executer/exmisc.c @@ -115,16 +115,13 @@ AcpiExGetObjectReference ( } break; - case ACPI_DESC_TYPE_NAMED: - /* * A named reference that has already been resolved to a Node */ ReferencedObj = ObjDesc; break; - default: ACPI_ERROR ((AE_INFO, "Invalid descriptor type 0x%X", @@ -286,19 +283,23 @@ AcpiExDoConcatenate ( switch (Operand0->Common.Type) { case ACPI_TYPE_INTEGER: + Status = AcpiExConvertToInteger (Operand1, &LocalOperand1, 16); break; case ACPI_TYPE_STRING: + Status = AcpiExConvertToString (Operand1, &LocalOperand1, ACPI_IMPLICIT_CONVERT_HEX); break; case ACPI_TYPE_BUFFER: + Status = AcpiExConvertToBuffer (Operand1, &LocalOperand1); break; default: + ACPI_ERROR ((AE_INFO, "Invalid object type: 0x%X", Operand0->Common.Type)); Status = AE_AML_INTERNAL; @@ -450,37 +451,30 @@ AcpiExDoMathOp ( return (Integer0 + Integer1); - case AML_BIT_AND_OP: /* And (Integer0, Integer1, Result) */ return (Integer0 & Integer1); - case AML_BIT_NAND_OP: /* NAnd (Integer0, Integer1, Result) */ return (~(Integer0 & Integer1)); - case AML_BIT_OR_OP: /* Or (Integer0, Integer1, Result) */ return (Integer0 | Integer1); - case AML_BIT_NOR_OP: /* NOr (Integer0, Integer1, Result) */ return (~(Integer0 | Integer1)); - case AML_BIT_XOR_OP: /* XOr (Integer0, Integer1, Result) */ return (Integer0 ^ Integer1); - case AML_MULTIPLY_OP: /* Multiply (Integer0, Integer1, Result) */ return (Integer0 * Integer1); - case AML_SHIFT_LEFT_OP: /* ShiftLeft (Operand, ShiftCount, Result)*/ /* @@ -493,7 +487,6 @@ AcpiExDoMathOp ( } return (Integer0 << Integer1); - case AML_SHIFT_RIGHT_OP: /* ShiftRight (Operand, ShiftCount, Result) */ /* @@ -506,7 +499,6 @@ AcpiExDoMathOp ( } return (Integer0 >> Integer1); - case AML_SUBTRACT_OP: /* Subtract (Integer0, Integer1, Result) */ return (Integer0 - Integer1); @@ -571,6 +563,7 @@ AcpiExDoLogicalNumericOp ( break; default: + Status = AE_AML_INTERNAL; break; } @@ -638,19 +631,23 @@ AcpiExDoLogicalOp ( switch (Operand0->Common.Type) { case ACPI_TYPE_INTEGER: + Status = AcpiExConvertToInteger (Operand1, &LocalOperand1, 16); break; case ACPI_TYPE_STRING: + Status = AcpiExConvertToString (Operand1, &LocalOperand1, ACPI_IMPLICIT_CONVERT_HEX); break; case ACPI_TYPE_BUFFER: + Status = AcpiExConvertToBuffer (Operand1, &LocalOperand1); break; default: + Status = AE_AML_INTERNAL; break; } @@ -699,6 +696,7 @@ AcpiExDoLogicalOp ( break; default: + Status = AE_AML_INTERNAL; break; } @@ -776,6 +774,7 @@ AcpiExDoLogicalOp ( break; default: + Status = AE_AML_INTERNAL; break; } diff --git a/source/components/executer/exnames.c b/source/components/executer/exnames.c index fee4e5c..ac12e1a 100644 --- a/source/components/executer/exnames.c +++ b/source/components/executer/exnames.c @@ -334,7 +334,6 @@ AcpiExGetNameString ( HasPrefix = TRUE; break; - case AML_PARENT_PREFIX: /* Increment past possibly multiple parent prefixes */ @@ -352,7 +351,6 @@ AcpiExGetNameString ( HasPrefix = TRUE; break; - default: /* Not a prefix character */ @@ -388,7 +386,6 @@ AcpiExGetNameString ( } break; - case AML_MULTI_NAME_PREFIX_OP: ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "MultiNamePrefix at %p\n", @@ -420,7 +417,6 @@ AcpiExGetNameString ( break; - case 0: /* NullName valid as of 8-12-98 ASL/AML Grammar Update */ @@ -443,7 +439,6 @@ AcpiExGetNameString ( break; - default: /* Name segment string */ diff --git a/source/components/executer/exoparg1.c b/source/components/executer/exoparg1.c index 73fc026..ff8dee2 100644 --- a/source/components/executer/exoparg1.c +++ b/source/components/executer/exoparg1.c @@ -180,37 +180,31 @@ AcpiExOpcode_1A_0T_0R ( Status = AcpiExReleaseMutex (Operand[0], WalkState); break; - case AML_RESET_OP: /* Reset (EventObject) */ Status = AcpiExSystemResetEvent (Operand[0]); break; - case AML_SIGNAL_OP: /* Signal (EventObject) */ Status = AcpiExSystemSignalEvent (Operand[0]); break; - case AML_SLEEP_OP: /* Sleep (MsecTime) */ Status = AcpiExSystemDoSleep (Operand[0]->Integer.Value); break; - case AML_STALL_OP: /* Stall (UsecTime) */ Status = AcpiExSystemDoStall ((UINT32) Operand[0]->Integer.Value); break; - case AML_UNLOAD_OP: /* Unload (Handle) */ Status = AcpiExUnloadTable (Operand[0]); break; - default: /* Unknown opcode */ ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -330,7 +324,6 @@ AcpiExOpcode_1A_1T_1R ( ReturnDesc->Integer.Value = ~Operand[0]->Integer.Value; break; - case AML_FIND_SET_LEFT_BIT_OP: /* FindSetLeftBit (Operand, Result) */ ReturnDesc->Integer.Value = Operand[0]->Integer.Value; @@ -348,7 +341,6 @@ AcpiExOpcode_1A_1T_1R ( ReturnDesc->Integer.Value = Temp32; break; - case AML_FIND_SET_RIGHT_BIT_OP: /* FindSetRightBit (Operand, Result) */ ReturnDesc->Integer.Value = Operand[0]->Integer.Value; @@ -369,9 +361,7 @@ AcpiExOpcode_1A_1T_1R ( Temp32 == 0 ? 0 : (ACPI_INTEGER_BIT_SIZE + 1) - Temp32; break; - case AML_FROM_BCD_OP: /* FromBcd (BCDValue, Result) */ - /* * The 64-bit ACPI integer can hold 16 4-bit BCD characters * (if table is 32-bit, integer can hold 8 BCD characters) @@ -416,7 +406,6 @@ AcpiExOpcode_1A_1T_1R ( } break; - case AML_TO_BCD_OP: /* ToBcd (Operand, Result) */ ReturnDesc->Integer.Value = 0; @@ -448,9 +437,7 @@ AcpiExOpcode_1A_1T_1R ( } break; - case AML_COND_REF_OF_OP: /* CondRefOf (SourceObject, Result) */ - /* * This op is a little strange because the internal return value is * different than the return value stored in the result descriptor @@ -485,14 +472,14 @@ AcpiExOpcode_1A_1T_1R ( default: + /* No other opcodes get here */ + break; } break; - case AML_STORE_OP: /* Store (Source, Target) */ - /* * A store operand is typically a number, string, buffer or lvalue * Be careful about deleting the source object, @@ -519,7 +506,6 @@ AcpiExOpcode_1A_1T_1R ( } return_ACPI_STATUS (Status); - /* * ACPI 2.0 Opcodes */ @@ -529,7 +515,6 @@ AcpiExOpcode_1A_1T_1R ( WalkState); break; - case AML_TO_DECSTRING_OP: /* ToDecimalString (Data, Result) */ Status = AcpiExConvertToString (Operand[0], &ReturnDesc, @@ -541,7 +526,6 @@ AcpiExOpcode_1A_1T_1R ( } break; - case AML_TO_HEXSTRING_OP: /* ToHexString (Data, Result) */ Status = AcpiExConvertToString (Operand[0], &ReturnDesc, @@ -553,7 +537,6 @@ AcpiExOpcode_1A_1T_1R ( } break; - case AML_TO_BUFFER_OP: /* ToBuffer (Data, Result) */ Status = AcpiExConvertToBuffer (Operand[0], &ReturnDesc); @@ -564,7 +547,6 @@ AcpiExOpcode_1A_1T_1R ( } break; - case AML_TO_INTEGER_OP: /* ToInteger (Data, Result) */ Status = AcpiExConvertToInteger (Operand[0], &ReturnDesc, @@ -576,7 +558,6 @@ AcpiExOpcode_1A_1T_1R ( } break; - case AML_SHIFT_LEFT_BIT_OP: /* ShiftLeftBit (Source, BitNum) */ case AML_SHIFT_RIGHT_BIT_OP: /* ShiftRightBit (Source, BitNum) */ @@ -588,7 +569,6 @@ AcpiExOpcode_1A_1T_1R ( Status = AE_SUPPORT; goto Cleanup; - default: /* Unknown opcode */ ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -676,10 +656,8 @@ AcpiExOpcode_1A_0T_1R ( } break; - case AML_DECREMENT_OP: /* Decrement (Operand) */ case AML_INCREMENT_OP: /* Increment (Operand) */ - /* * Create a new integer. Can't just get the base integer and * increment it because it may be an Arg or Field. @@ -744,9 +722,7 @@ AcpiExOpcode_1A_0T_1R ( Status = AcpiExStore (ReturnDesc, Operand[0], WalkState); break; - case AML_TYPE_OP: /* ObjectType (SourceObject) */ - /* * Note: The operand is not resolved at this point because we want to * get the associated object, not its value. For example, we don't @@ -772,9 +748,7 @@ AcpiExOpcode_1A_0T_1R ( } break; - case AML_SIZE_OF_OP: /* SizeOf (SourceObject) */ - /* * Note: The operand is not resolved at this point because we want to * get the associated object, not its value. @@ -801,10 +775,12 @@ AcpiExOpcode_1A_0T_1R ( switch (Type) { case ACPI_TYPE_INTEGER: + Value = AcpiGbl_IntegerByteWidth; break; case ACPI_TYPE_STRING: + Value = TempDesc->String.Length; break; @@ -825,6 +801,7 @@ AcpiExOpcode_1A_0T_1R ( break; default: + ACPI_ERROR ((AE_INFO, "Operand must be Buffer/Integer/String/Package - found type %s", AcpiUtGetTypeName (Type))); @@ -932,9 +909,11 @@ AcpiExOpcode_1A_0T_1R ( break; case ACPI_TYPE_STRING: + break; default: + Status = AE_AML_OPERAND_TYPE; goto Cleanup; } @@ -993,7 +972,6 @@ AcpiExOpcode_1A_0T_1R ( switch (Operand[0]->Reference.Class) { case ACPI_REFCLASS_INDEX: - /* * The target type for the Index operator must be * either a Buffer or a Package @@ -1025,9 +1003,7 @@ AcpiExOpcode_1A_0T_1R ( } break; - case ACPI_TYPE_PACKAGE: - /* * Return the referenced element of the package. We must * add another reference to the referenced object, however. @@ -1039,7 +1015,6 @@ AcpiExOpcode_1A_0T_1R ( } break; - default: ACPI_ERROR ((AE_INFO, @@ -1050,7 +1025,6 @@ AcpiExOpcode_1A_0T_1R ( } break; - case ACPI_REFCLASS_REFOF: ReturnDesc = Operand[0]->Reference.Object; @@ -1067,8 +1041,8 @@ AcpiExOpcode_1A_0T_1R ( AcpiUtAddReference (ReturnDesc); break; - default: + ACPI_ERROR ((AE_INFO, "Unknown class in reference(%p) - 0x%2.2X", Operand[0], Operand[0]->Reference.Class)); @@ -1079,7 +1053,6 @@ AcpiExOpcode_1A_0T_1R ( } break; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", diff --git a/source/components/executer/exoparg2.c b/source/components/executer/exoparg2.c index 6151fa8..ff1d8bb 100644 --- a/source/components/executer/exoparg2.c +++ b/source/components/executer/exoparg2.c @@ -144,7 +144,6 @@ AcpiExOpcode_2A_0T_0R ( Status = AcpiEvQueueNotifyRequest (Node, Value); break; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -217,7 +216,6 @@ AcpiExOpcode_2A_2T_1R ( } break; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -331,16 +329,13 @@ AcpiExOpcode_2A_1T_1R ( &ReturnDesc->Integer.Value); break; - case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */ Status = AcpiExDoConcatenate (Operand[0], Operand[1], &ReturnDesc, WalkState); break; - case AML_TO_STRING_OP: /* ToString (Buffer, Length, Result) (ACPI 2.0) */ - /* * Input object is guaranteed to be a buffer at this point (it may have * been converted.) Copy the raw buffer data to a new object of @@ -380,7 +375,6 @@ AcpiExOpcode_2A_1T_1R ( Operand[0]->Buffer.Pointer, Length); break; - case AML_CONCAT_RES_OP: /* ConcatenateResTemplate (Buffer, Buffer, Result) (ACPI 2.0) */ @@ -389,7 +383,6 @@ AcpiExOpcode_2A_1T_1R ( &ReturnDesc, WalkState); break; - case AML_INDEX_OP: /* Index (Source Index Result) */ /* Create the internal return object */ @@ -479,7 +472,6 @@ AcpiExOpcode_2A_1T_1R ( WalkState->ResultObj = ReturnDesc; goto Cleanup; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -602,7 +594,6 @@ AcpiExOpcode_2A_0T_1R ( } break; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", diff --git a/source/components/executer/exoparg3.c b/source/components/executer/exoparg3.c index a7d4431..b850485 100644 --- a/source/components/executer/exoparg3.c +++ b/source/components/executer/exoparg3.c @@ -129,7 +129,6 @@ AcpiExOpcode_3A_0T_0R ( ACPI_FREE (Fatal); break; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -176,7 +175,6 @@ AcpiExOpcode_3A_1T_1R ( switch (WalkState->Opcode) { case AML_MID_OP: /* Mid (Source[0], Index[1], Length[2], Result[3]) */ - /* * Create the return object. The Source operand is guaranteed to be * either a String or a Buffer, so just use its type. @@ -268,7 +266,6 @@ AcpiExOpcode_3A_1T_1R ( ReturnDesc->Buffer.Flags |= AOPOBJ_DATA_VALID; break; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", diff --git a/source/components/executer/exoparg6.c b/source/components/executer/exoparg6.c index 6b04784..974d4c8 100644 --- a/source/components/executer/exoparg6.c +++ b/source/components/executer/exoparg6.c @@ -130,7 +130,6 @@ AcpiExDoMatch ( break; case MATCH_MEQ: - /* * True if equal: (P[i] == M) * Change to: (M == P[i]) @@ -144,7 +143,6 @@ AcpiExDoMatch ( break; case MATCH_MLE: - /* * True if less than or equal: (P[i] <= M) (P[i] NotGreater than M) * Change to: (M >= P[i]) (M NotLess than P[i]) @@ -159,7 +157,6 @@ AcpiExDoMatch ( break; case MATCH_MLT: - /* * True if less than: (P[i] < M) * Change to: (M > P[i]) @@ -173,7 +170,6 @@ AcpiExDoMatch ( break; case MATCH_MGE: - /* * True if greater than or equal: (P[i] >= M) (P[i] NotLess than M) * Change to: (M <= P[i]) (M NotGreater than P[i]) @@ -188,7 +184,6 @@ AcpiExDoMatch ( break; case MATCH_MGT: - /* * True if greater than: (P[i] > M) * Change to: (M < P[i]) @@ -328,13 +323,11 @@ AcpiExOpcode_6A_0T_1R ( } break; - case AML_LOAD_TABLE_OP: Status = AcpiExLoadTableOp (WalkState, &ReturnDesc); break; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", diff --git a/source/components/executer/exprep.c b/source/components/executer/exprep.c index 90687a5..c629224 100644 --- a/source/components/executer/exprep.c +++ b/source/components/executer/exprep.c @@ -267,26 +267,31 @@ AcpiExDecodeFieldAccess ( case AML_FIELD_ACCESS_BYTE: case AML_FIELD_ACCESS_BUFFER: /* ACPI 2.0 (SMBus Buffer) */ + ByteAlignment = 1; BitLength = 8; break; case AML_FIELD_ACCESS_WORD: + ByteAlignment = 2; BitLength = 16; break; case AML_FIELD_ACCESS_DWORD: + ByteAlignment = 4; BitLength = 32; break; case AML_FIELD_ACCESS_QWORD: /* ACPI 2.0 */ + ByteAlignment = 8; BitLength = 64; break; default: + /* Invalid field access type */ ACPI_ERROR ((AE_INFO, @@ -536,7 +541,6 @@ AcpiExPrepFieldValue ( ObjDesc->Field.AccessByteWidth, ObjDesc->Field.RegionObj)); break; - case ACPI_TYPE_LOCAL_BANK_FIELD: ObjDesc->BankField.Value = Info->BankValue; @@ -571,7 +575,6 @@ AcpiExPrepFieldValue ( break; - case ACPI_TYPE_LOCAL_INDEX_FIELD: /* Get the Index and Data registers */ @@ -625,7 +628,9 @@ AcpiExPrepFieldValue ( break; default: + /* No other types should get here */ + break; } diff --git a/source/components/executer/exregion.c b/source/components/executer/exregion.c index 1092a42..304cfe6 100644 --- a/source/components/executer/exregion.c +++ b/source/components/executer/exregion.c @@ -99,22 +99,27 @@ AcpiExSystemMemorySpaceHandler ( switch (BitWidth) { case 8: + Length = 1; break; case 16: + Length = 2; break; case 32: + Length = 4; break; case 64: + Length = 8; break; default: + ACPI_ERROR ((AE_INFO, "Invalid SystemMemory width %u", BitWidth)); return_ACPI_STATUS (AE_AML_OPERAND_VALUE); @@ -231,23 +236,29 @@ AcpiExSystemMemorySpaceHandler ( switch (BitWidth) { case 8: + *Value = (UINT64) ACPI_GET8 (LogicalAddrPtr); break; case 16: + *Value = (UINT64) ACPI_GET16 (LogicalAddrPtr); break; case 32: + *Value = (UINT64) ACPI_GET32 (LogicalAddrPtr); break; case 64: + *Value = (UINT64) ACPI_GET64 (LogicalAddrPtr); break; default: + /* BitWidth was already validated */ + break; } break; @@ -257,28 +268,35 @@ AcpiExSystemMemorySpaceHandler ( switch (BitWidth) { case 8: + ACPI_SET8 (LogicalAddrPtr, *Value); break; case 16: + ACPI_SET16 (LogicalAddrPtr, *Value); break; case 32: + ACPI_SET32 (LogicalAddrPtr, *Value); break; case 64: + ACPI_SET64 (LogicalAddrPtr, *Value); break; default: + /* BitWidth was already validated */ + break; } break; default: + Status = AE_BAD_PARAMETER; break; } @@ -343,6 +361,7 @@ AcpiExSystemIoSpaceHandler ( break; default: + Status = AE_BAD_PARAMETER; break; } diff --git a/source/components/executer/exresnte.c b/source/components/executer/exresnte.c index fae97db..c26cbb9 100644 --- a/source/components/executer/exresnte.c +++ b/source/components/executer/exresnte.c @@ -164,7 +164,6 @@ AcpiExResolveNodeToValue ( } break; - case ACPI_TYPE_BUFFER: if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER) @@ -184,7 +183,6 @@ AcpiExResolveNodeToValue ( } break; - case ACPI_TYPE_STRING: if (SourceDesc->Common.Type != ACPI_TYPE_STRING) @@ -200,7 +198,6 @@ AcpiExResolveNodeToValue ( AcpiUtAddReference (ObjDesc); break; - case ACPI_TYPE_INTEGER: if (SourceDesc->Common.Type != ACPI_TYPE_INTEGER) @@ -216,7 +213,6 @@ AcpiExResolveNodeToValue ( AcpiUtAddReference (ObjDesc); break; - case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD: @@ -252,7 +248,6 @@ AcpiExResolveNodeToValue ( return_ACPI_STATUS (AE_AML_OPERAND_TYPE); /* Cannot be AE_TYPE */ - case ACPI_TYPE_LOCAL_REFERENCE: switch (SourceDesc->Reference.Class) @@ -268,6 +263,7 @@ AcpiExResolveNodeToValue ( break; default: + /* No named references are allowed here */ ACPI_ERROR ((AE_INFO, @@ -278,7 +274,6 @@ AcpiExResolveNodeToValue ( } break; - default: /* Default case is for unknown types */ diff --git a/source/components/executer/exresolv.c b/source/components/executer/exresolv.c index e68ea05..e99d46c 100644 --- a/source/components/executer/exresolv.c +++ b/source/components/executer/exresolv.c @@ -176,7 +176,6 @@ AcpiExResolveObjectToValue ( { case ACPI_REFCLASS_LOCAL: case ACPI_REFCLASS_ARG: - /* * Get the local from the method's state info * Note: this increments the local's object reference count @@ -199,7 +198,6 @@ AcpiExResolveObjectToValue ( *StackPtr = ObjDesc; break; - case ACPI_REFCLASS_INDEX: switch (StackDesc->Reference.TargetType) @@ -209,7 +207,6 @@ AcpiExResolveObjectToValue ( /* Just return - do not dereference */ break; - case ACPI_TYPE_PACKAGE: /* If method call or CopyObject - do not dereference */ @@ -247,7 +244,6 @@ AcpiExResolveObjectToValue ( } break; - default: /* Invalid reference object */ @@ -260,7 +256,6 @@ AcpiExResolveObjectToValue ( } break; - case ACPI_REFCLASS_REFOF: case ACPI_REFCLASS_DEBUG: case ACPI_REFCLASS_TABLE: @@ -300,19 +295,16 @@ AcpiExResolveObjectToValue ( } break; - case ACPI_TYPE_BUFFER: Status = AcpiDsGetBufferArguments (StackDesc); break; - case ACPI_TYPE_PACKAGE: Status = AcpiDsGetPackageArguments (StackDesc); break; - case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD: @@ -330,6 +322,7 @@ AcpiExResolveObjectToValue ( break; default: + break; } @@ -374,10 +367,12 @@ AcpiExResolveMultiple ( switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc)) { case ACPI_DESC_TYPE_OPERAND: + Type = ObjDesc->Common.Type; break; case ACPI_DESC_TYPE_NAMED: + Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type; ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc); @@ -454,7 +449,6 @@ AcpiExResolveMultiple ( } break; - case ACPI_REFCLASS_INDEX: /* Get the type of this reference (index into another object) */ @@ -482,13 +476,11 @@ AcpiExResolveMultiple ( } break; - case ACPI_REFCLASS_TABLE: Type = ACPI_TYPE_DDB_HANDLE; goto Exit; - case ACPI_REFCLASS_LOCAL: case ACPI_REFCLASS_ARG: @@ -520,7 +512,6 @@ AcpiExResolveMultiple ( } break; - case ACPI_REFCLASS_DEBUG: /* The Debug Object is of type "DebugObject" */ @@ -528,7 +519,6 @@ AcpiExResolveMultiple ( Type = ACPI_TYPE_DEBUG_OBJECT; goto Exit; - default: ACPI_ERROR ((AE_INFO, @@ -564,7 +554,9 @@ Exit: break; default: + /* No change to Type required */ + break; } diff --git a/source/components/executer/exresop.c b/source/components/executer/exresop.c index 96410b2..59602ba 100644 --- a/source/components/executer/exresop.c +++ b/source/components/executer/exresop.c @@ -224,7 +224,6 @@ AcpiExResolveOperands ( } break; - case ACPI_DESC_TYPE_OPERAND: /* ACPI internal object */ @@ -277,7 +276,6 @@ AcpiExResolveOperands ( } break; - default: /* Invalid descriptor */ @@ -324,7 +322,6 @@ AcpiExResolveOperands ( case ARGI_TARGETREF: /* Allows implicit conversion rules before store */ case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */ case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */ - /* * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE * A Namespace Node is OK as-is @@ -342,9 +339,7 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_DATAREFOBJ: /* Store operator only */ - /* * We don't want to resolve IndexOp reference objects during * a store because this would be an implicit DeRefOf operation. @@ -360,7 +355,9 @@ AcpiExResolveOperands ( break; default: + /* All cases covered above */ + break; } @@ -453,9 +450,7 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_BUFFER: - /* * Need an operand of type ACPI_TYPE_BUFFER, * But we can implicitly convert from a STRING or INTEGER @@ -482,9 +477,7 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_STRING: - /* * Need an operand of type ACPI_TYPE_STRING, * But we can implicitly convert from a BUFFER or INTEGER @@ -512,7 +505,6 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_COMPUTEDATA: /* Need an operand of type INTEGER, STRING or BUFFER */ @@ -535,7 +527,6 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_BUFFER_OR_STRING: /* Need an operand of type STRING or BUFFER */ @@ -573,7 +564,6 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_DATAOBJECT: /* * ARGI_DATAOBJECT is only used by the SizeOf operator. @@ -593,6 +583,7 @@ AcpiExResolveOperands ( break; default: + ACPI_ERROR ((AE_INFO, "Needed [Buffer/String/Package/Reference], found [%s] %p", AcpiUtGetObjectTypeName (ObjDesc), ObjDesc)); @@ -601,7 +592,6 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_COMPLEXOBJ: /* Need a buffer or package or (ACPI 2.0) String */ @@ -616,6 +606,7 @@ AcpiExResolveOperands ( break; default: + ACPI_ERROR ((AE_INFO, "Needed [Buffer/String/Package], found [%s] %p", AcpiUtGetObjectTypeName (ObjDesc), ObjDesc)); @@ -624,7 +615,6 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_REGION_OR_BUFFER: /* Used by Load() only */ /* Need an operand of type REGION or a BUFFER (which could be a resolved region field) */ @@ -638,6 +628,7 @@ AcpiExResolveOperands ( break; default: + ACPI_ERROR ((AE_INFO, "Needed [Region/Buffer], found [%s] %p", AcpiUtGetObjectTypeName (ObjDesc), ObjDesc)); @@ -646,7 +637,6 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_DATAREFOBJ: /* Used by the Store() operator only */ @@ -694,7 +684,6 @@ AcpiExResolveOperands ( } goto NextOperand; - default: /* Unknown type */ diff --git a/source/components/executer/exstore.c b/source/components/executer/exstore.c index 98c3eca..2ec392e 100644 --- a/source/components/executer/exstore.c +++ b/source/components/executer/exstore.c @@ -124,6 +124,7 @@ AcpiExStore ( switch (DestDesc->Common.Type) { case ACPI_TYPE_LOCAL_REFERENCE: + break; case ACPI_TYPE_INTEGER: @@ -167,7 +168,6 @@ AcpiExStore ( WalkState, ACPI_IMPLICIT_CONVERSION); break; - case ACPI_REFCLASS_INDEX: /* Storing to an Index (pointer into a packager or buffer) */ @@ -175,7 +175,6 @@ AcpiExStore ( Status = AcpiExStoreObjectToIndex (SourceDesc, RefDesc, WalkState); break; - case ACPI_REFCLASS_LOCAL: case ACPI_REFCLASS_ARG: @@ -185,9 +184,7 @@ AcpiExStore ( RefDesc->Reference.Value, SourceDesc, WalkState); break; - case ACPI_REFCLASS_DEBUG: - /* * Storing to the Debug object causes the value stored to be * displayed and otherwise has no effect -- see ACPI Specification @@ -199,7 +196,6 @@ AcpiExStore ( ACPI_DEBUG_OBJECT (SourceDesc, 0, 0); break; - default: ACPI_ERROR ((AE_INFO, "Unknown Reference Class 0x%2.2X", @@ -308,9 +304,7 @@ AcpiExStoreObjectToIndex ( break; - case ACPI_TYPE_BUFFER_FIELD: - /* * Store into a Buffer or String (not actually a real BufferField) * at a location defined by an Index. @@ -368,7 +362,6 @@ AcpiExStoreObjectToIndex ( ObjDesc->Buffer.Pointer[IndexDesc->Reference.Value] = Value; break; - default: ACPI_ERROR ((AE_INFO, "Target is not a Package or BufferField")); @@ -473,11 +466,9 @@ AcpiExStoreObjectToNode ( &WalkState->ResultObj); break; - case ACPI_TYPE_INTEGER: case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: - /* * These target types are all of type Integer/String/Buffer, and * therefore support implicit conversion before the store. @@ -511,7 +502,6 @@ AcpiExStoreObjectToNode ( } break; - default: ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, diff --git a/source/components/executer/exstoren.c b/source/components/executer/exstoren.c index ae36296..a21d8b9e 100644 --- a/source/components/executer/exstoren.c +++ b/source/components/executer/exstoren.c @@ -94,11 +94,9 @@ AcpiExResolveObject ( * These cases all require only Integers or values that * can be converted to Integers (Strings or Buffers) */ - case ACPI_TYPE_INTEGER: case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: - /* * Stores into a Field/Region or into a Integer/Buffer/String * are all essentially the same. This case handles the @@ -140,10 +138,8 @@ AcpiExResolveObject ( } break; - case ACPI_TYPE_LOCAL_ALIAS: case ACPI_TYPE_LOCAL_METHOD_ALIAS: - /* * All aliases should have been resolved earlier, during the * operand resolution phase. @@ -152,10 +148,8 @@ AcpiExResolveObject ( Status = AE_AML_INTERNAL; break; - case ACPI_TYPE_PACKAGE: default: - /* * All other types than Alias and the various Fields come here, * including the untyped case - ACPI_TYPE_ANY. diff --git a/source/components/hardware/hwacpi.c b/source/components/hardware/hwacpi.c index d4d5b55..deb2dfb 100644 --- a/source/components/hardware/hwacpi.c +++ b/source/components/hardware/hwacpi.c @@ -120,7 +120,6 @@ AcpiHwSetMode ( break; case ACPI_SYS_MODE_LEGACY: - /* * BIOS should clear all fixed status bits and restore fixed event * enable bits to default @@ -132,6 +131,7 @@ AcpiHwSetMode ( break; default: + return_ACPI_STATUS (AE_BAD_PARAMETER); } diff --git a/source/components/hardware/hwgpe.c b/source/components/hardware/hwgpe.c index efeba2b..4f123bc 100644 --- a/source/components/hardware/hwgpe.c +++ b/source/components/hardware/hwgpe.c @@ -142,14 +142,17 @@ AcpiHwLowSetGpe ( /*lint -fallthrough */ case ACPI_GPE_ENABLE: + ACPI_SET_BIT (EnableMask, RegisterBit); break; case ACPI_GPE_DISABLE: + ACPI_CLEAR_BIT (EnableMask, RegisterBit); break; default: + ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u", Action)); return (AE_BAD_PARAMETER); } diff --git a/source/components/hardware/hwregs.c b/source/components/hardware/hwregs.c index ca2f48b..88f8b4e 100644 --- a/source/components/hardware/hwregs.c +++ b/source/components/hardware/hwregs.c @@ -430,7 +430,6 @@ AcpiHwRegisterRead ( &AcpiGbl_XPm1bStatus); break; - case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */ Status = AcpiHwReadMultiple (&Value, @@ -438,7 +437,6 @@ AcpiHwRegisterRead ( &AcpiGbl_XPm1bEnable); break; - case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */ Status = AcpiHwReadMultiple (&Value, @@ -453,26 +451,23 @@ AcpiHwRegisterRead ( Value &= ~ACPI_PM1_CONTROL_WRITEONLY_BITS; break; - case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPm2ControlBlock); break; - case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPmTimerBlock); break; - case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ Status = AcpiHwReadPort (AcpiGbl_FADT.SmiCommand, &Value, 8); break; - default: + ACPI_ERROR ((AE_INFO, "Unknown Register ID: 0x%X", RegisterId)); Status = AE_BAD_PARAMETER; @@ -546,7 +541,6 @@ AcpiHwRegisterWrite ( &AcpiGbl_XPm1bStatus); break; - case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */ Status = AcpiHwWriteMultiple (Value, @@ -554,9 +548,7 @@ AcpiHwRegisterWrite ( &AcpiGbl_XPm1bEnable); break; - case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */ - /* * Perform a read first to preserve certain bits (per ACPI spec) * Note: This includes SCI_EN, we never want to change this bit @@ -580,9 +572,7 @@ AcpiHwRegisterWrite ( &AcpiGbl_FADT.XPm1bControlBlock); break; - case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ - /* * For control registers, all reserved bits must be preserved, * as per the ACPI spec. @@ -600,13 +590,11 @@ AcpiHwRegisterWrite ( Status = AcpiHwWrite (Value, &AcpiGbl_FADT.XPm2ControlBlock); break; - case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ Status = AcpiHwWrite (Value, &AcpiGbl_FADT.XPmTimerBlock); break; - case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ /* SMI_CMD is currently always in IO space */ @@ -614,8 +602,8 @@ AcpiHwRegisterWrite ( Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand, Value, 8); break; - default: + ACPI_ERROR ((AE_INFO, "Unknown Register ID: 0x%X", RegisterId)); Status = AE_BAD_PARAMETER; diff --git a/source/components/hardware/hwxface.c b/source/components/hardware/hwxface.c index 6f26c79..25ad60a 100644 --- a/source/components/hardware/hwxface.c +++ b/source/components/hardware/hwxface.c @@ -592,10 +592,12 @@ AcpiGetSleepTypeData ( switch (Info->ReturnObject->Package.Count) { case 0: + Status = AE_AML_PACKAGE_LIMIT; break; case 1: + if (Elements[0]->Common.Type != ACPI_TYPE_INTEGER) { Status = AE_AML_OPERAND_TYPE; @@ -610,6 +612,7 @@ AcpiGetSleepTypeData ( case 2: default: + if ((Elements[0]->Common.Type != ACPI_TYPE_INTEGER) || (Elements[1]->Common.Type != ACPI_TYPE_INTEGER)) { diff --git a/source/components/hardware/hwxfsleep.c b/source/components/hardware/hwxfsleep.c index 42f0543..8259f01 100644 --- a/source/components/hardware/hwxfsleep.c +++ b/source/components/hardware/hwxfsleep.c @@ -267,13 +267,14 @@ AcpiHwSleepDispatch ( #if (!ACPI_REDUCED_HARDWARE) - /* * If the Hardware Reduced flag is set (from the FADT), we must - * use the extended sleep registers + * use the extended sleep registers (FADT). Note: As per the ACPI + * specification, these extended registers are to be used for HW-reduced + * platforms only. They are not general-purpose replacements for the + * legacy PM register sleep support. */ - if (AcpiGbl_ReducedHardware || - AcpiGbl_FADT.SleepControl.Address) + if (AcpiGbl_ReducedHardware) { Status = SleepFunctions->ExtendedFunction (SleepState); } @@ -351,20 +352,24 @@ AcpiEnterSleepStatePrep ( switch (SleepState) { case ACPI_STATE_S0: + SstValue = ACPI_SST_WORKING; break; case ACPI_STATE_S1: case ACPI_STATE_S2: case ACPI_STATE_S3: + SstValue = ACPI_SST_SLEEPING; break; case ACPI_STATE_S4: + SstValue = ACPI_SST_SLEEP_CONTEXT; break; default: + SstValue = ACPI_SST_INDICATOR_OFF; /* Default is off */ break; } diff --git a/source/components/namespace/nsaccess.c b/source/components/namespace/nsaccess.c index 609256b..ad94f6c 100644 --- a/source/components/namespace/nsaccess.c +++ b/source/components/namespace/nsaccess.c @@ -167,6 +167,7 @@ AcpiNsRootInitialize ( switch (InitVal->Type) { case ACPI_TYPE_METHOD: + ObjDesc->Method.ParamCount = (UINT8) ACPI_TO_INTEGER (Val); ObjDesc->Common.Flags |= AOPOBJ_DATA_VALID; @@ -188,7 +189,6 @@ AcpiNsRootInitialize ( ObjDesc->Integer.Value = ACPI_TO_INTEGER (Val); break; - case ACPI_TYPE_STRING: /* Build an object around the static string */ @@ -198,7 +198,6 @@ AcpiNsRootInitialize ( ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER; break; - case ACPI_TYPE_MUTEX: ObjDesc->Mutex.Node = NewNode; @@ -231,7 +230,6 @@ AcpiNsRootInitialize ( } break; - default: ACPI_ERROR ((AE_INFO, "Unsupported initial type value 0x%X", diff --git a/source/components/namespace/nsconvert.c b/source/components/namespace/nsconvert.c index e3ff375..11aca36 100644 --- a/source/components/namespace/nsconvert.c +++ b/source/components/namespace/nsconvert.c @@ -111,6 +111,7 @@ AcpiNsConvertToInteger ( break; default: + return (AE_AML_OPERAND_TYPE); } @@ -208,6 +209,7 @@ AcpiNsConvertToString ( break; default: + return (AE_AML_OPERAND_TYPE); } @@ -317,6 +319,7 @@ AcpiNsConvertToBuffer ( break; default: + return (AE_AML_OPERAND_TYPE); } diff --git a/source/components/namespace/nsdump.c b/source/components/namespace/nsdump.c index ac7b679..be780f2 100644 --- a/source/components/namespace/nsdump.c +++ b/source/components/namespace/nsdump.c @@ -282,10 +282,12 @@ AcpiNsDumpOneObject ( case ACPI_TYPE_BUFFER: case ACPI_TYPE_STRING: case ACPI_TYPE_METHOD: + AcpiOsPrintf ("<No attached object>"); break; default: + break; } @@ -302,13 +304,11 @@ AcpiNsDumpOneObject ( ACPI_CAST_PTR (void, ObjDesc->Processor.Address)); break; - case ACPI_TYPE_DEVICE: AcpiOsPrintf ("Notify Object: %p\n", ObjDesc); break; - case ACPI_TYPE_METHOD: AcpiOsPrintf ("Args %X Len %.4X Aml %p\n", @@ -316,14 +316,12 @@ AcpiNsDumpOneObject ( ObjDesc->Method.AmlLength, ObjDesc->Method.AmlStart); break; - case ACPI_TYPE_INTEGER: AcpiOsPrintf ("= %8.8X%8.8X\n", ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); break; - case ACPI_TYPE_PACKAGE: if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID) @@ -337,7 +335,6 @@ AcpiNsDumpOneObject ( } break; - case ACPI_TYPE_BUFFER: if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID) @@ -363,7 +360,6 @@ AcpiNsDumpOneObject ( } break; - case ACPI_TYPE_STRING: AcpiOsPrintf ("Len %.2X ", ObjDesc->String.Length); @@ -371,7 +367,6 @@ AcpiNsDumpOneObject ( AcpiOsPrintf ("\n"); break; - case ACPI_TYPE_REGION: AcpiOsPrintf ("[%s]", @@ -388,13 +383,11 @@ AcpiNsDumpOneObject ( } break; - case ACPI_TYPE_LOCAL_REFERENCE: AcpiOsPrintf ("[%s]\n", AcpiUtGetReferenceName (ObjDesc)); break; - case ACPI_TYPE_BUFFER_FIELD: if (ObjDesc->BufferField.BufferObj && @@ -406,7 +399,6 @@ AcpiNsDumpOneObject ( } break; - case ACPI_TYPE_LOCAL_REGION_FIELD: AcpiOsPrintf ("Rgn [%4.4s]", @@ -414,7 +406,6 @@ AcpiNsDumpOneObject ( ObjDesc->CommonField.RegionObj->Region.Node)); break; - case ACPI_TYPE_LOCAL_BANK_FIELD: AcpiOsPrintf ("Rgn [%4.4s] Bnk [%4.4s]", @@ -424,7 +415,6 @@ AcpiNsDumpOneObject ( ObjDesc->BankField.BankObj->CommonField.Node)); break; - case ACPI_TYPE_LOCAL_INDEX_FIELD: AcpiOsPrintf ("Idx [%4.4s] Dat [%4.4s]", @@ -434,7 +424,6 @@ AcpiNsDumpOneObject ( ObjDesc->IndexField.DataObj->CommonField.Node)); break; - case ACPI_TYPE_LOCAL_ALIAS: case ACPI_TYPE_LOCAL_METHOD_ALIAS: @@ -465,11 +454,11 @@ AcpiNsDumpOneObject ( break; default: + break; } break; - case ACPI_DISPLAY_OBJECTS: AcpiOsPrintf ("O:%p", ObjDesc); @@ -518,7 +507,6 @@ AcpiNsDumpOneObject ( } break; - default: AcpiOsPrintf ("\n"); break; @@ -605,30 +593,37 @@ AcpiNsDumpOneObject ( goto Cleanup; case ACPI_TYPE_BUFFER_FIELD: + ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->BufferField.BufferObj; break; case ACPI_TYPE_PACKAGE: + ObjDesc = (void *) ObjDesc->Package.Elements; break; case ACPI_TYPE_METHOD: + ObjDesc = (void *) ObjDesc->Method.AmlStart; break; case ACPI_TYPE_LOCAL_REGION_FIELD: + ObjDesc = (void *) ObjDesc->Field.RegionObj; break; case ACPI_TYPE_LOCAL_BANK_FIELD: + ObjDesc = (void *) ObjDesc->BankField.RegionObj; break; case ACPI_TYPE_LOCAL_INDEX_FIELD: + ObjDesc = (void *) ObjDesc->IndexField.IndexObj; break; default: + goto Cleanup; } diff --git a/source/components/namespace/nsinit.c b/source/components/namespace/nsinit.c index 7e7764c..05d78c1 100644 --- a/source/components/namespace/nsinit.c +++ b/source/components/namespace/nsinit.c @@ -296,28 +296,34 @@ AcpiNsInitOneObject ( switch (Type) { case ACPI_TYPE_REGION: + Info->OpRegionCount++; break; case ACPI_TYPE_BUFFER_FIELD: + Info->FieldCount++; break; case ACPI_TYPE_LOCAL_BANK_FIELD: + Info->FieldCount++; break; case ACPI_TYPE_BUFFER: + Info->BufferCount++; break; case ACPI_TYPE_PACKAGE: + Info->PackageCount++; break; default: /* No init required, just exit now */ + return (AE_OK); } @@ -369,7 +375,9 @@ AcpiNsInitOneObject ( break; default: + /* No other types can get here */ + break; } @@ -456,6 +464,7 @@ AcpiNsFindIniMethods ( break; default: + break; } diff --git a/source/components/namespace/nspredef.c b/source/components/namespace/nspredef.c index aff90d8..7122e7a 100644 --- a/source/components/namespace/nspredef.c +++ b/source/components/namespace/nspredef.c @@ -175,7 +175,13 @@ AcpiNsCheckReturnValue ( Status = AcpiNsCheckPackage (Info, ReturnObjectPtr); if (ACPI_FAILURE (Status)) { - goto Exit; + /* We might be able to fix some errors */ + + if ((Status != AE_AML_OPERAND_TYPE) && + (Status != AE_AML_OPERAND_VALUE)) + { + goto Exit; + } } } @@ -377,26 +383,32 @@ AcpiNsGetBitmappedType ( switch (ReturnObject->Common.Type) { case ACPI_TYPE_INTEGER: + ReturnBtype = ACPI_RTYPE_INTEGER; break; case ACPI_TYPE_BUFFER: + ReturnBtype = ACPI_RTYPE_BUFFER; break; case ACPI_TYPE_STRING: + ReturnBtype = ACPI_RTYPE_STRING; break; case ACPI_TYPE_PACKAGE: + ReturnBtype = ACPI_RTYPE_PACKAGE; break; case ACPI_TYPE_LOCAL_REFERENCE: + ReturnBtype = ACPI_RTYPE_REFERENCE; break; default: + /* Not one of the supported objects, must be incorrect */ ReturnBtype = ACPI_RTYPE_ANY; diff --git a/source/components/namespace/nsprepkg.c b/source/components/namespace/nsprepkg.c index 5177c3d..6d74d57 100644 --- a/source/components/namespace/nsprepkg.c +++ b/source/components/namespace/nsprepkg.c @@ -149,7 +149,6 @@ AcpiNsCheckPackage ( switch (Package->RetInfo.Type) { case ACPI_PTYPE1_FIXED: - /* * The package count is fixed and there are no sub-packages * @@ -176,9 +175,7 @@ AcpiNsCheckPackage ( Package->RetInfo.ObjectType2, Package->RetInfo.Count2, 0); break; - case ACPI_PTYPE1_VAR: - /* * The package count is variable, there are no sub-packages, and all * elements must be of the same type @@ -195,9 +192,7 @@ AcpiNsCheckPackage ( } break; - case ACPI_PTYPE1_OPTION: - /* * The package count is variable, there are no sub-packages. There are * a fixed number of required elements, and a variable number of @@ -241,7 +236,6 @@ AcpiNsCheckPackage ( } break; - case ACPI_PTYPE2_REV_FIXED: /* First element is the (Integer) revision */ @@ -261,7 +255,6 @@ AcpiNsCheckPackage ( Status = AcpiNsCheckPackageList (Info, Package, Elements, Count); break; - case ACPI_PTYPE2_PKG_COUNT: /* First element is the (Integer) count of sub-packages to follow */ @@ -291,13 +284,11 @@ AcpiNsCheckPackage ( Status = AcpiNsCheckPackageList (Info, Package, Elements, Count); break; - case ACPI_PTYPE2: case ACPI_PTYPE2_FIXED: case ACPI_PTYPE2_MIN: case ACPI_PTYPE2_COUNT: case ACPI_PTYPE2_FIX_VAR: - /* * These types all return a single Package that consists of a * variable number of sub-Packages. @@ -330,7 +321,6 @@ AcpiNsCheckPackage ( Status = AcpiNsCheckPackageList (Info, Package, Elements, Count); break; - default: /* Should not get here if predefined info table is correct */ @@ -438,7 +428,6 @@ AcpiNsCheckPackageList ( } break; - case ACPI_PTYPE2_FIX_VAR: /* * Each subpackage has a fixed number of elements and an @@ -461,7 +450,6 @@ AcpiNsCheckPackageList ( } break; - case ACPI_PTYPE2_FIXED: /* Each sub-package has a fixed length */ @@ -485,7 +473,6 @@ AcpiNsCheckPackageList ( } break; - case ACPI_PTYPE2_MIN: /* Each sub-package has a variable but minimum length */ @@ -507,9 +494,7 @@ AcpiNsCheckPackageList ( } break; - case ACPI_PTYPE2_COUNT: - /* * First element is the (Integer) count of elements, including * the count field (the ACPI name is NumElements) @@ -558,7 +543,6 @@ AcpiNsCheckPackageList ( } break; - default: /* Should not get here, type was validated by caller */ return (AE_AML_INTERNAL); diff --git a/source/components/namespace/nsrepair.c b/source/components/namespace/nsrepair.c index 893ebe5..45b4660 100644 --- a/source/components/namespace/nsrepair.c +++ b/source/components/namespace/nsrepair.c @@ -510,6 +510,7 @@ AcpiNsRemoveNullElements ( case ACPI_PTYPE2_MIN: case ACPI_PTYPE2_REV_FIXED: case ACPI_PTYPE2_FIX_VAR: + break; default: diff --git a/source/components/namespace/nsrepair2.c b/source/components/namespace/nsrepair2.c index 63fb36d..0dcfaad 100644 --- a/source/components/namespace/nsrepair2.c +++ b/source/components/namespace/nsrepair2.c @@ -86,6 +86,11 @@ AcpiNsRepair_CID ( ACPI_OPERAND_OBJECT **ReturnObjectPtr); static ACPI_STATUS +AcpiNsRepair_CST ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + +static ACPI_STATUS AcpiNsRepair_FDE ( ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr); @@ -96,6 +101,11 @@ AcpiNsRepair_HID ( ACPI_OPERAND_OBJECT **ReturnObjectPtr); static ACPI_STATUS +AcpiNsRepair_PRT ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + +static ACPI_STATUS AcpiNsRepair_PSS ( ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr); @@ -109,11 +119,22 @@ static ACPI_STATUS AcpiNsCheckSortedList ( ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT *ReturnObject, + UINT32 StartIndex, UINT32 ExpectedCount, UINT32 SortIndex, UINT8 SortDirection, char *SortKeyName); +/* Values for SortDirection above */ + +#define ACPI_SORT_ASCENDING 0 +#define ACPI_SORT_DESCENDING 1 + +static void +AcpiNsRemoveElement ( + ACPI_OPERAND_OBJECT *ObjDesc, + UINT32 Index); + static void AcpiNsSortList ( ACPI_OPERAND_OBJECT **Elements, @@ -121,11 +142,6 @@ AcpiNsSortList ( UINT32 Index, UINT8 SortDirection); -/* Values for SortDirection above */ - -#define ACPI_SORT_ASCENDING 0 -#define ACPI_SORT_DESCENDING 1 - /* * This table contains the names of the predefined methods for which we can @@ -135,9 +151,11 @@ AcpiNsSortList ( * * _ALR: Sort the list ascending by AmbientIlluminance * _CID: Strings: uppercase all, remove any leading asterisk + * _CST: Sort the list ascending by C state type * _FDE: Convert Buffer of BYTEs to a Buffer of DWORDs * _GTM: Convert Buffer of BYTEs to a Buffer of DWORDs * _HID: Strings: uppercase all, remove any leading asterisk + * _PRT: Fix reversed SourceName and SourceIndex * _PSS: Sort the list descending by Power * _TSS: Sort the list descending by Power * @@ -152,9 +170,11 @@ static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] = { {"_ALR", AcpiNsRepair_ALR}, {"_CID", AcpiNsRepair_CID}, + {"_CST", AcpiNsRepair_CST}, {"_FDE", AcpiNsRepair_FDE}, {"_GTM", AcpiNsRepair_FDE}, /* _GTM has same repair as _FDE */ {"_HID", AcpiNsRepair_HID}, + {"_PRT", AcpiNsRepair_PRT}, {"_PSS", AcpiNsRepair_PSS}, {"_TSS", AcpiNsRepair_TSS}, {{0,0,0,0}, NULL} /* Table terminator */ @@ -267,7 +287,7 @@ AcpiNsRepair_ALR ( ACPI_STATUS Status; - Status = AcpiNsCheckSortedList (Info, ReturnObject, 2, 1, + Status = AcpiNsCheckSortedList (Info, ReturnObject, 0, 2, 1, ACPI_SORT_ASCENDING, "AmbientIlluminance"); return (Status); @@ -354,6 +374,7 @@ AcpiNsRepair_FDE ( break; default: + return (AE_AML_OPERAND_TYPE); } @@ -446,6 +467,97 @@ AcpiNsRepair_CID ( /****************************************************************************** * + * FUNCTION: AcpiNsRepair_CST + * + * PARAMETERS: Info - Method execution information block + * ReturnObjectPtr - Pointer to the object returned from the + * evaluation of a method or object + * + * RETURN: Status. AE_OK if object is OK or was repaired successfully + * + * DESCRIPTION: Repair for the _CST object: + * 1. Sort the list ascending by C state type + * 2. Ensure type cannot be zero + * 3. A sub-package count of zero means _CST is meaningless + * 4. Count must match the number of C state sub-packages + * + *****************************************************************************/ + +static ACPI_STATUS +AcpiNsRepair_CST ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **ReturnObjectPtr) +{ + ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; + ACPI_OPERAND_OBJECT **OuterElements; + UINT32 OuterElementCount; + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_STATUS Status; + BOOLEAN Removing; + UINT32 i; + + + ACPI_FUNCTION_NAME (NsRepair_CST); + + + /* + * Entries (subpackages) in the _CST Package must be sorted by the + * C-state type, in ascending order. + */ + Status = AcpiNsCheckSortedList (Info, ReturnObject, 1, 4, 1, + ACPI_SORT_ASCENDING, "C-State Type"); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* + * We now know the list is correctly sorted by C-state type. Check if + * the C-state type values are proportional. + */ + OuterElementCount = ReturnObject->Package.Count - 1; + i = 0; + while (i < OuterElementCount) + { + OuterElements = &ReturnObject->Package.Elements[i + 1]; + Removing = FALSE; + + if ((*OuterElements)->Package.Count == 0) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, + "SubPackage[%u] - removing entry due to zero count", i)); + Removing = TRUE; + } + + ObjDesc = (*OuterElements)->Package.Elements[1]; /* Index1 = Type */ + if ((UINT32) ObjDesc->Integer.Value == 0) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, + "SubPackage[%u] - removing entry due to invalid Type(0)", i)); + Removing = TRUE; + } + + if (Removing) + { + AcpiNsRemoveElement (ReturnObject, i + 1); + OuterElementCount--; + } + else + { + i++; + } + } + + /* Update top-level package count, Type "Integer" checked elsewhere */ + + ObjDesc = ReturnObject->Package.Elements[0]; + ObjDesc->Integer.Value = OuterElementCount; + return (AE_OK); +} + + +/****************************************************************************** + * * FUNCTION: AcpiNsRepair_HID * * PARAMETERS: Info - Method execution information block @@ -536,7 +648,7 @@ AcpiNsRepair_HID ( /****************************************************************************** * - * FUNCTION: AcpiNsRepair_TSS + * FUNCTION: AcpiNsRepair_PRT * * PARAMETERS: Info - Method execution information block * ReturnObjectPtr - Pointer to the object returned from the @@ -544,40 +656,57 @@ AcpiNsRepair_HID ( * * RETURN: Status. AE_OK if object is OK or was repaired successfully * - * DESCRIPTION: Repair for the _TSS object. If necessary, sort the object list - * descending by the power dissipation values. + * DESCRIPTION: Repair for the _PRT object. If necessary, fix reversed + * SourceName and SourceIndex field, a common BIOS bug. * *****************************************************************************/ static ACPI_STATUS -AcpiNsRepair_TSS ( +AcpiNsRepair_PRT ( ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr) { - ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; - ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node; + ACPI_OPERAND_OBJECT *PackageObject = *ReturnObjectPtr; + ACPI_OPERAND_OBJECT **TopObjectList; + ACPI_OPERAND_OBJECT **SubObjectList; + ACPI_OPERAND_OBJECT *ObjDesc; + UINT32 ElementCount; + UINT32 Index; - /* - * We can only sort the _TSS return package if there is no _PSS in the - * same scope. This is because if _PSS is present, the ACPI specification - * dictates that the _TSS Power Dissipation field is to be ignored, and - * therefore some BIOSs leave garbage values in the _TSS Power field(s). - * In this case, it is best to just return the _TSS package as-is. - * (May, 2011) - */ - Status = AcpiNsGetNode (Info->Node, "^_PSS", - ACPI_NS_NO_UPSEARCH, &Node); - if (ACPI_SUCCESS (Status)) + /* Each element in the _PRT package is a subpackage */ + + TopObjectList = PackageObject->Package.Elements; + ElementCount = PackageObject->Package.Count; + + for (Index = 0; Index < ElementCount; Index++) { - return (AE_OK); - } + SubObjectList = (*TopObjectList)->Package.Elements; - Status = AcpiNsCheckSortedList (Info, ReturnObject, 5, 1, - ACPI_SORT_DESCENDING, "PowerDissipation"); + /* + * If the BIOS has erroneously reversed the _PRT SourceName (index 2) + * and the SourceIndex (index 3), fix it. _PRT is important enough to + * workaround this BIOS error. This also provides compatibility with + * other ACPI implementations. + */ + ObjDesc = SubObjectList[3]; + if (!ObjDesc || (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)) + { + SubObjectList[3] = SubObjectList[2]; + SubObjectList[2] = ObjDesc; + Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; - return (Status); + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, + "PRT[%X]: Fixed reversed SourceName and SourceIndex", + Index)); + } + + /* Point to the next ACPI_OPERAND_OBJECT in the top level package */ + + TopObjectList++; + } + + return (AE_OK); } @@ -619,7 +748,7 @@ AcpiNsRepair_PSS ( * incorrectly sorted, sort it. We sort by CpuFrequency, since this * should be proportional to the power. */ - Status =AcpiNsCheckSortedList (Info, ReturnObject, 6, 0, + Status =AcpiNsCheckSortedList (Info, ReturnObject, 0, 6, 0, ACPI_SORT_DESCENDING, "CpuFrequency"); if (ACPI_FAILURE (Status)) { @@ -656,10 +785,58 @@ AcpiNsRepair_PSS ( /****************************************************************************** * + * FUNCTION: AcpiNsRepair_TSS + * + * PARAMETERS: Info - Method execution information block + * ReturnObjectPtr - Pointer to the object returned from the + * evaluation of a method or object + * + * RETURN: Status. AE_OK if object is OK or was repaired successfully + * + * DESCRIPTION: Repair for the _TSS object. If necessary, sort the object list + * descending by the power dissipation values. + * + *****************************************************************************/ + +static ACPI_STATUS +AcpiNsRepair_TSS ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **ReturnObjectPtr) +{ + ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; + ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node; + + + /* + * We can only sort the _TSS return package if there is no _PSS in the + * same scope. This is because if _PSS is present, the ACPI specification + * dictates that the _TSS Power Dissipation field is to be ignored, and + * therefore some BIOSs leave garbage values in the _TSS Power field(s). + * In this case, it is best to just return the _TSS package as-is. + * (May, 2011) + */ + Status = AcpiNsGetNode (Info->Node, "^_PSS", + ACPI_NS_NO_UPSEARCH, &Node); + if (ACPI_SUCCESS (Status)) + { + return (AE_OK); + } + + Status = AcpiNsCheckSortedList (Info, ReturnObject, 0, 5, 1, + ACPI_SORT_DESCENDING, "PowerDissipation"); + + return (Status); +} + + +/****************************************************************************** + * * FUNCTION: AcpiNsCheckSortedList * * PARAMETERS: Info - Method execution information block * ReturnObject - Pointer to the top-level returned object + * StartIndex - Index of the first sub-package * ExpectedCount - Minimum length of each sub-package * SortIndex - Sub-package entry to sort on * SortDirection - Ascending or descending @@ -677,6 +854,7 @@ static ACPI_STATUS AcpiNsCheckSortedList ( ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT *ReturnObject, + UINT32 StartIndex, UINT32 ExpectedCount, UINT32 SortIndex, UINT8 SortDirection, @@ -705,13 +883,15 @@ AcpiNsCheckSortedList ( * Any NULL elements should have been removed by earlier call * to AcpiNsRemoveNullElements. */ - OuterElements = ReturnObject->Package.Elements; OuterElementCount = ReturnObject->Package.Count; - if (!OuterElementCount) + if (!OuterElementCount || StartIndex >= OuterElementCount) { return (AE_AML_PACKAGE_LIMIT); } + OuterElements = &ReturnObject->Package.Elements[StartIndex]; + OuterElementCount -= StartIndex; + PreviousValue = 0; if (SortDirection == ACPI_SORT_DESCENDING) { @@ -753,7 +933,7 @@ AcpiNsCheckSortedList ( ((SortDirection == ACPI_SORT_DESCENDING) && (ObjDesc->Integer.Value > PreviousValue))) { - AcpiNsSortList (ReturnObject->Package.Elements, + AcpiNsSortList (&ReturnObject->Package.Elements[StartIndex], OuterElementCount, SortIndex, SortDirection); Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; @@ -826,3 +1006,61 @@ AcpiNsSortList ( } } } + + +/****************************************************************************** + * + * FUNCTION: AcpiNsRemoveElement + * + * PARAMETERS: ObjDesc - Package object element list + * Index - Index of element to remove + * + * RETURN: None + * + * DESCRIPTION: Remove the requested element of a package and delete it. + * + *****************************************************************************/ + +static void +AcpiNsRemoveElement ( + ACPI_OPERAND_OBJECT *ObjDesc, + UINT32 Index) +{ + ACPI_OPERAND_OBJECT **Source; + ACPI_OPERAND_OBJECT **Dest; + UINT32 Count; + UINT32 NewCount; + UINT32 i; + + + ACPI_FUNCTION_NAME (NsRemoveElement); + + + Count = ObjDesc->Package.Count; + NewCount = Count - 1; + + Source = ObjDesc->Package.Elements; + Dest = Source; + + /* Examine all elements of the package object, remove matched index */ + + for (i = 0; i < Count; i++) + { + if (i == Index) + { + AcpiUtRemoveReference (*Source); /* Remove one ref for being in pkg */ + AcpiUtRemoveReference (*Source); + } + else + { + *Dest = *Source; + Dest++; + } + Source++; + } + + /* NULL terminate list and update the package count */ + + *Dest = NULL; + ObjDesc->Package.Count = NewCount; +} diff --git a/source/components/namespace/nsutils.c b/source/components/namespace/nsutils.c index 16a6bdb..f2cf74f 100644 --- a/source/components/namespace/nsutils.c +++ b/source/components/namespace/nsutils.c @@ -497,10 +497,12 @@ AcpiNsExternalizeName ( switch (InternalName[0]) { case AML_ROOT_PREFIX: + PrefixLength = 1; break; case AML_PARENT_PREFIX: + for (i = 0; i < InternalNameLength; i++) { if (ACPI_IS_PARENT_PREFIX (InternalName[i])) @@ -521,6 +523,7 @@ AcpiNsExternalizeName ( break; default: + break; } diff --git a/source/components/namespace/nsxfeval.c b/source/components/namespace/nsxfeval.c index 57cc038..6a2649a 100644 --- a/source/components/namespace/nsxfeval.c +++ b/source/components/namespace/nsxfeval.c @@ -550,6 +550,7 @@ AcpiNsResolveReferences ( break; default: + return; } diff --git a/source/components/parser/psargs.c b/source/components/parser/psargs.c index 2bf7be7..42436fe 100644 --- a/source/components/parser/psargs.c +++ b/source/components/parser/psargs.c @@ -447,7 +447,6 @@ AcpiPsGetNextSimpleArg ( Length = 1; break; - case ARGP_WORDDATA: /* Get 2 bytes from the AML stream */ @@ -457,7 +456,6 @@ AcpiPsGetNextSimpleArg ( Length = 2; break; - case ARGP_DWORDDATA: /* Get 4 bytes from the AML stream */ @@ -467,7 +465,6 @@ AcpiPsGetNextSimpleArg ( Length = 4; break; - case ARGP_QWORDDATA: /* Get 8 bytes from the AML stream */ @@ -477,7 +474,6 @@ AcpiPsGetNextSimpleArg ( Length = 8; break; - case ARGP_CHARLIST: /* Get a pointer to the string, point past the string */ @@ -495,7 +491,6 @@ AcpiPsGetNextSimpleArg ( Length++; break; - case ARGP_NAME: case ARGP_NAMESTRING: @@ -503,7 +498,6 @@ AcpiPsGetNextSimpleArg ( Arg->Common.Value.Name = AcpiPsGetNextNamestring (ParserState); return_VOID; - default: ACPI_ERROR ((AE_INFO, "Invalid ArgType 0x%X", ArgType)); @@ -685,21 +679,25 @@ AcpiPsGetNextField ( switch (Opcode) { case AML_BYTE_OP: /* AML_BYTEDATA_ARG */ + BufferLength = ACPI_GET8 (ParserState->Aml); ParserState->Aml += 1; break; case AML_WORD_OP: /* AML_WORDDATA_ARG */ + BufferLength = ACPI_GET16 (ParserState->Aml); ParserState->Aml += 2; break; case AML_DWORD_OP: /* AML_DWORDATA_ARG */ + BufferLength = ACPI_GET32 (ParserState->Aml); ParserState->Aml += 4; break; default: + BufferLength = 0; break; } @@ -796,7 +794,6 @@ AcpiPsGetNextArg ( AcpiPsGetNextSimpleArg (ParserState, ArgType, Arg); break; - case ARGP_PKGLENGTH: /* Package length, nothing returned */ @@ -804,7 +801,6 @@ AcpiPsGetNextArg ( ParserState->PkgEnd = AcpiPsGetNextPackageEnd (ParserState); break; - case ARGP_FIELDLIST: if (ParserState->Aml < ParserState->PkgEnd) @@ -836,7 +832,6 @@ AcpiPsGetNextArg ( } break; - case ARGP_BYTELIST: if (ParserState->Aml < ParserState->PkgEnd) @@ -861,7 +856,6 @@ AcpiPsGetNextArg ( } break; - case ARGP_TARGET: case ARGP_SUPERNAME: case ARGP_SIMPLENAME: @@ -909,7 +903,6 @@ AcpiPsGetNextArg ( } break; - case ARGP_DATAOBJ: case ARGP_TERMARG: @@ -918,7 +911,6 @@ AcpiPsGetNextArg ( WalkState->ArgCount = 1; break; - case ARGP_DATAOBJLIST: case ARGP_TERMLIST: case ARGP_OBJLIST: @@ -931,7 +923,6 @@ AcpiPsGetNextArg ( } break; - default: ACPI_ERROR ((AE_INFO, "Invalid ArgType: 0x%X", ArgType)); diff --git a/source/components/parser/psloop.c b/source/components/parser/psloop.c index df7bd11..0afcb4c 100644 --- a/source/components/parser/psloop.c +++ b/source/components/parser/psloop.c @@ -174,7 +174,6 @@ AcpiPsGetArguments ( case AML_IF_OP: case AML_ELSE_OP: case AML_WHILE_OP: - /* * Currently supported module-level opcodes are: * IF/ELSE/WHILE. These appear to be the most common, @@ -280,6 +279,7 @@ AcpiPsGetArguments ( default: /* No action for all other opcodes */ + break; } diff --git a/source/components/parser/psobject.c b/source/components/parser/psobject.c index 78ee74c..f507e8e 100644 --- a/source/components/parser/psobject.c +++ b/source/components/parser/psobject.c @@ -436,8 +436,8 @@ AcpiPsCompleteOp ( switch (Status) { case AE_OK: - break; + break; case AE_CTRL_TRANSFER: @@ -447,7 +447,6 @@ AcpiPsCompleteOp ( WalkState->PrevArgTypes = WalkState->ArgTypes; return_ACPI_STATUS (Status); - case AE_CTRL_END: AcpiPsPopScope (&(WalkState->ParserState), Op, @@ -472,7 +471,6 @@ AcpiPsCompleteOp ( Status = AE_OK; break; - case AE_CTRL_BREAK: case AE_CTRL_CONTINUE: @@ -502,7 +500,6 @@ AcpiPsCompleteOp ( Status = AE_OK; break; - case AE_CTRL_TERMINATE: /* Clean up */ @@ -527,7 +524,6 @@ AcpiPsCompleteOp ( return_ACPI_STATUS (AE_OK); - default: /* All other non-AE_OK status */ do diff --git a/source/components/parser/psparse.c b/source/components/parser/psparse.c index a6a2ad9..925fa56 100644 --- a/source/components/parser/psparse.c +++ b/source/components/parser/psparse.c @@ -191,10 +191,10 @@ AcpiPsCompleteThisOp ( switch (ParentInfo->Class) { case AML_CLASS_CONTROL: + break; case AML_CLASS_CREATE: - /* * These opcodes contain TermArg operands. The current * op must be replaced by a placeholder return op @@ -207,7 +207,6 @@ AcpiPsCompleteThisOp ( break; case AML_CLASS_NAMED_OBJECT: - /* * These opcodes contain TermArg operands. The current * op must be replaced by a placeholder return op @@ -352,7 +351,6 @@ AcpiPsNextParseState ( Status = AE_CTRL_TERMINATE; break; - case AE_CTRL_BREAK: ParserState->Aml = WalkState->AmlLastWhile; @@ -360,14 +358,12 @@ AcpiPsNextParseState ( Status = AE_CTRL_BREAK; break; - case AE_CTRL_CONTINUE: ParserState->Aml = WalkState->AmlLastWhile; Status = AE_CTRL_CONTINUE; break; - case AE_CTRL_PENDING: ParserState->Aml = WalkState->AmlLastWhile; @@ -390,7 +386,6 @@ AcpiPsNextParseState ( Status = AE_CTRL_PENDING; break; - case AE_CTRL_FALSE: /* * Either an IF/WHILE Predicate was false or we encountered a BREAK @@ -407,7 +402,6 @@ AcpiPsNextParseState ( Status = AE_CTRL_END; break; - case AE_CTRL_TRANSFER: /* A method call (invocation) -- transfer control */ @@ -422,7 +416,6 @@ AcpiPsNextParseState ( WalkState->ReturnUsed = AcpiDsIsResultUsed (Op, WalkState); break; - default: Status = CallbackStatus; diff --git a/source/components/parser/pstree.c b/source/components/parser/pstree.c index 5a72b3b..6b67013 100644 --- a/source/components/parser/pstree.c +++ b/source/components/parser/pstree.c @@ -322,7 +322,6 @@ AcpiPsGetChild ( Child = AcpiPsGetArg (Op, 0); break; - case AML_BUFFER_OP: case AML_PACKAGE_OP: case AML_METHOD_OP: @@ -333,23 +332,22 @@ AcpiPsGetChild ( Child = AcpiPsGetArg (Op, 1); break; - case AML_POWER_RES_OP: case AML_INDEX_FIELD_OP: Child = AcpiPsGetArg (Op, 2); break; - case AML_PROCESSOR_OP: case AML_BANK_FIELD_OP: Child = AcpiPsGetArg (Op, 3); break; - default: + /* All others have no children */ + break; } diff --git a/source/components/resources/rscalc.c b/source/components/resources/rscalc.c index 5c373ec..a6e8b38 100644 --- a/source/components/resources/rscalc.c +++ b/source/components/resources/rscalc.c @@ -371,8 +371,8 @@ AcpiRsGetAmlLength ( break; - default: + break; } @@ -562,6 +562,7 @@ AcpiRsGetListLength ( break; default: + break; } @@ -676,7 +677,9 @@ AcpiRsGetPciRoutingTableLength ( NameFound = FALSE; - for (TableIndex = 0; TableIndex < 4 && !NameFound; TableIndex++) + for (TableIndex = 0; + TableIndex < PackageElement->Package.Count && !NameFound; + TableIndex++) { if (*SubObjectList && /* Null object allowed */ diff --git a/source/components/resources/rscreate.c b/source/components/resources/rscreate.c index 72202c6..209b503 100644 --- a/source/components/resources/rscreate.c +++ b/source/components/resources/rscreate.c @@ -297,16 +297,6 @@ AcpiRsCreatePciRoutingTable ( */ UserPrt->Length = (sizeof (ACPI_PCI_ROUTING_TABLE) - 4); - /* Each element of the top-level package must also be a package */ - - if ((*TopObjectList)->Common.Type != ACPI_TYPE_PACKAGE) - { - ACPI_ERROR ((AE_INFO, - "(PRT[%u]) Need sub-package, found %s", - Index, AcpiUtGetObjectTypeName (*TopObjectList))); - return_ACPI_STATUS (AE_AML_OPERAND_TYPE); - } - /* Each sub-package must be of length 4 */ if ((*TopObjectList)->Package.Count != 4) @@ -349,23 +339,6 @@ AcpiRsCreatePciRoutingTable ( UserPrt->Pin = (UINT32) ObjDesc->Integer.Value; /* - * If the BIOS has erroneously reversed the _PRT SourceName (index 2) - * and the SourceIndex (index 3), fix it. _PRT is important enough to - * workaround this BIOS error. This also provides compatibility with - * other ACPI implementations. - */ - ObjDesc = SubObjectList[3]; - if (!ObjDesc || (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)) - { - SubObjectList[3] = SubObjectList[2]; - SubObjectList[2] = ObjDesc; - - ACPI_WARNING ((AE_INFO, - "(PRT[%X].Source) SourceName and SourceIndex are reversed, fixed", - Index)); - } - - /* * 3) Third subobject: Dereference the PRT.SourceName * The name may be unresolved (slack mode), so allow a null object */ @@ -400,7 +373,6 @@ AcpiRsCreatePciRoutingTable ( UserPrt->Length += (UINT32) ACPI_STRLEN (UserPrt->Source) + 1; break; - case ACPI_TYPE_STRING: ACPI_STRCPY (UserPrt->Source, ObjDesc->String.Pointer); @@ -412,7 +384,6 @@ AcpiRsCreatePciRoutingTable ( UserPrt->Length += ObjDesc->String.Length + 1; break; - case ACPI_TYPE_INTEGER: /* * If this is a number, then the Source Name is NULL, since the @@ -423,7 +394,6 @@ AcpiRsCreatePciRoutingTable ( UserPrt->Length += sizeof (UINT32); break; - default: ACPI_ERROR ((AE_INFO, diff --git a/source/components/resources/rsdump.c b/source/components/resources/rsdump.c index 063be02..4f72cdf 100644 --- a/source/components/resources/rsdump.c +++ b/source/components/resources/rsdump.c @@ -168,16 +168,19 @@ AcpiRsDumpDescriptor ( /* Strings */ case ACPI_RSD_LITERAL: + AcpiRsOutString (Name, ACPI_CAST_PTR (char, Table->Pointer)); break; case ACPI_RSD_STRING: + AcpiRsOutString (Name, ACPI_CAST_PTR (char, Target)); break; /* Data items, 8/16/32/64 bit */ case ACPI_RSD_UINT8: + if (Table->Pointer) { AcpiRsOutString (Name, ACPI_CAST_PTR (char, @@ -190,30 +193,36 @@ AcpiRsDumpDescriptor ( break; case ACPI_RSD_UINT16: + AcpiRsOutInteger16 (Name, ACPI_GET16 (Target)); break; case ACPI_RSD_UINT32: + AcpiRsOutInteger32 (Name, ACPI_GET32 (Target)); break; case ACPI_RSD_UINT64: + AcpiRsOutInteger64 (Name, ACPI_GET64 (Target)); break; /* Flags: 1-bit and 2-bit flags supported */ case ACPI_RSD_1BITFLAG: + AcpiRsOutString (Name, ACPI_CAST_PTR (char, Table->Pointer [*Target & 0x01])); break; case ACPI_RSD_2BITFLAG: + AcpiRsOutString (Name, ACPI_CAST_PTR (char, Table->Pointer [*Target & 0x03])); break; case ACPI_RSD_3BITFLAG: + AcpiRsOutString (Name, ACPI_CAST_PTR (char, Table->Pointer [*Target & 0x07])); break; @@ -293,6 +302,7 @@ AcpiRsDumpDescriptor ( break; default: + AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n", Table->Opcode); return; diff --git a/source/components/resources/rsmisc.c b/source/components/resources/rsmisc.c index c17d64b..f3e02a1 100644 --- a/source/components/resources/rsmisc.c +++ b/source/components/resources/rsmisc.c @@ -137,17 +137,14 @@ AcpiRsConvertAmlToResource ( Resource->Length = INIT_RESOURCE_LENGTH (Info); break; - case ACPI_RSC_INITSET: break; - case ACPI_RSC_FLAGINIT: FlagsMode = TRUE; break; - case ACPI_RSC_1BITFLAG: /* * Mask and shift the flag bit @@ -156,7 +153,6 @@ AcpiRsConvertAmlToResource ( ((ACPI_GET8 (Source) >> Info->Value) & 0x01)); break; - case ACPI_RSC_2BITFLAG: /* * Mask and shift the flag bits @@ -165,7 +161,6 @@ AcpiRsConvertAmlToResource ( ((ACPI_GET8 (Source) >> Info->Value) & 0x03)); break; - case ACPI_RSC_3BITFLAG: /* * Mask and shift the flag bits @@ -174,7 +169,6 @@ AcpiRsConvertAmlToResource ( ((ACPI_GET8 (Source) >> Info->Value) & 0x07)); break; - case ACPI_RSC_COUNT: ItemCount = ACPI_GET8 (Source); @@ -184,7 +178,6 @@ AcpiRsConvertAmlToResource ( (Info->Value * (ItemCount - 1)); break; - case ACPI_RSC_COUNT16: ItemCount = AmlResourceLength; @@ -194,7 +187,6 @@ AcpiRsConvertAmlToResource ( (Info->Value * (ItemCount - 1)); break; - case ACPI_RSC_COUNT_GPIO_PIN: Target = ACPI_ADD_PTR (void, Aml, Info->Value); @@ -205,7 +197,6 @@ AcpiRsConvertAmlToResource ( ACPI_SET16 (Destination, ItemCount); break; - case ACPI_RSC_COUNT_GPIO_VEN: ItemCount = ACPI_GET8 (Source); @@ -215,9 +206,7 @@ AcpiRsConvertAmlToResource ( (Info->Value * ItemCount); break; - case ACPI_RSC_COUNT_GPIO_RES: - /* * Vendor data is optional (length/offset may both be zero) * Examine vendor data length field first @@ -243,7 +232,6 @@ AcpiRsConvertAmlToResource ( ACPI_SET16 (Destination, ItemCount); break; - case ACPI_RSC_COUNT_SERIAL_VEN: ItemCount = ACPI_GET16 (Source) - Info->Value; @@ -252,7 +240,6 @@ AcpiRsConvertAmlToResource ( ACPI_SET16 (Destination, ItemCount); break; - case ACPI_RSC_COUNT_SERIAL_RES: ItemCount = (AmlResourceLength + @@ -263,13 +250,11 @@ AcpiRsConvertAmlToResource ( ACPI_SET16 (Destination, ItemCount); break; - case ACPI_RSC_LENGTH: Resource->Length = Resource->Length + Info->Value; break; - case ACPI_RSC_MOVE8: case ACPI_RSC_MOVE16: case ACPI_RSC_MOVE32: @@ -285,7 +270,6 @@ AcpiRsConvertAmlToResource ( AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); break; - case ACPI_RSC_MOVE_GPIO_PIN: /* Generate and set the PIN data pointer */ @@ -300,7 +284,6 @@ AcpiRsConvertAmlToResource ( AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode); break; - case ACPI_RSC_MOVE_GPIO_RES: /* Generate and set the ResourceSource string pointer */ @@ -315,7 +298,6 @@ AcpiRsConvertAmlToResource ( AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode); break; - case ACPI_RSC_MOVE_SERIAL_VEN: /* Generate and set the Vendor Data pointer */ @@ -330,7 +312,6 @@ AcpiRsConvertAmlToResource ( AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode); break; - case ACPI_RSC_MOVE_SERIAL_RES: /* Generate and set the ResourceSource string pointer */ @@ -345,20 +326,17 @@ AcpiRsConvertAmlToResource ( AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode); break; - case ACPI_RSC_SET8: ACPI_MEMSET (Destination, Info->AmlOffset, Info->Value); break; - case ACPI_RSC_DATA8: Target = ACPI_ADD_PTR (char, Resource, Info->Value); ACPI_MEMCPY (Destination, Source, ACPI_GET16 (Target)); break; - case ACPI_RSC_ADDRESS: /* * Common handler for address descriptor flags @@ -369,7 +347,6 @@ AcpiRsConvertAmlToResource ( } break; - case ACPI_RSC_SOURCE: /* * Optional ResourceSource (Index and String) @@ -379,7 +356,6 @@ AcpiRsConvertAmlToResource ( Destination, Aml, NULL); break; - case ACPI_RSC_SOURCEX: /* * Optional ResourceSource (Index and String). This is the more @@ -394,7 +370,6 @@ AcpiRsConvertAmlToResource ( Destination, Aml, Target); break; - case ACPI_RSC_BITMASK: /* * 8-bit encoded bitmask (DMA macro) @@ -409,7 +384,6 @@ AcpiRsConvertAmlToResource ( ACPI_SET8 (Target, ItemCount); break; - case ACPI_RSC_BITMASK16: /* * 16-bit encoded bitmask (IRQ macro) @@ -426,7 +400,6 @@ AcpiRsConvertAmlToResource ( ACPI_SET8 (Target, ItemCount); break; - case ACPI_RSC_EXIT_NE: /* * Control - Exit conversion if not equal @@ -434,6 +407,7 @@ AcpiRsConvertAmlToResource ( switch (Info->ResourceOffset) { case ACPI_RSC_COMPARE_AML_LENGTH: + if (AmlResourceLength != Info->Value) { goto Exit; @@ -441,6 +415,7 @@ AcpiRsConvertAmlToResource ( break; case ACPI_RSC_COMPARE_VALUE: + if (ACPI_GET8 (Source) != Info->Value) { goto Exit; @@ -454,7 +429,6 @@ AcpiRsConvertAmlToResource ( } break; - default: ACPI_ERROR ((AE_INFO, "Invalid conversion opcode")); @@ -538,11 +512,9 @@ AcpiRsConvertResourceToAml ( AcpiRsSetResourceHeader (INIT_RESOURCE_TYPE (Info), AmlLength, Aml); break; - case ACPI_RSC_INITGET: break; - case ACPI_RSC_FLAGINIT: /* * Clear the flag byte @@ -550,7 +522,6 @@ AcpiRsConvertResourceToAml ( ACPI_SET8 (Destination, 0); break; - case ACPI_RSC_1BITFLAG: /* * Mask and shift the flag bit @@ -559,7 +530,6 @@ AcpiRsConvertResourceToAml ( ((ACPI_GET8 (Source) & 0x01) << Info->Value)); break; - case ACPI_RSC_2BITFLAG: /* * Mask and shift the flag bits @@ -568,7 +538,6 @@ AcpiRsConvertResourceToAml ( ((ACPI_GET8 (Source) & 0x03) << Info->Value)); break; - case ACPI_RSC_3BITFLAG: /* * Mask and shift the flag bits @@ -577,7 +546,6 @@ AcpiRsConvertResourceToAml ( ((ACPI_GET8 (Source) & 0x07) << Info->Value)); break; - case ACPI_RSC_COUNT: ItemCount = ACPI_GET8 (Source); @@ -586,7 +554,6 @@ AcpiRsConvertResourceToAml ( AmlLength = (UINT16) (AmlLength + (Info->Value * (ItemCount - 1))); break; - case ACPI_RSC_COUNT16: ItemCount = ACPI_GET16 (Source); @@ -594,7 +561,6 @@ AcpiRsConvertResourceToAml ( AcpiRsSetResourceLength (AmlLength, Aml); break; - case ACPI_RSC_COUNT_GPIO_PIN: ItemCount = ACPI_GET16 (Source); @@ -606,7 +572,6 @@ AcpiRsConvertResourceToAml ( AcpiRsSetResourceLength (AmlLength, Aml); break; - case ACPI_RSC_COUNT_GPIO_VEN: ItemCount = ACPI_GET16 (Source); @@ -616,7 +581,6 @@ AcpiRsConvertResourceToAml ( AcpiRsSetResourceLength (AmlLength, Aml); break; - case ACPI_RSC_COUNT_GPIO_RES: /* Set resource source string length */ @@ -639,7 +603,6 @@ AcpiRsConvertResourceToAml ( AcpiRsSetResourceLength (AmlLength, Aml); break; - case ACPI_RSC_COUNT_SERIAL_VEN: ItemCount = ACPI_GET16 (Source); @@ -648,7 +611,6 @@ AcpiRsConvertResourceToAml ( AcpiRsSetResourceLength (AmlLength, Aml); break; - case ACPI_RSC_COUNT_SERIAL_RES: ItemCount = ACPI_GET16 (Source); @@ -656,13 +618,11 @@ AcpiRsConvertResourceToAml ( AcpiRsSetResourceLength (AmlLength, Aml); break; - case ACPI_RSC_LENGTH: AcpiRsSetResourceLength (Info->Value, Aml); break; - case ACPI_RSC_MOVE8: case ACPI_RSC_MOVE16: case ACPI_RSC_MOVE32: @@ -675,7 +635,6 @@ AcpiRsConvertResourceToAml ( AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); break; - case ACPI_RSC_MOVE_GPIO_PIN: Destination = (char *) ACPI_ADD_PTR (void, Aml, @@ -684,7 +643,6 @@ AcpiRsConvertResourceToAml ( AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); break; - case ACPI_RSC_MOVE_GPIO_RES: /* Used for both ResourceSource string and VendorData */ @@ -695,7 +653,6 @@ AcpiRsConvertResourceToAml ( AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); break; - case ACPI_RSC_MOVE_SERIAL_VEN: Destination = (char *) ACPI_ADD_PTR (void, Aml, @@ -704,7 +661,6 @@ AcpiRsConvertResourceToAml ( AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); break; - case ACPI_RSC_MOVE_SERIAL_RES: Destination = (char *) ACPI_ADD_PTR (void, Aml, @@ -713,7 +669,6 @@ AcpiRsConvertResourceToAml ( AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); break; - case ACPI_RSC_ADDRESS: /* Set the Resource Type, General Flags, and Type-Specific Flags */ @@ -721,7 +676,6 @@ AcpiRsConvertResourceToAml ( AcpiRsSetAddressCommon (Aml, Resource); break; - case ACPI_RSC_SOURCEX: /* * Optional ResourceSource (Index and String) @@ -731,7 +685,6 @@ AcpiRsConvertResourceToAml ( AcpiRsSetResourceLength (AmlLength, Aml); break; - case ACPI_RSC_SOURCE: /* * Optional ResourceSource (Index and String). This is the more @@ -741,7 +694,6 @@ AcpiRsConvertResourceToAml ( AcpiRsSetResourceLength (AmlLength, Aml); break; - case ACPI_RSC_BITMASK: /* * 8-bit encoded bitmask (DMA macro) @@ -751,7 +703,6 @@ AcpiRsConvertResourceToAml ( *ACPI_ADD_PTR (UINT8, Resource, Info->Value))); break; - case ACPI_RSC_BITMASK16: /* * 16-bit encoded bitmask (IRQ macro) @@ -761,7 +712,6 @@ AcpiRsConvertResourceToAml ( ACPI_MOVE_16_TO_16 (Destination, &Temp16); break; - case ACPI_RSC_EXIT_LE: /* * Control - Exit conversion if less than or equal @@ -772,7 +722,6 @@ AcpiRsConvertResourceToAml ( } break; - case ACPI_RSC_EXIT_NE: /* * Control - Exit conversion if not equal @@ -795,7 +744,6 @@ AcpiRsConvertResourceToAml ( } break; - case ACPI_RSC_EXIT_EQ: /* * Control - Exit conversion if equal @@ -807,7 +755,6 @@ AcpiRsConvertResourceToAml ( } break; - default: ACPI_ERROR ((AE_INFO, "Invalid conversion opcode")); diff --git a/source/components/resources/rsutils.c b/source/components/resources/rsutils.c index fd54dab..a453efe 100644 --- a/source/components/resources/rsutils.c +++ b/source/components/resources/rsutils.c @@ -176,6 +176,7 @@ AcpiRsMoveData ( case ACPI_RSC_MOVE_GPIO_RES: case ACPI_RSC_MOVE_SERIAL_VEN: case ACPI_RSC_MOVE_SERIAL_RES: + ACPI_MEMCPY (Destination, Source, ItemCount); return; @@ -186,21 +187,25 @@ AcpiRsMoveData ( */ case ACPI_RSC_MOVE16: case ACPI_RSC_MOVE_GPIO_PIN: + ACPI_MOVE_16_TO_16 (&ACPI_CAST_PTR (UINT16, Destination)[i], &ACPI_CAST_PTR (UINT16, Source)[i]); break; case ACPI_RSC_MOVE32: + ACPI_MOVE_32_TO_32 (&ACPI_CAST_PTR (UINT32, Destination)[i], &ACPI_CAST_PTR (UINT32, Source)[i]); break; case ACPI_RSC_MOVE64: + ACPI_MOVE_64_TO_64 (&ACPI_CAST_PTR (UINT64, Destination)[i], &ACPI_CAST_PTR (UINT64, Source)[i]); break; default: + return; } } diff --git a/source/components/resources/rsxface.c b/source/components/resources/rsxface.c index 36edc81..0523f5b 100644 --- a/source/components/resources/rsxface.c +++ b/source/components/resources/rsxface.c @@ -452,6 +452,7 @@ AcpiResourceToAddress64 ( break; default: + return (AE_BAD_PARAMETER); } diff --git a/source/components/tables/tbinstal.c b/source/components/tables/tbinstal.c index e4a0610..e480749 100644 --- a/source/components/tables/tbinstal.c +++ b/source/components/tables/tbinstal.c @@ -160,7 +160,7 @@ AcpiTbAddTable ( ACPI_BIOS_ERROR ((AE_INFO, "Table has invalid signature [%4.4s] (0x%8.8X), " "must be SSDT or OEMx", - AcpiUtValidAcpiName (*(UINT32 *) TableDesc->Pointer->Signature) ? + AcpiUtValidAcpiName (TableDesc->Pointer->Signature) ? TableDesc->Pointer->Signature : "????", *(UINT32 *) TableDesc->Pointer->Signature)); @@ -514,16 +514,19 @@ AcpiTbDeleteTable ( switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) { case ACPI_TABLE_ORIGIN_MAPPED: + AcpiOsUnmapMemory (TableDesc->Pointer, TableDesc->Length); break; case ACPI_TABLE_ORIGIN_ALLOCATED: + ACPI_FREE (TableDesc->Pointer); break; /* Not mapped or allocated, there is nothing we can do */ default: + return; } diff --git a/source/components/tables/tbprint.c b/source/components/tables/tbprint.c new file mode 100644 index 0000000..7823ffc --- /dev/null +++ b/source/components/tables/tbprint.c @@ -0,0 +1,265 @@ +/****************************************************************************** + * + * Module Name: tbprint - Table output utilities + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2013, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#define __TBPRINT_C__ + +#include "acpi.h" +#include "accommon.h" +#include "actables.h" + +#define _COMPONENT ACPI_TABLES + ACPI_MODULE_NAME ("tbprint") + + +/* Local prototypes */ + +static void +AcpiTbFixString ( + char *String, + ACPI_SIZE Length); + +static void +AcpiTbCleanupTableHeader ( + ACPI_TABLE_HEADER *OutHeader, + ACPI_TABLE_HEADER *Header); + + +/******************************************************************************* + * + * FUNCTION: AcpiTbFixString + * + * PARAMETERS: String - String to be repaired + * Length - Maximum length + * + * RETURN: None + * + * DESCRIPTION: Replace every non-printable or non-ascii byte in the string + * with a question mark '?'. + * + ******************************************************************************/ + +static void +AcpiTbFixString ( + char *String, + ACPI_SIZE Length) +{ + + while (Length && *String) + { + if (!ACPI_IS_PRINT (*String)) + { + *String = '?'; + } + String++; + Length--; + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbCleanupTableHeader + * + * PARAMETERS: OutHeader - Where the cleaned header is returned + * Header - Input ACPI table header + * + * RETURN: Returns the cleaned header in OutHeader + * + * DESCRIPTION: Copy the table header and ensure that all "string" fields in + * the header consist of printable characters. + * + ******************************************************************************/ + +static void +AcpiTbCleanupTableHeader ( + ACPI_TABLE_HEADER *OutHeader, + ACPI_TABLE_HEADER *Header) +{ + + ACPI_MEMCPY (OutHeader, Header, sizeof (ACPI_TABLE_HEADER)); + + AcpiTbFixString (OutHeader->Signature, ACPI_NAME_SIZE); + AcpiTbFixString (OutHeader->OemId, ACPI_OEM_ID_SIZE); + AcpiTbFixString (OutHeader->OemTableId, ACPI_OEM_TABLE_ID_SIZE); + AcpiTbFixString (OutHeader->AslCompilerId, ACPI_NAME_SIZE); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbPrintTableHeader + * + * PARAMETERS: Address - Table physical address + * Header - Table header + * + * RETURN: None + * + * DESCRIPTION: Print an ACPI table header. Special cases for FACS and RSDP. + * + ******************************************************************************/ + +void +AcpiTbPrintTableHeader ( + ACPI_PHYSICAL_ADDRESS Address, + ACPI_TABLE_HEADER *Header) +{ + ACPI_TABLE_HEADER LocalHeader; + + + /* + * The reason that the Address is cast to a void pointer is so that we + * can use %p which will work properly on both 32-bit and 64-bit hosts. + */ + if (ACPI_COMPARE_NAME (Header->Signature, ACPI_SIG_FACS)) + { + /* FACS only has signature and length fields */ + + ACPI_INFO ((AE_INFO, "%4.4s %p %05X", + Header->Signature, ACPI_CAST_PTR (void, Address), + Header->Length)); + } + else if (ACPI_COMPARE_NAME (Header->Signature, ACPI_SIG_RSDP)) + { + /* RSDP has no common fields */ + + ACPI_MEMCPY (LocalHeader.OemId, + ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId, ACPI_OEM_ID_SIZE); + AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE); + + ACPI_INFO ((AE_INFO, "RSDP %p %05X (v%.2d %6.6s)", + ACPI_CAST_PTR (void, Address), + (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision > 0) ? + ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Length : 20, + ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision, + LocalHeader.OemId)); + } + else + { + /* Standard ACPI table with full common header */ + + AcpiTbCleanupTableHeader (&LocalHeader, Header); + + ACPI_INFO ((AE_INFO, + "%4.4s %p %05X (v%.2d %6.6s %8.8s %08X %4.4s %08X)", + LocalHeader.Signature, ACPI_CAST_PTR (void, Address), + LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId, + LocalHeader.OemTableId, LocalHeader.OemRevision, + LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision)); + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbValidateChecksum + * + * PARAMETERS: Table - ACPI table to verify + * Length - Length of entire table + * + * RETURN: Status + * + * DESCRIPTION: Verifies that the table checksums to zero. Optionally returns + * exception on bad checksum. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbVerifyChecksum ( + ACPI_TABLE_HEADER *Table, + UINT32 Length) +{ + UINT8 Checksum; + + + /* Compute the checksum on the table */ + + Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Length); + + /* Checksum ok? (should be zero) */ + + if (Checksum) + { + ACPI_BIOS_WARNING ((AE_INFO, + "Incorrect checksum in table [%4.4s] - 0x%2.2X, " + "should be 0x%2.2X", + Table->Signature, Table->Checksum, + (UINT8) (Table->Checksum - Checksum))); + +#if (ACPI_CHECKSUM_ABORT) + return (AE_BAD_CHECKSUM); +#endif + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbChecksum + * + * PARAMETERS: Buffer - Pointer to memory region to be checked + * Length - Length of this memory region + * + * RETURN: Checksum (UINT8) + * + * DESCRIPTION: Calculates circular checksum of memory region. + * + ******************************************************************************/ + +UINT8 +AcpiTbChecksum ( + UINT8 *Buffer, + UINT32 Length) +{ + UINT8 Sum = 0; + UINT8 *End = Buffer + Length; + + + while (Buffer < End) + { + Sum = (UINT8) (Sum + *(Buffer++)); + } + + return (Sum); +} diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c index 0ea5edd..7c84d5e 100644 --- a/source/components/tables/tbutils.c +++ b/source/components/tables/tbutils.c @@ -1,6 +1,6 @@ /****************************************************************************** * - * Module Name: tbutils - table utilities + * Module Name: tbutils - ACPI Table utilities * *****************************************************************************/ @@ -53,16 +53,6 @@ /* Local prototypes */ -static void -AcpiTbFixString ( - char *String, - ACPI_SIZE Length); - -static void -AcpiTbCleanupTableHeader ( - ACPI_TABLE_HEADER *OutHeader, - ACPI_TABLE_HEADER *Header); - static ACPI_PHYSICAL_ADDRESS AcpiTbGetRootTableEntry ( UINT8 *TableEntry, @@ -134,207 +124,6 @@ AcpiTbTablesLoaded ( /******************************************************************************* * - * FUNCTION: AcpiTbFixString - * - * PARAMETERS: String - String to be repaired - * Length - Maximum length - * - * RETURN: None - * - * DESCRIPTION: Replace every non-printable or non-ascii byte in the string - * with a question mark '?'. - * - ******************************************************************************/ - -static void -AcpiTbFixString ( - char *String, - ACPI_SIZE Length) -{ - - while (Length && *String) - { - if (!ACPI_IS_PRINT (*String)) - { - *String = '?'; - } - String++; - Length--; - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbCleanupTableHeader - * - * PARAMETERS: OutHeader - Where the cleaned header is returned - * Header - Input ACPI table header - * - * RETURN: Returns the cleaned header in OutHeader - * - * DESCRIPTION: Copy the table header and ensure that all "string" fields in - * the header consist of printable characters. - * - ******************************************************************************/ - -static void -AcpiTbCleanupTableHeader ( - ACPI_TABLE_HEADER *OutHeader, - ACPI_TABLE_HEADER *Header) -{ - - ACPI_MEMCPY (OutHeader, Header, sizeof (ACPI_TABLE_HEADER)); - - AcpiTbFixString (OutHeader->Signature, ACPI_NAME_SIZE); - AcpiTbFixString (OutHeader->OemId, ACPI_OEM_ID_SIZE); - AcpiTbFixString (OutHeader->OemTableId, ACPI_OEM_TABLE_ID_SIZE); - AcpiTbFixString (OutHeader->AslCompilerId, ACPI_NAME_SIZE); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbPrintTableHeader - * - * PARAMETERS: Address - Table physical address - * Header - Table header - * - * RETURN: None - * - * DESCRIPTION: Print an ACPI table header. Special cases for FACS and RSDP. - * - ******************************************************************************/ - -void -AcpiTbPrintTableHeader ( - ACPI_PHYSICAL_ADDRESS Address, - ACPI_TABLE_HEADER *Header) -{ - ACPI_TABLE_HEADER LocalHeader; - - - /* - * The reason that the Address is cast to a void pointer is so that we - * can use %p which will work properly on both 32-bit and 64-bit hosts. - */ - if (ACPI_COMPARE_NAME (Header->Signature, ACPI_SIG_FACS)) - { - /* FACS only has signature and length fields */ - - ACPI_INFO ((AE_INFO, "%4.4s %p %05X", - Header->Signature, ACPI_CAST_PTR (void, Address), - Header->Length)); - } - else if (ACPI_COMPARE_NAME (Header->Signature, ACPI_SIG_RSDP)) - { - /* RSDP has no common fields */ - - ACPI_MEMCPY (LocalHeader.OemId, - ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId, ACPI_OEM_ID_SIZE); - AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE); - - ACPI_INFO ((AE_INFO, "RSDP %p %05X (v%.2d %6.6s)", - ACPI_CAST_PTR (void, Address), - (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision > 0) ? - ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Length : 20, - ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision, - LocalHeader.OemId)); - } - else - { - /* Standard ACPI table with full common header */ - - AcpiTbCleanupTableHeader (&LocalHeader, Header); - - ACPI_INFO ((AE_INFO, - "%4.4s %p %05X (v%.2d %6.6s %8.8s %08X %4.4s %08X)", - LocalHeader.Signature, ACPI_CAST_PTR (void, Address), - LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId, - LocalHeader.OemTableId, LocalHeader.OemRevision, - LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision)); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbValidateChecksum - * - * PARAMETERS: Table - ACPI table to verify - * Length - Length of entire table - * - * RETURN: Status - * - * DESCRIPTION: Verifies that the table checksums to zero. Optionally returns - * exception on bad checksum. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiTbVerifyChecksum ( - ACPI_TABLE_HEADER *Table, - UINT32 Length) -{ - UINT8 Checksum; - - - /* Compute the checksum on the table */ - - Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Length); - - /* Checksum ok? (should be zero) */ - - if (Checksum) - { - ACPI_BIOS_WARNING ((AE_INFO, - "Incorrect checksum in table [%4.4s] - 0x%2.2X, " - "should be 0x%2.2X", - Table->Signature, Table->Checksum, - (UINT8) (Table->Checksum - Checksum))); - -#if (ACPI_CHECKSUM_ABORT) - return (AE_BAD_CHECKSUM); -#endif - } - - return (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbChecksum - * - * PARAMETERS: Buffer - Pointer to memory region to be checked - * Length - Length of this memory region - * - * RETURN: Checksum (UINT8) - * - * DESCRIPTION: Calculates circular checksum of memory region. - * - ******************************************************************************/ - -UINT8 -AcpiTbChecksum ( - UINT8 *Buffer, - UINT32 Length) -{ - UINT8 Sum = 0; - UINT8 *End = Buffer + Length; - - - while (Buffer < End) - { - Sum = (UINT8) (Sum + *(Buffer++)); - } - - return (Sum); -} - - -/******************************************************************************* - * * FUNCTION: AcpiTbCheckDsdtHeader * * PARAMETERS: None diff --git a/source/components/tables/tbxfload.c b/source/components/tables/tbxfload.c index 3beafe9..2ebaab9 100644 --- a/source/components/tables/tbxfload.c +++ b/source/components/tables/tbxfload.c @@ -192,6 +192,18 @@ AcpiTbLoadNamespace ( continue; } + /* + * Optionally do not load any SSDTs from the RSDT/XSDT. This can + * be useful for debugging ACPI problems on some machines. + */ + if (AcpiGbl_DisableSsdtTableLoad) + { + ACPI_INFO ((AE_INFO, "Ignoring %4.4s at %p", + AcpiGbl_RootTableList.Tables[i].Signature.Ascii, + ACPI_CAST_PTR (void, AcpiGbl_RootTableList.Tables[i].Address))); + continue; + } + /* Ignore errors while loading tables, get as many as possible */ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); diff --git a/source/components/utilities/utbuffer.c b/source/components/utilities/utbuffer.c new file mode 100644 index 0000000..e1b56d5 --- /dev/null +++ b/source/components/utilities/utbuffer.c @@ -0,0 +1,220 @@ +/****************************************************************************** + * + * Module Name: utbuffer - Buffer dump routines + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2013, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#define __UTBUFFER_C__ + +#include "acpi.h" +#include "accommon.h" + +#define _COMPONENT ACPI_UTILITIES + ACPI_MODULE_NAME ("utbuffer") + + +/******************************************************************************* + * + * FUNCTION: AcpiUtDumpBuffer + * + * PARAMETERS: Buffer - Buffer to dump + * Count - Amount to dump, in bytes + * Display - BYTE, WORD, DWORD, or QWORD display: + * DB_BYTE_DISPLAY + * DB_WORD_DISPLAY + * DB_DWORD_DISPLAY + * DB_QWORD_DISPLAY + * BaseOffset - Beginning buffer offset (display only) + * + * RETURN: None + * + * DESCRIPTION: Generic dump buffer in both hex and ascii. + * + ******************************************************************************/ + +void +AcpiUtDumpBuffer ( + UINT8 *Buffer, + UINT32 Count, + UINT32 Display, + UINT32 BaseOffset) +{ + UINT32 i = 0; + UINT32 j; + UINT32 Temp32; + UINT8 BufChar; + + + if (!Buffer) + { + AcpiOsPrintf ("Null Buffer Pointer in DumpBuffer!\n"); + return; + } + + if ((Count < 4) || (Count & 0x01)) + { + Display = DB_BYTE_DISPLAY; + } + + /* Nasty little dump buffer routine! */ + + while (i < Count) + { + /* Print current offset */ + + AcpiOsPrintf ("%6.4X: ", (BaseOffset + i)); + + /* Print 16 hex chars */ + + for (j = 0; j < 16;) + { + if (i + j >= Count) + { + /* Dump fill spaces */ + + AcpiOsPrintf ("%*s", ((Display * 2) + 1), " "); + j += Display; + continue; + } + + switch (Display) + { + case DB_BYTE_DISPLAY: + default: /* Default is BYTE display */ + + AcpiOsPrintf ("%02X ", Buffer[(ACPI_SIZE) i + j]); + break; + + case DB_WORD_DISPLAY: + + ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); + AcpiOsPrintf ("%04X ", Temp32); + break; + + case DB_DWORD_DISPLAY: + + ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); + AcpiOsPrintf ("%08X ", Temp32); + break; + + case DB_QWORD_DISPLAY: + + ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); + AcpiOsPrintf ("%08X", Temp32); + + ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]); + AcpiOsPrintf ("%08X ", Temp32); + break; + } + + j += Display; + } + + /* + * Print the ASCII equivalent characters but watch out for the bad + * unprintable ones (printable chars are 0x20 through 0x7E) + */ + AcpiOsPrintf (" "); + for (j = 0; j < 16; j++) + { + if (i + j >= Count) + { + AcpiOsPrintf ("\n"); + return; + } + + BufChar = Buffer[(ACPI_SIZE) i + j]; + if (ACPI_IS_PRINT (BufChar)) + { + AcpiOsPrintf ("%c", BufChar); + } + else + { + AcpiOsPrintf ("."); + } + } + + /* Done with that line. */ + + AcpiOsPrintf ("\n"); + i += 16; + } + + return; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtDebugDumpBuffer + * + * PARAMETERS: Buffer - Buffer to dump + * Count - Amount to dump, in bytes + * Display - BYTE, WORD, DWORD, or QWORD display: + * DB_BYTE_DISPLAY + * DB_WORD_DISPLAY + * DB_DWORD_DISPLAY + * DB_QWORD_DISPLAY + * ComponentID - Caller's component ID + * + * RETURN: None + * + * DESCRIPTION: Generic dump buffer in both hex and ascii. + * + ******************************************************************************/ + +void +AcpiUtDebugDumpBuffer ( + UINT8 *Buffer, + UINT32 Count, + UINT32 Display, + UINT32 ComponentId) +{ + + /* Only dump the buffer if tracing is enabled */ + + if (!((ACPI_LV_TABLES & AcpiDbgLevel) && + (ComponentId & AcpiDbgLayer))) + { + return; + } + + AcpiUtDumpBuffer (Buffer, Count, Display, 0); +} diff --git a/source/components/utilities/utcopy.c b/source/components/utilities/utcopy.c index 13ffdb2..a251c06 100644 --- a/source/components/utilities/utcopy.c +++ b/source/components/utilities/utcopy.c @@ -172,7 +172,6 @@ AcpiUtCopyIsimpleToEsimple ( (ACPI_SIZE) InternalObject->String.Length + 1); break; - case ACPI_TYPE_BUFFER: ExternalObject->Buffer.Pointer = DataSpace; @@ -185,13 +184,11 @@ AcpiUtCopyIsimpleToEsimple ( InternalObject->Buffer.Length); break; - case ACPI_TYPE_INTEGER: ExternalObject->Integer.Value = InternalObject->Integer.Value; break; - case ACPI_TYPE_LOCAL_REFERENCE: /* This is an object reference. */ @@ -199,7 +196,6 @@ AcpiUtCopyIsimpleToEsimple ( switch (InternalObject->Reference.Class) { case ACPI_REFCLASS_NAME: - /* * For namepath, return the object handle ("reference") * We are referring to the namespace node @@ -218,7 +214,6 @@ AcpiUtCopyIsimpleToEsimple ( } break; - case ACPI_TYPE_PROCESSOR: ExternalObject->Processor.ProcId = @@ -229,7 +224,6 @@ AcpiUtCopyIsimpleToEsimple ( InternalObject->Processor.Length; break; - case ACPI_TYPE_POWER: ExternalObject->PowerResource.SystemLevel = @@ -239,7 +233,6 @@ AcpiUtCopyIsimpleToEsimple ( InternalObject->PowerResource.ResourceOrder; break; - default: /* * There is no corresponding external object type @@ -291,7 +284,6 @@ AcpiUtCopyIelementToEelement ( switch (ObjectType) { case ACPI_COPY_TYPE_SIMPLE: - /* * This is a simple or null object */ @@ -303,9 +295,7 @@ AcpiUtCopyIelementToEelement ( } break; - case ACPI_COPY_TYPE_PACKAGE: - /* * Build the package object */ @@ -328,8 +318,8 @@ AcpiUtCopyIelementToEelement ( sizeof (ACPI_OBJECT)); break; - default: + return (AE_BAD_PARAMETER); } @@ -514,6 +504,7 @@ AcpiUtCopyEsimpleToIsimple ( return_ACPI_STATUS (AE_OK); default: + /* All other types are not supported */ ACPI_ERROR ((AE_INFO, @@ -546,7 +537,6 @@ AcpiUtCopyEsimpleToIsimple ( InternalObject->String.Length = ExternalObject->String.Length; break; - case ACPI_TYPE_BUFFER: InternalObject->Buffer.Pointer = @@ -567,7 +557,6 @@ AcpiUtCopyEsimpleToIsimple ( InternalObject->Buffer.Flags |= AOPOBJ_DATA_VALID; break; - case ACPI_TYPE_INTEGER: InternalObject->Integer.Value = ExternalObject->Integer.Value; @@ -582,7 +571,9 @@ AcpiUtCopyEsimpleToIsimple ( break; default: + /* Other types can't get here */ + break; } @@ -855,7 +846,9 @@ AcpiUtCopySimpleObject ( break; default: + /* Nothing to do for other simple objects */ + break; } @@ -929,9 +922,7 @@ AcpiUtCopyIelementToIelement ( } break; - case ACPI_COPY_TYPE_PACKAGE: - /* * This object is a package - go down another nesting level * Create and build the package object @@ -953,8 +944,8 @@ AcpiUtCopyIelementToIelement ( *ThisTargetPtr = TargetObject; break; - default: + return (AE_BAD_PARAMETER); } diff --git a/source/components/utilities/utdebug.c b/source/components/utilities/utdebug.c index 9e749fb..e879967 100644 --- a/source/components/utilities/utdebug.c +++ b/source/components/utilities/utdebug.c @@ -1,6 +1,6 @@ /****************************************************************************** * - * Module Name: utdebug - Debug print routines + * Module Name: utdebug - Debug print/trace routines * *****************************************************************************/ @@ -613,168 +613,3 @@ AcpiUtPtrExit ( } #endif - - -/******************************************************************************* - * - * FUNCTION: AcpiUtDumpBuffer - * - * PARAMETERS: Buffer - Buffer to dump - * Count - Amount to dump, in bytes - * Display - BYTE, WORD, DWORD, or QWORD display - * Offset - Beginning buffer offset (display only) - * - * RETURN: None - * - * DESCRIPTION: Generic dump buffer in both hex and ascii. - * - ******************************************************************************/ - -void -AcpiUtDumpBuffer ( - UINT8 *Buffer, - UINT32 Count, - UINT32 Display, - UINT32 BaseOffset) -{ - UINT32 i = 0; - UINT32 j; - UINT32 Temp32; - UINT8 BufChar; - - - if (!Buffer) - { - AcpiOsPrintf ("Null Buffer Pointer in DumpBuffer!\n"); - return; - } - - if ((Count < 4) || (Count & 0x01)) - { - Display = DB_BYTE_DISPLAY; - } - - /* Nasty little dump buffer routine! */ - - while (i < Count) - { - /* Print current offset */ - - AcpiOsPrintf ("%6.4X: ", (BaseOffset + i)); - - /* Print 16 hex chars */ - - for (j = 0; j < 16;) - { - if (i + j >= Count) - { - /* Dump fill spaces */ - - AcpiOsPrintf ("%*s", ((Display * 2) + 1), " "); - j += Display; - continue; - } - - switch (Display) - { - case DB_BYTE_DISPLAY: - default: /* Default is BYTE display */ - - AcpiOsPrintf ("%02X ", Buffer[(ACPI_SIZE) i + j]); - break; - - - case DB_WORD_DISPLAY: - - ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); - AcpiOsPrintf ("%04X ", Temp32); - break; - - - case DB_DWORD_DISPLAY: - - ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); - AcpiOsPrintf ("%08X ", Temp32); - break; - - - case DB_QWORD_DISPLAY: - - ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); - AcpiOsPrintf ("%08X", Temp32); - - ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]); - AcpiOsPrintf ("%08X ", Temp32); - break; - } - - j += Display; - } - - /* - * Print the ASCII equivalent characters but watch out for the bad - * unprintable ones (printable chars are 0x20 through 0x7E) - */ - AcpiOsPrintf (" "); - for (j = 0; j < 16; j++) - { - if (i + j >= Count) - { - AcpiOsPrintf ("\n"); - return; - } - - BufChar = Buffer[(ACPI_SIZE) i + j]; - if (ACPI_IS_PRINT (BufChar)) - { - AcpiOsPrintf ("%c", BufChar); - } - else - { - AcpiOsPrintf ("."); - } - } - - /* Done with that line. */ - - AcpiOsPrintf ("\n"); - i += 16; - } - - return; -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtDebugDumpBuffer - * - * PARAMETERS: Buffer - Buffer to dump - * Count - Amount to dump, in bytes - * Display - BYTE, WORD, DWORD, or QWORD display - * ComponentID - Caller's component ID - * - * RETURN: None - * - * DESCRIPTION: Generic dump buffer in both hex and ascii. - * - ******************************************************************************/ - -void -AcpiUtDebugDumpBuffer ( - UINT8 *Buffer, - UINT32 Count, - UINT32 Display, - UINT32 ComponentId) -{ - - /* Only dump the buffer if tracing is enabled */ - - if (!((ACPI_LV_TABLES & AcpiDbgLevel) && - (ComponentId & AcpiDbgLayer))) - { - return; - } - - AcpiUtDumpBuffer (Buffer, Count, Display, 0); -} diff --git a/source/components/utilities/utdelete.c b/source/components/utilities/utdelete.c index f18d556..5047bc1 100644 --- a/source/components/utilities/utdelete.c +++ b/source/components/utilities/utdelete.c @@ -118,7 +118,6 @@ AcpiUtDeleteInternalObj ( } break; - case ACPI_TYPE_BUFFER: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "**** Buffer %p, ptr %p\n", @@ -134,7 +133,6 @@ AcpiUtDeleteInternalObj ( } break; - case ACPI_TYPE_PACKAGE: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, " **** Package of count %X\n", @@ -150,7 +148,6 @@ AcpiUtDeleteInternalObj ( ObjPointer = Object->Package.Elements; break; - /* * These objects have a possible list of notify handlers. * Device object also may have a GPE block. @@ -178,7 +175,6 @@ AcpiUtDeleteInternalObj ( } break; - case ACPI_TYPE_MUTEX: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, @@ -202,7 +198,6 @@ AcpiUtDeleteInternalObj ( } break; - case ACPI_TYPE_EVENT: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, @@ -213,7 +208,6 @@ AcpiUtDeleteInternalObj ( Object->Event.OsSemaphore = NULL; break; - case ACPI_TYPE_METHOD: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, @@ -229,7 +223,6 @@ AcpiUtDeleteInternalObj ( } break; - case ACPI_TYPE_REGION: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, @@ -298,7 +291,6 @@ AcpiUtDeleteInternalObj ( } break; - case ACPI_TYPE_BUFFER_FIELD: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, @@ -311,7 +303,6 @@ AcpiUtDeleteInternalObj ( } break; - case ACPI_TYPE_LOCAL_BANK_FIELD: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, @@ -324,8 +315,8 @@ AcpiUtDeleteInternalObj ( } break; - default: + break; } @@ -557,7 +548,6 @@ AcpiUtUpdateObjectReference ( case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_POWER: case ACPI_TYPE_THERMAL: - /* * Update the notify objects for these types (if present) * Two lists, system and device notify handlers. @@ -668,6 +658,7 @@ AcpiUtUpdateObjectReference ( case ACPI_TYPE_REGION: default: + break; /* No subobjects for all other types */ } diff --git a/source/components/utilities/uterror.c b/source/components/utilities/uterror.c new file mode 100644 index 0000000..73e2568 --- /dev/null +++ b/source/components/utilities/uterror.c @@ -0,0 +1,327 @@ +/******************************************************************************* + * + * Module Name: uterror - Various internal error/warning output functions + * + ******************************************************************************/ + +/* + * Copyright (C) 2000 - 2013, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#define __UTERROR_C__ + +#include "acpi.h" +#include "accommon.h" +#include "acnamesp.h" + + +#define _COMPONENT ACPI_UTILITIES + ACPI_MODULE_NAME ("uterror") + + +/* + * This module contains internal error functions that may + * be configured out. + */ +#if !defined (ACPI_NO_ERROR_MESSAGES) + +/******************************************************************************* + * + * FUNCTION: AcpiUtPredefinedWarning + * + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * Pathname - Full pathname to the node + * NodeFlags - From Namespace node for the method/object + * Format - Printf format string + additional args + * + * RETURN: None + * + * DESCRIPTION: Warnings for the predefined validation module. Messages are + * only emitted the first time a problem with a particular + * method/object is detected. This prevents a flood of error + * messages for methods that are repeatedly evaluated. + * + ******************************************************************************/ + +void ACPI_INTERNAL_VAR_XFACE +AcpiUtPredefinedWarning ( + const char *ModuleName, + UINT32 LineNumber, + char *Pathname, + UINT8 NodeFlags, + const char *Format, + ...) +{ + va_list ArgList; + + + /* + * Warning messages for this method/object will be disabled after the + * first time a validation fails or an object is successfully repaired. + */ + if (NodeFlags & ANOBJ_EVALUATED) + { + return; + } + + AcpiOsPrintf (ACPI_MSG_WARNING "%s: ", Pathname); + + va_start (ArgList, Format); + AcpiOsVprintf (Format, ArgList); + ACPI_MSG_SUFFIX; + va_end (ArgList); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtPredefinedInfo + * + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * Pathname - Full pathname to the node + * NodeFlags - From Namespace node for the method/object + * Format - Printf format string + additional args + * + * RETURN: None + * + * DESCRIPTION: Info messages for the predefined validation module. Messages + * are only emitted the first time a problem with a particular + * method/object is detected. This prevents a flood of + * messages for methods that are repeatedly evaluated. + * + ******************************************************************************/ + +void ACPI_INTERNAL_VAR_XFACE +AcpiUtPredefinedInfo ( + const char *ModuleName, + UINT32 LineNumber, + char *Pathname, + UINT8 NodeFlags, + const char *Format, + ...) +{ + va_list ArgList; + + + /* + * Warning messages for this method/object will be disabled after the + * first time a validation fails or an object is successfully repaired. + */ + if (NodeFlags & ANOBJ_EVALUATED) + { + return; + } + + AcpiOsPrintf (ACPI_MSG_INFO "%s: ", Pathname); + + va_start (ArgList, Format); + AcpiOsVprintf (Format, ArgList); + ACPI_MSG_SUFFIX; + va_end (ArgList); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtPredefinedBiosError + * + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * Pathname - Full pathname to the node + * NodeFlags - From Namespace node for the method/object + * Format - Printf format string + additional args + * + * RETURN: None + * + * DESCRIPTION: BIOS error message for predefined names. Messages + * are only emitted the first time a problem with a particular + * method/object is detected. This prevents a flood of + * messages for methods that are repeatedly evaluated. + * + ******************************************************************************/ + +void ACPI_INTERNAL_VAR_XFACE +AcpiUtPredefinedBiosError ( + const char *ModuleName, + UINT32 LineNumber, + char *Pathname, + UINT8 NodeFlags, + const char *Format, + ...) +{ + va_list ArgList; + + + /* + * Warning messages for this method/object will be disabled after the + * first time a validation fails or an object is successfully repaired. + */ + if (NodeFlags & ANOBJ_EVALUATED) + { + return; + } + + AcpiOsPrintf (ACPI_MSG_BIOS_ERROR "%s: ", Pathname); + + va_start (ArgList, Format); + AcpiOsVprintf (Format, ArgList); + ACPI_MSG_SUFFIX; + va_end (ArgList); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtNamespaceError + * + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * InternalName - Name or path of the namespace node + * LookupStatus - Exception code from NS lookup + * + * RETURN: None + * + * DESCRIPTION: Print error message with the full pathname for the NS node. + * + ******************************************************************************/ + +void +AcpiUtNamespaceError ( + const char *ModuleName, + UINT32 LineNumber, + const char *InternalName, + ACPI_STATUS LookupStatus) +{ + ACPI_STATUS Status; + UINT32 BadName; + char *Name = NULL; + + + ACPI_MSG_REDIRECT_BEGIN; + AcpiOsPrintf (ACPI_MSG_ERROR); + + if (LookupStatus == AE_BAD_CHARACTER) + { + /* There is a non-ascii character in the name */ + + ACPI_MOVE_32_TO_32 (&BadName, ACPI_CAST_PTR (UINT32, InternalName)); + AcpiOsPrintf ("[0x%.8X] (NON-ASCII)", BadName); + } + else + { + /* Convert path to external format */ + + Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, + InternalName, NULL, &Name); + + /* Print target name */ + + if (ACPI_SUCCESS (Status)) + { + AcpiOsPrintf ("[%s]", Name); + } + else + { + AcpiOsPrintf ("[COULD NOT EXTERNALIZE NAME]"); + } + + if (Name) + { + ACPI_FREE (Name); + } + } + + AcpiOsPrintf (" Namespace lookup failure, %s", + AcpiFormatException (LookupStatus)); + + ACPI_MSG_SUFFIX; + ACPI_MSG_REDIRECT_END; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtMethodError + * + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * Message - Error message to use on failure + * PrefixNode - Prefix relative to the path + * Path - Path to the node (optional) + * MethodStatus - Execution status + * + * RETURN: None + * + * DESCRIPTION: Print error message with the full pathname for the method. + * + ******************************************************************************/ + +void +AcpiUtMethodError ( + const char *ModuleName, + UINT32 LineNumber, + const char *Message, + ACPI_NAMESPACE_NODE *PrefixNode, + const char *Path, + ACPI_STATUS MethodStatus) +{ + ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node = PrefixNode; + + + ACPI_MSG_REDIRECT_BEGIN; + AcpiOsPrintf (ACPI_MSG_ERROR); + + if (Path) + { + Status = AcpiNsGetNode (PrefixNode, Path, ACPI_NS_NO_UPSEARCH, + &Node); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("[Could not get node by pathname]"); + } + } + + AcpiNsPrintNodePathname (Node, Message); + AcpiOsPrintf (", %s", AcpiFormatException (MethodStatus)); + + ACPI_MSG_SUFFIX; + ACPI_MSG_REDIRECT_END; +} + +#endif /* ACPI_NO_ERROR_MESSAGES */ diff --git a/source/components/utilities/uteval.c b/source/components/utilities/uteval.c index 82f2b79f..e24f2a2 100644 --- a/source/components/utilities/uteval.c +++ b/source/components/utilities/uteval.c @@ -136,22 +136,27 @@ AcpiUtEvaluateObject ( switch ((Info->ReturnObject)->Common.Type) { case ACPI_TYPE_INTEGER: + ReturnBtype = ACPI_BTYPE_INTEGER; break; case ACPI_TYPE_BUFFER: + ReturnBtype = ACPI_BTYPE_BUFFER; break; case ACPI_TYPE_STRING: + ReturnBtype = ACPI_BTYPE_STRING; break; case ACPI_TYPE_PACKAGE: + ReturnBtype = ACPI_BTYPE_PACKAGE; break; default: + ReturnBtype = 0; break; } diff --git a/source/components/utilities/utexcep.c b/source/components/utilities/utexcep.c index 1aead78..75258d9 100644 --- a/source/components/utilities/utexcep.c +++ b/source/components/utilities/utexcep.c @@ -167,6 +167,7 @@ AcpiUtValidateException ( break; default: + break; } diff --git a/source/components/utilities/utids.c b/source/components/utilities/utids.c index 86c8a64..831875b 100644 --- a/source/components/utilities/utids.c +++ b/source/components/utilities/utids.c @@ -375,14 +375,17 @@ AcpiUtExecute_CID ( switch (CidObjects[i]->Common.Type) { case ACPI_TYPE_INTEGER: + StringAreaSize += ACPI_EISAID_STRING_SIZE; break; case ACPI_TYPE_STRING: + StringAreaSize += CidObjects[i]->String.Length + 1; break; default: + Status = AE_TYPE; goto Cleanup; } diff --git a/source/components/utilities/utmisc.c b/source/components/utilities/utmisc.c index 84fec46..6553d28 100644 --- a/source/components/utilities/utmisc.c +++ b/source/components/utilities/utmisc.c @@ -429,10 +429,12 @@ AcpiUtDisplayInitPathname ( switch (Type) { case ACPI_TYPE_METHOD: + AcpiOsPrintf ("Executing "); break; default: + AcpiOsPrintf ("Initializing "); break; } diff --git a/source/components/utilities/utobject.c b/source/components/utilities/utobject.c index a219798..32b31d3 100644 --- a/source/components/utilities/utobject.c +++ b/source/components/utilities/utobject.c @@ -140,6 +140,7 @@ AcpiUtCreateInternalObjectDbg ( break; default: + /* All others have no secondary object */ break; } @@ -397,6 +398,7 @@ AcpiUtValidInternalObject ( return (TRUE); default: + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p is not not an ACPI operand obj [%s]\n", Object, AcpiUtGetDescriptorName (Object))); @@ -556,13 +558,11 @@ AcpiUtGetSimpleObjectSize ( Length += (ACPI_SIZE) InternalObject->String.Length + 1; break; - case ACPI_TYPE_BUFFER: Length += (ACPI_SIZE) InternalObject->Buffer.Length; break; - case ACPI_TYPE_INTEGER: case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_POWER: @@ -571,13 +571,11 @@ AcpiUtGetSimpleObjectSize ( break; - case ACPI_TYPE_LOCAL_REFERENCE: switch (InternalObject->Reference.Class) { case ACPI_REFCLASS_NAME: - /* * Get the actual length of the full pathname to this object. * The reference will be converted to the pathname to the object @@ -592,7 +590,6 @@ AcpiUtGetSimpleObjectSize ( break; default: - /* * No other reference opcodes are supported. * Notably, Locals and Args are not supported, but this may be @@ -607,7 +604,6 @@ AcpiUtGetSimpleObjectSize ( } break; - default: ACPI_ERROR ((AE_INFO, "Cannot convert to external object - " @@ -656,7 +652,6 @@ AcpiUtGetElementLength ( switch (ObjectType) { case ACPI_COPY_TYPE_SIMPLE: - /* * Simple object - just get the size (Null object/entry is handled * here also) and sum it into the running package length @@ -670,7 +665,6 @@ AcpiUtGetElementLength ( Info->Length += ObjectSpace; break; - case ACPI_COPY_TYPE_PACKAGE: /* Package object - nothing much to do here, let the walk handle it */ @@ -679,7 +673,6 @@ AcpiUtGetElementLength ( State->Pkg.ThisTargetObj = NULL; break; - default: /* No other types allowed */ diff --git a/source/components/utilities/utstring.c b/source/components/utilities/utstring.c index 4d35429..9e58908 100644 --- a/source/components/utilities/utstring.c +++ b/source/components/utilities/utstring.c @@ -220,10 +220,13 @@ AcpiUtStrtoul64 ( { case ACPI_ANY_BASE: case 16: + break; default: + /* Invalid Base */ + return_ACPI_STATUS (AE_BAD_PARAMETER); } @@ -423,36 +426,44 @@ AcpiUtPrintString ( switch (String[i]) { case 0x07: + AcpiOsPrintf ("\\a"); /* BELL */ break; case 0x08: + AcpiOsPrintf ("\\b"); /* BACKSPACE */ break; case 0x0C: + AcpiOsPrintf ("\\f"); /* FORMFEED */ break; case 0x0A: + AcpiOsPrintf ("\\n"); /* LINEFEED */ break; case 0x0D: + AcpiOsPrintf ("\\r"); /* CARRIAGE RETURN*/ break; case 0x09: + AcpiOsPrintf ("\\t"); /* HORIZONTAL TAB */ break; case 0x0B: + AcpiOsPrintf ("\\v"); /* VERTICAL TAB */ break; case '\'': /* Single Quote */ case '\"': /* Double Quote */ case '\\': /* Backslash */ + AcpiOsPrintf ("\\%c", (int) String[i]); break; @@ -530,7 +541,8 @@ AcpiUtValidAcpiChar ( * * FUNCTION: AcpiUtValidAcpiName * - * PARAMETERS: Name - The name to be examined + * PARAMETERS: Name - The name to be examined. Does not have to + * be NULL terminated string. * * RETURN: TRUE if the name is valid, FALSE otherwise * @@ -543,7 +555,7 @@ AcpiUtValidAcpiChar ( BOOLEAN AcpiUtValidAcpiName ( - UINT32 Name) + char *Name) { UINT32 i; @@ -553,7 +565,7 @@ AcpiUtValidAcpiName ( for (i = 0; i < ACPI_NAME_SIZE; i++) { - if (!AcpiUtValidAcpiChar ((ACPI_CAST_PTR (char, &Name))[i], i)) + if (!AcpiUtValidAcpiChar (Name[i], i)) { return (FALSE); } diff --git a/source/components/utilities/uttrack.c b/source/components/utilities/uttrack.c index c7484ec..6cf9bdf 100644 --- a/source/components/utilities/uttrack.c +++ b/source/components/utilities/uttrack.c @@ -675,6 +675,7 @@ AcpiUtDumpAllocations ( switch (ACPI_GET_DESCRIPTOR_TYPE (Descriptor)) { case ACPI_DESC_TYPE_OPERAND: + if (Element->Size == sizeof (ACPI_OPERAND_OBJECT)) { DescriptorType = ACPI_DESC_TYPE_OPERAND; @@ -682,6 +683,7 @@ AcpiUtDumpAllocations ( break; case ACPI_DESC_TYPE_PARSER: + if (Element->Size == sizeof (ACPI_PARSE_OBJECT)) { DescriptorType = ACPI_DESC_TYPE_PARSER; @@ -689,6 +691,7 @@ AcpiUtDumpAllocations ( break; case ACPI_DESC_TYPE_NAMED: + if (Element->Size == sizeof (ACPI_NAMESPACE_NODE)) { DescriptorType = ACPI_DESC_TYPE_NAMED; @@ -696,6 +699,7 @@ AcpiUtDumpAllocations ( break; default: + break; } @@ -704,22 +708,26 @@ AcpiUtDumpAllocations ( switch (DescriptorType) { case ACPI_DESC_TYPE_OPERAND: + AcpiOsPrintf ("%12.12s RefCount 0x%04X\n", AcpiUtGetTypeName (Descriptor->Object.Common.Type), Descriptor->Object.Common.ReferenceCount); break; case ACPI_DESC_TYPE_PARSER: + AcpiOsPrintf ("AmlOpcode 0x%04hX\n", Descriptor->Op.Asl.AmlOpcode); break; case ACPI_DESC_TYPE_NAMED: + AcpiOsPrintf ("%4.4s\n", AcpiUtGetNodeName (&Descriptor->Node)); break; default: + AcpiOsPrintf ( "\n"); break; } diff --git a/source/components/utilities/utxferror.c b/source/components/utilities/utxferror.c index 8454f8b..a01b5b0 100644 --- a/source/components/utilities/utxferror.c +++ b/source/components/utilities/utxferror.c @@ -45,7 +45,6 @@ #include "acpi.h" #include "accommon.h" -#include "acnamesp.h" #define _COMPONENT ACPI_UTILITIES @@ -54,48 +53,7 @@ /* * This module is used for the in-kernel ACPICA as well as the ACPICA * tools/applications. - * - * For the iASL compiler case, the output is redirected to stderr so that - * any of the various ACPI errors and warnings do not appear in the output - * files, for either the compiler or disassembler portions of the tool. - */ -#ifdef ACPI_ASL_COMPILER -#include <stdio.h> - -extern FILE *AcpiGbl_OutputFile; - -#define ACPI_MSG_REDIRECT_BEGIN \ - FILE *OutputFile = AcpiGbl_OutputFile; \ - AcpiOsRedirectOutput (stderr); - -#define ACPI_MSG_REDIRECT_END \ - AcpiOsRedirectOutput (OutputFile); - -#else -/* - * non-iASL case - no redirection, nothing to do - */ -#define ACPI_MSG_REDIRECT_BEGIN -#define ACPI_MSG_REDIRECT_END -#endif - -/* - * Common message prefixes */ -#define ACPI_MSG_ERROR "ACPI Error: " -#define ACPI_MSG_EXCEPTION "ACPI Exception: " -#define ACPI_MSG_WARNING "ACPI Warning: " -#define ACPI_MSG_INFO "ACPI: " - -#define ACPI_MSG_BIOS_ERROR "ACPI BIOS Error (bug): " -#define ACPI_MSG_BIOS_WARNING "ACPI BIOS Warning (bug): " - -/* - * Common message suffix - */ -#define ACPI_MSG_SUFFIX \ - AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber) - /******************************************************************************* * @@ -331,278 +289,3 @@ AcpiBiosWarning ( } ACPI_EXPORT_SYMBOL (AcpiBiosWarning) - - -/* - * The remainder of this module contains internal error functions that may - * be configured out. - */ -#if !defined (ACPI_NO_ERROR_MESSAGES) && !defined (ACPI_BIN_APP) - -/******************************************************************************* - * - * FUNCTION: AcpiUtPredefinedWarning - * - * PARAMETERS: ModuleName - Caller's module name (for error output) - * LineNumber - Caller's line number (for error output) - * Pathname - Full pathname to the node - * NodeFlags - From Namespace node for the method/object - * Format - Printf format string + additional args - * - * RETURN: None - * - * DESCRIPTION: Warnings for the predefined validation module. Messages are - * only emitted the first time a problem with a particular - * method/object is detected. This prevents a flood of error - * messages for methods that are repeatedly evaluated. - * - ******************************************************************************/ - -void ACPI_INTERNAL_VAR_XFACE -AcpiUtPredefinedWarning ( - const char *ModuleName, - UINT32 LineNumber, - char *Pathname, - UINT8 NodeFlags, - const char *Format, - ...) -{ - va_list ArgList; - - - /* - * Warning messages for this method/object will be disabled after the - * first time a validation fails or an object is successfully repaired. - */ - if (NodeFlags & ANOBJ_EVALUATED) - { - return; - } - - AcpiOsPrintf (ACPI_MSG_WARNING "%s: ", Pathname); - - va_start (ArgList, Format); - AcpiOsVprintf (Format, ArgList); - ACPI_MSG_SUFFIX; - va_end (ArgList); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtPredefinedInfo - * - * PARAMETERS: ModuleName - Caller's module name (for error output) - * LineNumber - Caller's line number (for error output) - * Pathname - Full pathname to the node - * NodeFlags - From Namespace node for the method/object - * Format - Printf format string + additional args - * - * RETURN: None - * - * DESCRIPTION: Info messages for the predefined validation module. Messages - * are only emitted the first time a problem with a particular - * method/object is detected. This prevents a flood of - * messages for methods that are repeatedly evaluated. - * - ******************************************************************************/ - -void ACPI_INTERNAL_VAR_XFACE -AcpiUtPredefinedInfo ( - const char *ModuleName, - UINT32 LineNumber, - char *Pathname, - UINT8 NodeFlags, - const char *Format, - ...) -{ - va_list ArgList; - - - /* - * Warning messages for this method/object will be disabled after the - * first time a validation fails or an object is successfully repaired. - */ - if (NodeFlags & ANOBJ_EVALUATED) - { - return; - } - - AcpiOsPrintf (ACPI_MSG_INFO "%s: ", Pathname); - - va_start (ArgList, Format); - AcpiOsVprintf (Format, ArgList); - ACPI_MSG_SUFFIX; - va_end (ArgList); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtPredefinedBiosError - * - * PARAMETERS: ModuleName - Caller's module name (for error output) - * LineNumber - Caller's line number (for error output) - * Pathname - Full pathname to the node - * NodeFlags - From Namespace node for the method/object - * Format - Printf format string + additional args - * - * RETURN: None - * - * DESCRIPTION: BIOS error message for predefined names. Messages - * are only emitted the first time a problem with a particular - * method/object is detected. This prevents a flood of - * messages for methods that are repeatedly evaluated. - * - ******************************************************************************/ - -void ACPI_INTERNAL_VAR_XFACE -AcpiUtPredefinedBiosError ( - const char *ModuleName, - UINT32 LineNumber, - char *Pathname, - UINT8 NodeFlags, - const char *Format, - ...) -{ - va_list ArgList; - - - /* - * Warning messages for this method/object will be disabled after the - * first time a validation fails or an object is successfully repaired. - */ - if (NodeFlags & ANOBJ_EVALUATED) - { - return; - } - - AcpiOsPrintf (ACPI_MSG_BIOS_ERROR "%s: ", Pathname); - - va_start (ArgList, Format); - AcpiOsVprintf (Format, ArgList); - ACPI_MSG_SUFFIX; - va_end (ArgList); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtNamespaceError - * - * PARAMETERS: ModuleName - Caller's module name (for error output) - * LineNumber - Caller's line number (for error output) - * InternalName - Name or path of the namespace node - * LookupStatus - Exception code from NS lookup - * - * RETURN: None - * - * DESCRIPTION: Print error message with the full pathname for the NS node. - * - ******************************************************************************/ - -void -AcpiUtNamespaceError ( - const char *ModuleName, - UINT32 LineNumber, - const char *InternalName, - ACPI_STATUS LookupStatus) -{ - ACPI_STATUS Status; - UINT32 BadName; - char *Name = NULL; - - - ACPI_MSG_REDIRECT_BEGIN; - AcpiOsPrintf (ACPI_MSG_ERROR); - - if (LookupStatus == AE_BAD_CHARACTER) - { - /* There is a non-ascii character in the name */ - - ACPI_MOVE_32_TO_32 (&BadName, ACPI_CAST_PTR (UINT32, InternalName)); - AcpiOsPrintf ("[0x%.8X] (NON-ASCII)", BadName); - } - else - { - /* Convert path to external format */ - - Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, - InternalName, NULL, &Name); - - /* Print target name */ - - if (ACPI_SUCCESS (Status)) - { - AcpiOsPrintf ("[%s]", Name); - } - else - { - AcpiOsPrintf ("[COULD NOT EXTERNALIZE NAME]"); - } - - if (Name) - { - ACPI_FREE (Name); - } - } - - AcpiOsPrintf (" Namespace lookup failure, %s", - AcpiFormatException (LookupStatus)); - - ACPI_MSG_SUFFIX; - ACPI_MSG_REDIRECT_END; -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtMethodError - * - * PARAMETERS: ModuleName - Caller's module name (for error output) - * LineNumber - Caller's line number (for error output) - * Message - Error message to use on failure - * PrefixNode - Prefix relative to the path - * Path - Path to the node (optional) - * MethodStatus - Execution status - * - * RETURN: None - * - * DESCRIPTION: Print error message with the full pathname for the method. - * - ******************************************************************************/ - -void -AcpiUtMethodError ( - const char *ModuleName, - UINT32 LineNumber, - const char *Message, - ACPI_NAMESPACE_NODE *PrefixNode, - const char *Path, - ACPI_STATUS MethodStatus) -{ - ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node = PrefixNode; - - - ACPI_MSG_REDIRECT_BEGIN; - AcpiOsPrintf (ACPI_MSG_ERROR); - - if (Path) - { - Status = AcpiNsGetNode (PrefixNode, Path, ACPI_NS_NO_UPSEARCH, - &Node); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("[Could not get node by pathname]"); - } - } - - AcpiNsPrintNodePathname (Node, Message); - AcpiOsPrintf (", %s", AcpiFormatException (MethodStatus)); - - ACPI_MSG_SUFFIX; - ACPI_MSG_REDIRECT_END; -} - -#endif /* ACPI_NO_ERROR_MESSAGES */ |