From e1ea0a67e36ee6d6902dc21a0bf087f03c7d35b9 Mon Sep 17 00:00:00 2001 From: jhb Date: Fri, 18 Nov 2005 19:26:46 +0000 Subject: - Always print the trap number so that we have something to start with for mystery traps. If we don't have a message for a given trap, just use UNKNOWN for the message. - Add trap messages for T_XMMFLT and T_RESERVED. MFC after: 1 week --- sys/amd64/amd64/trap.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'sys/amd64') diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 173ee2c..09fd4fc 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -100,7 +100,7 @@ static int trap_pfault(struct trapframe *, int); static void trap_fatal(struct trapframe *, vm_offset_t); void dblfault_handler(void); -#define MAX_TRAP_MSG 28 +#define MAX_TRAP_MSG 30 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -131,6 +131,8 @@ static char *trap_msg[] = { "segment not present fault", /* 26 T_SEGNPFLT */ "stack fault", /* 27 T_STKFLT */ "machine check trap", /* 28 T_MCHK */ + "SIMD floating-point exception", /* 29 T_XMMFLT */ + "reserved (unknown) fault", /* 30 T_RESERVED */ }; #ifdef KDB @@ -609,15 +611,18 @@ trap_fatal(frame, eva) int code, type, ss; long esp; struct soft_segment_descriptor softseg; + char *msg; code = frame->tf_err; type = frame->tf_trapno; sdtossd(&gdt[IDXSEL(frame->tf_cs & 0xffff)], &softseg); if (type <= MAX_TRAP_MSG) - printf("\n\nFatal trap %d: %s while in %s mode\n", - type, trap_msg[type], - ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel"); + msg = trap_msg[type]; + else + msg = "UNKNOWN"; + printf("\n\nFatal trap %d: %s while in %s mode\n", type, msg, + ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel"); #ifdef SMP /* two separate prints in case of a trap on an unmapped page */ printf("cpuid = %d; ", PCPU_GET(cpuid)); -- cgit v1.1