Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/arch/powerpc/powerpc Pull up following revision(s) (r...



details:   https://anonhg.NetBSD.org/src/rev/8d5d627b4cb6
branches:  netbsd-9
changeset: 963650:8d5d627b4cb6
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Feb 27 18:32:08 2020 +0000

description:
Pull up following revision(s) (requested by rin in ticket #733):

        sys/arch/powerpc/powerpc/fpu.c: revision 1.39
        sys/arch/powerpc/powerpc/powerpc_machdep.c: revision 1.77

Provide no-op's as pcu_ops_md_defs[PCU_FPU] even if !PPC_HAVE_FPU.

This is required by subr_pcu.c rev 1.21 and later:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/subr_pcu.c#rev1.21

Otherwise, panic occurs when FP instruction is emulated on machines
without FPU.

Note that PowerPC UISA as well as SVR4 ABI require FP instructions,
and emulation is enabled unconditionally on machines without FPU.

diffstat:

 sys/arch/powerpc/powerpc/fpu.c             |  16 +++++++++-------
 sys/arch/powerpc/powerpc/powerpc_machdep.c |   6 ++----
 2 files changed, 11 insertions(+), 11 deletions(-)

diffs (113 lines):

diff -r 8f0c0ed51fc7 -r 8d5d627b4cb6 sys/arch/powerpc/powerpc/fpu.c
--- a/sys/arch/powerpc/powerpc/fpu.c    Thu Feb 27 18:24:44 2020 +0000
+++ b/sys/arch/powerpc/powerpc/fpu.c    Thu Feb 27 18:32:08 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu.c,v 1.38 2017/03/16 16:13:20 chs Exp $     */
+/*     $NetBSD: fpu.c,v 1.38.18.1 2020/02/27 18:32:08 martin Exp $     */
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.38 2017/03/16 16:13:20 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.38.18.1 2020/02/27 18:32:08 martin Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -47,19 +47,15 @@
 #include <machine/fpu.h>
 #include <machine/psl.h>
 
-#ifdef PPC_HAVE_FPU
 static void fpu_state_load(lwp_t *, u_int);
 static void fpu_state_save(lwp_t *);
 static void fpu_state_release(lwp_t *);
-#endif
 
 const pcu_ops_t fpu_ops = {
        .pcu_id = PCU_FPU,
-#ifdef PPC_HAVE_FPU
        .pcu_state_load = fpu_state_load,
        .pcu_state_save = fpu_state_save,
        .pcu_state_release = fpu_state_release,
-#endif
 };
 
 bool
@@ -74,10 +70,10 @@
        pcu_discard(&fpu_ops, l, true);
 }
 
-#ifdef PPC_HAVE_FPU
 void
 fpu_state_load(lwp_t *l, u_int flags)
 {
+#ifdef PPC_HAVE_FPU
        struct pcb * const pcb = lwp_getpcb(l);
 
        if ((flags & PCU_VALID) == 0) {
@@ -98,6 +94,7 @@
 
        curcpu()->ci_ev_fpusw.ev_count++;
        l->l_md.md_utf->tf_srr1 |= PSL_FP|(pcb->pcb_flags & (PCB_FE0|PCB_FE1));
+#endif
 }
 
 /*
@@ -106,6 +103,7 @@
 void
 fpu_state_save(lwp_t *l)
 {
+#ifdef PPC_HAVE_FPU
        struct pcb * const pcb = lwp_getpcb(l);
 
        const register_t msr = mfmsr();
@@ -117,14 +115,18 @@
 
        mtmsr(msr);
        __asm volatile ("isync");
+#endif
 }
 
 void
 fpu_state_release(lwp_t *l)
 {
+#ifdef PPC_HAVE_FPU
        l->l_md.md_utf->tf_srr1 &= ~PSL_FP;
+#endif
 }
 
+#ifdef PPC_HAVE_FPU
 #define        STICKYBITS      (FPSCR_VX|FPSCR_OX|FPSCR_UX|FPSCR_ZX|FPSCR_XX)
 #define        STICKYSHIFT     25
 #define        MASKBITS        (FPSCR_VE|FPSCR_OE|FPSCR_UE|FPSCR_ZE|FPSCR_XE)
diff -r 8f0c0ed51fc7 -r 8d5d627b4cb6 sys/arch/powerpc/powerpc/powerpc_machdep.c
--- a/sys/arch/powerpc/powerpc/powerpc_machdep.c        Thu Feb 27 18:24:44 2020 +0000
+++ b/sys/arch/powerpc/powerpc/powerpc_machdep.c        Thu Feb 27 18:32:08 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: powerpc_machdep.c,v 1.72 2018/09/16 09:25:47 skrll Exp $       */
+/*     $NetBSD: powerpc_machdep.c,v 1.72.4.1 2020/02/27 18:32:08 martin Exp $  */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.72 2018/09/16 09:25:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.72.4.1 2020/02/27 18:32:08 martin Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -89,9 +89,7 @@
 char *booted_kernel;
 
 const pcu_ops_t * const pcu_ops_md_defs[PCU_UNIT_COUNT] = {
-#if defined(PPC_HAVE_FPU)
        [PCU_FPU] = &fpu_ops,
-#endif
 #if defined(ALTIVEC) || defined(PPC_HAVE_SPE)
        [PCU_VEC] = &vec_ops,
 #endif



Home | Main Index | Thread Index | Old Index