diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2009-04-19 06:30:00 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2009-04-19 06:30:00 +0000 |
commit | 5db25627cf7785d7c87f82547521401e37b96f11 (patch) | |
tree | 9718a4ac1bfd580cde4f164c54b18aec5617f051 /sys/powerpc/aim/trap.c | |
parent | 7ee6b427aee5be9ef1e3f844d49ded50e6309bf2 (diff) | |
download | FreeBSD-src-5db25627cf7785d7c87f82547521401e37b96f11.zip FreeBSD-src-5db25627cf7785d7c87f82547521401e37b96f11.tar.gz |
Fix a typo in the SRR1 comparison for program exceptions. While here,
replace magic numbers with constants to keep this from happening again.
Without this fix, some programs would occasionally get SIGTRAP instead
of SIGILL on an illegal instruction. This affected Altivec detection
in pixman, and possibly other software.
Reported by: Andreas Tobler
MFC after: 1 week
Diffstat (limited to 'sys/powerpc/aim/trap.c')
-rw-r--r-- | sys/powerpc/aim/trap.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c index 4b54093..0ab58f3 100644 --- a/sys/powerpc/aim/trap.c +++ b/sys/powerpc/aim/trap.c @@ -208,9 +208,8 @@ trap(struct trapframe *frame) break; case EXC_PGM: - /* XXX temporarily */ - /* XXX: Magic Number? */ - if (frame->srr1 & 0x0002000) + /* Identify the trap reason */ + if (frame->srr1 & EXC_PGM_TRAP) sig = SIGTRAP; else sig = SIGILL; |