summaryrefslogtreecommitdiff
path: root/util/getpir/checksum.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/getpir/checksum.c')
-rw-r--r--util/getpir/checksum.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/getpir/checksum.c b/util/getpir/checksum.c
new file mode 100644
index 0000000000..a202f90912
--- /dev/null
+++ b/util/getpir/checksum.c
@@ -0,0 +1,14 @@
+#include <arch/pirq_routing.h>
+
+#include "checksum.h"
+
+int calc_checksum(struct irq_routing_table *rt)
+{
+ long i;
+ uint8_t *addr, sum = 0;
+
+ addr = (uint8_t *) rt;
+ for (i = 0; i < rt->size; i++)
+ sum += addr[i];
+ return (sum);
+}