diff options
author | peter <peter@FreeBSD.org> | 2001-01-18 07:42:02 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-01-18 07:42:02 +0000 |
commit | a6e9fcc15cd9747bd009b96d0ce69e7815443387 (patch) | |
tree | 8a566fc154666a5f70a269fbcf126db7e09ba16b /usr.sbin/mptable | |
parent | 5545c6b0d59187974427d2013757c05fe4bc354e (diff) | |
download | FreeBSD-src-a6e9fcc15cd9747bd009b96d0ce69e7815443387.zip FreeBSD-src-a6e9fcc15cd9747bd009b96d0ce69e7815443387.tar.gz |
Deal with table parsing bugs caused by out-of-order record entries.
Complain about out-of-order entries. This fixes the 'mp extended
table HOSED!" report on the DL360 we have here with the "fixed" compaq
bios rom to fix the table length off-by-one error.
Diffstat (limited to 'usr.sbin/mptable')
-rw-r--r-- | usr.sbin/mptable/mptable.c | 72 |
1 files changed, 41 insertions, 31 deletions
diff --git a/usr.sbin/mptable/mptable.c b/usr.sbin/mptable/mptable.c index 784b415..6dd24d7 100644 --- a/usr.sbin/mptable/mptable.c +++ b/usr.sbin/mptable/mptable.c @@ -669,9 +669,10 @@ MPConfigTableHeader( void* pap ) vm_offset_t paddr; mpcth_t cth; int x; - int totalSize, t; + int totalSize; int count, c; int type; + int oldtype, entrytype; if ( pap == 0 ) { printf( "MP Configuration Table Header MISSING!\n" ); @@ -733,45 +734,54 @@ MPConfigTableHeader( void* pap ) napic = 0; nintr = 0; - /* process all the CPUs */ - printf( "--\nProcessors:\tAPIC ID\tVersion\tState" - "\t\tFamily\tModel\tStep\tFlags\n" ); - for ( t = totalSize, c = count; c; c-- ) { - if ( readType() == 0 ) + oldtype = -1; + for (c = count; c; c--) { + entrytype = readType(); + if (entrytype != oldtype) + printf("--\n"); + if (entrytype < oldtype) + printf("MPTABLE OUT OF ORDER!\n"); + switch (entrytype) { + case 0: + if (oldtype != 0) + printf( "Processors:\tAPIC ID\tVersion\tState" + "\t\tFamily\tModel\tStep\tFlags\n" ); + oldtype = 0; processorEntry(); - totalSize -= basetableEntryTypes[ 0 ].length; - } + break; - /* process all the busses */ - printf( "--\nBus:\t\tBus ID\tType\n" ); - for ( t = totalSize, c = count; c; c-- ) { - if ( readType() == 1 ) + case 1: + if (oldtype != 1) + printf( "Bus:\t\tBus ID\tType\n" ); + oldtype = 1; busEntry(); - totalSize -= basetableEntryTypes[ 1 ].length; - } + break; - /* process all the apics */ - printf( "--\nI/O APICs:\tAPIC ID\tVersion\tState\t\tAddress\n" ); - for ( t = totalSize, c = count; c; c-- ) { - if ( readType() == 2 ) + case 2: + if (oldtype != 2) + printf( "I/O APICs:\tAPIC ID\tVersion\tState\t\tAddress\n" ); + oldtype = 2; ioApicEntry(); - totalSize -= basetableEntryTypes[ 2 ].length; - } + break; - /* process all the I/O Ints */ - printf( "--\nI/O Ints:\tType\tPolarity Trigger\tBus ID\t IRQ\tAPIC ID\tPIN#\n" ); - for ( t = totalSize, c = count; c; c-- ) { - if ( readType() == 3 ) + case 3: + if (oldtype != 3) + printf( "I/O Ints:\tType\tPolarity Trigger\tBus ID\t IRQ\tAPIC ID\tPIN#\n" ); + oldtype = 3; intEntry(); - totalSize -= basetableEntryTypes[ 3 ].length; - } + break; - /* process all the Local Ints */ - printf( "--\nLocal Ints:\tType\tPolarity Trigger\tBus ID\t IRQ\tAPIC ID\tPIN#\n" ); - for ( t = totalSize, c = count; c; c-- ) { - if ( readType() == 4 ) + case 4: + if (oldtype != 4) + printf( "Local Ints:\tType\tPolarity Trigger\tBus ID\t IRQ\tAPIC ID\tPIN#\n" ); + oldtype = 4; intEntry(); - totalSize -= basetableEntryTypes[ 4 ].length; + break; + + default: + printf("MPTABLE HOSED! record type = %d\n", entrytype); + exit(1); + } } |