Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/vfp PR port-arm/55790



details:   https://anonhg.NetBSD.org/src/rev/b577e0cd9d7c
branches:  trunk
changeset: 1021474:b577e0cd9d7c
user:      rin <rin%NetBSD.org@localhost>
date:      Tue Jun 01 00:13:19 2021 +0000

description:
PR port-arm/55790

Style fix for clarity, in preparation of main fix.

Replace condition ``curcpu()->ci_pcu_curlwp[PCU_FPU] == curlwp'' with
``curlwp->l_pcu_cpu[PCU_FPU] == curcpu()''. And add KASSERT to check
the two conditions are equivalent, as done for MI pcu code:

https://nxr.netbsd.org/xref/src/sys/kern/subr_pcu.c#323

No functional changes.

diffstat:

 sys/arch/arm/vfp/vfp_init.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r b468f9da5530 -r b577e0cd9d7c sys/arch/arm/vfp/vfp_init.c
--- a/sys/arch/arm/vfp/vfp_init.c       Mon May 31 22:33:19 2021 +0000
+++ b/sys/arch/arm/vfp/vfp_init.c       Tue Jun 01 00:13:19 2021 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: vfp_init.c,v 1.72 2020/10/30 18:54:37 skrll Exp $ */
+/*      $NetBSD: vfp_init.c,v 1.73 2021/06/01 00:13:19 rin Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -32,7 +32,7 @@
 #include "opt_cputypes.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfp_init.c,v 1.72 2020/10/30 18:54:37 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfp_init.c,v 1.73 2021/06/01 00:13:19 rin Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -438,9 +438,11 @@
         * If we already own the FPU and it's enabled (and no exception), raise
         * SIGILL.  If there is an exception, drop through to raise a SIGFPE.
         */
-       if (curcpu()->ci_pcu_curlwp[PCU_FPU] == curlwp
-           && (armreg_fpexc_read() & (VFP_FPEXC_EX|VFP_FPEXC_EN)) == VFP_FPEXC_EN)
+       if (curlwp->l_pcu_cpu[PCU_FPU] == ci
+           && (armreg_fpexc_read() & (VFP_FPEXC_EX|VFP_FPEXC_EN)) == VFP_FPEXC_EN) {
+               KASSERT(ci->ci_pcu_curlwp[PCU_FPU] == curlwp);
                return 1;
+       }
 
        /*
         * Make sure we own the FP.



Home | Main Index | Thread Index | Old Index