Module Name: src
Committed By: matt
Date: Mon Jul 6 02:30:22 UTC 2015
Modified Files:
src/sys/arch/powerpc/include: userret.h
Log Message:
Add a check to make sure that if PSL_FP is set, we own the FPU.
To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/powerpc/include/userret.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/powerpc/include/userret.h
diff -u src/sys/arch/powerpc/include/userret.h:1.28 src/sys/arch/powerpc/include/userret.h:1.29
--- src/sys/arch/powerpc/include/userret.h:1.28 Mon Mar 10 00:04:04 2014
+++ src/sys/arch/powerpc/include/userret.h Mon Jul 6 02:30:22 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: userret.h,v 1.28 2014/03/10 00:04:04 matt Exp $ */
+/* $NetBSD: userret.h,v 1.29 2015/07/06 02:30:22 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -61,6 +61,10 @@ userret(struct lwp *l, struct trapframe
KASSERTMSG((tf->tf_srr1 & PSL_PR) != 0,
"tf=%p: srr1 (%#lx): PSL_PR isn't set!",
tf, tf->tf_srr1);
+ KASSERTMSG((tf->tf_srr1 & PSL_FP) == 0
+ || l->l_cpu->ci_data.cpu_pcu_curlwp[PCU_FPU] == l,
+ "tf=%p: srr1 (%#lx): PSL_FP set but FPU curlwp %p is not curlwp %p!",
+ tf, tf->tf_srr1, l->l_cpu->ci_data.cpu_pcu_curlwp[PCU_FPU], l);
tf->tf_srr1 &= PSL_USERSRR1; /* clear SRR1 status bits */