summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2007-04-26 21:36:33 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2007-04-26 21:36:33 +0000
commitda6de1fbaf26dab6a3f6403e30d2740d5d83a9a5 (patch)
tree783b1a38f9bf484a31ea570a1d690a7c61675513 /sys/arch/powerpc
parent3cf94ca9907342b6f505b930f2528e3c0d82a229 (diff)
Handle AltiVec Assist exceptions. Fixes a panic when running crashme.
ok thib@, deraadt@
Diffstat (limited to 'sys/arch/powerpc')
-rw-r--r--sys/arch/powerpc/include/trap.h3
-rw-r--r--sys/arch/powerpc/powerpc/trap.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/arch/powerpc/include/trap.h b/sys/arch/powerpc/include/trap.h
index 971ad5b3f57..56da4a8f861 100644
--- a/sys/arch/powerpc/include/trap.h
+++ b/sys/arch/powerpc/include/trap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.h,v 1.6 2003/04/26 08:01:42 jmc Exp $ */
+/* $OpenBSD: trap.h,v 1.7 2007/04/26 21:36:32 kettenis Exp $ */
/* $NetBSD: trap.h,v 1.1 1996/09/30 16:34:35 ws Exp $ */
/*
@@ -51,6 +51,7 @@
#define EXC_VEC 0x0f20 /* AltiVec Unavailable */
#define EXC_BPT 0x1300 /* Instruction Breakpoint */
#define EXC_SMI 0x1400 /* System Management Interrupt */
+#define EXC_VECAST 0x1600 /* AltiVec Assist */
/* And these are only on the 603: */
#define EXC_IMISS 0x1000 /* Instruction translation miss */
diff --git a/sys/arch/powerpc/powerpc/trap.c b/sys/arch/powerpc/powerpc/trap.c
index 4758a5b4017..dde75b48119 100644
--- a/sys/arch/powerpc/powerpc/trap.c
+++ b/sys/arch/powerpc/powerpc/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.77 2007/04/01 09:29:27 art Exp $ */
+/* $OpenBSD: trap.c,v 1.78 2007/04/26 21:36:32 kettenis Exp $ */
/* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */
/*
@@ -650,6 +650,12 @@ for (i = 0; i < errnum; i++) {
break;
#endif
+ case EXC_VECAST|EXC_USER:
+ KERNEL_PROC_LOCK(p);
+ trapsignal(p, SIGFPE, 0, FPE_FLTRES, sv);
+ KERNEL_PROC_UNLOCK(p);
+ break;
+
case EXC_AST|EXC_USER:
uvmexp.softs++;
ci->ci_astpending = 0; /* we are about to do it */