Disassembler: Add option to disable Buffer->ResourceTemplate disassembly.

There may be cases where it is not desireable to fully disassemble a
buffer to a ResourceTemplate.
This commit is contained in:
Robert Moore 2011-10-11 13:36:12 -07:00
parent 26d92b01a1
commit 7acf57cb95
3 changed files with 29 additions and 18 deletions

View File

@ -168,7 +168,7 @@ AslDoResponseFile (
#define ASL_TOKEN_SEPARATORS " \t\n"
#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^no:p:r:s:t:T:G^v:w:x:z"
#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^mno:p:r:s:t:T:G^v:w:x:z"
/*******************************************************************************
@ -230,6 +230,7 @@ Options (
ACPI_OPTION ("-dc [file]", "Disassemble AML and immediately compile it");
ACPI_OPTION ("", "(Obtain DSDT from current system if no input file)");
ACPI_OPTION ("-e [f1,f2]", "Include ACPI table(s) for external symbol resolution");
ACPI_OPTION ("-m", "Do not translate Buffers to Resource Templates");
ACPI_OPTION ("-2", "Emit ACPI 2.0 compatible ASL code");
ACPI_OPTION ("-g", "Get ACPI tables and write to files (*.dat)");
@ -673,6 +674,20 @@ AslDoOptions (
break;
case 'm':
AcpiGbl_NoResourceDisassembly = TRUE;
break;
case 'n':
/* Parse only */
Gbl_ParseOnlyFlag = TRUE;
break;
case 'o':
switch (AcpiGbl_Optarg[0])
@ -721,14 +736,6 @@ AslDoOptions (
break;
case 'n':
/* Parse only */
Gbl_ParseOnlyFlag = TRUE;
break;
case 'p':
/* Override default AML output filename */

View File

@ -498,16 +498,19 @@ AcpiDmDisassembleOneOp (
* types of buffers, we have to closely look at the data in the
* buffer to determine the type.
*/
Status = AcpiDmIsResourceTemplate (Op);
if (ACPI_SUCCESS (Status))
if (!AcpiGbl_NoResourceDisassembly)
{
Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE;
AcpiOsPrintf ("ResourceTemplate");
break;
}
else if (Status == AE_AML_NO_RESOURCE_END_TAG)
{
AcpiOsPrintf ("/**** Is ResourceTemplate, but EndTag not at buffer end ****/ ");
Status = AcpiDmIsResourceTemplate (Op);
if (ACPI_SUCCESS (Status))
{
Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE;
AcpiOsPrintf ("ResourceTemplate");
break;
}
else if (Status == AE_AML_NO_RESOURCE_END_TAG)
{
AcpiOsPrintf ("/**** Is ResourceTemplate, but EndTag not at buffer end ****/ ");
}
}
if (AcpiDmIsUnicodeBuffer (Op))

View File

@ -343,6 +343,7 @@ ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent;
ACPI_EXTERN BOOLEAN AcpiGbl_EventsInitialized;
ACPI_EXTERN UINT8 AcpiGbl_OsiData;
ACPI_EXTERN ACPI_INTERFACE_INFO *AcpiGbl_SupportedInterfaces;
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_NoResourceDisassembly, FALSE);
#ifndef DEFINE_ACPI_GLOBALS