Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc/booke If we get a PGM exception for a trap, ...
details: https://anonhg.NetBSD.org/src/rev/c546644b58d5
branches: trunk
changeset: 761795:c546644b58d5
user: matt <matt%NetBSD.org@localhost>
date: Tue Feb 08 01:38:48 2011 +0000
description:
If we get a PGM exception for a trap, use SIGTRAP/TRAP_BRKPT instead of
SIGILL/ILL_ILLTRP so GDB will recognize it.
diffstat:
sys/arch/powerpc/booke/trap.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diffs (40 lines):
diff -r ecbf1e1ab1b6 -r c546644b58d5 sys/arch/powerpc/booke/trap.c
--- a/sys/arch/powerpc/booke/trap.c Tue Feb 08 00:33:05 2011 +0000
+++ b/sys/arch/powerpc/booke/trap.c Tue Feb 08 01:38:48 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.3 2011/02/07 06:41:08 matt Exp $ */
+/* $NetBSD: trap.c,v 1.4 2011/02/08 01:38:48 matt Exp $ */
/*-
* Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -39,7 +39,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.3 2011/02/07 06:41:08 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.4 2011/02/08 01:38:48 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -460,14 +460,16 @@
KSI_INIT_TRAP(ksi);
ksi->ksi_signo = SIGILL;
ksi->ksi_trap = EXC_PGM;
- if (tf->tf_esr & ESR_PIL)
+ if (tf->tf_esr & ESR_PIL) {
ksi->ksi_code = ILL_ILLOPC;
- else if (tf->tf_esr & ESR_PPR)
+ } else if (tf->tf_esr & ESR_PPR) {
ksi->ksi_code = ILL_PRVOPC;
- else if (tf->tf_esr & ESR_PTR)
- ksi->ksi_code = ILL_ILLTRP;
- else
+ } else if (tf->tf_esr & ESR_PTR) {
+ ksi->ksi_signo = SIGTRAP;
+ ksi->ksi_code = TRAP_BRKPT;
+ } else {
ksi->ksi_code = 0;
+ }
ksi->ksi_addr = (void *)tf->tf_srr0;
return rv;
}
Home |
Main Index |
Thread Index |
Old Index