summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2015-09-10 14:37:21 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2015-09-10 14:37:21 +0000
commit8fbdb03d1ffc51d9758f7dd2f694e94cf2a4ffa3 (patch)
treef282f4cce8e1327f4eda66cd50f795c9906dce35 /sys/arch
parentee72f801193e4a4723f717112af9589b99f62e23 (diff)
Initialize `pc' earlier so that the siginfo pc value is correct in case of
genuine FPU exception.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mips64/mips64/fp_emulate.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/arch/mips64/mips64/fp_emulate.c b/sys/arch/mips64/mips64/fp_emulate.c
index e5722652a40..c9a31c650b9 100644
--- a/sys/arch/mips64/mips64/fp_emulate.c
+++ b/sys/arch/mips64/mips64/fp_emulate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fp_emulate.c,v 1.12 2015/08/27 18:45:09 miod Exp $ */
+/* $OpenBSD: fp_emulate.c,v 1.13 2015/09/10 14:37:20 miod Exp $ */
/*
* Copyright (c) 2010 Miodrag Vallat.
@@ -148,6 +148,10 @@ MipsFPTrap(struct trap_frame *tf)
KDASSERT(tf == p->p_md.md_regs);
+ pc = (vaddr_t)tf->pc;
+ if (tf->cause & CR_BR_DELAY)
+ pc += 4;
+
#ifndef FPUEMUL
/*
* Enable FPU, and read its status register.
@@ -183,9 +187,6 @@ MipsFPTrap(struct trap_frame *tf)
* if it does, it's probably not your lucky day.
*/
- pc = (vaddr_t)tf->pc;
- if (tf->cause & CR_BR_DELAY)
- pc += 4;
if (copyin((void *)pc, &insn, sizeof insn) != 0) {
sig = SIGBUS;
fault_type = BUS_OBJERR;