trap.c (225474) | trap.c (233747) |
---|---|
1/*- 2 * Copyright (c) 2001, Jake Burkholder 3 * Copyright (C) 1994, David Greenman 4 * Copyright (c) 1990, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * the University of Utah, and William Jolitz. --- 22 unchanged lines hidden (view full) --- 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 35 * from: FreeBSD: src/sys/i386/i386/trap.c,v 1.197 2001/07/19 36 */ 37 38#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001, Jake Burkholder 3 * Copyright (C) 1994, David Greenman 4 * Copyright (c) 1990, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * the University of Utah, and William Jolitz. --- 22 unchanged lines hidden (view full) --- 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 35 * from: FreeBSD: src/sys/i386/i386/trap.c,v 1.197 2001/07/19 36 */ 37 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/sys/sparc64/sparc64/trap.c 225474 2011-09-11 16:05:09Z kib $"); | 39__FBSDID("$FreeBSD: head/sys/sparc64/sparc64/trap.c 233747 2012-03-31 13:56:24Z marius $"); |
40 41#include "opt_ddb.h" 42#include "opt_ktr.h" 43 44#include <sys/param.h> 45#include <sys/kdb.h> 46#include <sys/kernel.h> 47#include <sys/bus.h> --- 162 unchanged lines hidden (view full) --- 210 SIGILL, /* fix alignment */ 211 SIGILL, /* integer overflow */ 212 SIGSYS, /* syscall */ 213 -1, /* restore physical watchpoint */ 214 -1, /* restore virtual watchpoint */ 215 -1, /* kernel stack fault */ 216}; 217 | 40 41#include "opt_ddb.h" 42#include "opt_ktr.h" 43 44#include <sys/param.h> 45#include <sys/kdb.h> 46#include <sys/kernel.h> 47#include <sys/bus.h> --- 162 unchanged lines hidden (view full) --- 210 SIGILL, /* fix alignment */ 211 SIGILL, /* integer overflow */ 212 SIGSYS, /* syscall */ 213 -1, /* restore physical watchpoint */ 214 -1, /* restore virtual watchpoint */ 215 -1, /* kernel stack fault */ 216}; 217 |
218CTASSERT(sizeof(trap_msg) / sizeof(*trap_msg) == T_MAX); 219CTASSERT(sizeof(trap_sig) / sizeof(*trap_sig) == T_MAX); 220 |
|
218CTASSERT(sizeof(struct trapframe) == 256); 219 220int debugger_on_signal = 0; 221SYSCTL_INT(_debug, OID_AUTO, debugger_on_signal, CTLFLAG_RW, 222 &debugger_on_signal, 0, ""); 223 224u_int corrected_ecc = 0; 225SYSCTL_UINT(_machdep, OID_AUTO, corrected_ecc, CTLFLAG_RD, &corrected_ecc, 0, --- 67 unchanged lines hidden (view full) --- 293 break; 294 case T_SPILL: 295 sig = rwindow_save(td); 296 break; 297 case T_CORRECTED_ECC_ERROR: 298 sig = trap_cecc(); 299 break; 300 default: | 221CTASSERT(sizeof(struct trapframe) == 256); 222 223int debugger_on_signal = 0; 224SYSCTL_INT(_debug, OID_AUTO, debugger_on_signal, CTLFLAG_RW, 225 &debugger_on_signal, 0, ""); 226 227u_int corrected_ecc = 0; 228SYSCTL_UINT(_machdep, OID_AUTO, corrected_ecc, CTLFLAG_RD, &corrected_ecc, 0, --- 67 unchanged lines hidden (view full) --- 296 break; 297 case T_SPILL: 298 sig = rwindow_save(td); 299 break; 300 case T_CORRECTED_ECC_ERROR: 301 sig = trap_cecc(); 302 break; 303 default: |
301 if (tf->tf_type < 0 || tf->tf_type >= T_MAX) | 304 if (tf->tf_type < 0 || tf->tf_type > T_MAX) |
302 panic("trap: bad trap type %#lx (user)", 303 tf->tf_type); 304 else if (trap_sig[tf->tf_type] == -1) 305 panic("trap: %s (user)", 306 trap_msg[tf->tf_type]); 307 sig = trap_sig[tf->tf_type]; 308 break; 309 } --- 87 unchanged lines hidden (view full) --- 397 break; 398 default: 399 error = 1; 400 break; 401 } 402 403 if (error != 0) { 404 tf->tf_type &= ~T_KERNEL; | 305 panic("trap: bad trap type %#lx (user)", 306 tf->tf_type); 307 else if (trap_sig[tf->tf_type] == -1) 308 panic("trap: %s (user)", 309 trap_msg[tf->tf_type]); 310 sig = trap_sig[tf->tf_type]; 311 break; 312 } --- 87 unchanged lines hidden (view full) --- 400 break; 401 default: 402 error = 1; 403 break; 404 } 405 406 if (error != 0) { 407 tf->tf_type &= ~T_KERNEL; |
405 if (tf->tf_type < 0 || tf->tf_type >= T_MAX) | 408 if (tf->tf_type < 0 || tf->tf_type > T_MAX) |
406 panic("trap: bad trap type %#lx (kernel)", 407 tf->tf_type); | 409 panic("trap: bad trap type %#lx (kernel)", 410 tf->tf_type); |
408 else if (trap_sig[tf->tf_type] == -1) 409 panic("trap: %s (kernel)", 410 trap_msg[tf->tf_type]); | 411 panic("trap: %s (kernel)", trap_msg[tf->tf_type]); |
411 } 412 } 413 CTR1(KTR_TRAP, "trap: td=%p return", td); 414} 415 416static int 417trap_cecc(void) 418{ --- 221 unchanged lines hidden --- | 412 } 413 } 414 CTR1(KTR_TRAP, "trap: td=%p return", td); 415} 416 417static int 418trap_cecc(void) 419{ --- 221 unchanged lines hidden --- |