2004-04-13 23:06:45 +02:00
|
|
|
/* checkpir.c : This software is released under GPL
|
2008-01-18 16:34:24 +01:00
|
|
|
* For coreboot use only
|
2007-04-11 20:44:42 +02:00
|
|
|
* Aug 26 2001 , Nikolai Vladychevski, <niko@isl.net.mx>
|
|
|
|
*/
|
2004-04-13 23:06:45 +02:00
|
|
|
|
|
|
|
#include <stdio.h>
|
2007-04-11 20:44:42 +02:00
|
|
|
#include "pirq_routing.h"
|
2004-04-15 00:24:50 +02:00
|
|
|
#include "checksum.h"
|
2004-04-13 23:06:45 +02:00
|
|
|
|
2004-04-15 00:24:50 +02:00
|
|
|
struct irq_routing_table *rt;
|
2004-04-13 23:06:45 +02:00
|
|
|
|
2007-04-11 20:44:42 +02:00
|
|
|
int main(void)
|
2004-04-13 23:06:45 +02:00
|
|
|
{
|
|
|
|
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) {
|
2008-01-18 16:34:24 +01:00
|
|
|
printf("Checksum for IRQ Routing table is ok. You can use irq_tables.c in coreboot now.\n");
|
2004-04-13 23:06:45 +02:00
|
|
|
} 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);
|
|
|
|
}
|
2007-04-11 20:44:42 +02:00
|
|
|
return 0;
|
2004-04-13 23:06:45 +02:00
|
|
|
}
|