diff options
author | Dan Williams <dan.j.williams@intel.com> | 2021-10-29 22:51:37 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2021-11-15 22:02:59 +0300 |
commit | ad2f63971e9655e3987db32dac85aa50658790eb (patch) | |
tree | 475aad87769078e3ed145299b619059065049eff /drivers/acpi/tables.c | |
parent | f64bd790b750dd281406964af40d16adfc88a074 (diff) | |
download | linux-ad2f63971e9655e3987db32dac85aa50658790eb.tar.xz |
ACPI: Teach ACPI table parsing about the CEDT header format
The CEDT adds yet one more unique subtable header type where the length
is a 16-bit value. Extend the subtable helpers to detect this scenario.
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Len Brown <lenb@kernel.org>
Tested-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/163553709742.2509508.5177761945441327574.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/acpi/tables.c')
-rw-r--r-- | drivers/acpi/tables.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index b80a3de655d7..8d052b65f6bc 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c @@ -41,6 +41,7 @@ enum acpi_subtable_type { ACPI_SUBTABLE_COMMON, ACPI_SUBTABLE_HMAT, ACPI_SUBTABLE_PRMT, + ACPI_SUBTABLE_CEDT, }; struct acpi_subtable_entry { @@ -226,6 +227,8 @@ acpi_get_entry_type(struct acpi_subtable_entry *entry) return entry->hdr->hmat.type; case ACPI_SUBTABLE_PRMT: return 0; + case ACPI_SUBTABLE_CEDT: + return entry->hdr->cedt.type; } return 0; } @@ -240,6 +243,8 @@ acpi_get_entry_length(struct acpi_subtable_entry *entry) return entry->hdr->hmat.length; case ACPI_SUBTABLE_PRMT: return entry->hdr->prmt.length; + case ACPI_SUBTABLE_CEDT: + return entry->hdr->cedt.length; } return 0; } @@ -254,6 +259,8 @@ acpi_get_subtable_header_length(struct acpi_subtable_entry *entry) return sizeof(entry->hdr->hmat); case ACPI_SUBTABLE_PRMT: return sizeof(entry->hdr->prmt); + case ACPI_SUBTABLE_CEDT: + return sizeof(entry->hdr->cedt); } return 0; } @@ -265,6 +272,8 @@ acpi_get_subtable_type(char *id) return ACPI_SUBTABLE_HMAT; if (strncmp(id, ACPI_SIG_PRMT, 4) == 0) return ACPI_SUBTABLE_PRMT; + if (strncmp(id, ACPI_SIG_CEDT, 4) == 0) + return ACPI_SUBTABLE_CEDT; return ACPI_SUBTABLE_COMMON; } |