Sven Schnelle (svens@stackframe.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1113
-gerrit
commit 2c70985cc8a680983ce836c806bd70c00d97f437 Author: Sven Schnelle svens@stackframe.org Date: Wed Jun 20 09:58:21 2012 +0200
mptable: pretty print PCI INT entries
make it more readable by adding INT defines and a left shift.
Change-Id: I7db4d8c71ab4d705833019aa4cc2f11cef7d4fee Signed-off-by: Sven Schnelle svens@stackframe.org --- util/mptable/mptable.c | 30 +++++++++++++++++++++++------- 1 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/util/mptable/mptable.c b/util/mptable/mptable.c index 1aabe17..e281861 100644 --- a/util/mptable/mptable.c +++ b/util/mptable/mptable.c @@ -298,6 +298,11 @@ char *preamble[] = { "#include <string.h>", "#include <stdint.h>", "", + "#define INTA 0x00", + "#define INTB 0x01", + "#define INTC 0x02", + "#define INTD 0x03", + "", "static void *smp_write_config_table(void *v)", "{", " struct mp_config_table *mc;", @@ -1090,14 +1095,25 @@ static void intEntry(void) printf("\t %6d", (int)entry.dstApicID); printf("\t %3d\n", (int)entry.dstApicINT); } - printf("\tsmp_write_intsrc(mc, %s, %s|%s, 0x%x, 0x%x, 0x%x, 0x%x);\n", - intTypes[(int)entry.intType], - triggerMode[((int)entry.intFlags >> 2) & 0x03], - polarityMode[(int)entry.intFlags & 0x03], - (int)entry.srcBusID, - (int)entry.srcBusIRQ, - (int)entry.dstApicID, (int)entry.dstApicINT);
+ if (busses[(int)entry.srcBusID] == PCI) { + printf("\tsmp_write_intsrc(mc, %s, %s|%s, 0x%x, (0x%02x << 2) | INT%c, 0x%x, 0x%x);\n", + intTypes[(int)entry.intType], + triggerMode[((int)entry.intFlags >> 2) & 0x03], + polarityMode[(int)entry.intFlags & 0x03], + (int)entry.srcBusID, + (int)entry.srcBusIRQ >> 2, + ((int)entry.srcBusIRQ & 3) + 'A', + (int)entry.dstApicID, (int)entry.dstApicINT); + } else { + printf("\tsmp_write_intsrc(mc, %s, %s|%s, 0x%x, 0x%x, 0x%x, 0x%x);\n", + intTypes[(int)entry.intType], + triggerMode[((int)entry.intFlags >> 2) & 0x03], + polarityMode[(int)entry.intFlags & 0x03], + (int)entry.srcBusID, + (int)entry.srcBusIRQ, + (int)entry.dstApicID, (int)entry.dstApicINT); + } }
static void lintEntry(void)