Compare commits

...

10 Commits

Author SHA1 Message Date
Dean Nelson 31e6d9194b Fix big-endian related CEDT table errors 2023-05-18 09:54:42 +00:00
Dean Nelson ede2ebacb1 Remove a duplicate of ACPI_SIG_CEDT
Bugzilla: https://bugzilla.redhat.com/2123131
Upstream Status: https://github.com/acpica/acpica.git

commit 7021087eedb0d7156286e9e4f255e93c07816921
Author: Robert Moore <Robert.Moore@intel.com>
Date:   Fri Aug 26 12:20:07 2022 -0700

    Remove a duplicate of ACPI_SIG_CEDT

Resolves: rhbz#2123131

Signed-off-by: Dean Nelson <dnelson@redhat.com>
2022-10-07 08:57:10 -05:00
Dean Nelson 33f3860c17 Automated cleanup; No functional changes
Bugzilla: https://bugzilla.redhat.com/2123131
Upstream Status: https://github.com/acpica/acpica.git
Conflicts: Only the changes to CEDT-related code was backported due to
           unbackported acpica commits required for a full backport.

commit 0914618b553d6f3366e568409cebf2656891ca69
Author: Robert Moore <Robert.Moore@intel.com>
Date:   Thu Feb 17 14:24:24 2022 -0800

    Automated cleanup; No functional changes
    Removed some tabs and // comments.

Resolves: rhbz#2123131

Signed-off-by: Dean Nelson <dnelson@redhat.com>
2022-10-07 08:57:09 -05:00
Dean Nelson a81ccf7592 Fix Compile issue with CEDT and add template
Bugzilla: https://bugzilla.redhat.com/2123131
Upstream Status: https://github.com/acpica/acpica.git

commit d9798f5275bb20ab88ac854ba04e6e3bdb22cf6d
Author: Lawrence Hileman <larry.hileman@xconn-tech.com>
Date:   Mon Jan 17 15:24:34 2022 -0800

    Fix Compile issue with CEDT and add template

Resolves: rhbz#2123131

Signed-off-by: Dean Nelson <dnelson@redhat.com>
2022-10-07 08:57:08 -05:00
Dean Nelson cea3f775d1 Add the subtable CFMWS to the CEDT table
Bugzilla: https://bugzilla.redhat.com/2123131
Upstream Status: https://github.com/acpica/acpica.git

commit 19b11f91660b1a38a8e9655b0b1a4ad51ec4db1e
Author: Lawrence Hileman <larry.hileman@xconn-tech.com>
Date:   Fri Jan 7 16:33:40 2022 -0800

    Add the subtable CFMWS to the CEDT table

Resolves: rhbz#2123131

Signed-off-by: Dean Nelson <dnelson@redhat.com>
2022-10-07 08:57:05 -05:00
Dean Nelson 769eed98e3 Fix big-endian related prmt.asl compiler errors
Bugzilla: https://bugzilla.redhat.com/2065349

Running 'iasl -T prmt ; iasl prmt.asl' results in the compilation aborting due
to parser-detected syntax errors, which are big-endian related. This only
occurs on s390x systems.

Resolves: rhbz#2065349

Signed-off-by: Dean Nelson <dnelson@redhat.com>

---
2022-10-03 12:23:58 -05:00
Dean Nelson a9069d4ba2 Backport big-endian patches for PRMT, RGRT, and SVKL
Bugzilla: https://bugzilla.redhat.com/2065349
Upstream Status: https://src.fedoraproject.org/rpms/acpica-tools.git
Conflicts: Partial backport of only big-endian patches for PRMT, RGRT, and SVKL
           tables. This required some adjustments since RHEL-9 is based on
           acpica release 20210604, whereas Fedora is based on 20220331.

commit fc3eef63e813ae93feb4ceb7316ceab1ea3f1f35
Author: Al Stone <ahs3@redhat.com>
Date:   Sun Apr 3 15:18:02 2022 -0600

    Update to 20220331 upstream sources

    This includes new source tarballs, updated patches, and updated
    expected results for test cases.  In addition, three new tables
    (PRMT, RGRT and SVKL) now have big-endian support.

    Signed-off-by: Al Stone <ahs3@redhat.com>

Resolves: rhbz#2065349

Signed-off-by: Dean Nelson <dnelson@redhat.com>
2022-10-03 12:18:22 -05:00
Jim Bair 9f9752a432 Instruct rpminspect to allow a patch to modify up to 30 files
Signed-off-by: Jim Bair <jbair@redhat.com>
2022-02-10 11:40:29 -06:00
Mohan Boddu 17919e6e4c Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
Signed-off-by: Mohan Boddu <mboddu@redhat.com>
2021-08-09 19:18:07 +00:00
Al Stone 28e5ed7ff9 Fix WPBT processing of zero-length argument lists
Resolves: rhbz#1967794

Signed-off-by: Al Stone <ahs3@redhat.com>
2021-08-04 17:37:53 -05:00
12 changed files with 973 additions and 1 deletions

2
.acpica-tools.metadata Normal file
View File

@ -0,0 +1,2 @@
5b87f09fecda40cb089bdeb83e3a01d7615617dd acpica-unix2-20210604.tar_0.gz
1085e6c2a793cb2e3aca94c420e8300afe9eae59 acpitests-unix-20210604.tar.gz

View File

@ -0,0 +1,74 @@
Signed-off-by: Dean Nelson <dnelson@redhat.com>
Reviewed-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 11 ++++++-----
source/compiler/dttable2.c | 4 ++--
2 files changed, 8 insertions(+), 7 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -1959,13 +1959,14 @@ AcpiDmDumpPrmt (
ACPI_PRMT_MODULE_INFO *PrmtModuleInfo;
ACPI_PRMT_HANDLER_INFO *PrmtHandlerInfo;
ACPI_STATUS Status;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
UINT32 i, j;
/* Main table header */
PrmtHeader = ACPI_ADD_PTR (ACPI_TABLE_PRMT_HEADER, Table, CurrentOffset);
- Status = AcpiDmDumpTable (Table->Length, CurrentOffset, PrmtHeader,
+ Status = AcpiDmDumpTable (TableLength, CurrentOffset, PrmtHeader,
sizeof (ACPI_TABLE_PRMT_HEADER), AcpiDmTableInfoPrmtHdr);
if (ACPI_FAILURE (Status))
{
@@ -1977,20 +1978,20 @@ AcpiDmDumpPrmt (
/* PRM Module Information Structure array */
- for (i = 0; i < PrmtHeader->ModuleInfoCount; ++i)
+ for (i = 0; i < AcpiUtReadUint32 (&PrmtHeader->ModuleInfoCount); ++i)
{
PrmtModuleInfo = ACPI_ADD_PTR (ACPI_PRMT_MODULE_INFO, Table, CurrentOffset);
- Status = AcpiDmDumpTable (Table->Length, CurrentOffset, PrmtModuleInfo,
+ Status = AcpiDmDumpTable (TableLength, CurrentOffset, PrmtModuleInfo,
sizeof (ACPI_PRMT_MODULE_INFO), AcpiDmTableInfoPrmtModule);
CurrentOffset += sizeof (ACPI_PRMT_MODULE_INFO);
/* PRM handler information structure array */
- for (j = 0; j < PrmtModuleInfo->HandlerInfoCount; ++j)
+ for (j = 0; j < AcpiUtReadUint16 (&PrmtModuleInfo->HandlerInfoCount); ++j)
{
PrmtHandlerInfo = ACPI_ADD_PTR (ACPI_PRMT_HANDLER_INFO, Table, CurrentOffset);
- Status = AcpiDmDumpTable (Table->Length, CurrentOffset, PrmtHandlerInfo,
+ Status = AcpiDmDumpTable (TableLength, CurrentOffset, PrmtHandlerInfo,
sizeof (ACPI_PRMT_HANDLER_INFO), AcpiDmTableInfoPrmtHandler);
CurrentOffset += sizeof (ACPI_PRMT_HANDLER_INFO);
Index: acpica-unix2-20210604/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
+++ acpica-unix2-20210604/source/compiler/dttable2.c
@@ -1278,7 +1278,7 @@ DtCompilePrmt (
DtInsertSubtable (ParentTable, Subtable);
PrmtHeader = ACPI_CAST_PTR (ACPI_TABLE_PRMT_HEADER, Subtable->Buffer);
- for (i = 0; i < PrmtHeader->ModuleInfoCount; i++)
+ for (i = 0; i < AcpiUtReadUint32 (&PrmtHeader->ModuleInfoCount); i++)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoPrmtModule,
&Subtable);
@@ -1289,7 +1289,7 @@ DtCompilePrmt (
DtInsertSubtable (ParentTable, Subtable);
PrmtModuleInfo = ACPI_CAST_PTR (ACPI_PRMT_MODULE_INFO, Subtable->Buffer);
- for (j = 0; j < PrmtModuleInfo->HandlerInfoCount; j++)
+ for (j = 0; j < AcpiUtReadUint16 (&PrmtModuleInfo->HandlerInfoCount); j++)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoPrmtHandler,
&Subtable);

View File

@ -0,0 +1,35 @@
Signed-off-by: Dean Nelson <dnelson@redhat.com>
Reviewed-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump2.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump2.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump2.c
+++ acpica-unix2-20210604/source/common/dmtbdump2.c
@@ -2019,11 +2019,12 @@ AcpiDmDumpRgrt (
ACPI_STATUS Status;
ACPI_TABLE_RGRT *Subtable = ACPI_CAST_PTR (ACPI_TABLE_RGRT, Table);
UINT32 Offset = sizeof (ACPI_TABLE_RGRT);
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
/* Main table */
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoRgrt);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoRgrt);
if (ACPI_FAILURE (Status))
{
return;
@@ -2031,8 +2032,8 @@ AcpiDmDumpRgrt (
/* Dump the binary image as a subtable */
- Status = AcpiDmDumpTable (Table->Length, Offset, &Subtable->Image,
- Table->Length - Offset, AcpiDmTableInfoRgrt0);
+ Status = AcpiDmDumpTable (TableLength, Offset, &Subtable->Image,
+ TableLength - Offset, AcpiDmTableInfoRgrt0);
if (ACPI_FAILURE (Status))
{
return;

View File

@ -0,0 +1,42 @@
Signed-off-by: Dean Nelson <dnelson@redhat.com>
Reviewed-by: Al Stone <ahs3@redhat.com>
---
source/common/dmtbdump3.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump3.c
+++ acpica-unix2-20210604/source/common/dmtbdump3.c
@@ -339,14 +339,14 @@ AcpiDmDumpSvkl (
ACPI_TABLE_HEADER *Table)
{
ACPI_STATUS Status;
- UINT32 Length = Table->Length;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_SVKL);
ACPI_SVKL_KEY *Subtable;
/* Main table */
- Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoSvkl);
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoSvkl);
if (ACPI_FAILURE (Status))
{
return;
@@ -355,12 +355,12 @@ AcpiDmDumpSvkl (
/* The rest of the table consists of subtables (single type) */
Subtable = ACPI_ADD_PTR (ACPI_SVKL_KEY, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
/* Dump the subtable */
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
sizeof (ACPI_SVKL_KEY), AcpiDmTableInfoSvkl0);
if (ACPI_FAILURE (Status))
{

View File

@ -0,0 +1,91 @@
Signed-off-by: Dean Nelson <dnelson@redhat.com>
---
source/common/dmtbdump1.c | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
Index: acpica-unix2-20210604/source/common/dmtbdump1.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump1.c
+++ acpica-unix2-20210604/source/common/dmtbdump1.c
@@ -242,20 +242,23 @@ AcpiDmDumpCedt (
{
ACPI_STATUS Status;
ACPI_CEDT_HEADER *Subtable;
- UINT32 Length = Table->Length;
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
UINT32 Offset = sizeof (ACPI_TABLE_CEDT);
+ UINT16 SubtableLength;
/* There is no main table (other than the standard ACPI header) */
Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Table, Offset);
- while (Offset < Table->Length)
+ while (Offset < TableLength)
{
/* Common subtable header */
+ SubtableLength = AcpiUtReadUint16 (&Subtable->Length);
+
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoCedtHdr);
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
+ SubtableLength, AcpiDmTableInfoCedtHdr);
if (ACPI_FAILURE (Status))
{
return;
@@ -264,8 +267,8 @@ AcpiDmDumpCedt (
switch (Subtable->Type)
{
case ACPI_CEDT_TYPE_CHBS:
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoCedt0);
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
+ SubtableLength, AcpiDmTableInfoCedt0);
if (ACPI_FAILURE (Status)) {
return;
}
@@ -277,8 +280,8 @@ AcpiDmDumpCedt (
/* print out table with first "Interleave target" */
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, AcpiDmTableInfoCedt1);
+ Status = AcpiDmDumpTable (TableLength, Offset, Subtable,
+ SubtableLength, AcpiDmTableInfoCedt1);
if (ACPI_FAILURE (Status)) {
return;
}
@@ -288,8 +291,8 @@ AcpiDmDumpCedt (
for (i = 1; i < max; i++) {
unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET(ACPI_CEDT_CFMWS, InterleaveTargets);
unsigned int *trg = &(ptr->InterleaveTargets[i]);
- Status = AcpiDmDumpTable (Length, loc_offset, trg,
- Subtable->Length, AcpiDmTableInfoCedt1_te);
+ Status = AcpiDmDumpTable (TableLength, loc_offset, trg,
+ SubtableLength, AcpiDmTableInfoCedt1_te);
if (ACPI_FAILURE (Status)) {
return;
}
@@ -302,7 +305,7 @@ AcpiDmDumpCedt (
Subtable->Type);
/* Attempt to continue */
- if (!Subtable->Length)
+ if (!SubtableLength)
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return;
@@ -310,9 +313,9 @@ AcpiDmDumpCedt (
}
/* Point to next subtable */
- Offset += Subtable->Length;
+ Offset += SubtableLength;
Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable,
- Subtable->Length);
+ SubtableLength);
}
}

184
CEDT-support_08.patch Normal file
View File

@ -0,0 +1,184 @@
commit 19b11f91660b1a38a8e9655b0b1a4ad51ec4db1e
Author: Lawrence Hileman <larry.hileman@xconn-tech.com>
Date: Fri Jan 7 16:33:40 2022 -0800
Add the subtable CFMWS to the CEDT table
diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c
index 105a88e..6abe8bc 100644
--- a/source/common/dmtbdump1.c
+++ b/source/common/dmtbdump1.c
@@ -244,7 +244,6 @@ AcpiDmDumpCedt (
ACPI_CEDT_HEADER *Subtable;
UINT32 Length = Table->Length;
UINT32 Offset = sizeof (ACPI_TABLE_CEDT);
- ACPI_DMTABLE_INFO *InfoTable;
/* There is no main table (other than the standard ACPI header) */
@@ -265,35 +264,50 @@ AcpiDmDumpCedt (
switch (Subtable->Type)
{
case ACPI_CEDT_TYPE_CHBS:
+ Status = AcpiDmDumpTable (Length, Offset, Subtable,
+ Subtable->Length, AcpiDmTableInfoCedt0);
+ if (ACPI_FAILURE (Status)) {
+ return;
+ }
+ break;
+
+ case ACPI_CEDT_TYPE_CFMWS: {
+ ACPI_CEDT_CFMWS *ptr = (ACPI_CEDT_CFMWS *) Subtable;
+ unsigned int i, max = 0x01 << (ptr->InterleaveWays);
+
+ // print out table with first "Interleave target"
+ Status = AcpiDmDumpTable (Length, Offset, Subtable,
+ Subtable->Length, AcpiDmTableInfoCedt1);
+ if (ACPI_FAILURE (Status)) {
+ return;
+ }
- InfoTable = AcpiDmTableInfoCedt0;
+ // Now, print out any interleave targets beyond the first.
+ for (i = 1; i < max; i++) {
+ unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET(ACPI_CEDT_CFMWS, InterleaveTargets);
+ unsigned int *trg = &(ptr->InterleaveTargets[i]);
+ Status = AcpiDmDumpTable (Length, loc_offset, trg,
+ Subtable->Length, AcpiDmTableInfoCedt1_te);
+ if (ACPI_FAILURE (Status)) {
+ return;
+ }
+ }
break;
+ }
default:
-
AcpiOsPrintf ("\n**** Unknown CEDT subtable type 0x%X\n\n",
Subtable->Type);
/* Attempt to continue */
-
if (!Subtable->Length)
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return;
}
- goto NextSubtable;
- }
-
- Status = AcpiDmDumpTable (Length, Offset, Subtable,
- Subtable->Length, InfoTable);
- if (ACPI_FAILURE (Status))
- {
- return;
}
-NextSubtable:
/* Point to next subtable */
-
Offset += Subtable->Length;
Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable,
Subtable->Length);
diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c
index 5b8ffe6..ac8e79e 100644
--- a/source/common/dmtbinfo1.c
+++ b/source/common/dmtbinfo1.c
@@ -275,6 +275,28 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[] =
ACPI_DMT_TERMINATOR
};
+/* 1: CXL Fixed Memory Window Structure */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1[] =
+{
+ {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_CEDT1_OFFSET (BaseHpa), "Window base address", 0},
+ {ACPI_DMT_UINT64, ACPI_CEDT1_OFFSET (WindowSize), "Window size", 0},
+ {ACPI_DMT_UINT8, ACPI_CEDT1_OFFSET (InterleaveWays), "Interleave Members (2^n)", 0},
+ {ACPI_DMT_UINT8, ACPI_CEDT1_OFFSET (InterleaveArithmetic), "Interleave Arithmetic", 0},
+ {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (Reserved2), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (Granularity), "Granularity", 0},
+ {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (Restrictions), "Restrictions", 0},
+ {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (QtgId), "QtgId", 0},
+ {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (InterleaveTargets), "First Target", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1_te[] =
+{
+ {ACPI_DMT_UINT32, ACPI_CEDT1_TE_OFFSET (InterleaveTarget), "Next Target", 0},
+ ACPI_DMT_TERMINATOR
+};
/*******************************************************************************
*
diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c
index c56f61c..972be5f 100644
--- a/source/compiler/dttable1.c
+++ b/source/compiler/dttable1.c
@@ -282,18 +282,18 @@ DtCompileCedt (
switch (CedtHeader->Type)
{
case ACPI_CEDT_TYPE_CHBS:
-
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable);
+ break;
+ case ACPI_CEDT_TYPE_CFMWS:
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1, &Subtable);
break;
default:
-
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "CEDT");
return (AE_ERROR);
}
/* CEDT Subtable */
-
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable);
if (ACPI_FAILURE (Status))
{
return (Status);
diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h
index 4e7c02f..c165ba0 100644
--- a/source/include/acdisasm.h
+++ b/source/include/acdisasm.h
@@ -267,6 +267,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1_te[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[];
diff --git a/source/include/actbinfo.h b/source/include/actbinfo.h
index 80bd806..6b9f5c1 100644
--- a/source/include/actbinfo.h
+++ b/source/include/actbinfo.h
@@ -112,6 +112,8 @@
#define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f)
#define ACPI_CEDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_HEADER, f)
#define ACPI_CEDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CHBS, f)
+#define ACPI_CEDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CFMWS, f)
+#define ACPI_CEDT1_TE_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CFMWS_TARGET_ELEMENT, f)
#define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f)
#define ACPI_CSRT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f)
#define ACPI_CSRT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_SHARED_INFO,f)
diff --git a/source/include/actbl1.h b/source/include/actbl1.h
index 420189e..359861f 100644
--- a/source/include/actbl1.h
+++ b/source/include/actbl1.h
@@ -465,6 +465,11 @@ typedef struct acpi_cedt_cfmws
} ACPI_CEDT_CFMWS;
+typedef struct acpi_cedt_cfmws_target_element
+{
+ UINT32 InterleaveTarget;
+} ACPI_CEDT_CFMWS_TARGET_ELEMENT;
+
/* Values for Interleave Arithmetic field above */
#define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0)

173
CEDT-support_09.patch Normal file
View File

@ -0,0 +1,173 @@
commit d9798f5275bb20ab88ac854ba04e6e3bdb22cf6d
Author: Lawrence Hileman <larry.hileman@xconn-tech.com>
Date: Mon Jan 17 15:24:34 2022 -0800
Fix Compile issue with CEDT and add template
diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c
index 972be5f..09aca3a 100644
--- a/source/compiler/dttable1.c
+++ b/source/compiler/dttable1.c
@@ -262,6 +262,7 @@ DtCompileCedt (
while (*PFieldList)
{
+ int InsertFlag = 1; // if CFMWS and has more than one target, then set to zero later
SubtableStart = *PFieldList;
/* CEDT Header */
@@ -283,24 +284,68 @@ DtCompileCedt (
{
case ACPI_CEDT_TYPE_CHBS:
Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
break;
- case ACPI_CEDT_TYPE_CFMWS:
+ case ACPI_CEDT_TYPE_CFMWS: {
+ unsigned char *dump;
+ unsigned int idx, offset, max = 0;
+
+ // Compile table with first "Interleave target"
Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1, &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ // Look in buffer for the number of targets
+ offset = (unsigned int) ACPI_OFFSET (ACPI_CEDT_CFMWS, InterleaveWays);
+ dump = (unsigned char *) Subtable->Buffer - 4; // place at beginning of cedt1
+ max = 0x01 << dump[offset]; // 2^max, so 0=1, 1=2, 2=4, 3=8. 8 is MAX
+ if (max > 8) max=1; // Error in encoding Interleaving Ways.
+ if (max == 1) // if only one target, then break here.
+ break; // break if only one target.
+
+ // We need to add more interleave targets, so write the current Subtable.
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable); // Insert AcpiDmTableInfoCedt1 table so we can put in
+ DtPushSubtable (Subtable); // the targets > the first.
+
+ // Now, find out all interleave targets beyond the first.
+ for (idx = 1; idx < max; idx++) {
+ ParentTable = DtPeekSubtable ();
+
+ if (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1_te, &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ if (Subtable)
+ {
+ DtInsertSubtable (ParentTable, Subtable); // got a target, so insert table.
+ InsertFlag = 0;
+ }
+ }
+ }
+
+ DtPopSubtable ();
+ ParentTable = DtPeekSubtable ();
break;
+ }
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "CEDT");
return (AE_ERROR);
}
- /* CEDT Subtable */
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
+ if (InsertFlag == 1) {
+ DtInsertSubtable (ParentTable, Subtable);
+ }
DtPopSubtable ();
}
diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h
index 5fdd599..a62da8b 100644
--- a/source/compiler/dttemplate.h
+++ b/source/compiler/dttemplate.h
@@ -108,23 +108,58 @@ const unsigned char TemplateBoot[] =
const unsigned char TemplateCedt[] =
{
- 0x43,0x45,0x44,0x54,0x84,0x00,0x00,0x00, /* 00000000 "CEDT...." */
- 0x01,0x8B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
- 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
- 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x05,0x01,0x21,0x20,0x00,0x00,0x20,0x00, /* 00000020 "..! .. ." */
- 0x33,0x33,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000028 "33......" */
- 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xD5, /* 00000030 ".....!C." */
- 0x00,0x00,0x00,0x00,0x45,0x23,0x01,0x00, /* 00000038 "....E#.." */
+ 0x43,0x45,0x44,0x54,0x9c,0x01,0x00,0x00, /* 00000000 "CEDT...." */
+ 0x01,0x87,0x49,0x4e,0x54,0x45,0x4c,0x20, /* 00000008 "..INTEL " */
+ 0x54,0x45,0x4d,0x50,0x4c,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x00,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */
+ 0x17,0x12,0x21,0x20,0x00,0x00,0x20,0x00, /* 00000020 "..! .. ." */
+ 0x00,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000028 ".^......" */
+ 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 00000030 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000038 "..... .." */
0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000040 "...... ." */
- 0x44,0x44,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000048 "DD......" */
- 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xA5, /* 00000050 ".....!C." */
- 0x00,0x00,0x00,0x00,0x45,0x23,0xB1,0x00, /* 00000058 "....E#.." */
+ 0x01,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000048 ".^......" */
+ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000050 "..... .." */
+ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000058 "..... .." */
0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000060 "...... ." */
- 0x55,0x55,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000068 "UU......" */
- 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xB5, /* 00000070 ".....!C." */
- 0x00,0x00,0x00,0x00,0x45,0x23,0xB1,0x00, /* 00000078 "....E#.." */
- 0x00,0x00,0x00,0x00 /* 00000080 "...." */
+ 0x02,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000068 ".^......" */
+ 0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00, /* 00000070 ".....0.." */
+ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000078 "..... .." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000080 "...... ." */
+ 0x03,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000088 ".^......" */
+ 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, /* 00000090 ".....@.." */
+ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000098 "..... .." */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x28,0x00, /* 000000a0 "......(." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000a8 "........" */
+ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b0 "........" */
+ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b8 "........" */
+ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 000000c0 "........" */
+ 0x00,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 000000c8 ".^....(." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */
+ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d8 "........" */
+ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e0 "........" */
+ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 000000e8 "........" */
+ 0x01,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 000000f0 ".^....(." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000f8 "........" */
+ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */
+ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */
+ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000110 "........" */
+ 0x02,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 00000118 ".^....(." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */
+ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */
+ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */
+ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000138 "........" */
+ 0x03,0x5e,0xba,0x00,0x01,0x00,0x2c,0x00, /* 00000140 ".^....,." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */
+ 0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */
+ 0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000158 "........" */
+ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000160 "........" */
+ 0x00,0x5e,0xba,0x00,0x01,0x5e,0xba,0x00, /* 00000160 ".^...^.." */
+ 0x01,0x00,0x2c,0x00,0x00,0x00,0x00,0x00, /* 00000170 "..,....." */
+ 0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00, /* 00000178 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 00000180 "........" */
+ 0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 00000188 "........" */
+ 0x0a,0x00,0x01,0x00,0x02,0x5e,0xba,0x00, /* 00000190 ".....^.." */
+ 0x03,0x5e,0xba,0x00 /* 00000198 ".^.." */
};
const unsigned char TemplateCpep[] =

127
CEDT-support_10.patch Normal file
View File

@ -0,0 +1,127 @@
commit 0914618b553d6f3366e568409cebf2656891ca69
Author: Robert Moore <Robert.Moore@intel.com>
Date: Thu Feb 17 14:24:24 2022 -0800
Automated cleanup; No functional changes
Removed some tabs and // comments.
diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c
index 6abe8bc..88b7c1b 100644
--- a/source/common/dmtbdump1.c
+++ b/source/common/dmtbdump1.c
@@ -275,14 +275,16 @@ AcpiDmDumpCedt (
ACPI_CEDT_CFMWS *ptr = (ACPI_CEDT_CFMWS *) Subtable;
unsigned int i, max = 0x01 << (ptr->InterleaveWays);
- // print out table with first "Interleave target"
+ /* print out table with first "Interleave target" */
+
Status = AcpiDmDumpTable (Length, Offset, Subtable,
Subtable->Length, AcpiDmTableInfoCedt1);
if (ACPI_FAILURE (Status)) {
return;
}
- // Now, print out any interleave targets beyond the first.
+ /* Now, print out any interleave targets beyond the first. */
+
for (i = 1; i < max; i++) {
unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET(ACPI_CEDT_CFMWS, InterleaveTargets);
unsigned int *trg = &(ptr->InterleaveTargets[i]);
diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c
index 09aca3a..c1e6b98 100644
--- a/source/compiler/dttable1.c
+++ b/source/compiler/dttable1.c
@@ -262,7 +262,9 @@ DtCompileCedt (
while (*PFieldList)
{
- int InsertFlag = 1; // if CFMWS and has more than one target, then set to zero later
+ /* if CFMWS and has more than one target, then set to zero later */
+
+ int InsertFlag = 1;
SubtableStart = *PFieldList;
/* CEDT Header */
@@ -293,27 +295,30 @@ DtCompileCedt (
unsigned char *dump;
unsigned int idx, offset, max = 0;
- // Compile table with first "Interleave target"
+ /* Compile table with first "Interleave target" */
+
Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1, &Subtable);
if (ACPI_FAILURE (Status))
{
return (Status);
}
- // Look in buffer for the number of targets
+ /* Look in buffer for the number of targets */
offset = (unsigned int) ACPI_OFFSET (ACPI_CEDT_CFMWS, InterleaveWays);
- dump = (unsigned char *) Subtable->Buffer - 4; // place at beginning of cedt1
- max = 0x01 << dump[offset]; // 2^max, so 0=1, 1=2, 2=4, 3=8. 8 is MAX
- if (max > 8) max=1; // Error in encoding Interleaving Ways.
- if (max == 1) // if only one target, then break here.
- break; // break if only one target.
+ dump = (unsigned char *) Subtable->Buffer - 4; /* place at beginning of cedt1 */
+ max = 0x01 << dump[offset]; /* 2^max, so 0=1, 1=2, 2=4, 3=8. 8 is MAX */
+ if (max > 8) max=1; /* Error in encoding Interleaving Ways. */
+ if (max == 1) /* if only one target, then break here. */
+ break; /* break if only one target. */
+
+ /* We need to add more interleave targets, so write the current Subtable. */
- // We need to add more interleave targets, so write the current Subtable.
ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable); // Insert AcpiDmTableInfoCedt1 table so we can put in
- DtPushSubtable (Subtable); // the targets > the first.
+ DtInsertSubtable (ParentTable, Subtable); /* Insert AcpiDmTableInfoCedt1 table so we can put in */
+ DtPushSubtable (Subtable); /* the targets > the first. */
+
+ /* Now, find out all interleave targets beyond the first. */
- // Now, find out all interleave targets beyond the first.
for (idx = 1; idx < max; idx++) {
ParentTable = DtPeekSubtable ();
@@ -326,7 +331,7 @@ DtCompileCedt (
}
if (Subtable)
{
- DtInsertSubtable (ParentTable, Subtable); // got a target, so insert table.
+ DtInsertSubtable (ParentTable, Subtable); /* got a target, so insert table. */
InsertFlag = 0;
}
}
diff --git a/source/include/actbl1.h b/source/include/actbl1.h
index 359861f..ccf7c95 100644
--- a/source/include/actbl1.h
+++ b/source/include/actbl1.h
@@ -468,19 +468,20 @@ typedef struct acpi_cedt_cfmws
typedef struct acpi_cedt_cfmws_target_element
{
UINT32 InterleaveTarget;
+
} ACPI_CEDT_CFMWS_TARGET_ELEMENT;
/* Values for Interleave Arithmetic field above */
-#define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0)
+#define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0)
/* Values for Restrictions field above */
-#define ACPI_CEDT_CFMWS_RESTRICT_TYPE2 (1)
-#define ACPI_CEDT_CFMWS_RESTRICT_TYPE3 (1<<1)
-#define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE (1<<2)
-#define ACPI_CEDT_CFMWS_RESTRICT_PMEM (1<<3)
-#define ACPI_CEDT_CFMWS_RESTRICT_FIXED (1<<4)
+#define ACPI_CEDT_CFMWS_RESTRICT_TYPE2 (1)
+#define ACPI_CEDT_CFMWS_RESTRICT_TYPE3 (1<<1)
+#define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE (1<<2)
+#define ACPI_CEDT_CFMWS_RESTRICT_PMEM (1<<3)
+#define ACPI_CEDT_CFMWS_RESTRICT_FIXED (1<<4)
/*******************************************************************************

18
CEDT-support_11.patch Normal file
View File

@ -0,0 +1,18 @@
commit 7021087eedb0d7156286e9e4f255e93c07816921
Author: Robert Moore <Robert.Moore@intel.com>
Date: Fri Aug 26 12:20:07 2022 -0700
Remove a duplicate of ACPI_SIG_CEDT
diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c
index b984e6a..9f84aea 100644
--- a/source/tools/acpisrc/astable.c
+++ b/source/tools/acpisrc/astable.c
@@ -541,7 +541,6 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DBG2", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DBGP", SRC_TYPE_STRUCT},
- {"ACPI_TABLE_CEDT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DMAR", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DRTM", SRC_TYPE_STRUCT},
{"ACPI_TABLE_ECDT", SRC_TYPE_STRUCT},

View File

@ -1,6 +1,6 @@
Name: acpica-tools
Version: 20210604
Release: 2%{?dist}
Release: 5%{?dist}
Summary: ACPICA tools for the development and debug of ACPI tables
License: GPLv2
@ -70,6 +70,9 @@ Patch42: 0043-Support-DSDT-SSDT-in-a-big-endian-world.patch
Patch43: 0044-Initial-support-for-WPBT-in-big-endian-needs-more.patch
Patch44: 0045-CSRT-fixed-use-of-optional-ResourceInfo.patch
Patch45: 0046-Support-PHAT-in-a-big-endian-world.patch
Patch46: 0047-Support-PRMT-in-a-big-endian-world.patch
Patch47: 0048-Support-RGRT-in-a-big-endian-world.patch
Patch48: 0049-Support-SVKL-in-a-big-endian-world.patch
# other miscellaneous patches
Patch100: unaligned.patch
@ -89,6 +92,12 @@ Patch113: facp.patch
Patch114: armv7-str-fixes.patch
Patch115: dbtest.patch
Patch116: ull-32bit.patch
Patch117: wpbt-unicode.patch
Patch118: CEDT-support_08.patch
Patch119: CEDT-support_09.patch
Patch120: CEDT-support_10.patch
Patch121: CEDT-support_11.patch
Patch122: 0050-Support-CEDT-in-a-big-endian-world.patch
BuildRequires: make
BuildRequires: bison patchutils flex gcc
@ -254,9 +263,25 @@ fi
%changelog
* Thu Oct 06 2022 Dean Nelson <dnelson@redhat.com> - 20210604-5
- Backport 19b11f91660b ("Add the subtable CFMWS to the CEDT table").
- Backport d9798f5275bb ("Fix Compile issue with CEDT and add template").
- Backport 0914618b553d ("Automated cleanup; No functional changes").
- Backport 7021087eedb0 ("Remove a duplicate of ACPI_SIG_CEDT").
- Add in big-endian patch for CEDT tble.
* Mon Oct 03 2022 Dean Nelson <dnelson@redhat.com> - 20210604-4
- Add in big-endian patches for PRMT, RGRT and SVKL tables.
- Fix big-endian related prmt.asl compiler errors.
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 20210604-3
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Jul 27 2021 Al Stone <ahs3@redhat.com> - 20210604-2
- Running 'iasl -T all' would segfault when dumping the PHAT template;
fixed AcpiDmDumpPhat() by removing unnecessary assignments from patch
- Borrowed a patch from upstream to fix Unicode usage in WPBTs
* Fri Jul 23 2021 Dean Nelson <dnelson@redhat.com> - 20210604-1
- Update to 20210604 source tree.

5
rpminspect.yaml Normal file
View File

@ -0,0 +1,5 @@
---
patches:
# Allow up to 30 files to be touched by a patch
file_count_threshold: 30

196
wpbt-unicode.patch Normal file
View File

@ -0,0 +1,196 @@
Index: acpica-unix2-20210604/source/common/dmtable.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtable.c
+++ acpica-unix2-20210604/source/common/dmtable.c
@@ -979,6 +979,12 @@ AcpiDmDumpTable (
ByteLength = 128;
break;
+ case ACPI_DMT_WPBT_UNICODE:
+
+ ByteLength = SubtableLength;
+ CurrentOffset = sizeof (ACPI_TABLE_WPBT);
+ break;
+
case ACPI_DMT_UNICODE:
case ACPI_DMT_BUFFER:
case ACPI_DMT_RAW_BUFFER:
@@ -1596,6 +1602,7 @@ AcpiDmDumpTable (
break;
case ACPI_DMT_UNICODE:
+ case ACPI_DMT_WPBT_UNICODE:
if (ByteLength == 0)
{
Index: acpica-unix2-20210604/source/common/dmtbdump3.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbdump3.c
+++ acpica-unix2-20210604/source/common/dmtbdump3.c
@@ -753,8 +753,11 @@ AcpiDmDumpWpbt (
Subtable = ACPI_CAST_PTR (ACPI_TABLE_WPBT, Table);
ArgumentsLength = AcpiUtReadUint16 (&Subtable->ArgumentsLength);
- /* Dump the arguments buffer */
+ /* Dump the arguments buffer if present */
- (void) AcpiDmDumpTable (TableLength, 0, Table, ArgumentsLength,
- AcpiDmTableInfoWpbt0);
+ if (ArgumentsLength)
+ {
+ (void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
+ AcpiDmTableInfoWpbt0);
+ }
}
Index: acpica-unix2-20210604/source/common/dmtbinfo3.c
===================================================================
--- acpica-unix2-20210604.orig/source/common/dmtbinfo3.c
+++ acpica-unix2-20210604/source/common/dmtbinfo3.c
@@ -651,7 +651,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI
ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt0[] =
{
- {ACPI_DMT_UNICODE, sizeof (ACPI_TABLE_WPBT), "Command-line Arguments", 0},
+ {ACPI_DMT_WPBT_UNICODE, ACPI_WPBT2_OFFSET (UnicodeString), "Command-line Arguments", DT_DESCRIBES_OPTIONAL},
ACPI_DMT_TERMINATOR
};
Index: acpica-unix2-20210604/source/compiler/dttable2.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dttable2.c
+++ acpica-unix2-20210604/source/compiler/dttable2.c
@@ -2615,13 +2615,11 @@ DtCompileWpbt (
DT_SUBTABLE *ParentTable;
ACPI_TABLE_WPBT *Table;
ACPI_STATUS Status;
- UINT16 Length;
/* Compile the main table */
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt,
- &Subtable);
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt, &Subtable);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -2629,11 +2627,23 @@ DtCompileWpbt (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
+ Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer);
+
+ /*
+ * Exit now if there are no arguments specified. This is indicated by:
+ * The "Command-line Arguments" field has not been specified (if specified,
+ * it will be the last field in the field list -- after the main table).
+ * Set the Argument Length in the main table to zero.
+ */
+ if (!*PFieldList)
+ {
+ Table->ArgumentsLength = 0;
+ return (AE_OK);
+ }
/* Compile the argument list subtable */
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt0,
- &Subtable);
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt0, &Subtable);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -2641,12 +2651,8 @@ DtCompileWpbt (
/* Extract the length of the Arguments buffer, insert into main table */
- AcpiUtWriteUint (&Length, sizeof (UINT16),
+ AcpiUtWriteUint (&Table->ArgumentsLength, sizeof (UINT16),
&Subtable->TotalLength, sizeof (UINT32));
- Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer);
- Table->ArgumentsLength = AcpiUtReadUint16 (&Length);
-
- ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
return (AE_OK);
}
Index: acpica-unix2-20210604/source/compiler/dtutils.c
===================================================================
--- acpica-unix2-20210604.orig/source/compiler/dtutils.c
+++ acpica-unix2-20210604/source/compiler/dtutils.c
@@ -344,6 +344,7 @@ DtGetFieldType (
break;
case ACPI_DMT_UNICODE:
+ case ACPI_DMT_WPBT_UNICODE:
Type = DT_FIELD_TYPE_UNICODE;
break;
@@ -626,12 +627,13 @@ DtGetFieldLength (
break;
case ACPI_DMT_UNICODE:
+ case ACPI_DMT_WPBT_UNICODE:
Value = DtGetFieldValue (Field);
/* TBD: error if Value is NULL? (as below?) */
- ByteLength = (strlen (Value) + 1) * sizeof(UINT16);
+ ByteLength = (strlen (Value) + 1) * sizeof (UINT16);
break;
default:
Index: acpica-unix2-20210604/source/include/acdisasm.h
===================================================================
--- acpica-unix2-20210604.orig/source/include/acdisasm.h
+++ acpica-unix2-20210604/source/include/acdisasm.h
@@ -175,6 +175,7 @@ typedef enum
ACPI_DMT_SRAT,
ACPI_DMT_TPM2,
ACPI_DMT_VIOT,
+ ACPI_DMT_WPBT_UNICODE,
/* Special opcodes */
Index: acpica-unix2-20210604/source/include/actbinfo.h
===================================================================
--- acpica-unix2-20210604.orig/source/include/actbinfo.h
+++ acpica-unix2-20210604/source/include/actbinfo.h
@@ -97,6 +97,7 @@
#define ACPI_WDDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDDT,f)
#define ACPI_WDRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDRT,f)
#define ACPI_WPBT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WPBT,f)
+#define ACPI_WPBT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WPBT_UNICODE,f)
#define ACPI_WSMT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WSMT,f)
#define ACPI_XENV_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_XENV,f)
Index: acpica-unix2-20210604/source/include/actbl3.h
===================================================================
--- acpica-unix2-20210604.orig/source/include/actbl3.h
+++ acpica-unix2-20210604/source/include/actbl3.h
@@ -847,6 +847,12 @@ typedef struct acpi_table_wpbt
} ACPI_TABLE_WPBT;
+typedef struct acpi_wpbt_unicode
+{
+ UINT16 *UnicodeString;
+
+} ACPI_WPBT_UNICODE;
+
/*******************************************************************************
*
Index: acpica-unix2-20210604/source/tools/acpisrc/astable.c
===================================================================
--- acpica-unix2-20210604.orig/source/tools/acpisrc/astable.c
+++ acpica-unix2-20210604/source/tools/acpisrc/astable.c
@@ -772,6 +772,7 @@ ACPI_TYPED_IDENTIFIER_TABLE Ac
{"ACPI_VIOT_VIRTIO_IOMMU_PCI", SRC_TYPE_STRUCT},
{"ACPI_VIOT_VIRTIO_IOMMU_MMIO", SRC_TYPE_STRUCT},
{"ACPI_WDAT_ENTRY", SRC_TYPE_STRUCT},
+ {"ACPI_WPBT_UNICODE", SRC_TYPE_STRUCT},
/* Data Table compiler */