diff options
Diffstat (limited to 'source/components')
-rw-r--r-- | source/components/debugger/dbexec.c | 23 | ||||
-rw-r--r-- | source/components/debugger/dbinput.c | 309 | ||||
-rw-r--r-- | source/components/debugger/dbmethod.c | 6 | ||||
-rw-r--r-- | source/components/debugger/dbnames.c | 2 | ||||
-rw-r--r-- | source/components/debugger/dbstats.c | 8 | ||||
-rw-r--r-- | source/components/debugger/dbutils.c | 2 | ||||
-rw-r--r-- | source/components/disassembler/dmopcode.c | 4 | ||||
-rw-r--r-- | source/components/tables/tbinstal.c | 20 | ||||
-rw-r--r-- | source/components/tables/tbxface.c | 40 |
9 files changed, 268 insertions, 146 deletions
diff --git a/source/components/debugger/dbexec.c b/source/components/debugger/dbexec.c index 86c6579..d8ec3d3 100644 --- a/source/components/debugger/dbexec.c +++ b/source/components/debugger/dbexec.c @@ -607,7 +607,7 @@ AcpiDbExecuteSetup ( AcpiDbPrepNamestring (Info->Pathname); AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); - AcpiOsPrintf ("Executing %s\n", Info->Pathname); + AcpiOsPrintf ("Evaluating %s\n", Info->Pathname); if (Info->Flags & EX_SINGLE_STEP) { @@ -701,7 +701,7 @@ AcpiDbExecutionWalk ( ReturnObj.Pointer = NULL; ReturnObj.Length = ACPI_ALLOCATE_BUFFER; - AcpiNsPrintNodePathname (Node, "Execute"); + AcpiNsPrintNodePathname (Node, "Evaluating"); /* Do the actual method execution */ @@ -710,7 +710,7 @@ AcpiDbExecutionWalk ( Status = AcpiEvaluateObject (Node, NULL, NULL, &ReturnObj); - AcpiOsPrintf ("[%4.4s] returned %s\n", AcpiUtGetNodeName (Node), + AcpiOsPrintf ("Evaluation of [%4.4s] returned %s\n", AcpiUtGetNodeName (Node), AcpiFormatException (Status)); AcpiGbl_MethodExecuting = FALSE; @@ -1009,14 +1009,14 @@ AcpiDbExecute ( if (Allocations > 0) { - AcpiOsPrintf ("Outstanding: 0x%X allocations after execution\n", - Allocations); + AcpiOsPrintf ("0x%X Outstanding allocations after evaluation of %s\n", + Allocations, AcpiGbl_DbMethodInfo.Pathname); } #endif if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("Execution of %s failed with status %s\n", + AcpiOsPrintf ("Evaluation of %s failed with status %s\n", AcpiGbl_DbMethodInfo.Pathname, AcpiFormatException (Status)); } else @@ -1025,7 +1025,8 @@ AcpiDbExecute ( if (ReturnObj.Length) { - AcpiOsPrintf ("Execution of %s returned object %p Buflen %X\n", + AcpiOsPrintf ( + "Evaluation of %s returned object %p, external buffer length %X\n", AcpiGbl_DbMethodInfo.Pathname, ReturnObj.Pointer, (UINT32) ReturnObj.Length); AcpiDbDumpExternalObject (ReturnObj.Pointer, 1); @@ -1040,7 +1041,7 @@ AcpiDbExecute ( } else { - AcpiOsPrintf ("No return object from execution of %s\n", + AcpiOsPrintf ("No object was returned from evaluation of %s\n", AcpiGbl_DbMethodInfo.Pathname); } } @@ -1111,7 +1112,7 @@ AcpiDbMethodThread ( Status = AcpiDbExecuteMethod (&LocalInfo, &ReturnObj); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("%s During execution of %s at iteration %X\n", + AcpiOsPrintf ("%s During evaluation of %s at iteration %X\n", AcpiFormatException (Status), Info->Pathname, i); if (Status == AE_ABORT_METHOD) { @@ -1122,12 +1123,12 @@ AcpiDbMethodThread ( #if 0 if ((i % 100) == 0) { - AcpiOsPrintf ("%u executions, Thread 0x%x\n", i, AcpiOsGetThreadId ()); + AcpiOsPrintf ("%u loops, Thread 0x%x\n", i, AcpiOsGetThreadId ()); } if (ReturnObj.Length) { - AcpiOsPrintf ("Execution of %s returned object %p Buflen %X\n", + AcpiOsPrintf ("Evaluation of %s returned object %p Buflen %X\n", Info->Pathname, ReturnObj.Pointer, (UINT32) ReturnObj.Length); AcpiDbDumpExternalObject (ReturnObj.Pointer, 1); } diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c index 42452ac..2d48171 100644 --- a/source/components/debugger/dbinput.c +++ b/source/components/debugger/dbinput.c @@ -67,8 +67,18 @@ AcpiDbSingleThread ( void); static void +AcpiDbDisplayCommandInfo ( + char *Command, + BOOLEAN DisplayAll); + +static void AcpiDbDisplayHelp ( - void); + char *Command); + +static BOOLEAN +AcpiDbMatchCommandHelp ( + char *Command, + const ACPI_DB_COMMAND_HELP *Help); /* @@ -92,6 +102,7 @@ enum AcpiExDebuggerCommands CMD_DISASSEMBLE, CMD_DUMP, CMD_ENABLEACPI, + CMD_EVALUATE, CMD_EVENT, CMD_EXECUTE, CMD_EXIT, @@ -145,7 +156,7 @@ enum AcpiExDebuggerCommands /* Second parameter is the required argument count */ -static const COMMAND_INFO AcpiGbl_DbCommands[] = +static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] = { {"<NOT FOUND>", 0}, {"<NULL>", 0}, @@ -161,6 +172,7 @@ static const COMMAND_INFO AcpiGbl_DbCommands[] = {"DISASSEMBLE", 1}, {"DUMP", 1}, {"ENABLEACPI", 0}, + {"EVALUATE", 1}, {"EVENT", 1}, {"EXECUTE", 1}, {"EXIT", 0}, @@ -197,7 +209,7 @@ static const COMMAND_INFO AcpiGbl_DbCommands[] = {"RESULTS", 0}, {"SET", 3}, {"SLEEP", 1}, - {"STATS", 0}, + {"STATS", 1}, {"STOP", 0}, {"TABLES", 0}, {"TEMPLATE", 1}, @@ -210,100 +222,229 @@ static const COMMAND_INFO AcpiGbl_DbCommands[] = {NULL, 0} }; +/* + * Help for all debugger commands. First argument is the number of lines + * of help to output for the command. + */ +static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = +{ + {0, "\nGeneral-Purpose Commands:", "\n"}, + {1, " Allocations", "Display list of current memory allocations\n"}, + {2, " Dump <Address>|<Namepath>", "\n"}, + {0, " [Byte|Word|Dword|Qword]", "Display ACPI objects or memory\n"}, + {1, " EnableAcpi", "Enable ACPI (hardware) mode\n"}, + {1, " Handlers", "Info about global handlers\n"}, + {1, " Help [Command]", "This help screen or individual command\n"}, + {1, " History", "Display command history buffer\n"}, + {1, " Level <DebugLevel>] [console]", "Get/Set debug level for file or console\n"}, + {1, " Locks", "Current status of internal mutexes\n"}, + {1, " Osi [Install|Remove <name>]", "Display or modify global _OSI list\n"}, + {1, " Quit or Exit", "Exit this command\n"}, + {9, " Stats [Allocations|Memory|Misc|", "\n"}, + {1, " Objects|Sizes|Stack|Tables]", "Display namespace and memory statistics\n"}, + {1, " Allocations", "Display list of current memory allocations\n"}, + {1, " Memory", "Dump internal memory lists\n"}, + {1, " Misc", "Namespace search and mutex stats\n"}, + {1, " Objects", "Summary of namespace objects\n"}, + {1, " Sizes", "Sizes for each of the internal objects\n"}, + {1, " Stack", "Display CPU stack usage\n"}, + {1, " Tables", "Info about current ACPI table(s)\n"}, + {1, " Tables", "Display info about loaded ACPI tables\n"}, + {1, " Unload <Namepath>", "Unload an ACPI table via namespace object\n"}, + {1, " ! <CommandNumber>", "Execute command from history buffer\n"}, + {1, " !!", "Execute last command again\n"}, + + {0, "\nNamespace Access Commands:", "\n"}, + {1, " Businfo", "Display system bus info\n"}, + {1, " Disassemble <Method>", "Disassemble a control method\n"}, + {1, " Event <F|G> <Value>", "Generate AcpiEvent (Fixed/GPE)\n"}, + {1, " Find <AcpiName> (? is wildcard)", "Find ACPI name(s) with wildcards\n"}, + {1, " Gpe <GpeNum> <GpeBlock>", "Simulate a GPE\n"}, + {1, " Gpes", "Display info on all GPEs\n"}, + {1, " Integrity", "Validate namespace integrity\n"}, + {1, " Methods", "Display list of loaded control methods\n"}, + {1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"}, + {1, " Notify <Object> <Value>", "Send a notification on Object\n"}, + {1, " Objects <ObjectType>", "Display all objects of the given type\n"}, + {1, " Owner <OwnerId> [Depth]", "Display loaded namespace by object owner\n"}, + {1, " Predefined", "Check all predefined names\n"}, + {1, " Prefix [<NamePath>]", "Set or Get current execution prefix\n"}, + {1, " References <Addr>", "Find all references to object at addr\n"}, + {1, " Resources <DeviceName | *>", "Display Device resources (* = all devices)\n"}, + {1, " Set N <NamedObject> <Value>", "Set value for named integer\n"}, + {1, " Sleep <SleepState>", "Simulate sleep/wake sequence\n"}, + {1, " Template <Object>", "Format/dump a Buffer/ResourceTemplate\n"}, + {1, " Terminate", "Delete namespace and all internal objects\n"}, + {1, " Type <Object>", "Display object type\n"}, + + {0, "\nControl Method Execution Commands:","\n"}, + {1, " Arguments (or Args)", "Display method arguments\n"}, + {1, " Breakpoint <AmlOffset>", "Set an AML execution breakpoint\n"}, + {1, " Call", "Run to next control method invocation\n"}, + {1, " Debug <Namepath> [Arguments]", "Single Step a control method\n"}, + {6, " Evaluate", "Synonym for Execute\n"}, + {5, " Execute <Namepath> [Arguments]", "Execute control method\n"}, + {1, " Hex Integer", "Integer method argument\n"}, + {1, " \"Ascii String\"", "String method argument\n"}, + {1, " (Byte List)", "Buffer method argument\n"}, + {1, " [Package Element List]", "Package method argument\n"}, + {1, " Go", "Allow method to run to completion\n"}, + {1, " Information", "Display info about the current method\n"}, + {1, " Into", "Step into (not over) a method call\n"}, + {1, " List [# of Aml Opcodes]", "Display method ASL statements\n"}, + {1, " Locals", "Display method local variables\n"}, + {1, " Results", "Display method result stack\n"}, + {1, " Set <A|L> <#> <Value>", "Set method data (Arguments/Locals)\n"}, + {1, " Stop", "Terminate control method\n"}, + {1, " Thread <Threads><Loops><NamePath>", "Spawn threads to execute method(s)\n"}, + {1, " Trace <method name>", "Trace method execution\n"}, + {1, " Tree", "Display control method calling tree\n"}, + {1, " <Enter>", "Single step next AML opcode (over calls)\n"}, + + {0, "\nFile I/O Commands:", "\n"}, + {1, " Close", "Close debug output file\n"}, + {1, " Load <Input Filename>", "Load ACPI table from a file\n"}, + {1, " Open <Output Filename>", "Open a file for debug output\n"}, + {0, NULL, NULL} +}; + + +/******************************************************************************* + * + * FUNCTION: AcpiDbMatchCommandHelp + * + * PARAMETERS: Command - Command string to match + * Help - Help table entry to attempt match + * + * RETURN: TRUE if command matched, FALSE otherwise + * + * DESCRIPTION: Attempt to match a command in the help table in order to + * print help information for a single command. + * + ******************************************************************************/ + +static BOOLEAN +AcpiDbMatchCommandHelp ( + char *Command, + const ACPI_DB_COMMAND_HELP *Help) +{ + char *Invocation = Help->Invocation; + UINT32 LineCount; + + + /* Valid commands in the help table begin with a couple of spaces */ + + if (*Invocation != ' ') + { + return (FALSE); + } + + while (*Invocation == ' ') + { + Invocation++; + } + + /* Match command name (full command or substring) */ + + while ((*Command) && (*Invocation) && (*Invocation != ' ')) + { + if (ACPI_TOLOWER (*Command) != ACPI_TOLOWER (*Invocation)) + { + return (FALSE); + } + + Invocation++; + Command++; + } + + /* Print the appropriate number of help lines */ + + LineCount = Help->LineCount; + while (LineCount) + { + AcpiOsPrintf ("%-38s : %s", Help->Invocation, Help->Description); + Help++; + LineCount--; + } + + return (TRUE); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDbDisplayCommandInfo + * + * PARAMETERS: Command - Command string to match + * DisplayAll - Display all matching commands, or just + * the first one (substring match) + * + * RETURN: None + * + * DESCRIPTION: Display help information for a Debugger command. + * + ******************************************************************************/ + +static void +AcpiDbDisplayCommandInfo ( + char *Command, + BOOLEAN DisplayAll) +{ + const ACPI_DB_COMMAND_HELP *Next; + BOOLEAN Matched; + + + Next = AcpiGbl_DbCommandHelp; + while (Next->Invocation) + { + Matched = AcpiDbMatchCommandHelp (Command, Next); + if (!DisplayAll && Matched) + { + return; + } + + Next++; + } +} + /******************************************************************************* * * FUNCTION: AcpiDbDisplayHelp * - * PARAMETERS: None + * PARAMETERS: Command - Optional command string to display help. + * if not specified, all debugger command + * help strings are displayed * * RETURN: None * - * DESCRIPTION: Print a usage message. + * DESCRIPTION: Display help for a single debugger command, or all of them. * ******************************************************************************/ static void AcpiDbDisplayHelp ( - void) + char *Command) { + const ACPI_DB_COMMAND_HELP *Next = AcpiGbl_DbCommandHelp; + - AcpiOsPrintf ("\nGeneral-Purpose Commands:\n"); - AcpiOsPrintf (" Allocations Display list of current memory allocations\n"); - AcpiOsPrintf (" Dump <Address>|<Namepath>\n"); - AcpiOsPrintf (" [Byte|Word|Dword|Qword] Display ACPI objects or memory\n"); - AcpiOsPrintf (" EnableAcpi Enable ACPI (hardware) mode\n"); - AcpiOsPrintf (" Handlers Info about global handlers\n"); - AcpiOsPrintf (" Help This help screen\n"); - AcpiOsPrintf (" History Display command history buffer\n"); - AcpiOsPrintf (" Level [<DebugLevel>] [console] Get/Set debug level for file or console\n"); - AcpiOsPrintf (" Locks Current status of internal mutexes\n"); - AcpiOsPrintf (" Osi [Install|Remove <name>] Display or modify global _OSI list\n"); - AcpiOsPrintf (" Quit or Exit Exit this command\n"); - AcpiOsPrintf (" Stats [Allocations|Memory|Misc|\n"); - AcpiOsPrintf (" Objects|Sizes|Stack|Tables] Display namespace and memory statistics\n"); - AcpiOsPrintf (" Allocations Display list of current memory allocations\n"); - AcpiOsPrintf (" Memory Dump internal memory lists\n"); - AcpiOsPrintf (" Misc Namespace search and mutex stats\n"); - AcpiOsPrintf (" Objects Summary of namespace objects\n"); - AcpiOsPrintf (" Sizes Sizes for each of the internal objects\n"); - AcpiOsPrintf (" Stack Display CPU stack usage\n"); - AcpiOsPrintf (" Tables Info about current ACPI table(s)\n"); - AcpiOsPrintf (" Tables Display info about loaded ACPI tables\n"); - AcpiOsPrintf (" Unload <Namepath> Unload an ACPI table via namespace object\n"); - AcpiOsPrintf (" ! <CommandNumber> Execute command from history buffer\n"); - AcpiOsPrintf (" !! Execute last command again\n"); - - AcpiOsPrintf ("\nNamespace Access Commands:\n"); - AcpiOsPrintf (" Businfo Display system bus info\n"); - AcpiOsPrintf (" Disassemble <Method> Disassemble a control method\n"); - AcpiOsPrintf (" Event <F|G> <Value> Generate AcpiEvent (Fixed/GPE)\n"); - AcpiOsPrintf (" Find <AcpiName> (? is wildcard) Find ACPI name(s) with wildcards\n"); - AcpiOsPrintf (" Gpe <GpeNum> <GpeBlock> Simulate a GPE\n"); - AcpiOsPrintf (" Gpes Display info on all GPEs\n"); - AcpiOsPrintf (" Integrity Validate namespace integrity\n"); - AcpiOsPrintf (" Methods Display list of loaded control methods\n"); - AcpiOsPrintf (" Namespace [Object] [Depth] Display loaded namespace tree/subtree\n"); - AcpiOsPrintf (" Notify <Object> <Value> Send a notification on Object\n"); - AcpiOsPrintf (" Objects <ObjectType> Display all objects of the given type\n"); - AcpiOsPrintf (" Owner <OwnerId> [Depth] Display loaded namespace by object owner\n"); - AcpiOsPrintf (" Predefined Check all predefined names\n"); - AcpiOsPrintf (" Prefix [<NamePath>] Set or Get current execution prefix\n"); - AcpiOsPrintf (" References <Addr> Find all references to object at addr\n"); - AcpiOsPrintf (" Resources <DeviceName | *> Display Device resources (* = all devices)\n"); - AcpiOsPrintf (" Set N <NamedObject> <Value> Set value for named integer\n"); - AcpiOsPrintf (" Sleep <SleepState> Simulate sleep/wake sequence\n"); - AcpiOsPrintf (" Template <Object> Format/dump a Buffer/ResourceTemplate\n"); - AcpiOsPrintf (" Terminate Delete namespace and all internal objects\n"); - AcpiOsPrintf (" Type <Object> Display object type\n"); - - AcpiOsPrintf ("\nControl Method Execution Commands:\n"); - AcpiOsPrintf (" Arguments (or Args) Display method arguments\n"); - AcpiOsPrintf (" Breakpoint <AmlOffset> Set an AML execution breakpoint\n"); - AcpiOsPrintf (" Call Run to next control method invocation\n"); - AcpiOsPrintf (" Debug <Namepath> [Arguments] Single Step a control method\n"); - AcpiOsPrintf (" Execute <Namepath> [Arguments] Execute control method\n"); - AcpiOsPrintf (" Hex Integer Integer method argument\n"); - AcpiOsPrintf (" \"Ascii String\" String method argument\n"); - AcpiOsPrintf (" (Byte List) Buffer method argument\n"); - AcpiOsPrintf (" [Package Element List] Package method argument\n"); - AcpiOsPrintf (" Go Allow method to run to completion\n"); - AcpiOsPrintf (" Information Display info about the current method\n"); - AcpiOsPrintf (" Into Step into (not over) a method call\n"); - AcpiOsPrintf (" List [# of Aml Opcodes] Display method ASL statements\n"); - AcpiOsPrintf (" Locals Display method local variables\n"); - AcpiOsPrintf (" Results Display method result stack\n"); - AcpiOsPrintf (" Set <A|L> <#> <Value> Set method data (Arguments/Locals)\n"); - AcpiOsPrintf (" Stop Terminate control method\n"); - AcpiOsPrintf (" Thread <Threads><Loops><NamePath> Spawn threads to execute method(s)\n"); - AcpiOsPrintf (" Trace <method name> Trace method execution\n"); - AcpiOsPrintf (" Tree Display control method calling tree\n"); - AcpiOsPrintf (" <Enter> Single step next AML opcode (over calls)\n"); - - AcpiOsPrintf ("\nFile I/O Commands:\n"); - AcpiOsPrintf (" Close Close debug output file\n"); - AcpiOsPrintf (" Load <Input Filename> Load ACPI table from a file\n"); - AcpiOsPrintf (" Open <Output Filename> Open a file for debug output\n"); + if (!Command) + { + /* No argument to help, display help for all commands */ + + while (Next->Invocation) + { + AcpiOsPrintf ("%-38s%s", Next->Invocation, Next->Description); + Next++; + } + } + else + { + /* Display help for all commands that match the subtring */ + + AcpiDbDisplayCommandInfo (Command, TRUE); + } } @@ -601,6 +742,7 @@ AcpiDbCommandDispatch ( ParamCount, AcpiGbl_DbCommands[CommandIndex].Name, AcpiGbl_DbCommands[CommandIndex].MinArgs); + AcpiDbDisplayCommandInfo (AcpiGbl_DbCommands[CommandIndex].Name, FALSE); return (AE_CTRL_TRUE); } @@ -677,6 +819,7 @@ AcpiDbCommandDispatch ( 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); @@ -704,7 +847,7 @@ AcpiDbCommandDispatch ( case CMD_HELP: case CMD_HELP2: - AcpiDbDisplayHelp (); + AcpiDbDisplayHelp (AcpiGbl_DbArgs[1]); break; case CMD_HISTORY: diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c index 0d45d68..5335611 100644 --- a/source/components/debugger/dbmethod.c +++ b/source/components/debugger/dbmethod.c @@ -402,7 +402,7 @@ AcpiDbWalkForExecute ( void **ReturnValue) { ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; - ACPI_EXECUTE_WALK *Info = (ACPI_EXECUTE_WALK *) Context; + ACPI_DB_EXECUTE_WALK *Info = (ACPI_DB_EXECUTE_WALK *) Context; ACPI_BUFFER ReturnObj; ACPI_STATUS Status; char *Pathname; @@ -502,7 +502,7 @@ void AcpiDbBatchExecute ( char *CountArg) { - ACPI_EXECUTE_WALK Info; + ACPI_DB_EXECUTE_WALK Info; Info.Count = 0; @@ -519,7 +519,7 @@ AcpiDbBatchExecute ( (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, AcpiDbWalkForExecute, NULL, (void *) &Info, NULL); - AcpiOsPrintf ("Executed %u predefined names in the namespace\n", Info.Count); + AcpiOsPrintf ("Evaluated %u predefined names in the namespace\n", Info.Count); } #endif /* ACPI_DEBUGGER */ diff --git a/source/components/debugger/dbnames.c b/source/components/debugger/dbnames.c index be326c5..0393e6b 100644 --- a/source/components/debugger/dbnames.c +++ b/source/components/debugger/dbnames.c @@ -102,7 +102,7 @@ AcpiDbBusWalk ( * Arguments for the Objects command * These object types map directly to the ACPI_TYPES */ -static ARGUMENT_INFO AcpiDbObjectTypes [] = +static ACPI_DB_ARGUMENT_INFO AcpiDbObjectTypes [] = { {"ANY"}, {"INTEGERS"}, diff --git a/source/components/debugger/dbstats.c b/source/components/debugger/dbstats.c index fcc4998..64c847a 100644 --- a/source/components/debugger/dbstats.c +++ b/source/components/debugger/dbstats.c @@ -79,7 +79,7 @@ AcpiDbListInfo ( /* * Statistics subcommands */ -static ARGUMENT_INFO AcpiDbStatTypes [] = +static ACPI_DB_ARGUMENT_INFO AcpiDbStatTypes [] = { {"ALLOCATIONS"}, {"OBJECTS"}, @@ -398,12 +398,6 @@ AcpiDbDisplayStatistics ( UINT32 Temp; - if (!TypeArg) - { - AcpiOsPrintf ("The following subcommands are available:\n ALLOCATIONS, OBJECTS, MEMORY, MISC, SIZES, TABLES\n"); - return (AE_OK); - } - AcpiUtStrupr (TypeArg); Temp = AcpiDbMatchArgument (TypeArg, AcpiDbStatTypes); if (Temp == (UINT32) -1) diff --git a/source/components/debugger/dbutils.c b/source/components/debugger/dbutils.c index 7ce9090..36a6d20 100644 --- a/source/components/debugger/dbutils.c +++ b/source/components/debugger/dbutils.c @@ -85,7 +85,7 @@ static char *Converter = "0123456789ABCDEF"; ACPI_OBJECT_TYPE AcpiDbMatchArgument ( char *UserArgument, - ARGUMENT_INFO *Arguments) + ACPI_DB_ARGUMENT_INFO *Arguments) { UINT32 i; diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c index 2ce08a3..caebe26 100644 --- a/source/components/disassembler/dmopcode.c +++ b/source/components/disassembler/dmopcode.c @@ -254,6 +254,10 @@ AcpiDmFieldPredefinedDescription ( /* Major cheat: We previously put the Tag ptr in the Node field */ Tag = ACPI_CAST_PTR (char, IndexOp->Common.Node); + if (!Tag) + { + return; + } /* Match the name in the info table */ diff --git a/source/components/tables/tbinstal.c b/source/components/tables/tbinstal.c index 648ee75..0626440 100644 --- a/source/components/tables/tbinstal.c +++ b/source/components/tables/tbinstal.c @@ -374,6 +374,7 @@ AcpiTbResizeRootTableList ( void) { ACPI_TABLE_DESC *Tables; + UINT32 TableCount; ACPI_FUNCTION_TRACE (TbResizeRootTableList); @@ -389,9 +390,17 @@ AcpiTbResizeRootTableList ( /* Increase the Table Array size */ + if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) + { + TableCount = AcpiGbl_RootTableList.MaxTableCount; + } + else + { + TableCount = AcpiGbl_RootTableList.CurrentTableCount; + } + Tables = ACPI_ALLOCATE_ZEROED ( - ((ACPI_SIZE) AcpiGbl_RootTableList.MaxTableCount + - ACPI_ROOT_TABLE_SIZE_INCREMENT) * + ((ACPI_SIZE) TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT) * sizeof (ACPI_TABLE_DESC)); if (!Tables) { @@ -404,7 +413,7 @@ AcpiTbResizeRootTableList ( if (AcpiGbl_RootTableList.Tables) { ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables, - (ACPI_SIZE) AcpiGbl_RootTableList.MaxTableCount * sizeof (ACPI_TABLE_DESC)); + (ACPI_SIZE) TableCount * sizeof (ACPI_TABLE_DESC)); if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) { @@ -413,8 +422,9 @@ AcpiTbResizeRootTableList ( } AcpiGbl_RootTableList.Tables = Tables; - AcpiGbl_RootTableList.MaxTableCount += ACPI_ROOT_TABLE_SIZE_INCREMENT; - AcpiGbl_RootTableList.Flags |= (UINT8) ACPI_ROOT_ORIGIN_ALLOCATED; + AcpiGbl_RootTableList.MaxTableCount = + TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT; + AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED; return_ACPI_STATUS (AE_OK); } diff --git a/source/components/tables/tbxface.c b/source/components/tables/tbxface.c index fcc44f3..d2f31ea 100644 --- a/source/components/tables/tbxface.c +++ b/source/components/tables/tbxface.c @@ -175,7 +175,7 @@ ACPI_EXPORT_SYMBOL (AcpiInitializeTables) * DESCRIPTION: Reallocate Root Table List into dynamic memory. Copies the * root list from the previously provided scratch area. Should * be called once dynamic memory allocation is available in the - * kernel + * kernel. * ******************************************************************************/ @@ -183,9 +183,7 @@ ACPI_STATUS AcpiReallocateRootTable ( void) { - ACPI_TABLE_DESC *Tables; - ACPI_SIZE NewSize; - ACPI_SIZE CurrentSize; + ACPI_STATUS Status; ACPI_FUNCTION_TRACE (AcpiReallocateRootTable); @@ -200,38 +198,10 @@ AcpiReallocateRootTable ( return_ACPI_STATUS (AE_SUPPORT); } - /* - * Get the current size of the root table and add the default - * increment to create the new table size. - */ - CurrentSize = (ACPI_SIZE) - AcpiGbl_RootTableList.CurrentTableCount * sizeof (ACPI_TABLE_DESC); - - NewSize = CurrentSize + - (ACPI_ROOT_TABLE_SIZE_INCREMENT * sizeof (ACPI_TABLE_DESC)); - - /* Create new array and copy the old array */ - - Tables = ACPI_ALLOCATE_ZEROED (NewSize); - if (!Tables) - { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables, CurrentSize); + AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ALLOW_RESIZE; - /* - * Update the root table descriptor. The new size will be the current - * number of tables plus the increment, independent of the reserved - * size of the original table list. - */ - AcpiGbl_RootTableList.Tables = Tables; - AcpiGbl_RootTableList.MaxTableCount = - AcpiGbl_RootTableList.CurrentTableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT; - AcpiGbl_RootTableList.Flags = - ACPI_ROOT_ORIGIN_ALLOCATED | ACPI_ROOT_ALLOW_RESIZE; - - return_ACPI_STATUS (AE_OK); + Status = AcpiTbResizeRootTableList (); + return_ACPI_STATUS (Status); } ACPI_EXPORT_SYMBOL (AcpiReallocateRootTable) |