[PATCH 4/5] qemu-sbsa: simplify updating ACPI table header checksum

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Sat Mar 22 00:21:19 CET 2025


Use acpi_update_checksum() to update table header.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
 board/emulation/qemu-sbsa/acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/emulation/qemu-sbsa/acpi.c b/board/emulation/qemu-sbsa/acpi.c
index ba85e08fc7d..7e4c55cc818 100644
--- a/board/emulation/qemu-sbsa/acpi.c
+++ b/board/emulation/qemu-sbsa/acpi.c
@@ -133,7 +133,7 @@ static int sbsa_write_gtdt(struct acpi_ctx *ctx, const struct acpi_writer *entry
 	gtdt->cnt_read_base = 0xffffffffffffffff;
 
 	// FIXME: VirtualPL2Timer
-	header->checksum = table_compute_checksum(header, header->length);
+	acpi_update_checksum(header);
 
 	acpi_add_table(ctx, gtdt);
 
@@ -181,7 +181,7 @@ static int acpi_write_pptt(struct acpi_ctx *ctx, const struct acpi_writer *entry
 	}
 
 	header->length = ctx->current - ctx->tab_start;
-	header->checksum = table_compute_checksum(header, header->length);
+	acpi_update_checksum(header);
 
 	acpi_inc(ctx, header->length);
 	acpi_add_table(ctx, header);
-- 
2.48.1



More information about the U-Boot mailing list