diff options
Diffstat (limited to 'source/components/disassembler')
-rw-r--r-- | source/components/disassembler/dmbuffer.c | 143 | ||||
-rw-r--r-- | source/components/disassembler/dmdeferred.c | 1 | ||||
-rw-r--r-- | source/components/disassembler/dmnames.c | 1 | ||||
-rw-r--r-- | source/components/disassembler/dmobject.c | 1 | ||||
-rw-r--r-- | source/components/disassembler/dmopcode.c | 7 | ||||
-rw-r--r-- | source/components/disassembler/dmresrc.c | 1 | ||||
-rw-r--r-- | source/components/disassembler/dmresrcl.c | 1 | ||||
-rw-r--r-- | source/components/disassembler/dmresrcl2.c | 3 | ||||
-rw-r--r-- | source/components/disassembler/dmresrcs.c | 1 | ||||
-rw-r--r-- | source/components/disassembler/dmutils.c | 1 | ||||
-rw-r--r-- | source/components/disassembler/dmwalk.c | 4 |
11 files changed, 151 insertions, 13 deletions
diff --git a/source/components/disassembler/dmbuffer.c b/source/components/disassembler/dmbuffer.c index 739fb44a18906..2231ce1efdd17 100644 --- a/source/components/disassembler/dmbuffer.c +++ b/source/components/disassembler/dmbuffer.c @@ -41,9 +41,9 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include "acpi.h" #include "accommon.h" +#include "acutils.h" #include "acdisasm.h" #include "acparser.h" #include "amlcode.h" @@ -58,6 +58,10 @@ /* Local prototypes */ static void +AcpiDmUuid ( + ACPI_PARSE_OBJECT *Op); + +static void AcpiDmUnicode ( ACPI_PARSE_OBJECT *Op); @@ -71,6 +75,7 @@ AcpiDmPldBuffer ( UINT8 *ByteData, UINT32 ByteCount); + #define ACPI_BUFFER_BYTES_PER_LINE 8 @@ -216,6 +221,11 @@ AcpiDmByteList ( AcpiOsPrintf ("\n"); break; + case ACPI_DASM_UUID: + + AcpiDmUuid (Op); + break; + case ACPI_DASM_UNICODE: AcpiDmUnicode (Op); @@ -241,6 +251,137 @@ AcpiDmByteList ( /******************************************************************************* * + * FUNCTION: AcpiDmIsUuidBuffer + * + * PARAMETERS: Op - Buffer Object to be examined + * + * RETURN: TRUE if buffer contains a UUID + * + * DESCRIPTION: Determine if a buffer Op contains a UUID + * + * To help determine whether the buffer is a UUID versus a raw data buffer, + * there a are a couple bytes we can look at: + * + * xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx + * + * The variant covered by the UUID specification is indicated by the two most + * significant bits of N being 1 0 (i.e., the hexadecimal N will always be + * 8, 9, A, or B). + * + * The variant covered by the UUID specification has five versions. For this + * variant, the four bits of M indicates the UUID version (i.e., the + * hexadecimal M will be either 1, 2, 3, 4, or 5). + * + ******************************************************************************/ + +BOOLEAN +AcpiDmIsUuidBuffer ( + ACPI_PARSE_OBJECT *Op) +{ + UINT8 *ByteData; + UINT32 ByteCount; + ACPI_PARSE_OBJECT *SizeOp; + ACPI_PARSE_OBJECT *NextOp; + + + /* Buffer size is the buffer argument */ + + SizeOp = Op->Common.Value.Arg; + + /* Next, the initializer byte list to examine */ + + NextOp = SizeOp->Common.Next; + if (!NextOp) + { + return (FALSE); + } + + /* Extract the byte list info */ + + ByteData = NextOp->Named.Data; + ByteCount = (UINT32) NextOp->Common.Value.Integer; + + /* Byte count must be exactly 16 */ + + if (ByteCount != UUID_BUFFER_LENGTH) + { + return (FALSE); + } + + /* Check for valid "M" and "N" values (see function header above) */ + + if (((ByteData[7] & 0xF0) == 0x00) || /* M={1,2,3,4,5} */ + ((ByteData[7] & 0xF0) > 0x50) || + ((ByteData[8] & 0xF0) < 0x80) || /* N={8,9,A,B} */ + ((ByteData[8] & 0xF0) > 0xB0)) + { + return (FALSE); + } + + /* Ignore the Size argument in the disassembly of this buffer op */ + + SizeOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; + return (TRUE); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmUuid + * + * PARAMETERS: Op - Byte List op containing a UUID + * + * RETURN: None + * + * DESCRIPTION: Dump a buffer containing a UUID as a standard ASCII string. + * + * Output Format: + * In its canonical form, the UUID is represented by a string containing 32 + * lowercase hexadecimal digits, displayed in 5 groups separated by hyphens. + * The complete form is 8-4-4-4-12 for a total of 36 characters (32 + * alphanumeric characters representing hex digits and 4 hyphens). In bytes, + * 4-2-2-2-6. Example: + * + * ToUUID ("107ededd-d381-4fd7-8da9-08e9a6c79644") + * + ******************************************************************************/ + +static void +AcpiDmUuid ( + ACPI_PARSE_OBJECT *Op) +{ + UINT8 *Data; + const char *Description; + + + Data = ACPI_CAST_PTR (UINT8, Op->Named.Data); + + /* Emit the 36-byte UUID string in the proper format/order */ + + AcpiOsPrintf ( + "\"%2.2x%2.2x%2.2x%2.2x-" + "%2.2x%2.2x-" + "%2.2x%2.2x-" + "%2.2x%2.2x-" + "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\")", + Data[3], Data[2], Data[1], Data[0], + Data[5], Data[4], + Data[7], Data[6], + Data[8], Data[9], + Data[10], Data[11], Data[12], Data[13], Data[14], Data[15]); + + /* Dump the UUID description string if available */ + + Description = AcpiAhMatchUuid (Data); + if (Description) + { + AcpiOsPrintf (" /* %s */", Description); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmIsUnicodeBuffer * * PARAMETERS: Op - Buffer Object to be examined diff --git a/source/components/disassembler/dmdeferred.c b/source/components/disassembler/dmdeferred.c index dd0be81a4e867..56c6b3899ebbf 100644 --- a/source/components/disassembler/dmdeferred.c +++ b/source/components/disassembler/dmdeferred.c @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include "acpi.h" #include "accommon.h" #include "acdispat.h" diff --git a/source/components/disassembler/dmnames.c b/source/components/disassembler/dmnames.c index 66d50a44335b8..4b48a348fe7ee 100644 --- a/source/components/disassembler/dmnames.c +++ b/source/components/disassembler/dmnames.c @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include "acpi.h" #include "accommon.h" #include "amlcode.h" diff --git a/source/components/disassembler/dmobject.c b/source/components/disassembler/dmobject.c index c938bdefd0676..00fc680d7b985 100644 --- a/source/components/disassembler/dmobject.c +++ b/source/components/disassembler/dmobject.c @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include "acpi.h" #include "accommon.h" #include "acnamesp.h" diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c index 30f985c524c18..52e01a9cb074d 100644 --- a/source/components/disassembler/dmopcode.c +++ b/source/components/disassembler/dmopcode.c @@ -827,7 +827,12 @@ AcpiDmDisassembleOneOp ( } } - if (AcpiDmIsUnicodeBuffer (Op)) + if (AcpiDmIsUuidBuffer (Op)) + { + Op->Common.DisasmOpcode = ACPI_DASM_UUID; + AcpiOsPrintf ("ToUUID ("); + } + else if (AcpiDmIsUnicodeBuffer (Op)) { Op->Common.DisasmOpcode = ACPI_DASM_UNICODE; AcpiOsPrintf ("Unicode ("); diff --git a/source/components/disassembler/dmresrc.c b/source/components/disassembler/dmresrc.c index 9bd47db6ffd20..ff6278b2e77e7 100644 --- a/source/components/disassembler/dmresrc.c +++ b/source/components/disassembler/dmresrc.c @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include "acpi.h" #include "accommon.h" #include "amlcode.h" diff --git a/source/components/disassembler/dmresrcl.c b/source/components/disassembler/dmresrcl.c index 41cbc01817fcc..d6707d39b8137 100644 --- a/source/components/disassembler/dmresrcl.c +++ b/source/components/disassembler/dmresrcl.c @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include "acpi.h" #include "accommon.h" #include "acdisasm.h" diff --git a/source/components/disassembler/dmresrcl2.c b/source/components/disassembler/dmresrcl2.c index 3e48afca745a1..dd9039ea095f7 100644 --- a/source/components/disassembler/dmresrcl2.c +++ b/source/components/disassembler/dmresrcl2.c @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include "acpi.h" #include "accommon.h" #include "acdisasm.h" @@ -274,7 +273,7 @@ AcpiDmGpioIntDescriptor ( AcpiDmIndent (Level); AcpiOsPrintf ("GpioInt (%s, %s, %s, ", AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)], - AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->Gpio.IntFlags, 1)], + AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 1)], AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]); /* PinConfig, DebounceTimeout */ diff --git a/source/components/disassembler/dmresrcs.c b/source/components/disassembler/dmresrcs.c index 1041890982583..cbbdc7114d729 100644 --- a/source/components/disassembler/dmresrcs.c +++ b/source/components/disassembler/dmresrcs.c @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include "acpi.h" #include "accommon.h" #include "acdisasm.h" diff --git a/source/components/disassembler/dmutils.c b/source/components/disassembler/dmutils.c index 2771d44abdd34..700cfecc3092b 100644 --- a/source/components/disassembler/dmutils.c +++ b/source/components/disassembler/dmutils.c @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include "acpi.h" #include "accommon.h" #include "amlcode.h" diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c index 0aa305282a04a..92f27e5062245 100644 --- a/source/components/disassembler/dmwalk.c +++ b/source/components/disassembler/dmwalk.c @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include "acpi.h" #include "accommon.h" #include "acparser.h" @@ -285,7 +284,8 @@ AcpiDmBlockType ( case AML_BUFFER_OP: - if (Op->Common.DisasmOpcode == ACPI_DASM_UNICODE) + if ((Op->Common.DisasmOpcode == ACPI_DASM_UNICODE) || + (Op->Common.DisasmOpcode == ACPI_DASM_UUID)) { return (BLOCK_NONE); } |