summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_trap.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1997-04-26 11:46:25 +0000
committerpeter <peter@FreeBSD.org>1997-04-26 11:46:25 +0000
commit6323aa10bffe459912ba8b2f8592c7ac4ffd8705 (patch)
treebf48960e09e26f0de373de093c89322724bbdd64 /sys/kern/subr_trap.c
parent96efe480c0c091aecb2f359675c74aca30f36a4a (diff)
downloadFreeBSD-src-6323aa10bffe459912ba8b2f8592c7ac4ffd8705.zip
FreeBSD-src-6323aa10bffe459912ba8b2f8592c7ac4ffd8705.tar.gz
Man the liferafts! Here comes the long awaited SMP -> -current merge!
There are various options documented in i386/conf/LINT, there is more to come over the next few days. The kernel should run pretty much "as before" without the options to activate SMP mode. There are a handful of known "loose ends" that need to be fixed, but have been put off since the SMP kernel is in a moderately good condition at the moment. This commit is the result of the tinkering and testing over the last 14 months by many people. A special thanks to Steve Passe for implementing the APIC code!
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r--sys/kern/subr_trap.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index 8a86965..aa4e3c5 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
- * $Id: trap.c,v 1.91 1997/04/07 07:15:55 peter Exp $
+ * $Id: trap.c,v 1.92 1997/04/14 13:52:52 bde Exp $
*/
/*
@@ -44,6 +44,7 @@
#include "opt_ktrace.h"
#include "opt_ddb.h"
+#include "opt_smp.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -76,6 +77,7 @@
#include <machine/reg.h>
#include <machine/trap.h>
#include <machine/../isa/isa_device.h>
+#include <machine/smp.h>
#ifdef POWERFAIL_NMI
#include <sys/syslog.h>
@@ -85,7 +87,11 @@
#include "isa.h"
#include "npx.h"
+#ifdef SMP
+extern struct i386tss *SMPcommon_tss_ptr[NCPU];
+#else
extern struct i386tss common_tss;
+#endif
int (*pmath_emulate) __P((struct trapframe *));
@@ -678,6 +684,9 @@ trap_fatal(frame)
printf("\n\nFatal trap %d: %s while in %s mode\n",
type, trap_msg[type],
ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel");
+#ifdef SMP
+ printf("cpunumber = %d\n", cpunumber());
+#endif
if (type == T_PAGEFLT) {
printf("fault virtual address = 0x%x\n", eva);
printf("fault code = %s %s, %s\n",
@@ -740,6 +749,7 @@ trap_fatal(frame)
if (kdb_trap (type, 0, frame))
return;
#endif
+ printf("trap number = %d\n", type);
if (type <= MAX_TRAP_MSG)
panic(trap_msg[type]);
else
@@ -761,11 +771,20 @@ trap_fatal(frame)
void
dblfault_handler()
{
+#ifdef SMP
+ int x = cpunumber();
+#endif
printf("\nFatal double fault:\n");
+#ifdef SMP
+ printf("eip = 0x%x\n", SMPcommon_tss_ptr[x]->tss_eip);
+ printf("esp = 0x%x\n", SMPcommon_tss_ptr[x]->tss_esp);
+ printf("ebp = 0x%x\n", SMPcommon_tss_ptr[x]->tss_ebp);
+#else
printf("eip = 0x%x\n", common_tss.tss_eip);
printf("esp = 0x%x\n", common_tss.tss_esp);
printf("ebp = 0x%x\n", common_tss.tss_ebp);
+#endif
panic("double fault");
}
OpenPOWER on IntegriCloud