summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorSven Schnelle <svens@stackframe.org>2012-06-20 09:58:21 +0200
committerSven Schnelle <svens@stackframe.org>2012-06-20 12:46:28 +0200
commit2fcc166fb89f85fc91bf5270a0d0973feb077cab (patch)
tree62afff6c4889ef8cf3309a483d6ab85e6139da80 /util
parent4fbcaecf9a457d80eaf131a858617756c4f62376 (diff)
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> Reviewed-on: http://review.coreboot.org/1113 Tested-by: build bot (Jenkins)
Diffstat (limited to 'util')
-rw-r--r--util/mptable/mptable.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/util/mptable/mptable.c b/util/mptable/mptable.c
index 1aabe1782f..e2818610b6 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)