coreboot-kgpe-d16/util/getpir/checksum.c
Jeremy Jackson 46d65e85a1 Jeremy Jackson wrote:
I'm guessing nobody has tried compiling it with 64bit userspace?

Patch makes it compile cleanly and stops a "SEGV instead of working"
issue.

I also added a few checks for errors on system calls.

Signed-off-by: Jeremy Jackson <jerj@coplanar.net>

Reworked and
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2602 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2007-04-11 18:44:42 +00:00

13 lines
225 B
C

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