2020-10-24 00:40:24 +00:00
|
|
|
From a11c0a997dca2b40d1bcff68368d9d5d5297b781 Mon Sep 17 00:00:00 2001
|
2020-10-19 18:24:09 +00:00
|
|
|
From: Al Stone <ahs3@redhat.com>
|
|
|
|
Date: Thu, 15 Oct 2020 11:35:23 -0600
|
2020-10-24 00:40:24 +00:00
|
|
|
Subject: [PATCH 2/5] Support DSDT/SSDT in a big-endian world
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
NB: this is a very large diff. The problem is that ResourceTemplates
|
|
|
|
are treated differently during compilation and disassembly so each of
|
|
|
|
the resource types had code that needed to be touched directly.
|
|
|
|
|
|
|
|
In general, however, just reading or writing individual AML opcodes
|
|
|
|
wasn't that much of a change, and most of it was on the codegen side.
|
|
|
|
|
|
|
|
Signed-off-by: Al Stone <ahs3@redhat.com>
|
|
|
|
---
|
|
|
|
source/common/dmrestag.c | 2 +-
|
|
|
|
source/common/dmtables.c | 17 +-
|
|
|
|
source/common/dmtbdump.c | 3 +-
|
2020-10-24 00:40:24 +00:00
|
|
|
source/compiler/aslcodegen.c | 61 ++++--
|
|
|
|
source/compiler/aslopcodes.c | 3 +-
|
2020-10-19 18:24:09 +00:00
|
|
|
source/compiler/aslrestype1.c | 44 +++--
|
|
|
|
source/compiler/aslrestype1i.c | 33 ++--
|
2020-10-24 00:40:24 +00:00
|
|
|
source/compiler/aslrestype2.c | 20 +-
|
|
|
|
source/compiler/aslrestype2d.c | 99 ++++++----
|
|
|
|
source/compiler/aslrestype2e.c | 90 ++++++---
|
|
|
|
source/compiler/aslrestype2q.c | 81 +++++---
|
|
|
|
source/compiler/aslrestype2s.c | 214 +++++++++++++++++----
|
|
|
|
source/compiler/aslrestype2w.c | 94 +++++----
|
|
|
|
source/components/disassembler/dmbuffer.c | 10 +-
|
2020-10-19 18:24:09 +00:00
|
|
|
source/components/disassembler/dmopcode.c | 8 +-
|
|
|
|
source/components/disassembler/dmresrc.c | 2 +-
|
|
|
|
source/components/disassembler/dmresrcl.c | 43 +++--
|
2020-10-24 00:40:24 +00:00
|
|
|
source/components/disassembler/dmresrcl2.c | 128 +++++++-----
|
2020-10-19 18:24:09 +00:00
|
|
|
source/components/disassembler/dmresrcs.c | 18 +-
|
2020-10-24 00:40:24 +00:00
|
|
|
source/components/disassembler/dmwalk.c | 2 +-
|
2020-10-19 18:24:09 +00:00
|
|
|
source/components/dispatcher/dsfield.c | 16 +-
|
|
|
|
source/components/namespace/nsaccess.c | 2 +-
|
|
|
|
source/components/namespace/nsnames.c | 2 +-
|
|
|
|
source/components/namespace/nsparse.c | 6 +-
|
|
|
|
source/components/namespace/nsutils.c | 7 +-
|
2020-10-24 00:40:24 +00:00
|
|
|
25 files changed, 682 insertions(+), 323 deletions(-)
|
2020-10-19 18:24:09 +00:00
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/common/dmrestag.c b/source/common/dmrestag.c
|
|
|
|
index fe6e74146..eed863037 100644
|
|
|
|
--- a/source/common/dmrestag.c
|
|
|
|
+++ b/source/common/dmrestag.c
|
|
|
|
@@ -1146,7 +1146,7 @@ AcpiDmAddResourcesToNamespace (
|
2020-10-19 18:24:09 +00:00
|
|
|
* NextOp contains the Aml pointer and the Aml length
|
|
|
|
*/
|
|
|
|
AcpiUtWalkAmlResources (NULL, (UINT8 *) NextOp->Named.Data,
|
|
|
|
- (ACPI_SIZE) NextOp->Common.Value.Integer,
|
|
|
|
+ (ACPI_SIZE) NextOp->Common.Value.Size,
|
|
|
|
AcpiDmAddResourceToNamespace, (void **) BufferNode);
|
|
|
|
}
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/common/dmtables.c b/source/common/dmtables.c
|
|
|
|
index ee18d26c9..2a5551ece 100644
|
|
|
|
--- a/source/common/dmtables.c
|
|
|
|
+++ b/source/common/dmtables.c
|
|
|
|
@@ -250,6 +250,10 @@ AdCreateTableHeader (
|
2020-10-19 18:24:09 +00:00
|
|
|
ACPI_TABLE_HEADER *Table)
|
|
|
|
{
|
|
|
|
UINT8 Checksum;
|
|
|
|
+ UINT32 TableLength = AcpiUtReadUint32(&Table->Length);
|
|
|
|
+ UINT32 OemRevision = AcpiUtReadUint32(&Table->OemRevision);
|
|
|
|
+ UINT32 CompilerRevision =
|
|
|
|
+ AcpiUtReadUint32(&Table->AslCompilerRevision);
|
|
|
|
|
|
|
|
|
|
|
|
/* Reset globals for External statements */
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -264,7 +268,7 @@ AdCreateTableHeader (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
AcpiOsPrintf (" * Original Table Header:\n");
|
|
|
|
AcpiOsPrintf (" * Signature \"%4.4s\"\n", Table->Signature);
|
|
|
|
- AcpiOsPrintf (" * Length 0x%8.8X (%u)\n", Table->Length, Table->Length);
|
|
|
|
+ AcpiOsPrintf (" * Length 0x%8.8X (%u)\n", TableLength, TableLength);
|
|
|
|
|
|
|
|
/* Print and validate the revision */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -296,7 +300,7 @@ AdCreateTableHeader (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
AcpiOsPrintf ("\n * Checksum 0x%2.2X", Table->Checksum);
|
|
|
|
|
|
|
|
- Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Table->Length);
|
|
|
|
+ Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), TableLength);
|
|
|
|
if (Checksum)
|
|
|
|
{
|
|
|
|
AcpiOsPrintf (" **** Incorrect checksum, should be 0x%2.2X",
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -306,9 +310,9 @@ AdCreateTableHeader (
|
2020-10-19 18:24:09 +00:00
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
AcpiOsPrintf (" * OEM ID \"%.6s\"\n", Table->OemId);
|
|
|
|
AcpiOsPrintf (" * OEM Table ID \"%.8s\"\n", Table->OemTableId);
|
|
|
|
- AcpiOsPrintf (" * OEM Revision 0x%8.8X (%u)\n", Table->OemRevision, Table->OemRevision);
|
|
|
|
+ AcpiOsPrintf (" * OEM Revision 0x%8.8X (%u)\n", OemRevision, OemRevision);
|
|
|
|
AcpiOsPrintf (" * Compiler ID \"%.4s\"\n", Table->AslCompilerId);
|
|
|
|
- AcpiOsPrintf (" * Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision);
|
|
|
|
+ AcpiOsPrintf (" * Compiler Version 0x%8.8X (%u)\n", CompilerRevision, CompilerRevision);
|
|
|
|
AcpiOsPrintf (" */\n");
|
|
|
|
|
|
|
|
/*
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -329,7 +333,7 @@ AdCreateTableHeader (
|
2020-10-19 18:24:09 +00:00
|
|
|
AcpiOsPrintf (
|
|
|
|
"DefinitionBlock (\"\", \"%4.4s\", %u, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
|
|
|
|
Table->Signature, Table->Revision,
|
|
|
|
- Table->OemId, Table->OemTableId, Table->OemRevision);
|
|
|
|
+ Table->OemId, Table->OemTableId, OemRevision);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -504,7 +508,8 @@ AdParseTable (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
fprintf (stderr, "Pass 1 parse of [%4.4s]\n", (char *) Table->Signature);
|
|
|
|
|
|
|
|
- AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
|
|
|
|
+ AmlLength = AcpiUtReadUint32(&Table->Length);
|
|
|
|
+ AmlLength -= sizeof (ACPI_TABLE_HEADER);
|
|
|
|
AmlStart = ((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER));
|
|
|
|
|
|
|
|
AcpiUtSetIntegerWidth (Table->Revision);
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/common/dmtbdump.c b/source/common/dmtbdump.c
|
|
|
|
index 92d86930b..5ad20ff62 100644
|
|
|
|
--- a/source/common/dmtbdump.c
|
|
|
|
+++ b/source/common/dmtbdump.c
|
|
|
|
@@ -441,8 +441,7 @@ AcpiDmDumpXsdt (
|
2020-10-19 18:24:09 +00:00
|
|
|
for (i = 0; i < Entries; i++)
|
|
|
|
{
|
|
|
|
AcpiDmLineHeader2 (Offset, sizeof (UINT64), "ACPI Table Address", i);
|
|
|
|
- AcpiOsPrintf ("%8.8X%8.8X\n",
|
|
|
|
- ACPI_FORMAT_UINT64 (AcpiUtReadUint64(&Array[i])));
|
|
|
|
+ AcpiOsPrintf ("%16.16lX\n", AcpiUtReadUint64(&Array[i]));
|
|
|
|
Offset += sizeof (UINT64);
|
|
|
|
}
|
|
|
|
}
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/compiler/aslcodegen.c b/source/compiler/aslcodegen.c
|
|
|
|
index ba0384e84..14be9dcc2 100644
|
|
|
|
--- a/source/compiler/aslcodegen.c
|
|
|
|
+++ b/source/compiler/aslcodegen.c
|
|
|
|
@@ -346,6 +346,10 @@ CgWriteAmlOpcode (
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
UINT8 PkgLenFirstByte;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT8 Tmp8;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
+ UINT64 Tmp64;
|
|
|
|
union {
|
|
|
|
UINT16 Opcode;
|
|
|
|
UINT8 OpcodeBytes[2];
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -413,25 +417,26 @@ CgWriteAmlOpcode (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Value is the length to be encoded (Used in field definitions) */
|
|
|
|
|
|
|
|
- PkgLen.Len = (UINT32) Op->Asl.Value.Integer;
|
|
|
|
+ PkgLen.Len = (UINT32) Op->Asl.Value.Integer;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
/* Check for two-byte opcode */
|
|
|
|
|
|
|
|
+ Tmp16 = AcpiUtReadUint16(&Aml.Opcode);
|
|
|
|
if (Aml.Opcode > 0x00FF)
|
|
|
|
{
|
|
|
|
/* Write the high byte first */
|
|
|
|
|
|
|
|
- CgLocalWriteAmlData (Op, &Aml.OpcodeBytes[1], 1);
|
|
|
|
+ CgLocalWriteAmlData (Op, ((UINT8 *)&Tmp16)+1, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
- CgLocalWriteAmlData (Op, &Aml.OpcodeBytes[0], 1);
|
|
|
|
+ CgLocalWriteAmlData (Op, (UINT8 *)&Tmp16, 1);
|
|
|
|
|
|
|
|
/* Subtreelength doesn't include length of package length bytes */
|
|
|
|
|
|
|
|
- PkgLen.Len = Op->Asl.AmlSubtreeLength + Op->Asl.AmlPkgLenBytes;
|
|
|
|
+ PkgLen.Len = Op->Asl.AmlSubtreeLength + Op->Asl.AmlPkgLenBytes;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -443,7 +448,8 @@ CgWriteAmlOpcode (
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
/* Simplest case -- no bytes to follow, just write the count */
|
|
|
|
|
|
|
|
- CgLocalWriteAmlData (Op, &PkgLen.LenBytes[0], 1);
|
|
|
|
+ Tmp8 = (UINT8) PkgLen.Len;
|
|
|
|
+ CgLocalWriteAmlData (Op, &Tmp8, 1);
|
|
|
|
}
|
|
|
|
else if (Op->Asl.AmlPkgLenBytes != 0)
|
|
|
|
{
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -451,9 +457,10 @@ CgWriteAmlOpcode (
|
2020-10-19 18:24:09 +00:00
|
|
|
* Encode the "bytes to follow" in the first byte, top two bits.
|
|
|
|
* The low-order nybble of the length is in the bottom 4 bits
|
|
|
|
*/
|
|
|
|
+ Tmp8 = (UINT8) PkgLen.Len;
|
|
|
|
PkgLenFirstByte = (UINT8)
|
|
|
|
(((UINT32) (Op->Asl.AmlPkgLenBytes - 1) << 6) |
|
|
|
|
- (PkgLen.LenBytes[0] & 0x0F));
|
|
|
|
+ (Tmp8 & 0x0F));
|
|
|
|
|
|
|
|
CgLocalWriteAmlData (Op, &PkgLenFirstByte, 1);
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -467,6 +474,9 @@ CgWriteAmlOpcode (
|
2020-10-19 18:24:09 +00:00
|
|
|
* Now we can write the remaining bytes -
|
|
|
|
* either 1, 2, or 3 bytes
|
|
|
|
*/
|
|
|
|
+ Tmp32 = PkgLen.Len;
|
|
|
|
+ AcpiUtWriteUint(&PkgLen.Len, Op->Asl.AmlPkgLenBytes,
|
|
|
|
+ &Tmp32, sizeof(UINT32));
|
|
|
|
for (i = 0; i < (UINT32) (Op->Asl.AmlPkgLenBytes - 1); i++)
|
|
|
|
{
|
|
|
|
CgLocalWriteAmlData (Op, &PkgLen.LenBytes[i], 1);
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -478,22 +488,30 @@ CgWriteAmlOpcode (
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
case AML_BYTE_OP:
|
|
|
|
|
|
|
|
- CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 1);
|
|
|
|
+ Tmp64 = 0;
|
|
|
|
+ AcpiUtWriteUint(&Tmp64, 1, &Op->Asl.Value.Integer, 8);
|
|
|
|
+ CgLocalWriteAmlData (Op, &Tmp64, 1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_WORD_OP:
|
|
|
|
|
|
|
|
- CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 2);
|
|
|
|
+ Tmp64 = 0;
|
|
|
|
+ AcpiUtWriteUint(&Tmp64, 2, &Op->Asl.Value.Integer, 8);
|
|
|
|
+ CgLocalWriteAmlData (Op, &Tmp64, 2);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_DWORD_OP:
|
|
|
|
|
|
|
|
- CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 4);
|
|
|
|
+ Tmp64 = 0;
|
|
|
|
+ AcpiUtWriteUint(&Tmp64, 4, &Op->Asl.Value.Integer, 8);
|
|
|
|
+ CgLocalWriteAmlData (Op, &Tmp64, 4);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_QWORD_OP:
|
|
|
|
|
|
|
|
- CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, 8);
|
|
|
|
+ Tmp64 = 0;
|
|
|
|
+ AcpiUtWriteUint(&Tmp64, 8, &Op->Asl.Value.Integer, 8);
|
|
|
|
+ CgLocalWriteAmlData (Op, &Tmp64, 8);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_STRING_OP:
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -531,6 +549,7 @@ CgWriteTableHeader (
|
2020-10-19 18:24:09 +00:00
|
|
|
ACPI_PARSE_OBJECT *Child;
|
|
|
|
UINT32 CommentLength;
|
|
|
|
ACPI_COMMENT_NODE *Current;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
|
|
|
|
|
|
|
|
memset (&AslGbl_TableHeader, 0, sizeof (ACPI_TABLE_HEADER));
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -586,7 +605,9 @@ CgWriteTableHeader (
|
2020-10-19 18:24:09 +00:00
|
|
|
/* OEM Revision */
|
|
|
|
|
|
|
|
Child = Child->Asl.Next;
|
|
|
|
- AslGbl_TableHeader.OemRevision = (UINT32) Child->Asl.Value.Integer;
|
|
|
|
+ AcpiUtWriteUint(&Tmp32, sizeof(UINT32),
|
|
|
|
+ &Child->Asl.Value.Integer, sizeof(Child->Asl.Value.Integer));
|
|
|
|
+ AslGbl_TableHeader.OemRevision = Tmp32;
|
|
|
|
|
|
|
|
/* Compiler ID */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -594,7 +615,8 @@ CgWriteTableHeader (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Compiler version */
|
|
|
|
|
|
|
|
- AslGbl_TableHeader.AslCompilerRevision = ACPI_CA_VERSION;
|
|
|
|
+ Tmp32 = ACPI_CA_VERSION;
|
|
|
|
+ AslGbl_TableHeader.AslCompilerRevision = AcpiUtReadUint32(&Tmp32);
|
|
|
|
|
|
|
|
/* Table length. Checksum zero for now, will rewrite later */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -649,6 +671,15 @@ CgWriteTableHeader (
|
2020-10-19 18:24:09 +00:00
|
|
|
AslGbl_TableHeader.Checksum = 0;
|
|
|
|
Op->Asl.FinalAmlOffset = ftell (AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle);
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Adjust the Table length; it will only change when big-endian
|
|
|
|
+ * but we have to wait until here in case there is arithmetic to
|
|
|
|
+ * be done on the length before this step in the function
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+ Tmp32 = AslGbl_TableHeader.Length;
|
|
|
|
+ AslGbl_TableHeader.Length = AcpiUtReadUint32(&Tmp32);
|
|
|
|
+
|
|
|
|
/* Write entire header and clear the table header global */
|
|
|
|
|
|
|
|
CgLocalWriteAmlData (Op, &AslGbl_TableHeader, sizeof (ACPI_TABLE_HEADER));
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -733,6 +764,7 @@ CgWriteNode (
|
2020-10-19 18:24:09 +00:00
|
|
|
ACPI_PARSE_OBJECT *Op)
|
|
|
|
{
|
|
|
|
ASL_RESOURCE_NODE *Rnode;
|
|
|
|
+ UINT64 Tmp64;
|
|
|
|
|
|
|
|
|
|
|
|
/* Write all comments here. */
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -761,7 +793,10 @@ CgWriteNode (
|
2020-10-19 18:24:09 +00:00
|
|
|
case AML_RAW_DATA_DWORD:
|
|
|
|
case AML_RAW_DATA_QWORD:
|
|
|
|
|
|
|
|
- CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, Op->Asl.AmlLength);
|
|
|
|
+ Tmp64 = 0;
|
|
|
|
+ AcpiUtWriteUint(&Tmp64, Op->Asl.AmlLength,
|
|
|
|
+ &Op->Asl.Value.Integer, sizeof(UINT64));
|
|
|
|
+ CgLocalWriteAmlData (Op, &Tmp64, Op->Asl.AmlLength);
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/compiler/aslopcodes.c b/source/compiler/aslopcodes.c
|
|
|
|
index b2a023650..afc9004af 100644
|
|
|
|
--- a/source/compiler/aslopcodes.c
|
|
|
|
+++ b/source/compiler/aslopcodes.c
|
|
|
|
@@ -619,7 +619,8 @@ OpcDoUnicode (
|
|
|
|
|
|
|
|
for (i = 0; i < Count; i++)
|
|
|
|
{
|
|
|
|
- UnicodeString[i] = (UINT16) AsciiString[i];
|
|
|
|
+ AcpiUtWriteUint(&UnicodeString[i], sizeof(UINT16),
|
|
|
|
+ &AsciiString[i], sizeof(UINT8));
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
diff --git a/source/compiler/aslrestype1.c b/source/compiler/aslrestype1.c
|
|
|
|
index 4dff4607d..e7639c0bb 100644
|
|
|
|
--- a/source/compiler/aslrestype1.c
|
|
|
|
+++ b/source/compiler/aslrestype1.c
|
|
|
|
@@ -251,6 +251,7 @@ RsDoMemory24Descriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
ASL_RESOURCE_NODE *Rnode;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -259,7 +260,8 @@ RsDoMemory24Descriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
Descriptor = Rnode->Buffer;
|
|
|
|
Descriptor->Memory24.DescriptorType = ACPI_RESOURCE_NAME_MEMORY24;
|
|
|
|
- Descriptor->Memory24.ResourceLength = 9;
|
|
|
|
+ Tmp16 = 9;
|
|
|
|
+ Descriptor->Memory24.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
|
|
|
|
/* Process all child initialization nodes */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -276,7 +278,8 @@ RsDoMemory24Descriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 1: /* Min Address */
|
|
|
|
|
|
|
|
- Descriptor->Memory24.Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Memory24.Minimum = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -284,7 +287,8 @@ RsDoMemory24Descriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 2: /* Max Address */
|
|
|
|
|
|
|
|
- Descriptor->Memory24.Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Memory24.Maximum = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -292,14 +296,16 @@ RsDoMemory24Descriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 3: /* Alignment */
|
|
|
|
|
|
|
|
- Descriptor->Memory24.Alignment = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Memory24.Alignment = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_ALIGNMENT,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.Alignment));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4: /* Length */
|
|
|
|
|
|
|
|
- Descriptor->Memory24.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Memory24.AddressLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Memory24.AddressLength));
|
|
|
|
LengthOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -357,6 +363,8 @@ RsDoMemory32Descriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
ASL_RESOURCE_NODE *Rnode;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -365,7 +373,8 @@ RsDoMemory32Descriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
Descriptor = Rnode->Buffer;
|
|
|
|
Descriptor->Memory32.DescriptorType = ACPI_RESOURCE_NAME_MEMORY32;
|
|
|
|
- Descriptor->Memory32.ResourceLength = 17;
|
|
|
|
+ Tmp16 = 17;
|
|
|
|
+ Descriptor->Memory32.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
|
|
|
|
/* Process all child initialization nodes */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -382,7 +391,8 @@ RsDoMemory32Descriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 1: /* Min Address */
|
|
|
|
|
|
|
|
- Descriptor->Memory32.Minimum = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Memory32.Minimum = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -390,7 +400,8 @@ RsDoMemory32Descriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 2: /* Max Address */
|
|
|
|
|
|
|
|
- Descriptor->Memory32.Maximum = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Memory32.Maximum = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -398,7 +409,8 @@ RsDoMemory32Descriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 3: /* Alignment */
|
|
|
|
|
|
|
|
- Descriptor->Memory32.Alignment = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Memory32.Alignment = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_ALIGNMENT,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.Alignment));
|
|
|
|
AlignOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -406,7 +418,8 @@ RsDoMemory32Descriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 4: /* Length */
|
|
|
|
|
|
|
|
- Descriptor->Memory32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Memory32.AddressLength = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Memory32.AddressLength));
|
|
|
|
LengthOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -460,6 +473,8 @@ RsDoMemory32FixedDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
ASL_RESOURCE_NODE *Rnode;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -468,7 +483,8 @@ RsDoMemory32FixedDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
Descriptor = Rnode->Buffer;
|
|
|
|
Descriptor->FixedMemory32.DescriptorType = ACPI_RESOURCE_NAME_FIXED_MEMORY32;
|
|
|
|
- Descriptor->FixedMemory32.ResourceLength = 9;
|
|
|
|
+ Tmp16 = 9;
|
|
|
|
+ Descriptor->FixedMemory32.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
|
|
|
|
/* Process all child initialization nodes */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -485,14 +501,16 @@ RsDoMemory32FixedDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 1: /* Address */
|
|
|
|
|
|
|
|
- Descriptor->FixedMemory32.Address = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->FixedMemory32.Address = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_BASEADDRESS,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.Address));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2: /* Length */
|
|
|
|
|
|
|
|
- Descriptor->FixedMemory32.AddressLength = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->FixedMemory32.AddressLength = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (FixedMemory32.AddressLength));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/compiler/aslrestype1i.c b/source/compiler/aslrestype1i.c
|
|
|
|
index 9e9bc2096..532553c4b 100644
|
|
|
|
--- a/source/compiler/aslrestype1i.c
|
|
|
|
+++ b/source/compiler/aslrestype1i.c
|
|
|
|
@@ -307,6 +307,7 @@ RsDoFixedDmaDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
ASL_RESOURCE_NODE *Rnode;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -325,14 +326,16 @@ RsDoFixedDmaDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
case 0: /* DMA Request Lines [WORD] (_DMA) */
|
|
|
|
|
|
|
|
- Descriptor->FixedDma.RequestLines = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->FixedDma.RequestLines = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_DMA,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (FixedDma.RequestLines));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1: /* DMA Channel [WORD] (_TYP) */
|
|
|
|
|
|
|
|
- Descriptor->FixedDma.Channels = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->FixedDma.Channels = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_DMATYPE,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (FixedDma.Channels));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -383,6 +386,7 @@ RsDoFixedIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
ASL_RESOURCE_NODE *Rnode;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -401,8 +405,8 @@ RsDoFixedIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
case 0: /* Base Address */
|
|
|
|
|
|
|
|
- Descriptor->FixedIo.Address =
|
|
|
|
- (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->FixedIo.Address = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_BASEADDRESS,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (FixedIo.Address));
|
|
|
|
AddressOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -466,6 +470,7 @@ RsDoIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
ASL_RESOURCE_NODE *Rnode;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -491,8 +496,8 @@ RsDoIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 1: /* Min Address */
|
|
|
|
|
|
|
|
- Descriptor->Io.Minimum =
|
|
|
|
- (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Io.Minimum = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Io.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -500,8 +505,8 @@ RsDoIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 2: /* Max Address */
|
|
|
|
|
|
|
|
- Descriptor->Io.Maximum =
|
|
|
|
- (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Io.Maximum = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Io.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -542,10 +547,10 @@ RsDoIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
/* Validate the Min/Max/Len/Align values */
|
|
|
|
|
|
|
|
RsSmallAddressCheck (ACPI_RESOURCE_NAME_IO,
|
|
|
|
- Descriptor->Io.Minimum,
|
|
|
|
- Descriptor->Io.Maximum,
|
|
|
|
- Descriptor->Io.AddressLength,
|
|
|
|
- Descriptor->Io.Alignment,
|
|
|
|
+ (UINT32)(AcpiUtReadUint16(&Descriptor->Io.Minimum)),
|
|
|
|
+ (UINT32)(AcpiUtReadUint16(&Descriptor->Io.Maximum)),
|
|
|
|
+ (UINT32)Descriptor->Io.AddressLength,
|
|
|
|
+ (UINT32)Descriptor->Io.Alignment,
|
|
|
|
MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
|
|
|
|
|
|
|
|
return (Rnode);
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -669,7 +674,7 @@ RsDoIrqDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Now we can set the channel mask */
|
|
|
|
|
|
|
|
- Descriptor->Irq.IrqMask = IrqMask;
|
|
|
|
+ Descriptor->Irq.IrqMask = AcpiUtReadUint16(&IrqMask);
|
|
|
|
return (Rnode);
|
|
|
|
}
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -768,6 +773,6 @@ RsDoIrqNoFlagsDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Now we can set the interrupt mask */
|
|
|
|
|
|
|
|
- Descriptor->Irq.IrqMask = IrqMask;
|
|
|
|
+ Descriptor->Irq.IrqMask = AcpiUtReadUint16(&IrqMask);
|
|
|
|
return (Rnode);
|
|
|
|
}
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/compiler/aslrestype2.c b/source/compiler/aslrestype2.c
|
|
|
|
index 93236853a..13d0476e7 100644
|
|
|
|
--- a/source/compiler/aslrestype2.c
|
|
|
|
+++ b/source/compiler/aslrestype2.c
|
|
|
|
@@ -185,6 +185,8 @@ RsDoGeneralRegisterDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
ASL_RESOURCE_NODE *Rnode;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT64 Tmp64;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -193,7 +195,8 @@ RsDoGeneralRegisterDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
Descriptor = Rnode->Buffer;
|
|
|
|
Descriptor->GenericReg.DescriptorType = ACPI_RESOURCE_NAME_GENERIC_REGISTER;
|
|
|
|
- Descriptor->GenericReg.ResourceLength = 12;
|
|
|
|
+ Tmp16 = 12;
|
|
|
|
+ Descriptor->GenericReg.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
|
|
|
|
/* Process all child initialization nodes */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -224,7 +227,8 @@ RsDoGeneralRegisterDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 3: /* Register Address */
|
|
|
|
|
|
|
|
- Descriptor->GenericReg.Address = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp64 = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->GenericReg.Address = AcpiUtReadUint64(&Tmp64);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_ADDRESS,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (GenericReg.Address));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -292,6 +296,8 @@ RsDoInterruptDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
BOOLEAN HasResSourceIndex = FALSE;
|
|
|
|
UINT8 ResSourceIndex = 0;
|
|
|
|
UINT8 *ResSourceString = NULL;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -333,7 +339,7 @@ RsDoInterruptDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
* Initial descriptor length -- may be enlarged if there are
|
|
|
|
* optional fields present
|
|
|
|
*/
|
|
|
|
- Descriptor->ExtendedIrq.ResourceLength = 2; /* Flags and table length byte */
|
|
|
|
+ Descriptor->ExtendedIrq.ResourceLength = 2; /* Flags and table length byte */
|
|
|
|
Descriptor->ExtendedIrq.InterruptCount = 0;
|
|
|
|
|
|
|
|
Rover = ACPI_CAST_PTR (AML_RESOURCE,
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -441,7 +447,8 @@ RsDoInterruptDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Save the integer and move pointer to the next one */
|
|
|
|
|
|
|
|
- Rover->DwordItem = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Rover->DwordItem = AcpiUtReadUint32(&Tmp32);
|
|
|
|
Rover = ACPI_ADD_PTR (AML_RESOURCE, &(Rover->DwordItem), 4);
|
|
|
|
Descriptor->ExtendedIrq.InterruptCount++;
|
|
|
|
Descriptor->ExtendedIrq.ResourceLength += 4;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -492,6 +499,8 @@ RsDoInterruptDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
Descriptor->ExtendedIrq.ResourceLength = (UINT16)
|
|
|
|
(Descriptor->ExtendedIrq.ResourceLength + StringLength);
|
|
|
|
}
|
|
|
|
+ Tmp16 = Descriptor->ExtendedIrq.ResourceLength;
|
|
|
|
+ Descriptor->ExtendedIrq.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
|
|
|
|
Rnode->BufferLength =
|
|
|
|
(ASL_RESDESC_OFFSET (ExtendedIrq.Interrupts[0]) -
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -544,7 +553,8 @@ RsDoVendorLargeDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
Descriptor = Rnode->Buffer;
|
|
|
|
Descriptor->VendorLarge.DescriptorType = ACPI_RESOURCE_NAME_VENDOR_LARGE;
|
|
|
|
- Descriptor->VendorLarge.ResourceLength = (UINT16) i;
|
|
|
|
+ AcpiUtWriteUint(&Descriptor->VendorLarge.ResourceLength, sizeof(UINT16),
|
|
|
|
+ &i, sizeof(UINT32));
|
|
|
|
|
|
|
|
/* Point to end-of-descriptor for vendor data */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/compiler/aslrestype2d.c b/source/compiler/aslrestype2d.c
|
|
|
|
index 394530ae3..fd9dc91de 100644
|
|
|
|
--- a/source/compiler/aslrestype2d.c
|
|
|
|
+++ b/source/compiler/aslrestype2d.c
|
|
|
|
@@ -192,6 +192,8 @@ RsDoDwordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
BOOLEAN ResSourceIndex = FALSE;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -255,8 +257,8 @@ RsDoDwordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 5: /* Address Granularity */
|
|
|
|
|
|
|
|
- Descriptor->Address32.Granularity =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.Granularity = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
|
|
|
|
GranOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -264,8 +266,8 @@ RsDoDwordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 6: /* Address Min */
|
|
|
|
|
|
|
|
- Descriptor->Address32.Minimum =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.Minimum = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -273,8 +275,8 @@ RsDoDwordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 7: /* Address Max */
|
|
|
|
|
|
|
|
- Descriptor->Address32.Maximum =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.Maximum = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -282,16 +284,16 @@ RsDoDwordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 8: /* Translation Offset */
|
|
|
|
|
|
|
|
- Descriptor->Address32.TranslationOffset =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.TranslationOffset = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 9: /* Address Length */
|
|
|
|
|
|
|
|
- Descriptor->Address32.AddressLength =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.AddressLength = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
|
|
|
|
LengthOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -379,11 +381,14 @@ RsDoDwordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Validate the Min/Max/Len/Gran values */
|
|
|
|
|
|
|
|
+ Tmp16 = Descriptor->Address32.ResourceLength;
|
|
|
|
+ Descriptor->Address32.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
RsLargeAddressCheck (
|
|
|
|
- (UINT64) Descriptor->Address32.Minimum,
|
|
|
|
- (UINT64) Descriptor->Address32.Maximum,
|
|
|
|
- (UINT64) Descriptor->Address32.AddressLength,
|
|
|
|
- (UINT64) Descriptor->Address32.Granularity,
|
|
|
|
+ (UINT64) AcpiUtReadUint32(&Descriptor->Address32.Minimum),
|
|
|
|
+ (UINT64) AcpiUtReadUint32(&Descriptor->Address32.Maximum),
|
|
|
|
+ (UINT64) AcpiUtReadUint32(&Descriptor->Address32.AddressLength),
|
|
|
|
+ (UINT64) AcpiUtReadUint32(&Descriptor->Address32.Granularity),
|
|
|
|
Descriptor->Address32.Flags,
|
|
|
|
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -422,6 +427,8 @@ RsDoDwordMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
BOOLEAN ResSourceIndex = FALSE;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -493,8 +500,8 @@ RsDoDwordMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 6: /* Address Granularity */
|
|
|
|
|
|
|
|
- Descriptor->Address32.Granularity =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.Granularity = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
|
|
|
|
GranOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -502,8 +509,8 @@ RsDoDwordMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 7: /* Min Address */
|
|
|
|
|
|
|
|
- Descriptor->Address32.Minimum =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.Minimum = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -511,8 +518,8 @@ RsDoDwordMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 8: /* Max Address */
|
|
|
|
|
|
|
|
- Descriptor->Address32.Maximum =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.Maximum = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -520,16 +527,16 @@ RsDoDwordMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 9: /* Translation Offset */
|
|
|
|
|
|
|
|
- Descriptor->Address32.TranslationOffset =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.TranslationOffset = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 10: /* Address Length */
|
|
|
|
|
|
|
|
- Descriptor->Address32.AddressLength =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.AddressLength = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
|
|
|
|
LengthOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -614,11 +621,14 @@ RsDoDwordMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Validate the Min/Max/Len/Gran values */
|
|
|
|
|
|
|
|
+ Tmp16 = Descriptor->Address32.ResourceLength;
|
|
|
|
+ Descriptor->Address32.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
RsLargeAddressCheck (
|
|
|
|
- (UINT64) Descriptor->Address32.Minimum,
|
|
|
|
- (UINT64) Descriptor->Address32.Maximum,
|
|
|
|
- (UINT64) Descriptor->Address32.AddressLength,
|
|
|
|
- (UINT64) Descriptor->Address32.Granularity,
|
|
|
|
+ (UINT64) AcpiUtReadUint32(&Descriptor->Address32.Minimum),
|
|
|
|
+ (UINT64) AcpiUtReadUint32(&Descriptor->Address32.Maximum),
|
|
|
|
+ (UINT64) AcpiUtReadUint32(&Descriptor->Address32.AddressLength),
|
|
|
|
+ (UINT64) AcpiUtReadUint32(&Descriptor->Address32.Granularity),
|
|
|
|
Descriptor->Address32.Flags,
|
|
|
|
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -657,6 +667,8 @@ RsDoDwordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
BOOLEAN ResSourceIndex = FALSE;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -724,8 +736,8 @@ RsDoDwordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 6: /* Address Granularity */
|
|
|
|
|
|
|
|
- Descriptor->Address32.Granularity =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.Granularity = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Granularity));
|
|
|
|
GranOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -733,8 +745,8 @@ RsDoDwordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 7: /* Min Address */
|
|
|
|
|
|
|
|
- Descriptor->Address32.Minimum =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.Minimum = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -742,8 +754,8 @@ RsDoDwordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 8: /* Max Address */
|
|
|
|
|
|
|
|
- Descriptor->Address32.Maximum =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.Maximum = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -751,16 +763,16 @@ RsDoDwordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 9: /* Translation Offset */
|
|
|
|
|
|
|
|
- Descriptor->Address32.TranslationOffset =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.TranslationOffset = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.TranslationOffset));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 10: /* Address Length */
|
|
|
|
|
|
|
|
- Descriptor->Address32.AddressLength =
|
|
|
|
- (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address32.AddressLength = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address32.AddressLength));
|
|
|
|
LengthOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -831,11 +843,14 @@ RsDoDwordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Validate the Min/Max/Len/Gran values */
|
|
|
|
|
|
|
|
+ Tmp16 = Descriptor->Address32.ResourceLength;
|
|
|
|
+ Descriptor->Address32.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
RsLargeAddressCheck (
|
|
|
|
- (UINT64) Descriptor->Address32.Minimum,
|
|
|
|
- (UINT64) Descriptor->Address32.Maximum,
|
|
|
|
- (UINT64) Descriptor->Address32.AddressLength,
|
|
|
|
- (UINT64) Descriptor->Address32.Granularity,
|
|
|
|
+ (UINT64) AcpiUtReadUint32(&Descriptor->Address32.Minimum),
|
|
|
|
+ (UINT64) AcpiUtReadUint32(&Descriptor->Address32.Maximum),
|
|
|
|
+ (UINT64) AcpiUtReadUint32(&Descriptor->Address32.AddressLength),
|
|
|
|
+ (UINT64) AcpiUtReadUint32(&Descriptor->Address32.Granularity),
|
|
|
|
Descriptor->Address32.Flags,
|
|
|
|
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/compiler/aslrestype2e.c b/source/compiler/aslrestype2e.c
|
|
|
|
index b188994d3..ad61efc77 100644
|
|
|
|
--- a/source/compiler/aslrestype2e.c
|
|
|
|
+++ b/source/compiler/aslrestype2e.c
|
|
|
|
@@ -188,6 +188,7 @@ RsDoExtendedIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT16 StringLength = 0;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -247,7 +248,8 @@ RsDoExtendedIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 5: /* Address Granularity */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.Granularity =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
|
|
|
|
GranOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -255,7 +257,8 @@ RsDoExtendedIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 6: /* Address Min */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.Minimum =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -263,7 +266,8 @@ RsDoExtendedIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 7: /* Address Max */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.Maximum =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -271,14 +275,16 @@ RsDoExtendedIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 8: /* Translation Offset */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.TranslationOffset =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 9: /* Address Length */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.AddressLength =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
|
|
|
|
LengthOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -286,7 +292,8 @@ RsDoExtendedIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 10: /* Type-Specific Attributes */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.TypeSpecific =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -321,11 +328,14 @@ RsDoExtendedIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Validate the Min/Max/Len/Gran values */
|
|
|
|
|
|
|
|
+ Tmp16 = Descriptor->ExtAddress64.ResourceLength;
|
|
|
|
+ Descriptor->ExtAddress64.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
RsLargeAddressCheck (
|
|
|
|
- Descriptor->ExtAddress64.Minimum,
|
|
|
|
- Descriptor->ExtAddress64.Maximum,
|
|
|
|
- Descriptor->ExtAddress64.AddressLength,
|
|
|
|
- Descriptor->ExtAddress64.Granularity,
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->ExtAddress64.Minimum),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->ExtAddress64.Maximum),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->ExtAddress64.AddressLength),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->ExtAddress64.Granularity),
|
|
|
|
Descriptor->ExtAddress64.Flags,
|
|
|
|
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -361,6 +371,7 @@ RsDoExtendedMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT16 StringLength = 0;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -427,7 +438,8 @@ RsDoExtendedMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 6: /* Address Granularity */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.Granularity =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
|
|
|
|
GranOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -435,7 +447,8 @@ RsDoExtendedMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 7: /* Min Address */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.Minimum =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -443,7 +456,8 @@ RsDoExtendedMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 8: /* Max Address */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.Maximum =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -451,14 +465,16 @@ RsDoExtendedMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 9: /* Translation Offset */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.TranslationOffset =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 10: /* Address Length */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.AddressLength =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
|
|
|
|
LengthOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -466,7 +482,8 @@ RsDoExtendedMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 11: /* Type-Specific Attributes */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.TypeSpecific =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -502,11 +519,14 @@ RsDoExtendedMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Validate the Min/Max/Len/Gran values */
|
|
|
|
|
|
|
|
+ Tmp16 = Descriptor->ExtAddress64.ResourceLength;
|
|
|
|
+ Descriptor->ExtAddress64.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
RsLargeAddressCheck (
|
|
|
|
- Descriptor->ExtAddress64.Minimum,
|
|
|
|
- Descriptor->ExtAddress64.Maximum,
|
|
|
|
- Descriptor->ExtAddress64.AddressLength,
|
|
|
|
- Descriptor->ExtAddress64.Granularity,
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->ExtAddress64.Minimum),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->ExtAddress64.Maximum),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->ExtAddress64.AddressLength),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->ExtAddress64.Granularity),
|
|
|
|
Descriptor->ExtAddress64.Flags,
|
|
|
|
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -542,6 +562,7 @@ RsDoExtendedSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT16 StringLength = 0;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -605,7 +626,8 @@ RsDoExtendedSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 6: /* Address Granularity */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.Granularity = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.Granularity =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Granularity));
|
|
|
|
GranOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -613,7 +635,8 @@ RsDoExtendedSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 7: /* Min Address */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.Minimum = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.Minimum =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -621,7 +644,8 @@ RsDoExtendedSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 8: /* Max Address */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.Maximum = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.Maximum =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -629,14 +653,16 @@ RsDoExtendedSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 9: /* Translation Offset */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.TranslationOffset = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.TranslationOffset =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TranslationOffset));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 10: /* Address Length */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.AddressLength = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.AddressLength =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.AddressLength));
|
|
|
|
LengthOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -644,7 +670,8 @@ RsDoExtendedSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 11: /* Type-Specific Attributes */
|
|
|
|
|
|
|
|
- Descriptor->ExtAddress64.TypeSpecific = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->ExtAddress64.TypeSpecific =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_TYPESPECIFICATTRIBUTES,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (ExtAddress64.TypeSpecific));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -665,11 +692,14 @@ RsDoExtendedSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Validate the Min/Max/Len/Gran values */
|
|
|
|
|
|
|
|
+ Tmp16 = Descriptor->ExtAddress64.ResourceLength;
|
|
|
|
+ Descriptor->ExtAddress64.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
RsLargeAddressCheck (
|
|
|
|
- Descriptor->ExtAddress64.Minimum,
|
|
|
|
- Descriptor->ExtAddress64.Maximum,
|
|
|
|
- Descriptor->ExtAddress64.AddressLength,
|
|
|
|
- Descriptor->ExtAddress64.Granularity,
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->ExtAddress64.Minimum),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->ExtAddress64.Maximum),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->ExtAddress64.AddressLength),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->ExtAddress64.Granularity),
|
|
|
|
Descriptor->ExtAddress64.Flags,
|
|
|
|
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/compiler/aslrestype2q.c b/source/compiler/aslrestype2q.c
|
|
|
|
index 02db0ab34..7706b07ac 100644
|
|
|
|
--- a/source/compiler/aslrestype2q.c
|
|
|
|
+++ b/source/compiler/aslrestype2q.c
|
|
|
|
@@ -192,6 +192,7 @@ RsDoQwordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
BOOLEAN ResSourceIndex = FALSE;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -255,7 +256,8 @@ RsDoQwordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 5: /* Address Granularity */
|
|
|
|
|
|
|
|
- Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.Granularity =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
|
|
|
|
GranOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -263,7 +265,8 @@ RsDoQwordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 6: /* Address Min */
|
|
|
|
|
|
|
|
- Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.Minimum =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -271,7 +274,8 @@ RsDoQwordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 7: /* Address Max */
|
|
|
|
|
|
|
|
- Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.Maximum =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -279,14 +283,16 @@ RsDoQwordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 8: /* Translation Offset */
|
|
|
|
|
|
|
|
- Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.TranslationOffset =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateByteField (InitializerOp, ACPI_RESTAG_TRANSLATION,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 9: /* Address Length */
|
|
|
|
|
|
|
|
- Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.AddressLength =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
|
|
|
|
LengthOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -370,11 +376,14 @@ RsDoQwordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Validate the Min/Max/Len/Gran values */
|
|
|
|
|
|
|
|
+ Tmp16 = Descriptor->Address64.ResourceLength;
|
|
|
|
+ Descriptor->Address64.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
RsLargeAddressCheck (
|
|
|
|
- Descriptor->Address64.Minimum,
|
|
|
|
- Descriptor->Address64.Maximum,
|
|
|
|
- Descriptor->Address64.AddressLength,
|
|
|
|
- Descriptor->Address64.Granularity,
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->Address64.Minimum),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->Address64.Maximum),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->Address64.AddressLength),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->Address64.Granularity),
|
|
|
|
Descriptor->Address64.Flags,
|
|
|
|
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -413,6 +422,7 @@ RsDoQwordMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
BOOLEAN ResSourceIndex = FALSE;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -483,7 +493,8 @@ RsDoQwordMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 6: /* Address Granularity */
|
|
|
|
|
|
|
|
- Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.Granularity =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
|
|
|
|
GranOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -491,7 +502,8 @@ RsDoQwordMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 7: /* Min Address */
|
|
|
|
|
|
|
|
- Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.Minimum =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -499,7 +511,8 @@ RsDoQwordMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 8: /* Max Address */
|
|
|
|
|
|
|
|
- Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.Maximum =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -507,14 +520,16 @@ RsDoQwordMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 9: /* Translation Offset */
|
|
|
|
|
|
|
|
- Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.TranslationOffset =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 10: /* Address Length */
|
|
|
|
|
|
|
|
- Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.AddressLength =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
|
|
|
|
LengthOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -599,11 +614,14 @@ RsDoQwordMemoryDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Validate the Min/Max/Len/Gran values */
|
|
|
|
|
|
|
|
+ Tmp16 = Descriptor->Address64.ResourceLength;
|
|
|
|
+ Descriptor->Address64.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
RsLargeAddressCheck (
|
|
|
|
- Descriptor->Address64.Minimum,
|
|
|
|
- Descriptor->Address64.Maximum,
|
|
|
|
- Descriptor->Address64.AddressLength,
|
|
|
|
- Descriptor->Address64.Granularity,
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->Address64.Minimum),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->Address64.Maximum),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->Address64.AddressLength),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->Address64.Granularity),
|
|
|
|
Descriptor->Address64.Flags,
|
|
|
|
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -642,6 +660,7 @@ RsDoQwordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
BOOLEAN ResSourceIndex = FALSE;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -709,7 +728,8 @@ RsDoQwordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 6: /* Address Granularity */
|
|
|
|
|
|
|
|
- Descriptor->Address64.Granularity = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.Granularity =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Granularity));
|
|
|
|
GranOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -717,7 +737,8 @@ RsDoQwordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 7: /* Min Address */
|
|
|
|
|
|
|
|
- Descriptor->Address64.Minimum = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.Minimum =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -725,7 +746,8 @@ RsDoQwordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 8: /* Max Address */
|
|
|
|
|
|
|
|
- Descriptor->Address64.Maximum = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.Maximum =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -733,14 +755,16 @@ RsDoQwordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 9: /* Translation Offset */
|
|
|
|
|
|
|
|
- Descriptor->Address64.TranslationOffset = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.TranslationOffset =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.TranslationOffset));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 10: /* Address Length */
|
|
|
|
|
|
|
|
- Descriptor->Address64.AddressLength = InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address64.AddressLength =
|
|
|
|
+ AcpiUtReadUint64(&InitializerOp->Asl.Value.Integer);
|
|
|
|
RsCreateQwordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address64.AddressLength));
|
|
|
|
LengthOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -810,11 +834,14 @@ RsDoQwordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Validate the Min/Max/Len/Gran values */
|
|
|
|
|
|
|
|
+ Tmp16 = Descriptor->Address64.ResourceLength;
|
|
|
|
+ Descriptor->Address64.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
RsLargeAddressCheck (
|
|
|
|
- Descriptor->Address64.Minimum,
|
|
|
|
- Descriptor->Address64.Maximum,
|
|
|
|
- Descriptor->Address64.AddressLength,
|
|
|
|
- Descriptor->Address64.Granularity,
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->Address64.Minimum),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->Address64.Maximum),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->Address64.AddressLength),
|
|
|
|
+ AcpiUtReadUint64(&Descriptor->Address64.Granularity),
|
|
|
|
Descriptor->Address64.Flags,
|
|
|
|
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/compiler/aslrestype2s.c b/source/compiler/aslrestype2s.c
|
|
|
|
index c075c89c9..7aa23a35b 100644
|
|
|
|
--- a/source/compiler/aslrestype2s.c
|
|
|
|
+++ b/source/compiler/aslrestype2s.c
|
|
|
|
@@ -451,6 +451,7 @@ RsDoGpioIntDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 PinCount = 0;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -593,7 +594,8 @@ RsDoGpioIntDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
* (implies resource source must immediately follow the pin list.)
|
|
|
|
* Name: _PIN
|
|
|
|
*/
|
|
|
|
- *InterruptList = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ *InterruptList = AcpiUtReadUint16(&Tmp16);
|
|
|
|
InterruptList++;
|
|
|
|
PinCount++;
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -626,6 +628,27 @@ RsDoGpioIntDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
MpSaveGpioInfo (Info->MappingOp, Descriptor,
|
|
|
|
PinCount, PinList, ResourceSource);
|
|
|
|
+
|
|
|
|
+ /* correct endian-ness issues */
|
|
|
|
+ Tmp16 = Descriptor->Gpio.ResourceLength;
|
|
|
|
+ Descriptor->Gpio.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.Flags;
|
|
|
|
+ Descriptor->Gpio.Flags = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.IntFlags;
|
|
|
|
+ Descriptor->Gpio.IntFlags = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.DriveStrength;
|
|
|
|
+ Descriptor->Gpio.DriveStrength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.DebounceTimeout;
|
|
|
|
+ Descriptor->Gpio.DebounceTimeout = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.PinTableOffset;
|
|
|
|
+ Descriptor->Gpio.PinTableOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.ResSourceOffset;
|
|
|
|
+ Descriptor->Gpio.ResSourceOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.VendorOffset;
|
|
|
|
+ Descriptor->Gpio.VendorOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.VendorLength;
|
|
|
|
+ Descriptor->Gpio.VendorLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
return (Rnode);
|
|
|
|
}
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -660,6 +683,7 @@ RsDoGpioIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 PinCount = 0;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -799,7 +823,8 @@ RsDoGpioIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
* (implies resource source must immediately follow the pin list.)
|
|
|
|
* Name: _PIN
|
|
|
|
*/
|
|
|
|
- *InterruptList = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ *InterruptList = AcpiUtReadUint16(&Tmp16);
|
|
|
|
InterruptList++;
|
|
|
|
PinCount++;
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -832,6 +857,27 @@ RsDoGpioIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
MpSaveGpioInfo (Info->MappingOp, Descriptor,
|
|
|
|
PinCount, PinList, ResourceSource);
|
|
|
|
+
|
|
|
|
+ /* correct endian-ness issues */
|
|
|
|
+ Tmp16 = Descriptor->Gpio.ResourceLength;
|
|
|
|
+ Descriptor->Gpio.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.Flags;
|
|
|
|
+ Descriptor->Gpio.Flags = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.IntFlags;
|
|
|
|
+ Descriptor->Gpio.IntFlags = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.DriveStrength;
|
|
|
|
+ Descriptor->Gpio.DriveStrength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.DebounceTimeout;
|
|
|
|
+ Descriptor->Gpio.DebounceTimeout = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.PinTableOffset;
|
|
|
|
+ Descriptor->Gpio.PinTableOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.ResSourceOffset;
|
|
|
|
+ Descriptor->Gpio.ResSourceOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.VendorOffset;
|
|
|
|
+ Descriptor->Gpio.VendorOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->Gpio.VendorLength;
|
|
|
|
+ Descriptor->Gpio.VendorLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
return (Rnode);
|
|
|
|
}
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -862,6 +908,8 @@ RsDoI2cSerialBusDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT16 DescriptorSize;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -889,7 +937,8 @@ RsDoI2cSerialBusDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
Descriptor->I2cSerialBus.RevisionId = AML_RESOURCE_I2C_REVISION;
|
|
|
|
Descriptor->I2cSerialBus.TypeRevisionId = AML_RESOURCE_I2C_TYPE_REVISION;
|
|
|
|
Descriptor->I2cSerialBus.Type = AML_RESOURCE_I2C_SERIALBUSTYPE;
|
|
|
|
- Descriptor->I2cSerialBus.TypeDataLength = AML_RESOURCE_I2C_MIN_DATA_LEN + VendorLength;
|
|
|
|
+ Tmp16 = AML_RESOURCE_I2C_MIN_DATA_LEN + VendorLength;
|
|
|
|
+ Descriptor->I2cSerialBus.TypeDataLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
|
|
|
|
if (Info->DescriptorTypeOp->Asl.ParseOpcode == PARSEOP_I2C_SERIALBUS_V2)
|
|
|
|
{
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -903,13 +952,15 @@ RsDoI2cSerialBusDescriptor (
|
|
|
|
|
|
|
|
/* Process all child initialization nodes */
|
|
|
|
|
|
|
|
+ Descriptor->I2cSerialBus.TypeSpecificFlags = 0;
|
|
|
|
for (i = 0; InitializerOp; i++)
|
|
|
|
{
|
|
|
|
switch (i)
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
case 0: /* Slave Address [WORD] (_ADR) */
|
|
|
|
|
|
|
|
- Descriptor->I2cSerialBus.SlaveAddress = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->I2cSerialBus.SlaveAddress = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_ADDRESS,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.SlaveAddress));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -923,16 +974,19 @@ RsDoI2cSerialBusDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 2: /* Connection Speed [DWORD] (_SPE) */
|
|
|
|
|
|
|
|
- Descriptor->I2cSerialBus.ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->I2cSerialBus.ConnectionSpeed = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.ConnectionSpeed));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
|
|
|
|
case 3: /* Addressing Mode [Flag] (_MOD) */
|
|
|
|
|
|
|
|
- RsSetFlagBits16 (&Descriptor->I2cSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
|
|
|
|
+ Tmp16 = AcpiUtReadUint16(&Descriptor->I2cSerialBus.TypeSpecificFlags);
|
|
|
|
+ RsSetFlagBits16 (&Tmp16, InitializerOp, 0, 0);
|
|
|
|
RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.TypeSpecificFlags), 0);
|
|
|
|
+ Descriptor->I2cSerialBus.TypeSpecificFlags = AcpiUtReadUint16(&Tmp16);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4: /* ResSource [Optional Field - STRING] */
|
|
|
|
@@ -990,6 +1044,8 @@ RsDoI2cSerialBusDescriptor (
|
|
|
|
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
|
|
|
|
}
|
|
|
|
|
|
|
|
+ Tmp16 = Descriptor->I2cSerialBus.ResourceLength;
|
|
|
|
+ Descriptor->I2cSerialBus.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
|
|
|
|
return (Rnode);
|
|
|
|
}
|
|
|
|
@@ -1021,6 +1077,8 @@ RsDoSpiSerialBusDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT16 DescriptorSize;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1043,12 +1101,13 @@ RsDoSpiSerialBusDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
sizeof (AML_RESOURCE_LARGE_HEADER));
|
|
|
|
|
|
|
|
Descriptor = Rnode->Buffer;
|
|
|
|
- Descriptor->SpiSerialBus.ResourceLength = DescriptorSize;
|
|
|
|
+ Descriptor->SpiSerialBus.ResourceLength = AcpiUtReadUint16(&DescriptorSize);
|
|
|
|
Descriptor->SpiSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS;
|
|
|
|
Descriptor->SpiSerialBus.RevisionId = AML_RESOURCE_SPI_REVISION;
|
|
|
|
Descriptor->SpiSerialBus.TypeRevisionId = AML_RESOURCE_SPI_TYPE_REVISION;
|
|
|
|
Descriptor->SpiSerialBus.Type = AML_RESOURCE_SPI_SERIALBUSTYPE;
|
|
|
|
- Descriptor->SpiSerialBus.TypeDataLength = AML_RESOURCE_SPI_MIN_DATA_LEN + VendorLength;
|
|
|
|
+ Tmp16 = AML_RESOURCE_SPI_MIN_DATA_LEN + VendorLength;
|
|
|
|
+ Descriptor->SpiSerialBus.TypeDataLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
|
|
|
|
if (Info->DescriptorTypeOp->Asl.ParseOpcode == PARSEOP_SPI_SERIALBUS_V2)
|
|
|
|
{
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1063,29 +1122,35 @@ RsDoSpiSerialBusDescriptor (
|
|
|
|
|
|
|
|
/* Process all child initialization nodes */
|
|
|
|
|
|
|
|
+ Descriptor->SpiSerialBus.TypeSpecificFlags = 0;
|
|
|
|
for (i = 0; InitializerOp; i++)
|
|
|
|
{
|
|
|
|
switch (i)
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
case 0: /* Device Selection [WORD] (_ADR) */
|
|
|
|
|
|
|
|
- Descriptor->SpiSerialBus.DeviceSelection = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->SpiSerialBus.DeviceSelection = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_ADDRESS,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.DeviceSelection));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
|
|
|
|
case 1: /* Device Polarity [Flag] (_DPL) */
|
|
|
|
|
|
|
|
- RsSetFlagBits16 (&Descriptor->SpiSerialBus.TypeSpecificFlags, InitializerOp, 1, 0);
|
|
|
|
+ Tmp16 = AcpiUtReadUint16(&Descriptor->SpiSerialBus.TypeSpecificFlags);
|
|
|
|
+ RsSetFlagBits16 (&Tmp16, InitializerOp, 1, 0);
|
|
|
|
RsCreateBitField (InitializerOp, ACPI_RESTAG_DEVICEPOLARITY,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.TypeSpecificFlags), 1);
|
|
|
|
+ Descriptor->SpiSerialBus.TypeSpecificFlags = AcpiUtReadUint16(&Tmp16);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2: /* Wire Mode [Flag] (_MOD) */
|
|
|
|
|
|
|
|
- RsSetFlagBits16 (&Descriptor->SpiSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
|
|
|
|
+ Tmp16 = AcpiUtReadUint16(&Descriptor->SpiSerialBus.TypeSpecificFlags);
|
|
|
|
+ RsSetFlagBits16 (&Tmp16, InitializerOp, 0, 0);
|
|
|
|
RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.TypeSpecificFlags), 0);
|
|
|
|
+ Descriptor->SpiSerialBus.TypeSpecificFlags = AcpiUtReadUint16(&Tmp16);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3: /* Device Bit Length [BYTE] (_LEN) */
|
|
|
|
@@ -1104,7 +1169,8 @@ RsDoSpiSerialBusDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 5: /* Connection Speed [DWORD] (_SPE) */
|
|
|
|
|
|
|
|
- Descriptor->SpiSerialBus.ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->SpiSerialBus.ConnectionSpeed = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.ConnectionSpeed));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1209,6 +1275,8 @@ RsDoUartSerialBusDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT16 DescriptorSize;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1231,12 +1299,13 @@ RsDoUartSerialBusDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
sizeof (AML_RESOURCE_LARGE_HEADER));
|
|
|
|
|
|
|
|
Descriptor = Rnode->Buffer;
|
|
|
|
- Descriptor->UartSerialBus.ResourceLength = DescriptorSize;
|
|
|
|
+ Descriptor->UartSerialBus.ResourceLength = AcpiUtReadUint16(&DescriptorSize);
|
|
|
|
Descriptor->UartSerialBus.DescriptorType = ACPI_RESOURCE_NAME_SERIAL_BUS;
|
|
|
|
Descriptor->UartSerialBus.RevisionId = AML_RESOURCE_UART_REVISION;
|
|
|
|
Descriptor->UartSerialBus.TypeRevisionId = AML_RESOURCE_UART_TYPE_REVISION;
|
|
|
|
Descriptor->UartSerialBus.Type = AML_RESOURCE_UART_SERIALBUSTYPE;
|
|
|
|
- Descriptor->UartSerialBus.TypeDataLength = AML_RESOURCE_UART_MIN_DATA_LEN + VendorLength;
|
|
|
|
+ Tmp16 = AML_RESOURCE_UART_MIN_DATA_LEN + VendorLength;
|
|
|
|
+ Descriptor->UartSerialBus.TypeDataLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
|
|
|
|
if (Info->DescriptorTypeOp->Asl.ParseOpcode == PARSEOP_UART_SERIALBUS_V2)
|
|
|
|
{
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1250,29 +1319,35 @@ RsDoUartSerialBusDescriptor (
|
|
|
|
|
|
|
|
/* Process all child initialization nodes */
|
|
|
|
|
|
|
|
+ Descriptor->UartSerialBus.TypeSpecificFlags = 0;
|
|
|
|
for (i = 0; InitializerOp; i++)
|
|
|
|
{
|
|
|
|
switch (i)
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
case 0: /* Connection Speed (Baud Rate) [DWORD] (_SPE) */
|
|
|
|
|
|
|
|
- Descriptor->UartSerialBus.DefaultBaudRate = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->UartSerialBus.DefaultBaudRate = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.DefaultBaudRate));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
|
|
|
|
case 1: /* Bits Per Byte [Flags] (_LEN) */
|
|
|
|
|
|
|
|
- RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 4, 3);
|
|
|
|
+ Tmp16 = AcpiUtReadUint16(&Descriptor->UartSerialBus.TypeSpecificFlags);
|
|
|
|
+ RsSetFlagBits16 (&Tmp16, InitializerOp, 4, 3);
|
|
|
|
RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 4, 3);
|
|
|
|
+ Descriptor->UartSerialBus.TypeSpecificFlags = AcpiUtReadUint16(&Tmp16);;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2: /* Stop Bits [Flags] (_STB) */
|
|
|
|
|
|
|
|
- RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 2, 1);
|
|
|
|
+ Tmp16 = AcpiUtReadUint16(&Descriptor->UartSerialBus.TypeSpecificFlags);
|
|
|
|
+ RsSetFlagBits16 (&Tmp16, InitializerOp, 2, 1);
|
|
|
|
RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_STOPBITS,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 2, 2);
|
|
|
|
+ Descriptor->UartSerialBus.TypeSpecificFlags = AcpiUtReadUint16(&Tmp16);;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3: /* Lines In Use [BYTE] (_LIN) */
|
|
|
|
@@ -1284,9 +1359,11 @@ RsDoUartSerialBusDescriptor (
|
|
|
|
|
|
|
|
case 4: /* Endianness [Flag] (_END) */
|
|
|
|
|
|
|
|
- RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 7, 0);
|
|
|
|
+ Tmp16 = AcpiUtReadUint16(&Descriptor->UartSerialBus.TypeSpecificFlags);
|
|
|
|
+ RsSetFlagBits16 (&Tmp16, InitializerOp, 7, 0);
|
|
|
|
RsCreateBitField (InitializerOp, ACPI_RESTAG_ENDIANNESS,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 7);
|
|
|
|
+ Descriptor->UartSerialBus.TypeSpecificFlags = AcpiUtReadUint16(&Tmp16);;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 5: /* Parity [BYTE] (_PAR) */
|
|
|
|
@@ -1298,21 +1375,25 @@ RsDoUartSerialBusDescriptor (
|
|
|
|
|
|
|
|
case 6: /* Flow Control [Flags] (_FLC) */
|
|
|
|
|
|
|
|
- RsSetFlagBits16 (&Descriptor->UartSerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
|
|
|
|
+ Tmp16 = AcpiUtReadUint16(&Descriptor->UartSerialBus.TypeSpecificFlags);
|
|
|
|
+ RsSetFlagBits16 (&Tmp16, InitializerOp, 0, 0);
|
|
|
|
RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_FLOWCONTROL,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TypeSpecificFlags), 0, 2);
|
|
|
|
+ Descriptor->UartSerialBus.TypeSpecificFlags = AcpiUtReadUint16(&Tmp16);;
|
|
|
|
break;
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 7: /* Rx Buffer Size [WORD] (_RXL) */
|
|
|
|
|
|
|
|
- Descriptor->UartSerialBus.RxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->UartSerialBus.RxFifoSize = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH_RX,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.RxFifoSize));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 8: /* Tx Buffer Size [WORD] (_TXL) */
|
|
|
|
|
|
|
|
- Descriptor->UartSerialBus.TxFifoSize = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->UartSerialBus.TxFifoSize = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH_TX,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.TxFifoSize));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1416,6 +1497,7 @@ RsDoPinFunctionDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 PinCount = 0;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
|
|
|
CurrentByteOffset = Info->CurrentByteOffset;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1439,7 +1521,7 @@ RsDoPinFunctionDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
sizeof (AML_RESOURCE_LARGE_HEADER));
|
|
|
|
|
|
|
|
Descriptor = Rnode->Buffer;
|
|
|
|
- Descriptor->PinFunction.ResourceLength = DescriptorSize;
|
|
|
|
+ Descriptor->PinFunction.ResourceLength = AcpiUtReadUint16(&DescriptorSize);
|
|
|
|
Descriptor->PinFunction.DescriptorType = ACPI_RESOURCE_NAME_PIN_FUNCTION;
|
|
|
|
Descriptor->PinFunction.RevisionId = AML_RESOURCE_PIN_FUNCTION_REVISION;
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1479,7 +1561,8 @@ RsDoPinFunctionDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 2: /* Function Number [WORD] (_FUN) */
|
|
|
|
|
|
|
|
- Descriptor->PinFunction.FunctionNumber = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->PinFunction.FunctionNumber = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_FUNCTION,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (PinFunction.FunctionNumber));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1527,6 +1610,12 @@ RsDoPinFunctionDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
Descriptor->PinFunction.VendorLength = VendorLength;
|
|
|
|
}
|
|
|
|
+ Tmp16 = (UINT16) ACPI_PTR_DIFF (VendorData, Descriptor);
|
|
|
|
+ Descriptor->PinFunction.VendorOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
+ Tmp16 = Descriptor->PinFunction.VendorLength;
|
|
|
|
+ Descriptor->PinFunction.VendorLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1538,7 +1627,8 @@ RsDoPinFunctionDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
* (implies resource source must immediately follow the pin list.)
|
|
|
|
* Name: _PIN
|
|
|
|
*/
|
|
|
|
- *PinList = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ *PinList = AcpiUtReadUint16(&Tmp16);
|
|
|
|
PinList++;
|
|
|
|
PinCount++;
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1569,6 +1659,13 @@ RsDoPinFunctionDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
|
|
|
|
}
|
|
|
|
|
|
|
|
+ /* correct the endian-ness of the values */
|
|
|
|
+ Tmp16 = Descriptor->PinFunction.PinTableOffset;
|
|
|
|
+ Descriptor->PinFunction.PinTableOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
+ Tmp16 = Descriptor->PinFunction.ResSourceOffset;
|
|
|
|
+ Descriptor->PinFunction.ResSourceOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
return (Rnode);
|
|
|
|
}
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1602,6 +1699,8 @@ RsDoPinConfigDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 PinCount = 0;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
|
|
|
CurrentByteOffset = Info->CurrentByteOffset;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1625,7 +1724,7 @@ RsDoPinConfigDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
sizeof (AML_RESOURCE_LARGE_HEADER));
|
|
|
|
|
|
|
|
Descriptor = Rnode->Buffer;
|
|
|
|
- Descriptor->PinConfig.ResourceLength = DescriptorSize;
|
|
|
|
+ Descriptor->PinConfig.ResourceLength = AcpiUtReadUint16(&DescriptorSize);
|
|
|
|
Descriptor->PinConfig.DescriptorType = ACPI_RESOURCE_NAME_PIN_CONFIG;
|
|
|
|
Descriptor->PinConfig.RevisionId = AML_RESOURCE_PIN_CONFIG_REVISION;
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1679,7 +1778,8 @@ RsDoPinConfigDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 2: /* Pin Config Value [DWORD] (_VAL) */
|
|
|
|
|
|
|
|
- Descriptor->PinConfig.PinConfigValue = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->PinConfig.PinConfigValue = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_PINCONFIG_VALUE,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (PinConfig.PinConfigValue));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1738,7 +1838,8 @@ RsDoPinConfigDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
* (implies resource source must immediately follow the pin list.)
|
|
|
|
* Name: _PIN
|
|
|
|
*/
|
|
|
|
- *PinList = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ *PinList = AcpiUtReadUint16(&Tmp16);
|
|
|
|
PinList++;
|
|
|
|
PinCount++;
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1769,6 +1870,16 @@ RsDoPinConfigDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
|
|
|
|
}
|
|
|
|
|
|
|
|
+ /* correct the endianness if needed */
|
|
|
|
+ Tmp16 = Descriptor->PinConfig.PinTableOffset;
|
|
|
|
+ Descriptor->PinConfig.PinTableOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->PinConfig.ResSourceOffset;
|
|
|
|
+ Descriptor->PinConfig.ResSourceOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->PinConfig.VendorOffset;
|
|
|
|
+ Descriptor->PinConfig.VendorOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->PinConfig.VendorLength;
|
|
|
|
+ Descriptor->PinConfig.VendorLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
return (Rnode);
|
|
|
|
}
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1802,6 +1913,7 @@ RsDoPinGroupDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 PinCount = 0;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
|
|
|
CurrentByteOffset = Info->CurrentByteOffset;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1825,7 +1937,7 @@ RsDoPinGroupDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
sizeof (AML_RESOURCE_LARGE_HEADER));
|
|
|
|
|
|
|
|
Descriptor = Rnode->Buffer;
|
|
|
|
- Descriptor->PinGroup.ResourceLength = DescriptorSize;
|
|
|
|
+ Descriptor->PinGroup.ResourceLength = AcpiUtReadUint16(&DescriptorSize);
|
|
|
|
Descriptor->PinGroup.DescriptorType = ACPI_RESOURCE_NAME_PIN_GROUP;
|
|
|
|
Descriptor->PinGroup.RevisionId = AML_RESOURCE_PIN_GROUP_REVISION;
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1892,7 +2004,8 @@ RsDoPinGroupDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
* (implies resource source must immediately follow the pin list.)
|
|
|
|
* Name: _PIN
|
|
|
|
*/
|
|
|
|
- *PinList = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ *PinList = AcpiUtReadUint16(&Tmp16);
|
|
|
|
PinList++;
|
|
|
|
PinCount++;
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1923,6 +2036,16 @@ RsDoPinGroupDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
|
|
|
|
}
|
|
|
|
|
|
|
|
+ /* correct enddianness as needed */
|
|
|
|
+ Tmp16 = Descriptor->PinGroup.PinTableOffset;
|
|
|
|
+ Descriptor->PinGroup.PinTableOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->PinGroup.LabelOffset;
|
|
|
|
+ Descriptor->PinGroup.LabelOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->PinGroup.VendorOffset;
|
|
|
|
+ Descriptor->PinGroup.VendorOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->PinGroup.VendorLength;
|
|
|
|
+ Descriptor->PinGroup.VendorLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
return (Rnode);
|
|
|
|
}
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1955,6 +2078,7 @@ RsDoPinGroupFunctionDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT16 DescriptorSize;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
|
|
|
CurrentByteOffset = Info->CurrentByteOffset;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1978,7 +2102,7 @@ RsDoPinGroupFunctionDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
sizeof (AML_RESOURCE_LARGE_HEADER));
|
|
|
|
|
|
|
|
Descriptor = Rnode->Buffer;
|
|
|
|
- Descriptor->PinGroupFunction.ResourceLength = DescriptorSize;
|
|
|
|
+ Descriptor->PinGroupFunction.ResourceLength = AcpiUtReadUint16(&DescriptorSize);
|
|
|
|
Descriptor->PinGroupFunction.DescriptorType = ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION;
|
|
|
|
Descriptor->PinGroupFunction.RevisionId = AML_RESOURCE_PIN_GROUP_FUNCTION_REVISION;
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -2010,7 +2134,8 @@ RsDoPinGroupFunctionDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 1: /* Function Number [WORD] */
|
|
|
|
|
|
|
|
- Descriptor->PinGroupFunction.FunctionNumber = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->PinGroupFunction.FunctionNumber = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_FUNCTION,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (PinGroupFunction.FunctionNumber));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -2069,6 +2194,16 @@ RsDoPinGroupFunctionDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
|
|
|
|
}
|
|
|
|
|
|
|
|
+ /* correct enddianness as needed */
|
|
|
|
+ Tmp16 = Descriptor->PinGroupFunction.ResSourceOffset;
|
|
|
|
+ Descriptor->PinGroupFunction.ResSourceOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->PinGroupFunction.ResSourceLabelOffset;
|
|
|
|
+ Descriptor->PinGroupFunction.ResSourceLabelOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->PinGroupFunction.VendorOffset;
|
|
|
|
+ Descriptor->PinGroupFunction.VendorOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->PinGroupFunction.VendorLength;
|
|
|
|
+ Descriptor->PinGroupFunction.VendorLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
return (Rnode);
|
|
|
|
}
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -2101,6 +2236,8 @@ RsDoPinGroupConfigDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT16 DescriptorSize;
|
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
|
|
|
CurrentByteOffset = Info->CurrentByteOffset;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -2124,7 +2261,7 @@ RsDoPinGroupConfigDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
sizeof (AML_RESOURCE_LARGE_HEADER));
|
|
|
|
|
|
|
|
Descriptor = Rnode->Buffer;
|
|
|
|
- Descriptor->PinGroupConfig.ResourceLength = DescriptorSize;
|
|
|
|
+ Descriptor->PinGroupConfig.ResourceLength = AcpiUtReadUint16(&DescriptorSize);
|
|
|
|
Descriptor->PinGroupConfig.DescriptorType = ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG;
|
|
|
|
Descriptor->PinGroupConfig.RevisionId = AML_RESOURCE_PIN_GROUP_CONFIG_REVISION;
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -2177,7 +2314,8 @@ RsDoPinGroupConfigDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 2: /* Pin Config Value [DWORD] (_VAL) */
|
|
|
|
|
|
|
|
- Descriptor->PinGroupConfig.PinConfigValue = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp32 = (UINT32) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->PinGroupConfig.PinConfigValue = AcpiUtReadUint32(&Tmp32);
|
|
|
|
RsCreateDwordField (InitializerOp, ACPI_RESTAG_PINCONFIG_VALUE,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (PinGroupConfig.PinConfigValue));
|
|
|
|
break;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -2238,5 +2376,15 @@ RsDoPinGroupConfigDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
|
|
|
|
}
|
|
|
|
|
|
|
|
+ /* correct enddianness as needed */
|
|
|
|
+ Tmp16 = Descriptor->PinGroupConfig.ResSourceOffset;
|
|
|
|
+ Descriptor->PinGroupConfig.ResSourceOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->PinGroupConfig.ResSourceLabelOffset;
|
|
|
|
+ Descriptor->PinGroupConfig.ResSourceLabelOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->PinGroupConfig.VendorOffset;
|
|
|
|
+ Descriptor->PinGroupConfig.VendorOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+ Tmp16 = Descriptor->PinGroupConfig.VendorLength;
|
|
|
|
+ Descriptor->PinGroupConfig.VendorLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
return (Rnode);
|
|
|
|
}
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/compiler/aslrestype2w.c b/source/compiler/aslrestype2w.c
|
|
|
|
index b2113f4c9..6077f5f1a 100644
|
|
|
|
--- a/source/compiler/aslrestype2w.c
|
|
|
|
+++ b/source/compiler/aslrestype2w.c
|
|
|
|
@@ -192,6 +192,7 @@ RsDoWordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
BOOLEAN ResSourceIndex = FALSE;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -255,7 +256,8 @@ RsDoWordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 5: /* Address Granularity */
|
|
|
|
|
|
|
|
- Descriptor->Address16.Granularity = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.Granularity = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
|
|
|
|
GranOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -263,7 +265,8 @@ RsDoWordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 6: /* Address Min */
|
|
|
|
|
|
|
|
- Descriptor->Address16.Minimum = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.Minimum = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -271,7 +274,8 @@ RsDoWordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 7: /* Address Max */
|
|
|
|
|
|
|
|
- Descriptor->Address16.Maximum = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.Maximum = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -279,14 +283,16 @@ RsDoWordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 8: /* Translation Offset */
|
|
|
|
|
|
|
|
- Descriptor->Address16.TranslationOffset = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.TranslationOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 9: /* Address Length */
|
|
|
|
|
|
|
|
- Descriptor->Address16.AddressLength = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.AddressLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
|
|
|
|
LengthOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -371,13 +377,17 @@ RsDoWordIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
/* Validate the Min/Max/Len/Gran values */
|
|
|
|
|
|
|
|
RsLargeAddressCheck (
|
|
|
|
- (UINT64) Descriptor->Address16.Minimum,
|
|
|
|
- (UINT64) Descriptor->Address16.Maximum,
|
|
|
|
- (UINT64) Descriptor->Address16.AddressLength,
|
|
|
|
- (UINT64) Descriptor->Address16.Granularity,
|
|
|
|
+ (UINT64) AcpiUtReadUint16(&Descriptor->Address16.Minimum),
|
|
|
|
+ (UINT64) AcpiUtReadUint16(&Descriptor->Address16.Maximum),
|
|
|
|
+ (UINT64) AcpiUtReadUint16(&Descriptor->Address16.AddressLength),
|
|
|
|
+ (UINT64) AcpiUtReadUint16(&Descriptor->Address16.Granularity),
|
|
|
|
Descriptor->Address16.Flags,
|
|
|
|
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
|
|
|
|
|
|
|
|
+ /* correct enddianness */
|
|
|
|
+ Tmp16 = Descriptor->Address16.ResourceLength;
|
|
|
|
+ Descriptor->Address16.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
|
|
|
|
OptionIndex + StringLength;
|
|
|
|
return (Rnode);
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -413,6 +423,7 @@ RsDoWordBusNumberDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
BOOLEAN ResSourceIndex = FALSE;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -469,8 +480,8 @@ RsDoWordBusNumberDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 4: /* Address Granularity */
|
|
|
|
|
|
|
|
- Descriptor->Address16.Granularity =
|
|
|
|
- (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.Granularity = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
|
|
|
|
GranOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -478,8 +489,8 @@ RsDoWordBusNumberDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 5: /* Min Address */
|
|
|
|
|
|
|
|
- Descriptor->Address16.Minimum =
|
|
|
|
- (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.Minimum = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -487,8 +498,8 @@ RsDoWordBusNumberDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 6: /* Max Address */
|
|
|
|
|
|
|
|
- Descriptor->Address16.Maximum =
|
|
|
|
- (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.Maximum = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -496,16 +507,16 @@ RsDoWordBusNumberDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 7: /* Translation Offset */
|
|
|
|
|
|
|
|
- Descriptor->Address16.TranslationOffset =
|
|
|
|
- (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.TranslationOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 8: /* Address Length */
|
|
|
|
|
|
|
|
- Descriptor->Address16.AddressLength =
|
|
|
|
- (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.AddressLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
|
|
|
|
LengthOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -576,13 +587,17 @@ RsDoWordBusNumberDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
/* Validate the Min/Max/Len/Gran values */
|
|
|
|
|
|
|
|
RsLargeAddressCheck (
|
|
|
|
- (UINT64) Descriptor->Address16.Minimum,
|
|
|
|
- (UINT64) Descriptor->Address16.Maximum,
|
|
|
|
- (UINT64) Descriptor->Address16.AddressLength,
|
|
|
|
- (UINT64) Descriptor->Address16.Granularity,
|
|
|
|
+ (UINT64) AcpiUtReadUint16(&Descriptor->Address16.Minimum),
|
|
|
|
+ (UINT64) AcpiUtReadUint16(&Descriptor->Address16.Maximum),
|
|
|
|
+ (UINT64) AcpiUtReadUint16(&Descriptor->Address16.AddressLength),
|
|
|
|
+ (UINT64) AcpiUtReadUint16(&Descriptor->Address16.Granularity),
|
|
|
|
Descriptor->Address16.Flags,
|
|
|
|
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
|
|
|
|
|
|
|
|
+ /* correct enddianness */
|
|
|
|
+ Tmp16 = Descriptor->Address16.ResourceLength;
|
|
|
|
+ Descriptor->Address16.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
|
|
|
|
OptionIndex + StringLength;
|
|
|
|
return (Rnode);
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -618,6 +633,7 @@ RsDoWordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 CurrentByteOffset;
|
|
|
|
UINT32 i;
|
|
|
|
BOOLEAN ResSourceIndex = FALSE;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -685,8 +701,8 @@ RsDoWordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 6: /* Address Granularity */
|
|
|
|
|
|
|
|
- Descriptor->Address16.Granularity =
|
|
|
|
- (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.Granularity = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_GRANULARITY,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Granularity));
|
|
|
|
GranOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -694,8 +710,8 @@ RsDoWordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 7: /* Min Address */
|
|
|
|
|
|
|
|
- Descriptor->Address16.Minimum =
|
|
|
|
- (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.Minimum = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_MINADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Minimum));
|
|
|
|
MinOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -703,8 +719,8 @@ RsDoWordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 8: /* Max Address */
|
|
|
|
|
|
|
|
- Descriptor->Address16.Maximum =
|
|
|
|
- (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.Maximum = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_MAXADDR,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.Maximum));
|
|
|
|
MaxOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -712,16 +728,16 @@ RsDoWordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case 9: /* Translation Offset */
|
|
|
|
|
|
|
|
- Descriptor->Address16.TranslationOffset =
|
|
|
|
- (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.TranslationOffset = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_TRANSLATION,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.TranslationOffset));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 10: /* Address Length */
|
|
|
|
|
|
|
|
- Descriptor->Address16.AddressLength =
|
|
|
|
- (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Tmp16 = (UINT16) InitializerOp->Asl.Value.Integer;
|
|
|
|
+ Descriptor->Address16.AddressLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
RsCreateWordField (InitializerOp, ACPI_RESTAG_LENGTH,
|
|
|
|
CurrentByteOffset + ASL_RESDESC_OFFSET (Address16.AddressLength));
|
|
|
|
LengthOp = InitializerOp;
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -792,13 +808,17 @@ RsDoWordSpaceDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
/* Validate the Min/Max/Len/Gran values */
|
|
|
|
|
|
|
|
RsLargeAddressCheck (
|
|
|
|
- (UINT64) Descriptor->Address16.Minimum,
|
|
|
|
- (UINT64) Descriptor->Address16.Maximum,
|
|
|
|
- (UINT64) Descriptor->Address16.AddressLength,
|
|
|
|
- (UINT64) Descriptor->Address16.Granularity,
|
|
|
|
+ (UINT64) AcpiUtReadUint16(&Descriptor->Address16.Minimum),
|
|
|
|
+ (UINT64) AcpiUtReadUint16(&Descriptor->Address16.Maximum),
|
|
|
|
+ (UINT64) AcpiUtReadUint16(&Descriptor->Address16.AddressLength),
|
|
|
|
+ (UINT64) AcpiUtReadUint16(&Descriptor->Address16.Granularity),
|
|
|
|
Descriptor->Address16.Flags,
|
|
|
|
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
|
|
|
|
|
|
|
|
+ /* correct enddianness */
|
|
|
|
+ Tmp16 = Descriptor->Address16.ResourceLength;
|
|
|
|
+ Descriptor->Address16.ResourceLength = AcpiUtReadUint16(&Tmp16);
|
|
|
|
+
|
|
|
|
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
|
|
|
|
OptionIndex + StringLength;
|
|
|
|
return (Rnode);
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/components/disassembler/dmbuffer.c b/source/components/disassembler/dmbuffer.c
|
|
|
|
index 810f727fa..6960e9913 100644
|
|
|
|
--- a/source/components/disassembler/dmbuffer.c
|
|
|
|
+++ b/source/components/disassembler/dmbuffer.c
|
|
|
|
@@ -312,7 +312,7 @@ AcpiDmByteList (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
ByteData = Op->Named.Data;
|
|
|
|
- ByteCount = (UINT32) Op->Common.Value.Integer;
|
|
|
|
+ ByteCount = (UINT32) Op->Common.Value.Size;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The byte list belongs to a buffer, and can be produced by either
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -416,7 +416,7 @@ AcpiDmIsUuidBuffer (
|
|
|
|
/* Extract the byte list info */
|
|
|
|
|
|
|
|
ByteData = NextOp->Named.Data;
|
|
|
|
- ByteCount = (UINT32) NextOp->Common.Value.Integer;
|
|
|
|
+ ByteCount = (UINT32) NextOp->Common.Value.Size;
|
|
|
|
|
|
|
|
/* Byte count must be exactly 16 */
|
|
|
|
|
|
|
|
@@ -544,7 +544,7 @@ AcpiDmIsUnicodeBuffer (
|
|
|
|
/* Extract the byte list info */
|
|
|
|
|
|
|
|
ByteData = NextOp->Named.Data;
|
|
|
|
- ByteCount = (UINT32) NextOp->Common.Value.Integer;
|
|
|
|
+ ByteCount = (UINT32) NextOp->Common.Value.Size;
|
|
|
|
WordCount = ACPI_DIV_2 (ByteCount);
|
|
|
|
|
|
|
|
/*
|
|
|
|
@@ -986,14 +986,14 @@ AcpiDmUnicode (
|
|
|
|
/* Extract the buffer info as a WORD buffer */
|
|
|
|
|
|
|
|
WordData = ACPI_CAST_PTR (UINT16, Op->Named.Data);
|
|
|
|
- WordCount = ACPI_DIV_2 (((UINT32) Op->Common.Value.Integer));
|
|
|
|
+ WordCount = ACPI_DIV_2 (((UINT32) Op->Common.Value.Size));
|
|
|
|
|
|
|
|
/* Write every other byte as an ASCII character */
|
|
|
|
|
|
|
|
AcpiOsPrintf ("\"");
|
|
|
|
for (i = 0; i < (WordCount - 1); i++)
|
|
|
|
{
|
|
|
|
- OutputValue = (int) WordData[i];
|
|
|
|
+ OutputValue = (int) AcpiUtReadUint16(&WordData[i]);
|
|
|
|
|
|
|
|
/* Handle values that must be escaped */
|
|
|
|
|
|
|
|
diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c
|
|
|
|
index 1372a0f25..bb7abab2c 100644
|
|
|
|
--- a/source/components/disassembler/dmopcode.c
|
|
|
|
+++ b/source/components/disassembler/dmopcode.c
|
|
|
|
@@ -990,23 +990,23 @@ AcpiDmDisassembleOneOp (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
case AML_INT_NAMEDFIELD_OP:
|
|
|
|
|
|
|
|
- Length = AcpiDmDumpName (Op->Named.Name);
|
|
|
|
+ Length = AcpiDmDumpName (AcpiUtReadUint32(&Op->Named.Name));
|
|
|
|
|
|
|
|
AcpiOsPrintf (",");
|
|
|
|
ASL_CV_PRINT_ONE_COMMENT (Op, AML_NAMECOMMENT, NULL, 0);
|
|
|
|
AcpiOsPrintf ("%*.s %u", (unsigned) (5 - Length), " ",
|
|
|
|
- (UINT32) Op->Common.Value.Integer);
|
|
|
|
+ (UINT32) Op->Common.Value.Size);
|
|
|
|
|
|
|
|
AcpiDmCommaIfFieldMember (Op);
|
|
|
|
|
|
|
|
- Info->BitOffset += (UINT32) Op->Common.Value.Integer;
|
|
|
|
+ Info->BitOffset += (UINT32) Op->Common.Value.Size;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AML_INT_RESERVEDFIELD_OP:
|
|
|
|
|
|
|
|
/* Offset() -- Must account for previous offsets */
|
|
|
|
|
|
|
|
- Offset = (UINT32) Op->Common.Value.Integer;
|
|
|
|
+ Offset = (UINT32) Op->Common.Value.Size;
|
|
|
|
Info->BitOffset += Offset;
|
|
|
|
|
|
|
|
if (Info->BitOffset % 8 == 0)
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/components/disassembler/dmresrc.c b/source/components/disassembler/dmresrc.c
|
|
|
|
index a3403322b..af75a7833 100644
|
|
|
|
--- a/source/components/disassembler/dmresrc.c
|
|
|
|
+++ b/source/components/disassembler/dmresrc.c
|
|
|
|
@@ -525,7 +525,7 @@ AcpiDmIsResourceTemplate (
|
2020-10-19 18:24:09 +00:00
|
|
|
return (AE_TYPE);
|
|
|
|
}
|
|
|
|
|
|
|
|
- DeclaredBufferLength = NextOp->Common.Value.Size;
|
|
|
|
+ DeclaredBufferLength = NextOp->Common.Value.Integer;
|
|
|
|
|
|
|
|
/* Get the length of the raw initialization byte list */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/components/disassembler/dmresrcl.c b/source/components/disassembler/dmresrcl.c
|
|
|
|
index e9d391df3..eed859928 100644
|
|
|
|
--- a/source/components/disassembler/dmresrcl.c
|
|
|
|
+++ b/source/components/disassembler/dmresrcl.c
|
|
|
|
@@ -249,6 +249,8 @@ AcpiDmMemoryFields (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 Level)
|
|
|
|
{
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++)
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -259,14 +261,16 @@ AcpiDmMemoryFields (
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
case 16:
|
|
|
|
|
|
|
|
- AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
|
|
|
|
- AcpiDmMemoryNames[i]);
|
|
|
|
+ Tmp16 = ACPI_CAST_PTR (UINT16, Source)[i];
|
|
|
|
+ AcpiDmDumpInteger16 (AcpiUtReadUint16(&Tmp16),
|
|
|
|
+ AcpiDmMemoryNames[i]);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 32:
|
|
|
|
|
|
|
|
- AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
|
|
|
|
- AcpiDmMemoryNames[i]);
|
|
|
|
+ Tmp32 = ACPI_CAST_PTR (UINT32, Source)[i];
|
|
|
|
+ AcpiDmDumpInteger32 (AcpiUtReadUint32(&Tmp32),
|
|
|
|
+ AcpiDmMemoryNames[i]);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -298,6 +302,9 @@ AcpiDmAddressFields (
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 Level)
|
|
|
|
{
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
+ UINT32 Tmp32;
|
|
|
|
+ UINT64 Tmp64;
|
|
|
|
|
|
|
|
|
|
|
|
AcpiOsPrintf ("\n");
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -310,20 +317,23 @@ AcpiDmAddressFields (
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
case 16:
|
|
|
|
|
|
|
|
- AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
|
|
|
|
- AcpiDmAddressNames[i]);
|
|
|
|
+ Tmp16 = ACPI_CAST_PTR (UINT16, Source)[i];
|
|
|
|
+ AcpiDmDumpInteger16 (AcpiUtReadUint16(&Tmp16),
|
|
|
|
+ AcpiDmAddressNames[i]);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 32:
|
|
|
|
|
|
|
|
- AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
|
|
|
|
- AcpiDmAddressNames[i]);
|
|
|
|
+ Tmp32 = ACPI_CAST_PTR (UINT32, Source)[i];
|
|
|
|
+ AcpiDmDumpInteger32 (AcpiUtReadUint32(&Tmp32),
|
|
|
|
+ AcpiDmAddressNames[i]);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 64:
|
|
|
|
|
|
|
|
- AcpiDmDumpInteger64 (ACPI_CAST_PTR (UINT64, Source)[i],
|
|
|
|
- AcpiDmAddressNames[i]);
|
|
|
|
+ Tmp64 = ACPI_CAST_PTR (UINT64, Source)[i];
|
|
|
|
+ AcpiDmDumpInteger64 (AcpiUtReadUint64(&Tmp64),
|
|
|
|
+ AcpiDmAddressNames[i]);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -857,7 +867,7 @@ AcpiDmExtendedDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
/* Extra field for this descriptor only */
|
|
|
|
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
- AcpiDmDumpInteger64 (Resource->ExtAddress64.TypeSpecific,
|
|
|
|
+ AcpiDmDumpInteger64 (AcpiUtReadUint64(&Resource->ExtAddress64.TypeSpecific),
|
|
|
|
"Type-Specific Attributes");
|
|
|
|
|
|
|
|
/* Insert a descriptor name */
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -984,11 +994,11 @@ AcpiDmFixedMemory32Descriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->FixedMemory32.Flags)]);
|
|
|
|
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
- AcpiDmDumpInteger32 (Resource->FixedMemory32.Address,
|
|
|
|
+ AcpiDmDumpInteger32 (AcpiUtReadUint32(&Resource->FixedMemory32.Address),
|
|
|
|
"Address Base");
|
|
|
|
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
- AcpiDmDumpInteger32 (Resource->FixedMemory32.AddressLength,
|
|
|
|
+ AcpiDmDumpInteger32 (AcpiUtReadUint32(&Resource->FixedMemory32.AddressLength),
|
|
|
|
"Address Length");
|
|
|
|
|
|
|
|
/* Insert a descriptor name */
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1034,7 +1044,8 @@ AcpiDmGenericRegisterDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
AcpiDmDumpInteger8 (Resource->GenericReg.BitOffset, "Bit Offset");
|
|
|
|
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
- AcpiDmDumpInteger64 (Resource->GenericReg.Address, "Address");
|
|
|
|
+ AcpiDmDumpInteger64 (AcpiUtReadUint64(&Resource->GenericReg.Address),
|
|
|
|
+ "Address");
|
|
|
|
|
|
|
|
/* Optional field for ACPI 3.0 */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1097,7 +1108,7 @@ AcpiDmInterruptDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
AcpiDmResourceSource (Resource,
|
|
|
|
sizeof (AML_RESOURCE_EXTENDED_IRQ) +
|
|
|
|
((UINT32) Resource->ExtendedIrq.InterruptCount - 1) * sizeof (UINT32),
|
|
|
|
- Resource->ExtendedIrq.ResourceLength);
|
|
|
|
+ AcpiUtReadUint16(&Resource->ExtendedIrq.ResourceLength));
|
|
|
|
|
|
|
|
/* Insert a descriptor name */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -1112,7 +1123,7 @@ AcpiDmInterruptDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
AcpiOsPrintf ("0x%8.8X,\n",
|
|
|
|
- (UINT32) Resource->ExtendedIrq.Interrupts[i]);
|
|
|
|
+ AcpiUtReadUint32(&Resource->ExtendedIrq.Interrupts[i]));
|
|
|
|
}
|
|
|
|
|
|
|
|
AcpiDmIndent (Level);
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/components/disassembler/dmresrcl2.c b/source/components/disassembler/dmresrcl2.c
|
|
|
|
index a2a85dfdc..11c3af1af 100644
|
|
|
|
--- a/source/components/disassembler/dmresrcl2.c
|
|
|
|
+++ b/source/components/disassembler/dmresrcl2.c
|
|
|
|
@@ -299,22 +299,27 @@ AcpiDmGpioCommon (
|
2020-10-19 18:24:09 +00:00
|
|
|
char *DeviceName = NULL;
|
|
|
|
UINT32 PinCount;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 ResSourceOffset;
|
|
|
|
+ UINT16 VendorOffset;
|
|
|
|
+ UINT16 VendorLength;
|
2020-10-24 00:40:24 +00:00
|
|
|
+ UINT16 Tmp16;
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* ResourceSource, ResourceSourceIndex, ResourceType */
|
|
|
|
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
- if (Resource->Gpio.ResSourceOffset)
|
|
|
|
+ ResSourceOffset = AcpiUtReadUint16(&Resource->Gpio.ResSourceOffset);
|
|
|
|
+ if (ResSourceOffset)
|
|
|
|
{
|
|
|
|
DeviceName = ACPI_ADD_PTR (char,
|
|
|
|
- Resource, Resource->Gpio.ResSourceOffset),
|
|
|
|
+ Resource, ResSourceOffset),
|
|
|
|
AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
|
|
|
|
}
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
AcpiOsPrintf (", ");
|
|
|
|
AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.ResSourceIndex);
|
|
|
|
- AcpiOsPrintf ("%s, ",
|
|
|
|
- AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.Flags)]);
|
|
|
|
+ Tmp16 = AcpiUtReadUint16(&Resource->Gpio.Flags);
|
|
|
|
+ AcpiOsPrintf ("%s, ", AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Tmp16)]);
|
|
|
|
|
|
|
|
/* Insert a descriptor name */
|
|
|
|
|
|
|
|
@@ -323,15 +328,15 @@ AcpiDmGpioCommon (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Dump the vendor data */
|
|
|
|
|
|
|
|
- if (Resource->Gpio.VendorOffset)
|
|
|
|
+ VendorOffset = AcpiUtReadUint16(&Resource->Gpio.VendorOffset);
|
|
|
|
+ VendorLength = AcpiUtReadUint16(&Resource->Gpio.VendorLength);
|
|
|
|
+ if (VendorOffset)
|
|
|
|
{
|
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
- VendorData = ACPI_ADD_PTR (UINT8, Resource,
|
|
|
|
- Resource->Gpio.VendorOffset);
|
|
|
|
+ VendorData = ACPI_ADD_PTR (UINT8, Resource, VendorOffset);
|
|
|
|
|
|
|
|
- AcpiDmDumpRawDataBuffer (VendorData,
|
|
|
|
- Resource->Gpio.VendorLength, Level);
|
|
|
|
+ AcpiDmDumpRawDataBuffer (VendorData, VendorLength, Level);
|
|
|
|
}
|
|
|
|
|
|
|
|
AcpiOsPrintf (")\n");
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -341,17 +346,17 @@ AcpiDmGpioCommon (
|
2020-10-19 18:24:09 +00:00
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
AcpiOsPrintf ("{ // Pin list\n");
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
- PinCount = ((UINT32) (Resource->Gpio.ResSourceOffset -
|
|
|
|
- Resource->Gpio.PinTableOffset)) /
|
|
|
|
- sizeof (UINT16);
|
2020-10-19 18:24:09 +00:00
|
|
|
+ PinCount = (UINT32) AcpiUtReadUint16(&Resource->Gpio.ResSourceOffset);
|
|
|
|
+ PinCount -= (UINT32) AcpiUtReadUint16(&Resource->Gpio.PinTableOffset);
|
|
|
|
+ PinCount /= sizeof (UINT16);
|
|
|
|
|
|
|
|
PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
|
|
|
|
- Resource->Gpio.PinTableOffset);
|
|
|
|
+ AcpiUtReadUint16(&Resource->Gpio.PinTableOffset));
|
|
|
|
|
|
|
|
for (i = 0; i < PinCount; i++)
|
|
|
|
{
|
|
|
|
AcpiDmIndent (Level + 2);
|
|
|
|
- AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
|
|
|
|
+ AcpiOsPrintf ("0x%4.4X%s\n", AcpiUtReadUint16(&(PinList[i])),
|
|
|
|
((i + 1) < PinCount) ? "," : "");
|
|
|
|
}
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -385,16 +390,18 @@ AcpiDmGpioIntDescriptor (
|
|
|
|
UINT32 Length,
|
|
|
|
UINT32 Level)
|
|
|
|
{
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
/* Dump the GpioInt-specific portion of the descriptor */
|
|
|
|
|
|
|
|
/* EdgeLevel, ActiveLevel, Shared */
|
|
|
|
|
|
|
|
AcpiDmIndent (Level);
|
|
|
|
+ Tmp16 = AcpiUtReadUint16(&Resource->Gpio.IntFlags);
|
|
|
|
AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
|
|
|
|
- AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)],
|
|
|
|
- AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 1)],
|
|
|
|
- AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
|
|
|
|
+ AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Tmp16)],
|
|
|
|
+ AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Tmp16, 1)],
|
|
|
|
+ AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Tmp16, 3)]);
|
|
|
|
|
|
|
|
/* PinConfig, DebounceTimeout */
|
|
|
|
|
|
|
|
@@ -407,7 +414,8 @@ AcpiDmGpioIntDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.PinConfig);
|
|
|
|
}
|
|
|
|
- AcpiOsPrintf ("0x%4.4X,\n", Resource->Gpio.DebounceTimeout);
|
|
|
|
+ AcpiOsPrintf ("0x%4.4X,\n",
|
|
|
|
+ AcpiUtReadUint16(&Resource->Gpio.DebounceTimeout));
|
|
|
|
|
|
|
|
/* Dump the GpioInt/GpioIo common portion of the descriptor */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -437,14 +445,16 @@ AcpiDmGpioIoDescriptor (
|
|
|
|
UINT32 Length,
|
|
|
|
UINT32 Level)
|
|
|
|
{
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
/* Dump the GpioIo-specific portion of the descriptor */
|
|
|
|
|
|
|
|
/* Shared, PinConfig */
|
|
|
|
|
|
|
|
AcpiDmIndent (Level);
|
|
|
|
+ Tmp16 = AcpiUtReadUint16(&Resource->Gpio.IntFlags);
|
|
|
|
AcpiOsPrintf ("GpioIo (%s, ",
|
|
|
|
- AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
|
|
|
|
+ AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Tmp16, 3)]);
|
|
|
|
|
|
|
|
if (Resource->Gpio.PinConfig <= 3)
|
|
|
|
{
|
|
|
|
@@ -458,10 +468,10 @@ AcpiDmGpioIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* DebounceTimeout, DriveStrength, IoRestriction */
|
|
|
|
|
|
|
|
- AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DebounceTimeout);
|
|
|
|
- AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DriveStrength);
|
2020-10-24 00:40:24 +00:00
|
|
|
- AcpiOsPrintf ("%s,\n",
|
|
|
|
- AcpiGbl_IorDecode [ACPI_GET_2BIT_FLAG (Resource->Gpio.IntFlags)]);
|
2020-10-19 18:24:09 +00:00
|
|
|
+ AcpiOsPrintf ("0x%4.4X, ", AcpiUtReadUint16(&Resource->Gpio.DebounceTimeout));
|
|
|
|
+ AcpiOsPrintf ("0x%4.4X, ", AcpiUtReadUint16(&Resource->Gpio.DriveStrength));
|
2020-10-24 00:40:24 +00:00
|
|
|
+ Tmp16 = AcpiUtReadUint16(&Resource->Gpio.IntFlags);
|
|
|
|
+ AcpiOsPrintf ("%s,\n", AcpiGbl_IorDecode [ACPI_GET_2BIT_FLAG (Tmp16)]);
|
|
|
|
|
|
|
|
/* Dump the GpioInt/GpioIo common portion of the descriptor */
|
2020-10-19 18:24:09 +00:00
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -542,6 +552,9 @@ AcpiDmPinFunctionDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
char *DeviceName = NULL;
|
|
|
|
UINT32 PinCount;
|
|
|
|
UINT32 i;
|
|
|
|
+ UINT16 ResSourceOffset;
|
|
|
|
+ UINT16 VendorOffset;
|
|
|
|
+ UINT16 VendorLength;
|
|
|
|
|
|
|
|
AcpiDmIndent (Level);
|
|
|
|
AcpiOsPrintf ("PinFunction (%s, ",
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -559,12 +572,14 @@ AcpiDmPinFunctionDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* FunctionNumber */
|
|
|
|
|
|
|
|
- AcpiOsPrintf ("0x%4.4X, ", Resource->PinFunction.FunctionNumber);
|
|
|
|
+ AcpiOsPrintf ("0x%4.4X, ",
|
|
|
|
+ AcpiUtReadUint16(&Resource->PinFunction.FunctionNumber));
|
|
|
|
|
|
|
|
- if (Resource->PinFunction.ResSourceOffset)
|
|
|
|
+ ResSourceOffset = AcpiUtReadUint16(&Resource->PinFunction.ResSourceOffset);
|
|
|
|
+ if (ResSourceOffset)
|
|
|
|
{
|
|
|
|
DeviceName = ACPI_ADD_PTR (char,
|
|
|
|
- Resource, Resource->PinFunction.ResSourceOffset),
|
|
|
|
+ Resource, ResSourceOffset),
|
|
|
|
AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
|
|
|
|
}
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -584,15 +599,15 @@ AcpiDmPinFunctionDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Dump the vendor data */
|
|
|
|
|
|
|
|
- if (Resource->PinFunction.VendorLength)
|
|
|
|
+ VendorOffset = AcpiUtReadUint16(&Resource->PinFunction.VendorOffset);
|
|
|
|
+ VendorLength = AcpiUtReadUint16(&Resource->PinFunction.VendorLength);
|
|
|
|
+ if (VendorLength)
|
|
|
|
{
|
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
- VendorData = ACPI_ADD_PTR (UINT8, Resource,
|
|
|
|
- Resource->PinFunction.VendorOffset);
|
|
|
|
+ VendorData = ACPI_ADD_PTR (UINT8, Resource, VendorOffset);
|
|
|
|
|
|
|
|
- AcpiDmDumpRawDataBuffer (VendorData,
|
|
|
|
- Resource->PinFunction.VendorLength, Level);
|
|
|
|
+ AcpiDmDumpRawDataBuffer (VendorData, VendorLength, Level);
|
|
|
|
}
|
|
|
|
|
|
|
|
AcpiOsPrintf (")\n");
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -603,17 +618,17 @@ AcpiDmPinFunctionDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
AcpiOsPrintf ("{ // Pin list\n");
|
|
|
|
|
|
|
|
- PinCount = ((UINT32) (Resource->PinFunction.ResSourceOffset -
|
|
|
|
- Resource->PinFunction.PinTableOffset)) /
|
|
|
|
- sizeof (UINT16);
|
|
|
|
+ PinCount = AcpiUtReadUint16(&Resource->PinFunction.ResSourceOffset);
|
|
|
|
+ PinCount -= AcpiUtReadUint16(&Resource->PinFunction.PinTableOffset);
|
|
|
|
+ PinCount /= sizeof (UINT16);
|
|
|
|
|
|
|
|
PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
|
|
|
|
- Resource->PinFunction.PinTableOffset);
|
|
|
|
+ AcpiUtReadUint16(&Resource->PinFunction.PinTableOffset));
|
|
|
|
|
|
|
|
for (i = 0; i < PinCount; i++)
|
|
|
|
{
|
|
|
|
AcpiDmIndent (Level + 2);
|
|
|
|
- AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
|
|
|
|
+ AcpiOsPrintf ("0x%4.4X%s\n", AcpiUtReadUint16(&(PinList[i])),
|
|
|
|
((i + 1) < PinCount) ? "," : "");
|
|
|
|
}
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -649,7 +664,8 @@ AcpiDmDumpSerialBusVendorData (
|
|
|
|
{
|
|
|
|
case AML_RESOURCE_I2C_SERIALBUSTYPE:
|
|
|
|
|
|
|
|
- VendorLength = Resource->CommonSerialBus.TypeDataLength -
|
|
|
|
+ VendorLength =
|
|
|
|
+ AcpiUtReadUint16(&Resource->CommonSerialBus.TypeDataLength) -
|
|
|
|
AML_RESOURCE_I2C_MIN_DATA_LEN;
|
|
|
|
|
|
|
|
VendorData = ACPI_ADD_PTR (UINT8, Resource,
|
|
|
|
@@ -658,7 +674,8 @@ AcpiDmDumpSerialBusVendorData (
|
|
|
|
|
|
|
|
case AML_RESOURCE_SPI_SERIALBUSTYPE:
|
|
|
|
|
|
|
|
- VendorLength = Resource->CommonSerialBus.TypeDataLength -
|
|
|
|
+ VendorLength =
|
|
|
|
+ AcpiUtReadUint16(&Resource->CommonSerialBus.TypeDataLength) -
|
|
|
|
AML_RESOURCE_SPI_MIN_DATA_LEN;
|
|
|
|
|
|
|
|
VendorData = ACPI_ADD_PTR (UINT8, Resource,
|
|
|
|
@@ -667,7 +684,8 @@ AcpiDmDumpSerialBusVendorData (
|
|
|
|
|
|
|
|
case AML_RESOURCE_UART_SERIALBUSTYPE:
|
|
|
|
|
|
|
|
- VendorLength = Resource->CommonSerialBus.TypeDataLength -
|
|
|
|
+ VendorLength =
|
|
|
|
+ AcpiUtReadUint16(&Resource->CommonSerialBus.TypeDataLength) -
|
|
|
|
AML_RESOURCE_UART_MIN_DATA_LEN;
|
|
|
|
|
|
|
|
VendorData = ACPI_ADD_PTR (UINT8, Resource,
|
|
|
|
@@ -715,9 +733,9 @@ AcpiDmI2cSerialBusDescriptor (
|
|
|
|
|
|
|
|
AcpiDmIndent (Level);
|
|
|
|
AcpiOsPrintf ("I2cSerialBusV2 (0x%4.4X, %s, 0x%8.8X,\n",
|
|
|
|
- Resource->I2cSerialBus.SlaveAddress,
|
|
|
|
+ AcpiUtReadUint16(&Resource->I2cSerialBus.SlaveAddress),
|
|
|
|
AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.Flags)],
|
|
|
|
- Resource->I2cSerialBus.ConnectionSpeed);
|
|
|
|
+ AcpiUtReadUint32(&Resource->I2cSerialBus.ConnectionSpeed));
|
|
|
|
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
AcpiOsPrintf ("%s, ",
|
|
|
|
@@ -726,7 +744,7 @@ AcpiDmI2cSerialBusDescriptor (
|
|
|
|
/* ResourceSource is a required field */
|
|
|
|
|
|
|
|
ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
|
|
|
|
- Resource->CommonSerialBus.TypeDataLength;
|
|
|
|
+ AcpiUtReadUint16(&Resource->CommonSerialBus.TypeDataLength);
|
|
|
|
|
|
|
|
DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
|
|
|
|
AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
|
|
|
|
@@ -783,15 +801,17 @@ AcpiDmSpiSerialBusDescriptor (
|
|
|
|
{
|
|
|
|
UINT32 ResourceSourceOffset;
|
|
|
|
char *DeviceName;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
/* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */
|
|
|
|
|
|
|
|
AcpiDmIndent (Level);
|
|
|
|
+ Tmp16 = AcpiUtReadUint16(&Resource->SpiSerialBus.TypeSpecificFlags);
|
|
|
|
AcpiOsPrintf ("SpiSerialBusV2 (0x%4.4X, %s, %s, 0x%2.2X,\n",
|
|
|
|
- Resource->SpiSerialBus.DeviceSelection,
|
|
|
|
- AcpiGbl_DpDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags, 1)],
|
|
|
|
- AcpiGbl_WmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags)],
|
|
|
|
+ AcpiUtReadUint16(&Resource->SpiSerialBus.DeviceSelection),
|
|
|
|
+ AcpiGbl_DpDecode [ACPI_EXTRACT_1BIT_FLAG (Tmp16, 1)],
|
|
|
|
+ AcpiGbl_WmDecode [ACPI_GET_1BIT_FLAG (Tmp16)],
|
|
|
|
Resource->SpiSerialBus.DataBitLength);
|
|
|
|
|
|
|
|
/* SlaveMode, ConnectionSpeed, ClockPolarity, ClockPhase */
|
|
|
|
@@ -799,7 +819,7 @@ AcpiDmSpiSerialBusDescriptor (
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
AcpiOsPrintf ("%s, 0x%8.8X, %s,\n",
|
|
|
|
AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.Flags)],
|
|
|
|
- Resource->SpiSerialBus.ConnectionSpeed,
|
|
|
|
+ AcpiUtReadUint32(&Resource->SpiSerialBus.ConnectionSpeed),
|
|
|
|
AcpiGbl_CpoDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPolarity)]);
|
|
|
|
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
@@ -809,7 +829,7 @@ AcpiDmSpiSerialBusDescriptor (
|
|
|
|
/* ResourceSource is a required field */
|
|
|
|
|
|
|
|
ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
|
|
|
|
- Resource->CommonSerialBus.TypeDataLength;
|
|
|
|
+ AcpiUtReadUint16(&Resource->CommonSerialBus.TypeDataLength);
|
|
|
|
|
|
|
|
DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
|
|
|
|
AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
|
|
|
|
@@ -866,15 +886,17 @@ AcpiDmUartSerialBusDescriptor (
|
|
|
|
{
|
|
|
|
UINT32 ResourceSourceOffset;
|
|
|
|
char *DeviceName;
|
|
|
|
+ UINT16 Tmp16;
|
|
|
|
|
|
|
|
|
|
|
|
/* ConnectionSpeed, BitsPerByte, StopBits */
|
|
|
|
|
|
|
|
AcpiDmIndent (Level);
|
|
|
|
+ Tmp16 = AcpiUtReadUint16(&Resource->UartSerialBus.TypeSpecificFlags);
|
|
|
|
AcpiOsPrintf ("UartSerialBusV2 (0x%8.8X, %s, %s,\n",
|
|
|
|
- Resource->UartSerialBus.DefaultBaudRate,
|
|
|
|
- AcpiGbl_BpbDecode [ACPI_EXTRACT_3BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 4)],
|
|
|
|
- AcpiGbl_SbDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 2)]);
|
|
|
|
+ AcpiUtReadUint32(&Resource->UartSerialBus.DefaultBaudRate),
|
|
|
|
+ AcpiGbl_BpbDecode [ACPI_EXTRACT_3BIT_FLAG (Tmp16, 4)],
|
|
|
|
+ AcpiGbl_SbDecode [ACPI_EXTRACT_2BIT_FLAG (Tmp16, 2)]);
|
|
|
|
|
|
|
|
/* LinesInUse, IsBigEndian, Parity, FlowControl */
|
|
|
|
|
|
|
|
@@ -889,13 +911,13 @@ AcpiDmUartSerialBusDescriptor (
|
|
|
|
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
AcpiOsPrintf ("0x%4.4X, 0x%4.4X, ",
|
|
|
|
- Resource->UartSerialBus.RxFifoSize,
|
|
|
|
- Resource->UartSerialBus.TxFifoSize);
|
|
|
|
+ AcpiUtReadUint16(&Resource->UartSerialBus.RxFifoSize),
|
|
|
|
+ AcpiUtReadUint16(&Resource->UartSerialBus.TxFifoSize));
|
|
|
|
|
|
|
|
/* ResourceSource is a required field */
|
|
|
|
|
|
|
|
ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
|
|
|
|
- Resource->CommonSerialBus.TypeDataLength;
|
|
|
|
+ AcpiUtReadUint16(&Resource->CommonSerialBus.TypeDataLength);
|
|
|
|
|
|
|
|
DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset);
|
|
|
|
AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
|
|
|
|
diff --git a/source/components/disassembler/dmresrcs.c b/source/components/disassembler/dmresrcs.c
|
|
|
|
index 5f5c7edaf..21d397637 100644
|
|
|
|
--- a/source/components/disassembler/dmresrcs.c
|
|
|
|
+++ b/source/components/disassembler/dmresrcs.c
|
|
|
|
@@ -201,7 +201,7 @@ AcpiDmIrqDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
AcpiOsPrintf (")\n");
|
|
|
|
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
- AcpiDmBitList (Resource->Irq.IrqMask);
|
|
|
|
+ AcpiDmBitList (AcpiUtReadUint16(&Resource->Irq.IrqMask));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -269,8 +269,8 @@ AcpiDmFixedDmaDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
AcpiDmIndent (Level);
|
|
|
|
AcpiOsPrintf ("FixedDMA (0x%4.4X, 0x%4.4X, ",
|
|
|
|
- Resource->FixedDma.RequestLines,
|
|
|
|
- Resource->FixedDma.Channels);
|
|
|
|
+ AcpiUtReadUint16(&Resource->FixedDma.RequestLines),
|
|
|
|
+ AcpiUtReadUint16(&Resource->FixedDma.Channels));
|
|
|
|
|
|
|
|
if (Resource->FixedDma.Width <= 5)
|
|
|
|
{
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -318,10 +318,12 @@ AcpiDmIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
AcpiGbl_IoDecode [ACPI_GET_1BIT_FLAG (Resource->Io.Flags)]);
|
|
|
|
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
- AcpiDmDumpInteger16 (Resource->Io.Minimum, "Range Minimum");
|
|
|
|
+ AcpiDmDumpInteger16 (AcpiUtReadUint16(&Resource->Io.Minimum),
|
|
|
|
+ "Range Minimum");
|
|
|
|
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
- AcpiDmDumpInteger16 (Resource->Io.Maximum, "Range Maximum");
|
|
|
|
+ AcpiDmDumpInteger16 (AcpiUtReadUint16(&Resource->Io.Maximum),
|
|
|
|
+ "Range Maximum");
|
|
|
|
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
AcpiDmDumpInteger8 (Resource->Io.Alignment, "Alignment");
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -364,10 +366,12 @@ AcpiDmFixedIoDescriptor (
|
2020-10-19 18:24:09 +00:00
|
|
|
AcpiOsPrintf ("FixedIO (\n");
|
|
|
|
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
- AcpiDmDumpInteger16 (Resource->FixedIo.Address, "Address");
|
|
|
|
+ AcpiDmDumpInteger16 (AcpiUtReadUint16(&Resource->FixedIo.Address),
|
|
|
|
+ "Address");
|
|
|
|
|
|
|
|
AcpiDmIndent (Level + 1);
|
|
|
|
- AcpiDmDumpInteger8 (Resource->FixedIo.AddressLength, "Length");
|
|
|
|
+ AcpiDmDumpInteger8 (AcpiUtReadUint16(&Resource->FixedIo.AddressLength),
|
|
|
|
+ "Length");
|
|
|
|
|
|
|
|
/* Insert a descriptor name */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c
|
|
|
|
index 76ef0aacb..069c11fbb 100644
|
|
|
|
--- a/source/components/disassembler/dmwalk.c
|
|
|
|
+++ b/source/components/disassembler/dmwalk.c
|
|
|
|
@@ -1263,7 +1263,7 @@ AcpiDmAscendingOp (
|
|
|
|
{
|
|
|
|
ParentOp->Common.DisasmFlags |= ACPI_PARSEOP_EMPTY_TERMLIST;
|
|
|
|
ASL_CV_CLOSE_PAREN (Op, Level);
|
|
|
|
- AcpiOsPrintf ("{");
|
|
|
|
+ AcpiOsPrintf (" {");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/source/components/dispatcher/dsfield.c b/source/components/dispatcher/dsfield.c
|
|
|
|
index f41990780..937c1e9f5 100644
|
|
|
|
--- a/source/components/dispatcher/dsfield.c
|
|
|
|
+++ b/source/components/dispatcher/dsfield.c
|
|
|
|
@@ -444,6 +444,8 @@ AcpiDsGetFieldNames (
|
2020-10-19 18:24:09 +00:00
|
|
|
char *NamePath;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+ char TmpName[ACPI_NAMESEG_SIZE+1];
|
|
|
|
+
|
|
|
|
|
|
|
|
ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info);
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -550,14 +552,17 @@ AcpiDsGetFieldNames (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Lookup the name, it should already exist */
|
|
|
|
|
|
|
|
+ memset(TmpName, 0, ACPI_NAMESEG_SIZE+1);
|
|
|
|
+ AcpiUtWriteUint(TmpName, ACPI_NAMESEG_SIZE,
|
|
|
|
+ &Arg->Named.Name, ACPI_NAMESEG_SIZE);
|
|
|
|
Status = AcpiNsLookup (WalkState->ScopeInfo,
|
|
|
|
- (char *) &Arg->Named.Name, Info->FieldType,
|
|
|
|
+ TmpName, Info->FieldType,
|
|
|
|
ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
|
|
|
|
WalkState, &Info->FieldNode);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
|
|
|
|
- (char *) &Arg->Named.Name, Status);
|
|
|
|
+ TmpName, Status);
|
|
|
|
return_ACPI_STATUS (Status);
|
|
|
|
}
|
|
|
|
else
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -811,8 +816,13 @@ AcpiDsInitFieldObjects (
|
2020-10-19 18:24:09 +00:00
|
|
|
*/
|
|
|
|
if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
|
|
|
|
{
|
|
|
|
+ char Tmp[ACPI_NAMESEG_SIZE+1];
|
|
|
|
+
|
|
|
|
+ memset(&Tmp, 0, ACPI_NAMESEG_SIZE+1);
|
|
|
|
+ AcpiUtWriteUint(&Tmp, ACPI_NAMESEG_SIZE,
|
|
|
|
+ &Arg->Named.Name, ACPI_NAMESEG_SIZE);
|
|
|
|
Status = AcpiNsLookup (WalkState->ScopeInfo,
|
|
|
|
- (char *) &Arg->Named.Name, Type, ACPI_IMODE_LOAD_PASS1,
|
|
|
|
+ Tmp, Type, ACPI_IMODE_LOAD_PASS1,
|
|
|
|
Flags, WalkState, &Node);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/components/namespace/nsaccess.c b/source/components/namespace/nsaccess.c
|
|
|
|
index f9227ee4d..55e768698 100644
|
|
|
|
--- a/source/components/namespace/nsaccess.c
|
|
|
|
+++ b/source/components/namespace/nsaccess.c
|
|
|
|
@@ -753,7 +753,7 @@ AcpiNsLookup (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Extract one ACPI name from the front of the pathname */
|
|
|
|
|
|
|
|
- ACPI_MOVE_32_TO_32 (&SimpleName, Path);
|
|
|
|
+ ACPI_COPY_NAMESEG (&SimpleName, Path);
|
|
|
|
|
|
|
|
/* Try to find the single (4 character) ACPI name */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/components/namespace/nsnames.c b/source/components/namespace/nsnames.c
|
|
|
|
index a27a87f02..16202ce32 100644
|
|
|
|
--- a/source/components/namespace/nsnames.c
|
|
|
|
+++ b/source/components/namespace/nsnames.c
|
|
|
|
@@ -408,7 +408,7 @@ AcpiNsBuildNormalizedPath (
|
2020-10-19 18:24:09 +00:00
|
|
|
ACPI_PATH_PUT8(FullPath, PathSize, AML_DUAL_NAME_PREFIX, Length);
|
|
|
|
}
|
|
|
|
|
|
|
|
- ACPI_MOVE_32_TO_32 (Name, &NextNode->Name);
|
|
|
|
+ ACPI_COPY_NAMESEG (Name, &NextNode->Name);
|
|
|
|
DoNoTrailing = NoTrailing;
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
{
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/components/namespace/nsparse.c b/source/components/namespace/nsparse.c
|
|
|
|
index f10db0e4d..a5cb221aa 100644
|
|
|
|
--- a/source/components/namespace/nsparse.c
|
|
|
|
+++ b/source/components/namespace/nsparse.c
|
|
|
|
@@ -311,6 +311,7 @@ AcpiNsOneCompleteParse (
|
2020-10-19 18:24:09 +00:00
|
|
|
ACPI_WALK_STATE *WalkState;
|
|
|
|
ACPI_TABLE_HEADER *Table;
|
|
|
|
ACPI_OWNER_ID OwnerId;
|
|
|
|
+ UINT32 TableLength;
|
|
|
|
|
|
|
|
|
|
|
|
ACPI_FUNCTION_TRACE (NsOneCompleteParse);
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -324,13 +325,14 @@ AcpiNsOneCompleteParse (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Table must consist of at least a complete header */
|
|
|
|
|
|
|
|
- if (Table->Length < sizeof (ACPI_TABLE_HEADER))
|
|
|
|
+ TableLength = AcpiUtReadUint32(&Table->Length);
|
|
|
|
+ if (TableLength < sizeof (ACPI_TABLE_HEADER))
|
|
|
|
{
|
|
|
|
return_ACPI_STATUS (AE_BAD_HEADER);
|
|
|
|
}
|
|
|
|
|
|
|
|
AmlStart = (UINT8 *) Table + sizeof (ACPI_TABLE_HEADER);
|
|
|
|
- AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
|
|
|
|
+ AmlLength = TableLength - sizeof (ACPI_TABLE_HEADER);
|
|
|
|
|
|
|
|
Status = AcpiTbGetOwnerId (TableIndex, &OwnerId);
|
|
|
|
if (ACPI_FAILURE (Status))
|
2020-10-24 00:40:24 +00:00
|
|
|
diff --git a/source/components/namespace/nsutils.c b/source/components/namespace/nsutils.c
|
|
|
|
index a74dd1299..6df0d087d 100644
|
|
|
|
--- a/source/components/namespace/nsutils.c
|
|
|
|
+++ b/source/components/namespace/nsutils.c
|
|
|
|
@@ -380,7 +380,6 @@ AcpiNsBuildInternalName (
|
2020-10-19 18:24:09 +00:00
|
|
|
const char *ExternalName = Info->NextExternalChar;
|
|
|
|
char *Result = NULL;
|
|
|
|
UINT32 i;
|
|
|
|
- char TmpSeg[ACPI_NAMESEG_SIZE+1];
|
|
|
|
|
|
|
|
|
|
|
|
ACPI_FUNCTION_TRACE (NsBuildInternalName);
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -444,7 +443,6 @@ AcpiNsBuildInternalName (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
for (; NumSegments; NumSegments--)
|
|
|
|
{
|
|
|
|
- memset(TmpSeg, 0, ACPI_NAMESEG_SIZE+1);
|
|
|
|
for (i = 0; i < ACPI_NAMESEG_SIZE; i++)
|
|
|
|
{
|
|
|
|
if (ACPI_IS_PATH_SEPARATOR (*ExternalName) ||
|
2020-10-24 00:40:24 +00:00
|
|
|
@@ -452,17 +450,16 @@ AcpiNsBuildInternalName (
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
/* Pad the segment with underscore(s) if segment is short */
|
|
|
|
|
|
|
|
- TmpSeg[i] = '_';
|
|
|
|
+ Result[i] = '_';
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Convert the character to uppercase and save it */
|
|
|
|
|
|
|
|
- TmpSeg[i] = (char) toupper ((int) *ExternalName);
|
|
|
|
+ Result[i] = (char) toupper ((int) *ExternalName);
|
|
|
|
ExternalName++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- AcpiUtWriteUint(Result, ACPI_NAMESEG_SIZE, TmpSeg, ACPI_NAMESEG_SIZE);
|
|
|
|
|
|
|
|
/* Now we must have a path separator, or the pathname is bad */
|
|
|
|
|
2020-10-24 00:40:24 +00:00
|
|
|
--
|
|
|
|
2.26.2
|
|
|
|
|