diff options
author | jhb <jhb@FreeBSD.org> | 2005-11-18 19:26:46 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2005-11-18 19:26:46 +0000 |
commit | e1ea0a67e36ee6d6902dc21a0bf087f03c7d35b9 (patch) | |
tree | e134a00dfa3ad6654b8cfc7f324fee6e06663d1f /sys/amd64 | |
parent | e76b2aa5e34473052bb40db62fe1465a97467520 (diff) | |
download | FreeBSD-src-e1ea0a67e36ee6d6902dc21a0bf087f03c7d35b9.zip FreeBSD-src-e1ea0a67e36ee6d6902dc21a0bf087f03c7d35b9.tar.gz |
- 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
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/trap.c | 13 |
1 files changed, 9 insertions, 4 deletions
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)); |