aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-07-30 10:59:27 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-07-30 10:59:27 +0100
commit9b10f2284806d2d97b5e60a22eb0fadd642fb575 (patch)
treef0297e261987ecbdced1c388573e919029bc6bab /tools
parent1676e36c5d20c179effb70a47ed3a61c7e3fb86a (diff)
downloadxen-9b10f2284806d2d97b5e60a22eb0fadd642fb575.tar.gz
xen-9b10f2284806d2d97b5e60a22eb0fadd642fb575.tar.bz2
xen-9b10f2284806d2d97b5e60a22eb0fadd642fb575.zip
Move generate_acpi_checksum() from ia64 code to common.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/libxc/ia64/Makefile2
-rw-r--r--tools/libxc/ia64/dom_fw_acpi.c13
2 files changed, 14 insertions, 1 deletions
diff --git a/tools/libxc/ia64/Makefile b/tools/libxc/ia64/Makefile
index 29f7050ad5..27ab80765b 100644
--- a/tools/libxc/ia64/Makefile
+++ b/tools/libxc/ia64/Makefile
@@ -5,7 +5,7 @@ GUEST_SRCS-y += ia64/xc_ia64_linux_save.c
GUEST_SRCS-y += ia64/xc_ia64_linux_restore.c
GUEST_SRCS-y += ia64/xc_dom_ia64_util.c
-DOMFW_SRCS_BASE := dom_fw_common.c dom_fw_domu.c dom_fw_asm.S
+DOMFW_SRCS_BASE := dom_fw_common.c dom_fw_domu.c dom_fw_asm.S dom_fw_acpi.c
DOMFW_SRCS := $(addprefix ia64/, $(DOMFW_SRCS_BASE))
$(DOMFW_SRCS):
ln -sf ../$(XEN_ROOT)/xen/arch/ia64/xen/$(@F) $@
diff --git a/tools/libxc/ia64/dom_fw_acpi.c b/tools/libxc/ia64/dom_fw_acpi.c
new file mode 100644
index 0000000000..09d1281a15
--- /dev/null
+++ b/tools/libxc/ia64/dom_fw_acpi.c
@@ -0,0 +1,13 @@
+#include <inttypes.h>
+#include <xen/acpi.h>
+
+uint8_t
+generate_acpi_checksum(void *tbl, unsigned long len)
+{
+ uint8_t *ptr, sum = 0;
+
+ for ( ptr = tbl; len > 0 ; len--, ptr++ )
+ sum += *ptr;
+
+ return 0 - sum;
+}