46d65e85a1
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
31 lines
807 B
C
31 lines
807 B
C
/* checkpir.c : This software is released under GPL
|
|
* For LinuxBIOS use only
|
|
* Aug 26 2001 , Nikolai Vladychevski, <niko@isl.net.mx>
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include "pirq_routing.h"
|
|
#include "checksum.h"
|
|
|
|
struct irq_routing_table *rt;
|
|
|
|
int main(void)
|
|
{
|
|
uint8_t sum, newsum;
|
|
|
|
rt = (struct irq_routing_table *) &intel_irq_routing_table;
|
|
sum = calc_checksum(rt);
|
|
|
|
printf("Validating checksum, file: irq_tables.c that was in ./ at compile time...\n");
|
|
printf("(no other tests are done)\n");
|
|
|
|
if (!sum) {
|
|
printf("Checksum for IRQ Routing table is ok. You can use irq_tables.c in LinuxBIOS now.\n");
|
|
} else {
|
|
newsum = rt->checksum - sum;
|
|
printf("BAD CHECKSUM for IRQ Routing table !!!!\n");
|
|
printf("If you want to make it valid, change the checksum to: %#x\n",
|
|
newsum);
|
|
}
|
|
return 0;
|
|
}
|