diff options
author | Piotr Maziarz <piotrx.maziarz@linux.intel.com> | 2021-12-16 17:43:12 +0100 |
---|---|---|
committer | Piotr Maziarz <piotrx.maziarz@linux.intel.com> | 2022-01-13 19:23:36 +0100 |
commit | 23a659e190cf3ed0edd46cddf12bbbcfeaa09396 (patch) | |
tree | 93fa5b26e3168532ce27aeaa2060a24a3075c433 | |
parent | cf7d6ccc009aa04a475bca81dc7af0342bb7c1eb (diff) | |
download | acpica-23a659e190cf3ed0edd46cddf12bbbcfeaa09396.tar.gz |
iASL: NHLT: Treat Terminator as SpecificConfig
SpecificConfig has 4 bytes of size and then an amount of bytes specified
by size. All of the terminators that I've seen had a size equal to 4, but
theoretically it can vary.
-rw-r--r-- | source/common/dmtbdump2.c | 25 | ||||
-rw-r--r-- | source/common/dmtbinfo2.c | 9 | ||||
-rw-r--r-- | source/compiler/dttable2.c | 14 | ||||
-rw-r--r-- | source/include/acdisasm.h | 1 | ||||
-rw-r--r-- | source/include/actbinfo.h | 1 | ||||
-rw-r--r-- | source/include/actbl2.h | 7 |
6 files changed, 32 insertions, 25 deletions
diff --git a/source/common/dmtbdump2.c b/source/common/dmtbdump2.c index 04f7139fe..cc9003de8 100644 --- a/source/common/dmtbdump2.c +++ b/source/common/dmtbdump2.c @@ -1504,6 +1504,7 @@ AcpiDmDumpNhlt ( ACPI_NHLT_LINUX_SPECIFIC_COUNT *Count; ACPI_NHLT_LINUX_SPECIFIC_DATA *LinuxData; ACPI_NHLT_LINUX_SPECIFIC_DATA_B *LinuxDataB; + ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B *Capabilities; /* Main table */ @@ -1761,6 +1762,7 @@ AcpiDmDumpNhlt ( /* Do the Capabilities array (of bytes) */ AcpiOsPrintf ("\n /* Specific_Config table #%u */\n", j+1); + FormatSubtable = ACPI_ADD_PTR (ACPI_NHLT_FORMAT_CONFIG, Table, Offset); Status = AcpiDmDumpTable (TableLength, Offset, FormatSubtable, CapabilitiesSize, AcpiDmTableInfoNhlt3a); @@ -1858,17 +1860,30 @@ AcpiDmDumpNhlt ( * Done with all of the Endpoint Descriptors, Emit the table terminator * (if such a legacy structure is present -- not in NHLT specification) */ - if (Offset == TableLength - sizeof (ACPI_NHLT_TABLE_TERMINATOR)) + if (Offset < TableLength) { - LinuxData = ACPI_ADD_PTR (ACPI_NHLT_LINUX_SPECIFIC_DATA, Table, Offset); - AcpiOsPrintf ("\n /* Table terminator structure (not part of NHLT spec) */\n"); + Capabilities = ACPI_ADD_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B, Table, Offset); + AcpiOsPrintf ("\n/* Terminating specific config (not part of NHLT spec) */\n"); - Status = AcpiDmDumpTable (TableLength, Offset, LinuxData, - sizeof (ACPI_NHLT_TABLE_TERMINATOR), AcpiDmTableInfoNhlt8); + Status = AcpiDmDumpTable (TableLength, Offset, Capabilities, + sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B), AcpiDmTableInfoNhlt5b); if (ACPI_FAILURE (Status)) { return; } + Offset += sizeof (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B); + + if (Capabilities->CapabilitiesSize > 0) + { + UINT32 remainingBytes = TableLength - Offset; + UINT8* buffer = ACPI_ADD_PTR (UINT8, Table, Offset); + + if (remainingBytes != Capabilities->CapabilitiesSize) + AcpiOsPrintf ("\n/* Incorrect config size, should be %X, is %X */\n", + Capabilities->CapabilitiesSize, remainingBytes); + Status = AcpiDmDumpTable (TableLength, Offset, buffer, + remainingBytes, AcpiDmTableInfoNhlt3a); + } } return; diff --git a/source/common/dmtbinfo2.c b/source/common/dmtbinfo2.c index ab1b2634c..23285910a 100644 --- a/source/common/dmtbinfo2.c +++ b/source/common/dmtbinfo2.c @@ -1403,15 +1403,6 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt7b[] = ACPI_DMT_TERMINATOR }; -/* Table terminator (may or may not be present) */ - -ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt8[] = -{ - {ACPI_DMT_UINT32, ACPI_NHLT8_OFFSET (TerminatorValue), "Terminator Value", 0}, - {ACPI_DMT_UINT32, ACPI_NHLT8_OFFSET (TerminatorSignature), "Terminator Signature", 0}, - ACPI_DMT_TERMINATOR -}; - /* Sensitivity Extension */ ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt9[] = diff --git a/source/compiler/dttable2.c b/source/compiler/dttable2.c index 854063611..f0481928d 100644 --- a/source/compiler/dttable2.c +++ b/source/compiler/dttable2.c @@ -1143,11 +1143,21 @@ DtCompileNhlt ( /* * All Endpoint Descriptors are completed. - * Do the table terminator structure (not in NHLT spec, optional) + * Do the table terminator specific config (not in NHLT spec, optional) */ if (*PFieldList && (strcmp ((const char *) (*PFieldList)->Name, "Descriptor Length"))) { - Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt8, + Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt5b, + &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt3a, &Subtable); if (ACPI_FAILURE (Status)) { diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h index 17d70d4e7..c3d429152 100644 --- a/source/include/acdisasm.h +++ b/source/include/acdisasm.h @@ -571,7 +571,6 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt6b[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt7[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt7a[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt7b[]; -extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt8[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoNhlt9[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPhatHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoPhat0[]; diff --git a/source/include/actbinfo.h b/source/include/actbinfo.h index 7402d97b1..23f49221b 100644 --- a/source/include/actbinfo.h +++ b/source/include/actbinfo.h @@ -346,7 +346,6 @@ #define ACPI_NHLT7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_LINUX_SPECIFIC_COUNT,f) #define ACPI_NHLT7A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_LINUX_SPECIFIC_DATA,f) #define ACPI_NHLT7B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_LINUX_SPECIFIC_DATA_B,f) -#define ACPI_NHLT8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_TABLE_TERMINATOR,f) #define ACPI_NHLT9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NHLT_MIC_SNR_SENSITIVITY_EXTENSION,f) #define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f) #define ACPI_PCCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED,f) diff --git a/source/include/actbl2.h b/source/include/actbl2.h index eaa2e243e..a43077cd9 100644 --- a/source/include/actbl2.h +++ b/source/include/actbl2.h @@ -2124,13 +2124,6 @@ typedef struct acpi_nhlt_linux_specific_data_b } ACPI_NHLT_LINUX_SPECIFIC_DATA_B; -typedef struct acpi_nhlt_table_terminator -{ - UINT32 TerminatorValue; - UINT32 TerminatorSignature; - -} ACPI_NHLT_TABLE_TERMINATOR; - /******************************************************************************* * |