cosmetic update for getpir.
[coreboot.git] / util / getpir / code_gen.c
index 6d9a7e4c95c6680bb1eae15080b5c5e31e3540d3..bd7dc36a88fa19ad57fd484d8f8c1ffe1e816a13 100644 (file)
@@ -9,7 +9,7 @@ static char *preamble[] = {
        " * Contains the IRQ Routing Table dumped directly from your\n",
        " * memory, which BIOS sets up.\n",
        " *\n",
-       " * Documentation at: http://www.microsoft.com/hwdev/busbios/PCIIRQ.HTM\n */\n\n",
+       " * Documentation at: http://www.microsoft.com/whdc/archive/pciirq.mspx\n */\n\n",
        "#ifdef GETPIR\n",
        "#include \"pirq_routing.h\"\n",
        "#else\n"
@@ -46,7 +46,7 @@ void code_gen(char *filename, struct irq_routing_table *rt)
                rt->exclusive_irqs);
        fprintf(fpir, "\t%#x,            /* Vendor */\n", rt->rtr_vendor);
        fprintf(fpir, "\t%#x,            /* Device */\n", rt->rtr_device);
-       fprintf(fpir, "\t%#x,            /* Crap (miniport) */\n",
+       fprintf(fpir, "\t%#x,            /* Miniport */\n",
                rt->miniport_data);
        fprintf(fpir, "\t{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* u8 rfu[11] */\n");
        fprintf(fpir, "\t%#x,            /* u8 checksum. This has to be set to some\n                       value that would give 0 after the sum of all\n                          bytes for this structure (including checksum) */\n",
@@ -54,7 +54,7 @@ void code_gen(char *filename, struct irq_routing_table *rt)
        fprintf(fpir, "\t{\n");
        fprintf(fpir, "\t\t/* bus,     dev|fn,   {link, bitmap}, {link, bitmap}, {link, bitmap}, {link, bitmap},  slot, rfu */\n");
        for (i = 0; i < ts; i++) {
-               fprintf(fpir, "\t\t{0x%02x,(0x%02x<<3)|0x%01x, {{0x%02x, 0x%04x}, {0x%02x, 0x%04x}, {0x%02x, 0x%04x}, {0x%02x, 0x0%04x}}, 0x%x, 0x%x},\n",
+               fprintf(fpir, "\t\t{0x%02x,(0x%02x<<3)|0x%01x, {{0x%02x, 0x%04x}, {0x%02x, 0x%04x}, {0x%02x, 0x%04x}, {0x%02x, 0x%04x}}, 0x%x, 0x%x},\n",
                        (se_arr+i)->bus, (se_arr+i)->devfn >> 3,
                        (se_arr+i)->devfn & 7, (se_arr+i)->irq[0].link,
                        (se_arr+i)->irq[0].bitmap, (se_arr+i)->irq[1].link,
@@ -66,5 +66,10 @@ void code_gen(char *filename, struct irq_routing_table *rt)
        fprintf(fpir, "\t}\n");
        fprintf(fpir, "};\n");
 
+       fprintf(fpir, "\nunsigned long write_pirq_routing_table(unsigned long addr)\n");
+       fprintf(fpir, "{\n");
+       fprintf(fpir, "\treturn copy_pirq_routing_table(addr);\n");
+       fprintf(fpir, "}\n");
+
        fclose(fpir);
 }