summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2005-04-17 21:34:27 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2005-04-17 21:34:27 +0000
commitffba4fc4c3d751442d10867eab500c17723efafc (patch)
tree82aed0a61c29dc0d2944799a90780a34a5fca1a7
parent08a2c0ca772a989c37e99618a6d782641fea1ad6 (diff)
Generate SIGTRAP instead of SIGILL for breakpoint instructions.
Disable some debug code in the process. ok miod@
-rw-r--r--sys/arch/powerpc/powerpc/trap.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/arch/powerpc/powerpc/trap.c b/sys/arch/powerpc/powerpc/trap.c
index 3b7168c2862..0a7cd4ecbac 100644
--- a/sys/arch/powerpc/powerpc/trap.c
+++ b/sys/arch/powerpc/powerpc/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.65 2004/12/06 20:12:25 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.66 2005/04/17 21:34:26 kettenis Exp $ */
/* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */
/*
@@ -567,6 +567,7 @@ mpc_print_pci_stat();
case EXC_PGM|EXC_USER:
{
+#if 0
char *errstr[8];
int errnum = 0;
@@ -585,24 +586,22 @@ mpc_print_pci_stat();
errstr[errnum] = "privileged instr";
errnum++;
}
+#endif
if (frame->srr1 & (1<<(31-14))) {
+#if 0
errstr[errnum] = "trap instr";
errnum++;
- /* trap instruction exception */
- /*
- instr = copyin (srr0)
- if (instr == BKPT_INST && uid == 0) {
- cnpollc(TRUE);
- db_trap(T_BREAKPOINT?)
- cnpollc(FALSE);
- break;
- }
- */
+#endif
+ sv.sival_int = frame->srr0;
+ trapsignal(p, SIGTRAP, type, TRAP_BRKPT, sv);
+ break;
}
+#if 0
if (frame->srr1 & (1<<(31-15))) {
errstr[errnum] = "previous address";
errnum++;
}
+#endif
#if 0
printf("pgm iar %x srr1 %x\n", frame->srr0, frame->srr1);
{