For most tables we supply to guests checksum is
calculated by the bios at load time.

However, when table needs to be changed later dynamically,
QEMU has to calculate the checksum.

Export acpi_checksum so ACPI generation code can re-use it.

Signed-off-by: Michael S. Tsirkin <m...@redhat.com>
---
 include/hw/acpi/acpi.h | 2 ++
 hw/acpi/core.c         | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index c20ace0d0b..957a064d58 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -148,6 +148,8 @@ struct ACPIREGS {
     Notifier wakeup;
 };
 
+int acpi_checksum(const uint8_t *data, int len);
+
 /* PM_TMR */
 void acpi_pm_tmr_update(ACPIREGS *ar, bool enable);
 void acpi_pm_tmr_calc_overflow_time(ACPIREGS *ar);
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index b8d39012cd..ae24d104d4 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -72,7 +72,7 @@ static void acpi_register_config(void)
 
 opts_init(acpi_register_config);
 
-static int acpi_checksum(const uint8_t *data, int len)
+int acpi_checksum(const uint8_t *data, int len)
 {
     int sum, i;
     sum = 0;
-- 
MST


Reply via email to