From owner-svn-src-all@FreeBSD.ORG Sat Sep 6 22:37:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F986493; Sat, 6 Sep 2014 22:37:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 473D21E23; Sat, 6 Sep 2014 22:37:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s86Mbm5o068311; Sat, 6 Sep 2014 22:37:48 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s86Mbm05068310; Sat, 6 Sep 2014 22:37:48 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201409062237.s86Mbm05068310@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 6 Sep 2014 22:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271212 - stable/10/sys/powerpc/aim X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2014 22:37:48 -0000 Author: jhibbits Date: Sat Sep 6 22:37:47 2014 New Revision: 271212 URL: http://svnweb.freebsd.org/changeset/base/271212 Log: 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 Modified: stable/10/sys/powerpc/aim/trap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/powerpc/aim/trap.c ============================================================================== --- stable/10/sys/powerpc/aim/trap.c Sat Sep 6 22:17:54 2014 (r271211) +++ stable/10/sys/powerpc/aim/trap.c Sat Sep 6 22:37:47 2014 (r271212) @@ -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: