diff options
author | fsmp <fsmp@FreeBSD.org> | 1997-05-22 22:35:42 +0000 |
---|---|---|
committer | fsmp <fsmp@FreeBSD.org> | 1997-05-22 22:35:42 +0000 |
commit | 5a1c8ae0ba8a3d155b1fd30aae218425e8fa0769 (patch) | |
tree | ba5232f761d2b14950d4f28ee2f33f54a7eca67c | |
parent | 6c60e808838991bbedd72ec1f46a6e207c8de916 (diff) | |
download | FreeBSD-src-5a1c8ae0ba8a3d155b1fd30aae218425e8fa0769.zip FreeBSD-src-5a1c8ae0ba8a3d155b1fd30aae218425e8fa0769.tar.gz |
Convert all:
panic( "xxxxx\n" );
to:
printf( "xxxxx\n" );
panic( "\n" );
For some as yet undetermined reason the argument to panic() is often NOT
printed, and the system sometimes hangs before reaching the panic printout.
So we hopefully at least print some useful info before the hang, as oppossed to
leaving the user clueless as to what has happened.
-rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 76 | ||||
-rw-r--r-- | sys/amd64/amd64/mptable.c | 76 | ||||
-rw-r--r-- | sys/amd64/include/mptable.h | 76 | ||||
-rw-r--r-- | sys/i386/i386/mp_machdep.c | 76 | ||||
-rw-r--r-- | sys/i386/i386/mptable.c | 76 | ||||
-rw-r--r-- | sys/i386/include/mptable.h | 76 | ||||
-rw-r--r-- | sys/kern/subr_smp.c | 76 |
7 files changed, 343 insertions, 189 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 55bc8d2..7d57dd7 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.8 1997/05/05 22:56:27 fsmp Exp $ + * $Id: mp_machdep.c,v 1.9 1997/05/07 22:25:27 fsmp Exp $ */ #include "opt_smp.h" @@ -175,8 +175,8 @@ mp_start(void) if (mp_probe(base_memory)) mp_enable(boot_address); else { - printf("MP FPS NOT FOUND, suggest use of 'mptable' program\n"); - panic("can't continue!\n"); + printf( "MP FPS not found, can't continue!\n" ); + panic( "\n" ); } /* finish pmap initialization - turn off V==P mapping at zero */ @@ -331,8 +331,10 @@ mp_enable(u_int boot_addr) /* program each IO APIC in the system */ for (apic = 0; apic < mp_napics; ++apic) - if (io_apic_setup(apic) < 0) - panic("IO APIC setup failure\n"); + if (io_apic_setup(apic) < 0) { + printf( "IO APIC setup failure\n" ); + panic( "\n" ); + } /* install an inter-CPU IPI for TLB invalidation */ setidt(ICU_OFFSET + XINVLTLB_OFFSET, Xinvltlb, @@ -596,8 +598,10 @@ parse_mp_table(void) } #endif /* TEST_DEFAULT_CONFIG */ - if ((cth = fps->pap) == 0) - panic("MP Configuration Table Header MISSING!\n"); + if ((cth = fps->pap) == 0) { + printf( "MP Configuration Table Header MISSING!\n" ); + panic( "\n" ); + } cpu_apic_address = (vm_offset_t) cth->apic_address; @@ -630,7 +634,8 @@ parse_mp_table(void) /* int_entry(position); */ break; default: - panic("mpfps Base Table HOSED!\n"); + printf( "mpfps Base Table HOSED!\n" ); + panic( "\n" ); /* NOTREACHED */ } @@ -638,8 +643,10 @@ parse_mp_table(void) (u_char *) position += basetable_entry_types[type].length; } - if (boot_cpu_id == -1) - panic("NO BSP found!\n"); + if (boot_cpu_id == -1) { + printf( "NO BSP found!\n" ); + panic( "\n" ); + } /* record # of APs found */ mp_naps = (cpu - 1); @@ -733,8 +740,8 @@ fix_mp_table(void) if (bus_data[x].bus_type != PCI) continue; if (bus_data[x].bus_id >= num_pci_bus ) { - printf("bad PCI bus numbering\n"); - panic("\n"); + printf( "bad PCI bus numbering\n" ); + panic( "\n" ); } } } @@ -777,8 +784,10 @@ bus_entry(bus_entry_ptr entry, int *bus) char name[8]; char c; - if ((x = (*bus)++) == NBUS) - panic("too many busses, increase 'NBUS'\n"); + if ((x = (*bus)++) == NBUS) { + printf( "too many busses, increase 'NBUS'\n" ); + panic( "\n" ); + } /* encode the name into an index */ for (y = 0; y < 6; ++y) { @@ -788,8 +797,10 @@ bus_entry(bus_entry_ptr entry, int *bus) } name[y] = '\0'; - if ((y = lookup_bus_type(name)) == UNKNOWN_BUSTYPE) - panic("unknown bus type: '%s'\n", name); + if ((y = lookup_bus_type(name)) == UNKNOWN_BUSTYPE) { + printf( "unknown bus type: '%s'\n", name ); + panic( "\n" ); + } bus_data[x].bus_id = entry->bus_id; bus_data[x].bus_type = y; @@ -804,8 +815,10 @@ io_apic_entry(io_apic_entry_ptr entry, int *apic) if (!(entry->apic_flags & IOAPICENTRY_FLAG_EN)) return; - if ((x = (*apic)++) == NAPIC) - panic("too many APICs, increase 'NAPIC'\n"); + if ((x = (*apic)++) == NAPIC) { + printf( "too many APICs, increase 'NAPIC'\n" ); + panic( "\n" ); + } IO_TO_ID(x) = entry->apic_id; ID_TO_IO(entry->apic_id) = x; @@ -832,8 +845,10 @@ int_entry(int_entry_ptr entry, int *intr) { int x; - if ((x = (*intr)++) == NINTR) - panic("too many INTs, increase 'NINTR'\n"); + if ((x = (*intr)++) == NINTR) { + printf( "too many INTs, increase 'NINTR'\n" ); + panic( "\n" ); + } io_apic_ints[x].int_type = entry->int_type; io_apic_ints[x].int_flags = entry->int_flags; @@ -1203,8 +1218,10 @@ default_mp_table(int type) ux |= 0x02000000; /* set it to '2' */ io_apic_write(0, IOAPIC_ID, ux); /* write new value */ ux = io_apic_read(0, IOAPIC_ID); /* re-read && test */ - if ((ux & APIC_ID_MASK) != 0x02000000) - panic("Problem: can't control IO APIC ID, reg: 0x%08x\n", ux); + if ((ux & APIC_ID_MASK) != 0x02000000) { + printf( "can't control IO APIC ID, reg: 0x%08x\n", ux ); + panic( "\n" ); + } io_apic_id = 2; } IO_TO_ID(0) = io_apic_id; @@ -1230,7 +1247,8 @@ default_mp_table(int type) /* case 4: case 7: MCA NOT supported */ default: /* illegal/reserved */ - panic("BAD default MP config: %d\n", type); + printf( "BAD default MP config: %d\n", type ); + panic( "\n" ); } #if defined(APIC_IO) @@ -1250,9 +1268,11 @@ default_mp_table(int type) io_apic_ints[13].int_type = 0xff; /* N/C */ #if !defined(APIC_MIXED_MODE) /** FIXME: ??? */ - panic("sorry, can't support type 2 default yet\n"); + printf( "sorry, can't support type 2 default yet\n" ); + panic( "\n" ); #endif /* APIC_MIXED_MODE */ - } else + } + else io_apic_ints[2].src_bus_irq = 0; /* ISA IRQ0 is on APIC INT 2 */ if (type == 7) @@ -1317,8 +1337,10 @@ start_all_aps(u_int boot_addr) * somewhere */ printf("panic y/n? [n] "); - if (cngetc() != 'n') - panic("bye-bye\n"); + if (cngetc() != 'n') { + printf( "bye-bye\n" ); + panic( "\n" ); + } } CHECK_PRINT("trace"); /* show checkpoints */ diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c index 55bc8d2..7d57dd7 100644 --- a/sys/amd64/amd64/mptable.c +++ b/sys/amd64/amd64/mptable.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.8 1997/05/05 22:56:27 fsmp Exp $ + * $Id: mp_machdep.c,v 1.9 1997/05/07 22:25:27 fsmp Exp $ */ #include "opt_smp.h" @@ -175,8 +175,8 @@ mp_start(void) if (mp_probe(base_memory)) mp_enable(boot_address); else { - printf("MP FPS NOT FOUND, suggest use of 'mptable' program\n"); - panic("can't continue!\n"); + printf( "MP FPS not found, can't continue!\n" ); + panic( "\n" ); } /* finish pmap initialization - turn off V==P mapping at zero */ @@ -331,8 +331,10 @@ mp_enable(u_int boot_addr) /* program each IO APIC in the system */ for (apic = 0; apic < mp_napics; ++apic) - if (io_apic_setup(apic) < 0) - panic("IO APIC setup failure\n"); + if (io_apic_setup(apic) < 0) { + printf( "IO APIC setup failure\n" ); + panic( "\n" ); + } /* install an inter-CPU IPI for TLB invalidation */ setidt(ICU_OFFSET + XINVLTLB_OFFSET, Xinvltlb, @@ -596,8 +598,10 @@ parse_mp_table(void) } #endif /* TEST_DEFAULT_CONFIG */ - if ((cth = fps->pap) == 0) - panic("MP Configuration Table Header MISSING!\n"); + if ((cth = fps->pap) == 0) { + printf( "MP Configuration Table Header MISSING!\n" ); + panic( "\n" ); + } cpu_apic_address = (vm_offset_t) cth->apic_address; @@ -630,7 +634,8 @@ parse_mp_table(void) /* int_entry(position); */ break; default: - panic("mpfps Base Table HOSED!\n"); + printf( "mpfps Base Table HOSED!\n" ); + panic( "\n" ); /* NOTREACHED */ } @@ -638,8 +643,10 @@ parse_mp_table(void) (u_char *) position += basetable_entry_types[type].length; } - if (boot_cpu_id == -1) - panic("NO BSP found!\n"); + if (boot_cpu_id == -1) { + printf( "NO BSP found!\n" ); + panic( "\n" ); + } /* record # of APs found */ mp_naps = (cpu - 1); @@ -733,8 +740,8 @@ fix_mp_table(void) if (bus_data[x].bus_type != PCI) continue; if (bus_data[x].bus_id >= num_pci_bus ) { - printf("bad PCI bus numbering\n"); - panic("\n"); + printf( "bad PCI bus numbering\n" ); + panic( "\n" ); } } } @@ -777,8 +784,10 @@ bus_entry(bus_entry_ptr entry, int *bus) char name[8]; char c; - if ((x = (*bus)++) == NBUS) - panic("too many busses, increase 'NBUS'\n"); + if ((x = (*bus)++) == NBUS) { + printf( "too many busses, increase 'NBUS'\n" ); + panic( "\n" ); + } /* encode the name into an index */ for (y = 0; y < 6; ++y) { @@ -788,8 +797,10 @@ bus_entry(bus_entry_ptr entry, int *bus) } name[y] = '\0'; - if ((y = lookup_bus_type(name)) == UNKNOWN_BUSTYPE) - panic("unknown bus type: '%s'\n", name); + if ((y = lookup_bus_type(name)) == UNKNOWN_BUSTYPE) { + printf( "unknown bus type: '%s'\n", name ); + panic( "\n" ); + } bus_data[x].bus_id = entry->bus_id; bus_data[x].bus_type = y; @@ -804,8 +815,10 @@ io_apic_entry(io_apic_entry_ptr entry, int *apic) if (!(entry->apic_flags & IOAPICENTRY_FLAG_EN)) return; - if ((x = (*apic)++) == NAPIC) - panic("too many APICs, increase 'NAPIC'\n"); + if ((x = (*apic)++) == NAPIC) { + printf( "too many APICs, increase 'NAPIC'\n" ); + panic( "\n" ); + } IO_TO_ID(x) = entry->apic_id; ID_TO_IO(entry->apic_id) = x; @@ -832,8 +845,10 @@ int_entry(int_entry_ptr entry, int *intr) { int x; - if ((x = (*intr)++) == NINTR) - panic("too many INTs, increase 'NINTR'\n"); + if ((x = (*intr)++) == NINTR) { + printf( "too many INTs, increase 'NINTR'\n" ); + panic( "\n" ); + } io_apic_ints[x].int_type = entry->int_type; io_apic_ints[x].int_flags = entry->int_flags; @@ -1203,8 +1218,10 @@ default_mp_table(int type) ux |= 0x02000000; /* set it to '2' */ io_apic_write(0, IOAPIC_ID, ux); /* write new value */ ux = io_apic_read(0, IOAPIC_ID); /* re-read && test */ - if ((ux & APIC_ID_MASK) != 0x02000000) - panic("Problem: can't control IO APIC ID, reg: 0x%08x\n", ux); + if ((ux & APIC_ID_MASK) != 0x02000000) { + printf( "can't control IO APIC ID, reg: 0x%08x\n", ux ); + panic( "\n" ); + } io_apic_id = 2; } IO_TO_ID(0) = io_apic_id; @@ -1230,7 +1247,8 @@ default_mp_table(int type) /* case 4: case 7: MCA NOT supported */ default: /* illegal/reserved */ - panic("BAD default MP config: %d\n", type); + printf( "BAD default MP config: %d\n", type ); + panic( "\n" ); } #if defined(APIC_IO) @@ -1250,9 +1268,11 @@ default_mp_table(int type) io_apic_ints[13].int_type = 0xff; /* N/C */ #if !defined(APIC_MIXED_MODE) /** FIXME: ??? */ - panic("sorry, can't support type 2 default yet\n"); + printf( "sorry, can't support type 2 default yet\n" ); + panic( "\n" ); #endif /* APIC_MIXED_MODE */ - } else + } + else io_apic_ints[2].src_bus_irq = 0; /* ISA IRQ0 is on APIC INT 2 */ if (type == 7) @@ -1317,8 +1337,10 @@ start_all_aps(u_int boot_addr) * somewhere */ printf("panic y/n? [n] "); - if (cngetc() != 'n') - panic("bye-bye\n"); + if (cngetc() != 'n') { + printf( "bye-bye\n" ); + panic( "\n" ); + } } CHECK_PRINT("trace"); /* show checkpoints */ diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h index 55bc8d2..7d57dd7 100644 --- a/sys/amd64/include/mptable.h +++ b/sys/amd64/include/mptable.h @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.8 1997/05/05 22:56:27 fsmp Exp $ + * $Id: mp_machdep.c,v 1.9 1997/05/07 22:25:27 fsmp Exp $ */ #include "opt_smp.h" @@ -175,8 +175,8 @@ mp_start(void) if (mp_probe(base_memory)) mp_enable(boot_address); else { - printf("MP FPS NOT FOUND, suggest use of 'mptable' program\n"); - panic("can't continue!\n"); + printf( "MP FPS not found, can't continue!\n" ); + panic( "\n" ); } /* finish pmap initialization - turn off V==P mapping at zero */ @@ -331,8 +331,10 @@ mp_enable(u_int boot_addr) /* program each IO APIC in the system */ for (apic = 0; apic < mp_napics; ++apic) - if (io_apic_setup(apic) < 0) - panic("IO APIC setup failure\n"); + if (io_apic_setup(apic) < 0) { + printf( "IO APIC setup failure\n" ); + panic( "\n" ); + } /* install an inter-CPU IPI for TLB invalidation */ setidt(ICU_OFFSET + XINVLTLB_OFFSET, Xinvltlb, @@ -596,8 +598,10 @@ parse_mp_table(void) } #endif /* TEST_DEFAULT_CONFIG */ - if ((cth = fps->pap) == 0) - panic("MP Configuration Table Header MISSING!\n"); + if ((cth = fps->pap) == 0) { + printf( "MP Configuration Table Header MISSING!\n" ); + panic( "\n" ); + } cpu_apic_address = (vm_offset_t) cth->apic_address; @@ -630,7 +634,8 @@ parse_mp_table(void) /* int_entry(position); */ break; default: - panic("mpfps Base Table HOSED!\n"); + printf( "mpfps Base Table HOSED!\n" ); + panic( "\n" ); /* NOTREACHED */ } @@ -638,8 +643,10 @@ parse_mp_table(void) (u_char *) position += basetable_entry_types[type].length; } - if (boot_cpu_id == -1) - panic("NO BSP found!\n"); + if (boot_cpu_id == -1) { + printf( "NO BSP found!\n" ); + panic( "\n" ); + } /* record # of APs found */ mp_naps = (cpu - 1); @@ -733,8 +740,8 @@ fix_mp_table(void) if (bus_data[x].bus_type != PCI) continue; if (bus_data[x].bus_id >= num_pci_bus ) { - printf("bad PCI bus numbering\n"); - panic("\n"); + printf( "bad PCI bus numbering\n" ); + panic( "\n" ); } } } @@ -777,8 +784,10 @@ bus_entry(bus_entry_ptr entry, int *bus) char name[8]; char c; - if ((x = (*bus)++) == NBUS) - panic("too many busses, increase 'NBUS'\n"); + if ((x = (*bus)++) == NBUS) { + printf( "too many busses, increase 'NBUS'\n" ); + panic( "\n" ); + } /* encode the name into an index */ for (y = 0; y < 6; ++y) { @@ -788,8 +797,10 @@ bus_entry(bus_entry_ptr entry, int *bus) } name[y] = '\0'; - if ((y = lookup_bus_type(name)) == UNKNOWN_BUSTYPE) - panic("unknown bus type: '%s'\n", name); + if ((y = lookup_bus_type(name)) == UNKNOWN_BUSTYPE) { + printf( "unknown bus type: '%s'\n", name ); + panic( "\n" ); + } bus_data[x].bus_id = entry->bus_id; bus_data[x].bus_type = y; @@ -804,8 +815,10 @@ io_apic_entry(io_apic_entry_ptr entry, int *apic) if (!(entry->apic_flags & IOAPICENTRY_FLAG_EN)) return; - if ((x = (*apic)++) == NAPIC) - panic("too many APICs, increase 'NAPIC'\n"); + if ((x = (*apic)++) == NAPIC) { + printf( "too many APICs, increase 'NAPIC'\n" ); + panic( "\n" ); + } IO_TO_ID(x) = entry->apic_id; ID_TO_IO(entry->apic_id) = x; @@ -832,8 +845,10 @@ int_entry(int_entry_ptr entry, int *intr) { int x; - if ((x = (*intr)++) == NINTR) - panic("too many INTs, increase 'NINTR'\n"); + if ((x = (*intr)++) == NINTR) { + printf( "too many INTs, increase 'NINTR'\n" ); + panic( "\n" ); + } io_apic_ints[x].int_type = entry->int_type; io_apic_ints[x].int_flags = entry->int_flags; @@ -1203,8 +1218,10 @@ default_mp_table(int type) ux |= 0x02000000; /* set it to '2' */ io_apic_write(0, IOAPIC_ID, ux); /* write new value */ ux = io_apic_read(0, IOAPIC_ID); /* re-read && test */ - if ((ux & APIC_ID_MASK) != 0x02000000) - panic("Problem: can't control IO APIC ID, reg: 0x%08x\n", ux); + if ((ux & APIC_ID_MASK) != 0x02000000) { + printf( "can't control IO APIC ID, reg: 0x%08x\n", ux ); + panic( "\n" ); + } io_apic_id = 2; } IO_TO_ID(0) = io_apic_id; @@ -1230,7 +1247,8 @@ default_mp_table(int type) /* case 4: case 7: MCA NOT supported */ default: /* illegal/reserved */ - panic("BAD default MP config: %d\n", type); + printf( "BAD default MP config: %d\n", type ); + panic( "\n" ); } #if defined(APIC_IO) @@ -1250,9 +1268,11 @@ default_mp_table(int type) io_apic_ints[13].int_type = 0xff; /* N/C */ #if !defined(APIC_MIXED_MODE) /** FIXME: ??? */ - panic("sorry, can't support type 2 default yet\n"); + printf( "sorry, can't support type 2 default yet\n" ); + panic( "\n" ); #endif /* APIC_MIXED_MODE */ - } else + } + else io_apic_ints[2].src_bus_irq = 0; /* ISA IRQ0 is on APIC INT 2 */ if (type == 7) @@ -1317,8 +1337,10 @@ start_all_aps(u_int boot_addr) * somewhere */ printf("panic y/n? [n] "); - if (cngetc() != 'n') - panic("bye-bye\n"); + if (cngetc() != 'n') { + printf( "bye-bye\n" ); + panic( "\n" ); + } } CHECK_PRINT("trace"); /* show checkpoints */ diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index 55bc8d2..7d57dd7 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.8 1997/05/05 22:56:27 fsmp Exp $ + * $Id: mp_machdep.c,v 1.9 1997/05/07 22:25:27 fsmp Exp $ */ #include "opt_smp.h" @@ -175,8 +175,8 @@ mp_start(void) if (mp_probe(base_memory)) mp_enable(boot_address); else { - printf("MP FPS NOT FOUND, suggest use of 'mptable' program\n"); - panic("can't continue!\n"); + printf( "MP FPS not found, can't continue!\n" ); + panic( "\n" ); } /* finish pmap initialization - turn off V==P mapping at zero */ @@ -331,8 +331,10 @@ mp_enable(u_int boot_addr) /* program each IO APIC in the system */ for (apic = 0; apic < mp_napics; ++apic) - if (io_apic_setup(apic) < 0) - panic("IO APIC setup failure\n"); + if (io_apic_setup(apic) < 0) { + printf( "IO APIC setup failure\n" ); + panic( "\n" ); + } /* install an inter-CPU IPI for TLB invalidation */ setidt(ICU_OFFSET + XINVLTLB_OFFSET, Xinvltlb, @@ -596,8 +598,10 @@ parse_mp_table(void) } #endif /* TEST_DEFAULT_CONFIG */ - if ((cth = fps->pap) == 0) - panic("MP Configuration Table Header MISSING!\n"); + if ((cth = fps->pap) == 0) { + printf( "MP Configuration Table Header MISSING!\n" ); + panic( "\n" ); + } cpu_apic_address = (vm_offset_t) cth->apic_address; @@ -630,7 +634,8 @@ parse_mp_table(void) /* int_entry(position); */ break; default: - panic("mpfps Base Table HOSED!\n"); + printf( "mpfps Base Table HOSED!\n" ); + panic( "\n" ); /* NOTREACHED */ } @@ -638,8 +643,10 @@ parse_mp_table(void) (u_char *) position += basetable_entry_types[type].length; } - if (boot_cpu_id == -1) - panic("NO BSP found!\n"); + if (boot_cpu_id == -1) { + printf( "NO BSP found!\n" ); + panic( "\n" ); + } /* record # of APs found */ mp_naps = (cpu - 1); @@ -733,8 +740,8 @@ fix_mp_table(void) if (bus_data[x].bus_type != PCI) continue; if (bus_data[x].bus_id >= num_pci_bus ) { - printf("bad PCI bus numbering\n"); - panic("\n"); + printf( "bad PCI bus numbering\n" ); + panic( "\n" ); } } } @@ -777,8 +784,10 @@ bus_entry(bus_entry_ptr entry, int *bus) char name[8]; char c; - if ((x = (*bus)++) == NBUS) - panic("too many busses, increase 'NBUS'\n"); + if ((x = (*bus)++) == NBUS) { + printf( "too many busses, increase 'NBUS'\n" ); + panic( "\n" ); + } /* encode the name into an index */ for (y = 0; y < 6; ++y) { @@ -788,8 +797,10 @@ bus_entry(bus_entry_ptr entry, int *bus) } name[y] = '\0'; - if ((y = lookup_bus_type(name)) == UNKNOWN_BUSTYPE) - panic("unknown bus type: '%s'\n", name); + if ((y = lookup_bus_type(name)) == UNKNOWN_BUSTYPE) { + printf( "unknown bus type: '%s'\n", name ); + panic( "\n" ); + } bus_data[x].bus_id = entry->bus_id; bus_data[x].bus_type = y; @@ -804,8 +815,10 @@ io_apic_entry(io_apic_entry_ptr entry, int *apic) if (!(entry->apic_flags & IOAPICENTRY_FLAG_EN)) return; - if ((x = (*apic)++) == NAPIC) - panic("too many APICs, increase 'NAPIC'\n"); + if ((x = (*apic)++) == NAPIC) { + printf( "too many APICs, increase 'NAPIC'\n" ); + panic( "\n" ); + } IO_TO_ID(x) = entry->apic_id; ID_TO_IO(entry->apic_id) = x; @@ -832,8 +845,10 @@ int_entry(int_entry_ptr entry, int *intr) { int x; - if ((x = (*intr)++) == NINTR) - panic("too many INTs, increase 'NINTR'\n"); + if ((x = (*intr)++) == NINTR) { + printf( "too many INTs, increase 'NINTR'\n" ); + panic( "\n" ); + } io_apic_ints[x].int_type = entry->int_type; io_apic_ints[x].int_flags = entry->int_flags; @@ -1203,8 +1218,10 @@ default_mp_table(int type) ux |= 0x02000000; /* set it to '2' */ io_apic_write(0, IOAPIC_ID, ux); /* write new value */ ux = io_apic_read(0, IOAPIC_ID); /* re-read && test */ - if ((ux & APIC_ID_MASK) != 0x02000000) - panic("Problem: can't control IO APIC ID, reg: 0x%08x\n", ux); + if ((ux & APIC_ID_MASK) != 0x02000000) { + printf( "can't control IO APIC ID, reg: 0x%08x\n", ux ); + panic( "\n" ); + } io_apic_id = 2; } IO_TO_ID(0) = io_apic_id; @@ -1230,7 +1247,8 @@ default_mp_table(int type) /* case 4: case 7: MCA NOT supported */ default: /* illegal/reserved */ - panic("BAD default MP config: %d\n", type); + printf( "BAD default MP config: %d\n", type ); + panic( "\n" ); } #if defined(APIC_IO) @@ -1250,9 +1268,11 @@ default_mp_table(int type) io_apic_ints[13].int_type = 0xff; /* N/C */ #if !defined(APIC_MIXED_MODE) /** FIXME: ??? */ - panic("sorry, can't support type 2 default yet\n"); + printf( "sorry, can't support type 2 default yet\n" ); + panic( "\n" ); #endif /* APIC_MIXED_MODE */ - } else + } + else io_apic_ints[2].src_bus_irq = 0; /* ISA IRQ0 is on APIC INT 2 */ if (type == 7) @@ -1317,8 +1337,10 @@ start_all_aps(u_int boot_addr) * somewhere */ printf("panic y/n? [n] "); - if (cngetc() != 'n') - panic("bye-bye\n"); + if (cngetc() != 'n') { + printf( "bye-bye\n" ); + panic( "\n" ); + } } CHECK_PRINT("trace"); /* show checkpoints */ diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c index 55bc8d2..7d57dd7 100644 --- a/sys/i386/i386/mptable.c +++ b/sys/i386/i386/mptable.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.8 1997/05/05 22:56:27 fsmp Exp $ + * $Id: mp_machdep.c,v 1.9 1997/05/07 22:25:27 fsmp Exp $ */ #include "opt_smp.h" @@ -175,8 +175,8 @@ mp_start(void) if (mp_probe(base_memory)) mp_enable(boot_address); else { - printf("MP FPS NOT FOUND, suggest use of 'mptable' program\n"); - panic("can't continue!\n"); + printf( "MP FPS not found, can't continue!\n" ); + panic( "\n" ); } /* finish pmap initialization - turn off V==P mapping at zero */ @@ -331,8 +331,10 @@ mp_enable(u_int boot_addr) /* program each IO APIC in the system */ for (apic = 0; apic < mp_napics; ++apic) - if (io_apic_setup(apic) < 0) - panic("IO APIC setup failure\n"); + if (io_apic_setup(apic) < 0) { + printf( "IO APIC setup failure\n" ); + panic( "\n" ); + } /* install an inter-CPU IPI for TLB invalidation */ setidt(ICU_OFFSET + XINVLTLB_OFFSET, Xinvltlb, @@ -596,8 +598,10 @@ parse_mp_table(void) } #endif /* TEST_DEFAULT_CONFIG */ - if ((cth = fps->pap) == 0) - panic("MP Configuration Table Header MISSING!\n"); + if ((cth = fps->pap) == 0) { + printf( "MP Configuration Table Header MISSING!\n" ); + panic( "\n" ); + } cpu_apic_address = (vm_offset_t) cth->apic_address; @@ -630,7 +634,8 @@ parse_mp_table(void) /* int_entry(position); */ break; default: - panic("mpfps Base Table HOSED!\n"); + printf( "mpfps Base Table HOSED!\n" ); + panic( "\n" ); /* NOTREACHED */ } @@ -638,8 +643,10 @@ parse_mp_table(void) (u_char *) position += basetable_entry_types[type].length; } - if (boot_cpu_id == -1) - panic("NO BSP found!\n"); + if (boot_cpu_id == -1) { + printf( "NO BSP found!\n" ); + panic( "\n" ); + } /* record # of APs found */ mp_naps = (cpu - 1); @@ -733,8 +740,8 @@ fix_mp_table(void) if (bus_data[x].bus_type != PCI) continue; if (bus_data[x].bus_id >= num_pci_bus ) { - printf("bad PCI bus numbering\n"); - panic("\n"); + printf( "bad PCI bus numbering\n" ); + panic( "\n" ); } } } @@ -777,8 +784,10 @@ bus_entry(bus_entry_ptr entry, int *bus) char name[8]; char c; - if ((x = (*bus)++) == NBUS) - panic("too many busses, increase 'NBUS'\n"); + if ((x = (*bus)++) == NBUS) { + printf( "too many busses, increase 'NBUS'\n" ); + panic( "\n" ); + } /* encode the name into an index */ for (y = 0; y < 6; ++y) { @@ -788,8 +797,10 @@ bus_entry(bus_entry_ptr entry, int *bus) } name[y] = '\0'; - if ((y = lookup_bus_type(name)) == UNKNOWN_BUSTYPE) - panic("unknown bus type: '%s'\n", name); + if ((y = lookup_bus_type(name)) == UNKNOWN_BUSTYPE) { + printf( "unknown bus type: '%s'\n", name ); + panic( "\n" ); + } bus_data[x].bus_id = entry->bus_id; bus_data[x].bus_type = y; @@ -804,8 +815,10 @@ io_apic_entry(io_apic_entry_ptr entry, int *apic) if (!(entry->apic_flags & IOAPICENTRY_FLAG_EN)) return; - if ((x = (*apic)++) == NAPIC) - panic("too many APICs, increase 'NAPIC'\n"); + if ((x = (*apic)++) == NAPIC) { + printf( "too many APICs, increase 'NAPIC'\n" ); + panic( "\n" ); + } IO_TO_ID(x) = entry->apic_id; ID_TO_IO(entry->apic_id) = x; @@ -832,8 +845,10 @@ int_entry(int_entry_ptr entry, int *intr) { int x; - if ((x = (*intr)++) == NINTR) - panic("too many INTs, increase 'NINTR'\n"); + if ((x = (*intr)++) == NINTR) { + printf( "too many INTs, increase 'NINTR'\n" ); + panic( "\n" ); + } io_apic_ints[x].int_type = entry->int_type; io_apic_ints[x].int_flags = entry->int_flags; @@ -1203,8 +1218,10 @@ default_mp_table(int type) ux |= 0x02000000; /* set it to '2' */ io_apic_write(0, IOAPIC_ID, ux); /* write new value */ ux = io_apic_read(0, IOAPIC_ID); /* re-read && test */ - if ((ux & APIC_ID_MASK) != 0x02000000) - panic("Problem: can't control IO APIC ID, reg: 0x%08x\n", ux); + if ((ux & APIC_ID_MASK) != 0x02000000) { + printf( "can't control IO APIC ID, reg: 0x%08x\n", ux ); + panic( "\n" ); + } io_apic_id = 2; } IO_TO_ID(0) = io_apic_id; @@ -1230,7 +1247,8 @@ default_mp_table(int type) /* case 4: case 7: MCA NOT supported */ default: /* illegal/reserved */ - panic("BAD default MP config: %d\n", type); + printf( "BAD default MP config: %d\n", type ); + panic( "\n" ); } #if defined(APIC_IO) @@ -1250,9 +1268,11 @@ default_mp_table(int type) io_apic_ints[13].int_type = 0xff; /* N/C */ #if !defined(APIC_MIXED_MODE) /** FIXME: ??? */ - panic("sorry, can't support type 2 default yet\n"); + printf( "sorry, can't support type 2 default yet\n" ); + panic( "\n" ); #endif /* APIC_MIXED_MODE */ - } else + } + else io_apic_ints[2].src_bus_irq = 0; /* ISA IRQ0 is on APIC INT 2 */ if (type == 7) @@ -1317,8 +1337,10 @@ start_all_aps(u_int boot_addr) * somewhere */ printf("panic y/n? [n] "); - if (cngetc() != 'n') - panic("bye-bye\n"); + if (cngetc() != 'n') { + printf( "bye-bye\n" ); + panic( "\n" ); + } } CHECK_PRINT("trace"); /* show checkpoints */ diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h index 55bc8d2..7d57dd7 100644 --- a/sys/i386/include/mptable.h +++ b/sys/i386/include/mptable.h @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.8 1997/05/05 22:56:27 fsmp Exp $ + * $Id: mp_machdep.c,v 1.9 1997/05/07 22:25:27 fsmp Exp $ */ #include "opt_smp.h" @@ -175,8 +175,8 @@ mp_start(void) if (mp_probe(base_memory)) mp_enable(boot_address); else { - printf("MP FPS NOT FOUND, suggest use of 'mptable' program\n"); - panic("can't continue!\n"); + printf( "MP FPS not found, can't continue!\n" ); + panic( "\n" ); } /* finish pmap initialization - turn off V==P mapping at zero */ @@ -331,8 +331,10 @@ mp_enable(u_int boot_addr) /* program each IO APIC in the system */ for (apic = 0; apic < mp_napics; ++apic) - if (io_apic_setup(apic) < 0) - panic("IO APIC setup failure\n"); + if (io_apic_setup(apic) < 0) { + printf( "IO APIC setup failure\n" ); + panic( "\n" ); + } /* install an inter-CPU IPI for TLB invalidation */ setidt(ICU_OFFSET + XINVLTLB_OFFSET, Xinvltlb, @@ -596,8 +598,10 @@ parse_mp_table(void) } #endif /* TEST_DEFAULT_CONFIG */ - if ((cth = fps->pap) == 0) - panic("MP Configuration Table Header MISSING!\n"); + if ((cth = fps->pap) == 0) { + printf( "MP Configuration Table Header MISSING!\n" ); + panic( "\n" ); + } cpu_apic_address = (vm_offset_t) cth->apic_address; @@ -630,7 +634,8 @@ parse_mp_table(void) /* int_entry(position); */ break; default: - panic("mpfps Base Table HOSED!\n"); + printf( "mpfps Base Table HOSED!\n" ); + panic( "\n" ); /* NOTREACHED */ } @@ -638,8 +643,10 @@ parse_mp_table(void) (u_char *) position += basetable_entry_types[type].length; } - if (boot_cpu_id == -1) - panic("NO BSP found!\n"); + if (boot_cpu_id == -1) { + printf( "NO BSP found!\n" ); + panic( "\n" ); + } /* record # of APs found */ mp_naps = (cpu - 1); @@ -733,8 +740,8 @@ fix_mp_table(void) if (bus_data[x].bus_type != PCI) continue; if (bus_data[x].bus_id >= num_pci_bus ) { - printf("bad PCI bus numbering\n"); - panic("\n"); + printf( "bad PCI bus numbering\n" ); + panic( "\n" ); } } } @@ -777,8 +784,10 @@ bus_entry(bus_entry_ptr entry, int *bus) char name[8]; char c; - if ((x = (*bus)++) == NBUS) - panic("too many busses, increase 'NBUS'\n"); + if ((x = (*bus)++) == NBUS) { + printf( "too many busses, increase 'NBUS'\n" ); + panic( "\n" ); + } /* encode the name into an index */ for (y = 0; y < 6; ++y) { @@ -788,8 +797,10 @@ bus_entry(bus_entry_ptr entry, int *bus) } name[y] = '\0'; - if ((y = lookup_bus_type(name)) == UNKNOWN_BUSTYPE) - panic("unknown bus type: '%s'\n", name); + if ((y = lookup_bus_type(name)) == UNKNOWN_BUSTYPE) { + printf( "unknown bus type: '%s'\n", name ); + panic( "\n" ); + } bus_data[x].bus_id = entry->bus_id; bus_data[x].bus_type = y; @@ -804,8 +815,10 @@ io_apic_entry(io_apic_entry_ptr entry, int *apic) if (!(entry->apic_flags & IOAPICENTRY_FLAG_EN)) return; - if ((x = (*apic)++) == NAPIC) - panic("too many APICs, increase 'NAPIC'\n"); + if ((x = (*apic)++) == NAPIC) { + printf( "too many APICs, increase 'NAPIC'\n" ); + panic( "\n" ); + } IO_TO_ID(x) = entry->apic_id; ID_TO_IO(entry->apic_id) = x; @@ -832,8 +845,10 @@ int_entry(int_entry_ptr entry, int *intr) { int x; - if ((x = (*intr)++) == NINTR) - panic("too many INTs, increase 'NINTR'\n"); + if ((x = (*intr)++) == NINTR) { + printf( "too many INTs, increase 'NINTR'\n" ); + panic( "\n" ); + } io_apic_ints[x].int_type = entry->int_type; io_apic_ints[x].int_flags = entry->int_flags; @@ -1203,8 +1218,10 @@ default_mp_table(int type) ux |= 0x02000000; /* set it to '2' */ io_apic_write(0, IOAPIC_ID, ux); /* write new value */ ux = io_apic_read(0, IOAPIC_ID); /* re-read && test */ - if ((ux & APIC_ID_MASK) != 0x02000000) - panic("Problem: can't control IO APIC ID, reg: 0x%08x\n", ux); + if ((ux & APIC_ID_MASK) != 0x02000000) { + printf( "can't control IO APIC ID, reg: 0x%08x\n", ux ); + panic( "\n" ); + } io_apic_id = 2; } IO_TO_ID(0) = io_apic_id; @@ -1230,7 +1247,8 @@ default_mp_table(int type) /* case 4: case 7: MCA NOT supported */ default: /* illegal/reserved */ - panic("BAD default MP config: %d\n", type); + printf( "BAD default MP config: %d\n", type ); + panic( "\n" ); } #if defined(APIC_IO) @@ -1250,9 +1268,11 @@ default_mp_table(int type) io_apic_ints[13].int_type = 0xff; /* N/C */ #if !defined(APIC_MIXED_MODE) /** FIXME: ??? */ - panic("sorry, can't support type 2 default yet\n"); + printf( "sorry, can't support type 2 default yet\n" ); + panic( "\n" ); #endif /* APIC_MIXED_MODE */ - } else + } + else io_apic_ints[2].src_bus_irq = 0; /* ISA IRQ0 is on APIC INT 2 */ if (type == 7) @@ -1317,8 +1337,10 @@ start_all_aps(u_int boot_addr) * somewhere */ printf("panic y/n? [n] "); - if (cngetc() != 'n') - panic("bye-bye\n"); + if (cngetc() != 'n') { + printf( "bye-bye\n" ); + panic( "\n" ); + } } CHECK_PRINT("trace"); /* show checkpoints */ diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index 55bc8d2..7d57dd7 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.8 1997/05/05 22:56:27 fsmp Exp $ + * $Id: mp_machdep.c,v 1.9 1997/05/07 22:25:27 fsmp Exp $ */ #include "opt_smp.h" @@ -175,8 +175,8 @@ mp_start(void) if (mp_probe(base_memory)) mp_enable(boot_address); else { - printf("MP FPS NOT FOUND, suggest use of 'mptable' program\n"); - panic("can't continue!\n"); + printf( "MP FPS not found, can't continue!\n" ); + panic( "\n" ); } /* finish pmap initialization - turn off V==P mapping at zero */ @@ -331,8 +331,10 @@ mp_enable(u_int boot_addr) /* program each IO APIC in the system */ for (apic = 0; apic < mp_napics; ++apic) - if (io_apic_setup(apic) < 0) - panic("IO APIC setup failure\n"); + if (io_apic_setup(apic) < 0) { + printf( "IO APIC setup failure\n" ); + panic( "\n" ); + } /* install an inter-CPU IPI for TLB invalidation */ setidt(ICU_OFFSET + XINVLTLB_OFFSET, Xinvltlb, @@ -596,8 +598,10 @@ parse_mp_table(void) } #endif /* TEST_DEFAULT_CONFIG */ - if ((cth = fps->pap) == 0) - panic("MP Configuration Table Header MISSING!\n"); + if ((cth = fps->pap) == 0) { + printf( "MP Configuration Table Header MISSING!\n" ); + panic( "\n" ); + } cpu_apic_address = (vm_offset_t) cth->apic_address; @@ -630,7 +634,8 @@ parse_mp_table(void) /* int_entry(position); */ break; default: - panic("mpfps Base Table HOSED!\n"); + printf( "mpfps Base Table HOSED!\n" ); + panic( "\n" ); /* NOTREACHED */ } @@ -638,8 +643,10 @@ parse_mp_table(void) (u_char *) position += basetable_entry_types[type].length; } - if (boot_cpu_id == -1) - panic("NO BSP found!\n"); + if (boot_cpu_id == -1) { + printf( "NO BSP found!\n" ); + panic( "\n" ); + } /* record # of APs found */ mp_naps = (cpu - 1); @@ -733,8 +740,8 @@ fix_mp_table(void) if (bus_data[x].bus_type != PCI) continue; if (bus_data[x].bus_id >= num_pci_bus ) { - printf("bad PCI bus numbering\n"); - panic("\n"); + printf( "bad PCI bus numbering\n" ); + panic( "\n" ); } } } @@ -777,8 +784,10 @@ bus_entry(bus_entry_ptr entry, int *bus) char name[8]; char c; - if ((x = (*bus)++) == NBUS) - panic("too many busses, increase 'NBUS'\n"); + if ((x = (*bus)++) == NBUS) { + printf( "too many busses, increase 'NBUS'\n" ); + panic( "\n" ); + } /* encode the name into an index */ for (y = 0; y < 6; ++y) { @@ -788,8 +797,10 @@ bus_entry(bus_entry_ptr entry, int *bus) } name[y] = '\0'; - if ((y = lookup_bus_type(name)) == UNKNOWN_BUSTYPE) - panic("unknown bus type: '%s'\n", name); + if ((y = lookup_bus_type(name)) == UNKNOWN_BUSTYPE) { + printf( "unknown bus type: '%s'\n", name ); + panic( "\n" ); + } bus_data[x].bus_id = entry->bus_id; bus_data[x].bus_type = y; @@ -804,8 +815,10 @@ io_apic_entry(io_apic_entry_ptr entry, int *apic) if (!(entry->apic_flags & IOAPICENTRY_FLAG_EN)) return; - if ((x = (*apic)++) == NAPIC) - panic("too many APICs, increase 'NAPIC'\n"); + if ((x = (*apic)++) == NAPIC) { + printf( "too many APICs, increase 'NAPIC'\n" ); + panic( "\n" ); + } IO_TO_ID(x) = entry->apic_id; ID_TO_IO(entry->apic_id) = x; @@ -832,8 +845,10 @@ int_entry(int_entry_ptr entry, int *intr) { int x; - if ((x = (*intr)++) == NINTR) - panic("too many INTs, increase 'NINTR'\n"); + if ((x = (*intr)++) == NINTR) { + printf( "too many INTs, increase 'NINTR'\n" ); + panic( "\n" ); + } io_apic_ints[x].int_type = entry->int_type; io_apic_ints[x].int_flags = entry->int_flags; @@ -1203,8 +1218,10 @@ default_mp_table(int type) ux |= 0x02000000; /* set it to '2' */ io_apic_write(0, IOAPIC_ID, ux); /* write new value */ ux = io_apic_read(0, IOAPIC_ID); /* re-read && test */ - if ((ux & APIC_ID_MASK) != 0x02000000) - panic("Problem: can't control IO APIC ID, reg: 0x%08x\n", ux); + if ((ux & APIC_ID_MASK) != 0x02000000) { + printf( "can't control IO APIC ID, reg: 0x%08x\n", ux ); + panic( "\n" ); + } io_apic_id = 2; } IO_TO_ID(0) = io_apic_id; @@ -1230,7 +1247,8 @@ default_mp_table(int type) /* case 4: case 7: MCA NOT supported */ default: /* illegal/reserved */ - panic("BAD default MP config: %d\n", type); + printf( "BAD default MP config: %d\n", type ); + panic( "\n" ); } #if defined(APIC_IO) @@ -1250,9 +1268,11 @@ default_mp_table(int type) io_apic_ints[13].int_type = 0xff; /* N/C */ #if !defined(APIC_MIXED_MODE) /** FIXME: ??? */ - panic("sorry, can't support type 2 default yet\n"); + printf( "sorry, can't support type 2 default yet\n" ); + panic( "\n" ); #endif /* APIC_MIXED_MODE */ - } else + } + else io_apic_ints[2].src_bus_irq = 0; /* ISA IRQ0 is on APIC INT 2 */ if (type == 7) @@ -1317,8 +1337,10 @@ start_all_aps(u_int boot_addr) * somewhere */ printf("panic y/n? [n] "); - if (cngetc() != 'n') - panic("bye-bye\n"); + if (cngetc() != 'n') { + printf( "bye-bye\n" ); + panic( "\n" ); + } } CHECK_PRINT("trace"); /* show checkpoints */ |