Force coreboot mconf to create temp files in the output directory
[coreboot.git] / util / getpir / checkpir.c
1 /* checkpir.c : This software is released under GPL
2  * For coreboot use only
3  * Aug 26 2001 , Nikolai Vladychevski, <niko@isl.net.mx>
4  */
5
6 #include <stdio.h>
7 #include "pirq_routing.h"
8 #include "checksum.h"
9
10 struct irq_routing_table *rt;
11
12 int main(void)
13 {
14         uint8_t sum, newsum;
15
16         rt = (struct irq_routing_table *) &intel_irq_routing_table;
17         sum = calc_checksum(rt);
18
19         printf("Validating checksum, file: irq_tables.c that was in ./ at compile time...\n");
20         printf("(no other tests are done)\n");
21
22         if (!sum) {
23                 printf("Checksum for IRQ Routing table is ok. You can use irq_tables.c in coreboot now.\n");
24         } else {
25                 newsum = rt->checksum - sum;
26                 printf("BAD CHECKSUM for IRQ Routing table !!!!\n");
27                 printf("If you want to make it valid, change the checksum to: %#x\n",
28                        newsum);
29         }
30         return 0;
31 }