Skip to content

Commit ad2f639

Browse files
committed
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" <[email protected]> Cc: Len Brown <[email protected]> Tested-by: Alison Schofield <[email protected]> Reviewed-by: Alison Schofield <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Link: https://lore.kernel.org/r/163553709742.2509508.5177761945441327574.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <[email protected]>
1 parent f64bd79 commit ad2f639

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

drivers/acpi/tables.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ enum acpi_subtable_type {
4141
ACPI_SUBTABLE_COMMON,
4242
ACPI_SUBTABLE_HMAT,
4343
ACPI_SUBTABLE_PRMT,
44+
ACPI_SUBTABLE_CEDT,
4445
};
4546

4647
struct acpi_subtable_entry {
@@ -226,6 +227,8 @@ acpi_get_entry_type(struct acpi_subtable_entry *entry)
226227
return entry->hdr->hmat.type;
227228
case ACPI_SUBTABLE_PRMT:
228229
return 0;
230+
case ACPI_SUBTABLE_CEDT:
231+
return entry->hdr->cedt.type;
229232
}
230233
return 0;
231234
}
@@ -240,6 +243,8 @@ acpi_get_entry_length(struct acpi_subtable_entry *entry)
240243
return entry->hdr->hmat.length;
241244
case ACPI_SUBTABLE_PRMT:
242245
return entry->hdr->prmt.length;
246+
case ACPI_SUBTABLE_CEDT:
247+
return entry->hdr->cedt.length;
243248
}
244249
return 0;
245250
}
@@ -254,6 +259,8 @@ acpi_get_subtable_header_length(struct acpi_subtable_entry *entry)
254259
return sizeof(entry->hdr->hmat);
255260
case ACPI_SUBTABLE_PRMT:
256261
return sizeof(entry->hdr->prmt);
262+
case ACPI_SUBTABLE_CEDT:
263+
return sizeof(entry->hdr->cedt);
257264
}
258265
return 0;
259266
}
@@ -265,6 +272,8 @@ acpi_get_subtable_type(char *id)
265272
return ACPI_SUBTABLE_HMAT;
266273
if (strncmp(id, ACPI_SIG_PRMT, 4) == 0)
267274
return ACPI_SUBTABLE_PRMT;
275+
if (strncmp(id, ACPI_SIG_CEDT, 4) == 0)
276+
return ACPI_SUBTABLE_CEDT;
268277
return ACPI_SUBTABLE_COMMON;
269278
}
270279

include/linux/acpi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ union acpi_subtable_headers {
133133
struct acpi_subtable_header common;
134134
struct acpi_hmat_structure hmat;
135135
struct acpi_prmt_module_header prmt;
136+
struct acpi_cedt_header cedt;
136137
};
137138

138139
typedef int (*acpi_tbl_table_handler)(struct acpi_table_header *table);

0 commit comments

Comments
 (0)