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