summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2025-03-22 00:21:16 +0100
committerTom Rini <trini@konsulko.com>2025-04-08 15:22:56 -0600
commit69e61d46d2dcdcf84a3a7aed7cf74ac3b3b850fd (patch)
tree6312749e02915e1a9ffd0f33aa5a4005190dcbcf /lib
parentc0267678948bf9df776cca011c8f5329fee2f4c0 (diff)
acpi: new function acpi_update_checksum()
Introduce a new function to update ACPI table headers. This allows to simplify the existing code. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Matthias Brugger <mbrugger@suse.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/acpi/acpi.c7
1 files changed, 7 insertions, 0 deletions
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 <mapmem.h>
+#include <tables_csum.h>
#include <acpi/acpi_table.h>
#include <asm/global_data.h>
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;