dmopcode.c revision 26f3cdf03f1adcc98f6d3d99843ee71e9229a8c0
/*******************************************************************************
*
* Module Name: dmopcode - AML disassembler, specific AML opcodes
*
******************************************************************************/
/*
* Copyright (C) 2000 - 2011, 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.
*/
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
#include "amlcode.h"
#include "acdisasm.h"
#ifdef ACPI_DISASSEMBLER
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dmopcode")
/* Local prototypes */
static void
/*******************************************************************************
*
* FUNCTION: AcpiDmMethodFlags
*
* PARAMETERS: Op - Method Object to be examined
*
* RETURN: None
*
* DESCRIPTION: Decode control method flags
*
******************************************************************************/
void
{
/* The next Op contains the flags */
/* Mark the Op as completed */
/* 1) Method argument count */
/* 2) Serialize rule */
if (!(Flags & 0x08))
{
AcpiOsPrintf ("Not");
}
AcpiOsPrintf ("Serialized");
/* 3) SyncLevel */
if (Flags & 0xF0)
{
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmFieldFlags
*
* PARAMETERS: Op - Field Object to be examined
*
* RETURN: None
*
* DESCRIPTION: Decode Field definition flags
*
******************************************************************************/
void
{
/* Mark the Op as completed */
}
/*******************************************************************************
*
* FUNCTION: AcpiDmAddressSpace
*
* PARAMETERS: SpaceId - ID to be translated
*
* RETURN: None
*
* DESCRIPTION: Decode a SpaceId to an AddressSpaceKeyword
*
******************************************************************************/
void
{
if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS)
{
if (SpaceId == 0x7F)
{
AcpiOsPrintf ("FFixedHW, ");
}
else
{
}
}
else
{
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmRegionFlags
*
* PARAMETERS: Op - Object to be examined
*
* RETURN: None
*
* DESCRIPTION: Decode OperationRegion flags
*
******************************************************************************/
void
{
/* The next Op contains the SpaceId */
/* Mark the Op as completed */
AcpiOsPrintf (", ");
}
/*******************************************************************************
*
* FUNCTION: AcpiDmMatchOp
*
* PARAMETERS: Op - Match Object to be examined
*
* RETURN: None
*
* DESCRIPTION: Decode Match opcode operands
*
******************************************************************************/
void
{
if (!NextOp)
{
/* Handle partial tree during single-step */
return;
}
/* Mark the two nodes that contain the encoding for the match keywords */
}
/*******************************************************************************
*
* FUNCTION: AcpiDmMatchKeyword
*
* PARAMETERS: Op - Match Object to be examined
*
* RETURN: None
*
* DESCRIPTION: Decode Match opcode operands
*
******************************************************************************/
static void
{
{
AcpiOsPrintf ("/* Unknown Match Keyword encoding */");
}
else
{
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDisassembleOneOp
*
* PARAMETERS: WalkState - Current walk info
* Info - Parse tree walk info
* Op - Op that is to be printed
*
* RETURN: None
*
* DESCRIPTION: Disassemble a single AML opcode
*
******************************************************************************/
void
{
if (!Op)
{
AcpiOsPrintf ("<NULL OP PTR>");
return;
}
{
case ACPI_DASM_MATCHOP:
return;
case ACPI_DASM_LNOT_SUFFIX:
{
case AML_LEQUAL_OP:
AcpiOsPrintf ("LNotEqual");
break;
case AML_LGREATER_OP:
AcpiOsPrintf ("LLessEqual");
break;
case AML_LLESS_OP:
AcpiOsPrintf ("LGreaterEqual");
break;
default:
break;
}
return;
default:
break;
}
/* The op and arguments */
{
case AML_LNOT_OP:
{
}
else
{
}
break;
case AML_BYTE_OP:
break;
case AML_WORD_OP:
{
}
else
{
}
break;
case AML_DWORD_OP:
{
}
else
{
}
break;
case AML_QWORD_OP:
AcpiOsPrintf ("0x%8.8X%8.8X",
break;
case AML_STRING_OP:
break;
case AML_BUFFER_OP:
/*
* Determine the type of buffer. We can have one of the following:
*
* 1) ResourceTemplate containing Resource Descriptors.
* 2) Unicode String buffer
* 3) ASCII String buffer
* 4) Raw data buffer (if none of the above)
*
* Since there are no special AML opcodes to differentiate these
* types of buffers, we have to closely look at the data in the
* buffer to determine the type.
*/
if (ACPI_SUCCESS (Status))
{
AcpiOsPrintf ("ResourceTemplate");
break;
}
else if (Status == AE_AML_NO_RESOURCE_END_TAG)
{
AcpiOsPrintf ("/**** Is ResourceTemplate, but EndTag not at buffer end ****/ ");
}
if (AcpiDmIsUnicodeBuffer (Op))
{
AcpiOsPrintf ("Unicode (");
}
else if (AcpiDmIsStringBuffer (Op))
{
AcpiOsPrintf ("Buffer");
}
else
{
AcpiOsPrintf ("Buffer");
}
break;
case AML_INT_STATICSTRING_OP:
{
}
else
{
AcpiOsPrintf ("\"<NULL STATIC STRING PTR>\"");
}
break;
case AML_INT_NAMEPATH_OP:
break;
case AML_INT_NAMEDFIELD_OP:
break;
case AML_INT_RESERVEDFIELD_OP:
/* Offset() -- Must account for previous offsets */
{
}
else
{
}
break;
case AML_INT_ACCESSFIELD_OP:
AcpiOsPrintf (" AccessAs (%s, ",
AcpiOsPrintf (")");
break;
case AML_INT_BYTELIST_OP:
break;
case AML_INT_METHODCALL_OP:
break;
default:
/* Just get the opcode name and print it */
#ifdef ACPI_DEBUGGER
(WalkState) &&
(WalkState->ResultCount))
{
}
#endif
break;
}
}
#endif /* ACPI_DISASSEMBLER */