diff --git a/include/acpi/acpi_table.h b/include/acpi/acpi_table.h index b8b1f1338c6..f8e5f552ab1 100644 --- a/include/acpi/acpi_table.h +++ b/include/acpi/acpi_table.h @@ -1274,6 +1274,13 @@ ulong write_acpi_tables(ulong start); */ struct acpi_table_header *acpi_find_table(const char *sig); +/** + * acpi_update_checksum() - update ACPI table checksum + * + * @header - header of an ACPI table + */ +void acpi_update_checksum(struct acpi_table_header *header); + #endif /* !__ACPI__*/ #include diff --git a/lib/acpi/acpi.c b/lib/acpi/acpi.c index f4d5c1e25d0..596301a43fe 100644 --- a/lib/acpi/acpi.c +++ b/lib/acpi/acpi.c @@ -6,11 +6,18 @@ */ #include +#include #include #include DECLARE_GLOBAL_DATA_PTR; +void acpi_update_checksum(struct acpi_table_header *header) +{ + header->checksum = 0; + header->checksum = table_compute_checksum(header, header->length); +} + struct acpi_table_header *acpi_find_table(const char *sig) { struct acpi_rsdp *rsdp;