diff options
author | Li-Ta Lo <ollie@lanl.gov> | 2004-04-14 22:24:50 +0000 |
---|---|---|
committer | Li-Ta Lo <ollie@lanl.gov> | 2004-04-14 22:24:50 +0000 |
commit | 6463ae7f1bd1f7ab60725529cf79af30a0e7297d (patch) | |
tree | e8ddaba7c8da40c8f125149b0c3457c48550f619 /util/getpir/checksum.c | |
parent | 815a80316448f72ec9501da5c545595c30880e70 (diff) |
seperate checksum and code generating code.
use mmap instead of file io
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1504 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/getpir/checksum.c')
-rw-r--r-- | util/getpir/checksum.c | 14 |
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); +} |