From ca31bc3cd5bbc50eec9d22b6091c2a3e510c270b Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Mon, 28 Jan 2008 00:04:23 +0000 Subject: [PATCH] Fix mptable util so the output will compile Signed-off-by: Jon Dufresne Acked-by: Corey Osgood git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3084 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/mptable/mptable.c | 48 +++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/util/mptable/mptable.c b/util/mptable/mptable.c index 9c6b4f3127..0550981d0d 100644 --- a/util/mptable/mptable.c +++ b/util/mptable/mptable.c @@ -302,10 +302,10 @@ int noisy = 0; /* preamble to the mptable. This is fixed for all coreboots */ char *preamble[] = { +"#include ", "#include ", +"#include ", "#include ", -"#include ", -"#include ", "#include ", "", "void *smp_write_config_table(void *v)", @@ -361,31 +361,35 @@ char *postamble[] = { char *ioapic_code[] = { " smp_write_ioapic(mc, 2, 0x20, 0xfec00000);", " {", -" struct pci_dev *dev;", -" uint32_t base;", -" dev = pci_find_slot(1, PCI_DEVFN(0x1e,0));", +" device_t dev;", +" struct resource *res;", +" dev = dev_find_slot(1, PCI_DEVFN(0x1e,0));", " if (dev) {", -" pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &base);", -" base &= PCI_BASE_ADDRESS_MEM_MASK;", -" smp_write_ioapic(mc, 3, 0x20, base);", +" res = find_resource(dev, PCI_BASE_ADDRESS_0);", +" if (res) {", +" smp_write_ioapic(mc, 3, 0x20, res->base);", +" }", " }", -" dev = pci_find_slot(1, PCI_DEVFN(0x1c,0));", +" dev = dev_find_slot(1, PCI_DEVFN(0x1c,0));", " if (dev) {", -" pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &base);", -" base &= PCI_BASE_ADDRESS_MEM_MASK;", -" smp_write_ioapic(mc, 4, 0x20, base);", +" res = find_resource(dev, PCI_BASE_ADDRESS_0);", +" if (res) {", +" smp_write_ioapic(mc, 4, 0x20, res->base);", +" }", " }", -" dev = pci_find_slot(4, PCI_DEVFN(0x1e,0));", +" dev = dev_find_slot(4, PCI_DEVFN(0x1e,0));", " if (dev) {", -" pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &base);", -" base &= PCI_BASE_ADDRESS_MEM_MASK;", -" smp_write_ioapic(mc, 5, 0x20, base);", +" res = find_resource(dev, PCI_BASE_ADDRESS_0);", +" if (res) {", +" smp_write_ioapic(mc, 5, 0x20, res->base);", +" }", " }", -" dev = pci_find_slot(4, PCI_DEVFN(0x1c,0));", +" dev = dev_find_slot(4, PCI_DEVFN(0x1c,0));", " if (dev) {", -" pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &base);", -" base &= PCI_BASE_ADDRESS_MEM_MASK;", -" smp_write_ioapic(mc, 8, 0x20, base);", +" res = find_resource(dev, PCI_BASE_ADDRESS_0);", +" if (res) {", +" smp_write_ioapic(mc, 8, 0x20, res->base);", +" }", " }", " }", 0 @@ -1122,10 +1126,10 @@ char* intTypes[] = { }; char* polarityMode[] = { - "conforms", "MP_IRQ_POLARITY_HIGH", "reserved", "MP_IRQ_POLARITY_LOW" + "MP_IRQ_POLARITY_DEFAULT", "MP_IRQ_POLARITY_HIGH", "reserved", "MP_IRQ_POLARITY_LOW" }; char* triggerMode[] = { - "conforms", "MP_IRQ_TRIGGER_EDGE", "reserved", "MP_IRQ_TRIGGER_LEVEL" + "MP_IRQ_TRIGGER_DEFAULT", "MP_IRQ_TRIGGER_EDGE", "reserved", "MP_IRQ_TRIGGER_LEVEL" }; static void