summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/aim
diff options
context:
space:
mode:
authorjhibbits <jhibbits@FreeBSD.org>2014-09-06 22:37:47 +0000
committerjhibbits <jhibbits@FreeBSD.org>2014-09-06 22:37:47 +0000
commitf971f9cd086bb76934b413eff6e3eca9198211c3 (patch)
tree12d91e02f1017fe3807355899e5afd1573fecaf7 /sys/powerpc/aim
parent1e706702bd14e7d6c5f41f15ee0b520bd11c4933 (diff)
downloadFreeBSD-src-f971f9cd086bb76934b413eff6e3eca9198211c3.zip
FreeBSD-src-f971f9cd086bb76934b413eff6e3eca9198211c3.tar.gz
MFC r269701:
Set the si_code appropriately for exception-caused signals. LLDB checks the si_code, and aborts if a code isn't known. Approved by: re (gjb) Relnotes: yes
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r--sys/powerpc/aim/trap.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c
index cd5222a..9b9801f 100644
--- a/sys/powerpc/aim/trap.c
+++ b/sys/powerpc/aim/trap.c
@@ -197,6 +197,7 @@ trap(struct trapframe *frame)
case EXC_TRC:
frame->srr1 &= ~PSL_SE;
sig = SIGTRAP;
+ ucode = TRAP_TRACE;
break;
#ifdef __powerpc64__
@@ -204,13 +205,17 @@ trap(struct trapframe *frame)
case EXC_DSE:
if (handle_user_slb_spill(&p->p_vmspace->vm_pmap,
(type == EXC_ISE) ? frame->srr0 :
- frame->cpu.aim.dar) != 0)
+ frame->cpu.aim.dar) != 0) {
sig = SIGSEGV;
+ ucode = SEGV_MAPERR;
+ }
break;
#endif
case EXC_DSI:
case EXC_ISI:
sig = trap_pfault(frame, 1);
+ if (sig == SIGSEGV)
+ ucode = SEGV_MAPERR;
break;
case EXC_SC:
@@ -245,8 +250,10 @@ trap(struct trapframe *frame)
break;
case EXC_ALI:
- if (fix_unaligned(td, frame) != 0)
+ if (fix_unaligned(td, frame) != 0) {
sig = SIGBUS;
+ ucode = BUS_ADRALN;
+ }
else
frame->srr0 += 4;
break;
@@ -264,8 +271,16 @@ trap(struct trapframe *frame)
}
#endif
sig = SIGTRAP;
+ ucode = TRAP_BRKPT;
} else {
sig = ppc_instr_emulate(frame, td->td_pcb);
+ if (sig == SIGILL) {
+ if (frame->srr1 & EXC_PGM_PRIV)
+ ucode = ILL_PRVOPC;
+ else if (frame->srr1 & EXC_PGM_ILLEGAL)
+ ucode = ILL_ILLOPC;
+ } else if (sig == SIGFPE)
+ ucode = FPE_FLTINV; /* Punt for now, invalid operation. */
}
break;
@@ -276,6 +291,7 @@ trap(struct trapframe *frame)
* but it at least prevents the kernel from dying.
*/
sig = SIGBUS;
+ ucode = BUS_OBJERR;
break;
default:
OpenPOWER on IntegriCloud