coreboot-kgpe-d16/util/getpir/checksum.c
Li-Ta Lo 6463ae7f1b 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
2004-04-14 22:24:50 +00:00

14 lines
231 B
C

#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);
}