Make the ACPI table checksum calculation function (in core.c) public so
it can be reused in other parts of the ACPI code.
Signed-off-by: Oliver Steffen <osteffen@redhat.com>
---
hw/acpi/core.c | 5 ++++-
include/hw/acpi/acpi.h | 3 +++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index d9979b0da9..6b65e587f2 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -83,7 +83,10 @@ bool acpi_builtin(void)
return true;
}
-static int acpi_checksum(const uint8_t *data, int len)
+/* Calculate the ACPI checksum value so that if used in the corresponding
+ * header field, the ACPI checksum verification will be successful.
+ */
+int acpi_checksum(const uint8_t *data, int len)
{
int sum, i;
sum = 0;
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index 4b8ee094c4..b036116dfb 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -203,4 +203,7 @@ struct AcpiSlicOem {
};
int acpi_get_slic_oem(AcpiSlicOem *oem);
+/* core.c */
+int acpi_checksum(const uint8_t *data, int len);
+
#endif /* QEMU_HW_ACPI_H */
--
2.52.0