summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2015-09-10 14:37:20 +0000
committermiod <miod@openbsd.org>2015-09-10 14:37:20 +0000
commitc6c81e74a01598f08cae66755da0e68d010cd524 (patch)
treea7a96c2184bcc8110af092788f7fe7c0f10545e2
parentReplace remaining M_ASN1_STRING_* macros with calls to ASN1_STRING_*. (diff)
downloadwireguard-openbsd-c6c81e74a01598f08cae66755da0e68d010cd524.tar.xz
wireguard-openbsd-c6c81e74a01598f08cae66755da0e68d010cd524.zip
Initialize `pc' earlier so that the siginfo pc value is correct in case of
genuine FPU exception.
-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;