Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm ARMFPE hasn't compiled since NetBSD 4. Remove it.



details:   https://anonhg.NetBSD.org/src/rev/7953f88fdd7f
branches:  trunk
changeset: 783104:7953f88fdd7f
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Dec 05 19:05:45 2012 +0000

description:
ARMFPE hasn't compiled since NetBSD 4.  Remove it.
Complete support for FPU_VFP.
fpregs now contains vfpreg.
XXX vfpreg only has space for 16 64-bit FP registers though VFPv3 and later
have 32 64-bit FP registers.

diffstat:

 sys/arch/arm/arm/process_machdep.c |    38 +-
 sys/arch/arm/arm/sig_machdep.c     |    19 +-
 sys/arch/arm/arm32/cpu.c           |    42 +-
 sys/arch/arm/arm32/cpuswitch.S     |    15 +-
 sys/arch/arm/arm32/vm_machdep.c    |    35 +-
 sys/arch/arm/conf/files.arm        |     7 +-
 sys/arch/arm/fpe-arm/armfpe.S      |  7504 ------------------------------------
 sys/arch/arm/fpe-arm/armfpe.h      |   139 -
 sys/arch/arm/fpe-arm/armfpe_glue.S |   475 --
 sys/arch/arm/fpe-arm/armfpe_init.c |   272 -
 sys/arch/arm/include/mcontext.h    |     7 +-
 sys/arch/arm/include/ptrace.h      |     9 +-
 sys/arch/arm/include/reg.h         |    12 +-
 sys/arch/arm/vfp/vfp_init.c        |    35 +-
 14 files changed, 97 insertions(+), 8512 deletions(-)

diffs (truncated from 8882 to 300 lines):

diff -r bda9ebbf2ead -r 7953f88fdd7f sys/arch/arm/arm/process_machdep.c
--- a/sys/arch/arm/arm/process_machdep.c        Wed Dec 05 17:21:55 2012 +0000
+++ b/sys/arch/arm/arm/process_machdep.c        Wed Dec 05 19:05:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: process_machdep.c,v 1.23 2012/08/16 16:41:53 matt Exp $        */
+/*     $NetBSD: process_machdep.c,v 1.24 2012/12/05 19:05:46 matt Exp $        */
 
 /*
  * Copyright (c) 1993 The Regents of the University of California.
@@ -133,7 +133,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.23 2012/08/16 16:41:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.24 2012/12/05 19:05:46 matt Exp $");
 
 #include <sys/proc.h>
 #include <sys/ptrace.h>
@@ -145,10 +145,6 @@
 
 #include <arm/armreg.h>
 
-#ifdef ARMFPE
-#include <arm/fpe-arm/armfpe.h>
-#endif
-
 int
 process_read_regs(struct lwp *l, struct reg *regs)
 {
@@ -177,14 +173,15 @@
 int
 process_read_fpregs(struct lwp *l, struct fpreg *regs)
 {
-#ifdef ARMFPE
-       arm_fpe_getcontext(p, regs);
+#ifdef FPU_VFP
+       if (curcpu()->ci_vfp_id == 0) {
+               return EINVAL;
+       }
+       const struct pcb * const pcb = lwp_getpcb(l);
+       vfp_savecontext();
+       regs->fpr_vfp = pcb->pcb_vfp;
+#endif
        return(0);
-#else  /* ARMFPE */
-       /* No hardware FP support */
-       memset(regs, 0, sizeof(struct fpreg));
-       return(0);
-#endif /* ARMFPE */
 }
 
 int
@@ -222,13 +219,16 @@
 int
 process_write_fpregs(struct lwp *l, const struct fpreg *regs)
 {
-#ifdef ARMFPE
-       arm_fpe_setcontext(p, regs);
+#ifdef FPU_VFP
+       if (curcpu()->ci_vfp_id == 0) {
+               return EINVAL;
+       }
+       struct pcb * const pcb = lwp_getpcb(l);
+       vfp_discardcontext();
+       l->l_md.md_flags |= MDLWP_VFPUSED;
+       pcb->pcb_vfp = regs->fpr_vfp;
+#endif
        return(0);
-#else  /* ARMFPE */
-       /* No hardware FP support */
-       return(0);
-#endif /* ARMFPE */
 }
 
 int
diff -r bda9ebbf2ead -r 7953f88fdd7f sys/arch/arm/arm/sig_machdep.c
--- a/sys/arch/arm/arm/sig_machdep.c    Wed Dec 05 17:21:55 2012 +0000
+++ b/sys/arch/arm/arm/sig_machdep.c    Wed Dec 05 19:05:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sig_machdep.c,v 1.43 2012/08/16 16:41:53 matt Exp $    */
+/*     $NetBSD: sig_machdep.c,v 1.44 2012/12/05 19:05:46 matt Exp $    */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -44,7 +44,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.43 2012/08/16 16:41:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.44 2012/12/05 19:05:46 matt Exp $");
 
 #include <sys/mount.h>         /* XXX only needed by syscallargs.h */
 #include <sys/proc.h>
@@ -191,10 +191,8 @@
 
        *flags |= _UC_CPU;
 
-#ifdef ARMFPE
-       /* Save Floating Point Register context. */
-       arm_fpe_getcontext(p, (struct fpreg *)(void *)&mcp->fpregs);
-       *flags |= _UC_FPU;
+#ifdef FPU_VFP
+       vfp_getcontext(l, mcp, flags);
 #endif
 
        mcp->_mc_tlsbase = (uintptr_t)l->l_private;
@@ -220,6 +218,11 @@
        struct proc * const p = l->l_proc;
        int error;
 
+#ifdef FPU_VFP
+       if ((flags & _UC_FPU) && curcpu()->ci_vfp_id == 0)
+               return EINVAL;
+#endif
+
        if ((flags & _UC_CPU) != 0) {
                /* Restore General Register context. */
                error = cpu_mcontext_validate(l, mcp);
@@ -245,10 +248,10 @@
                tf->tf_spsr   = gr[_REG_CPSR];
        }
 
-#ifdef ARMFPE
+#ifdef FPU_VFP
        if ((flags & _UC_FPU) != 0) {
                /* Restore Floating Point Register context. */
-               arm_fpe_setcontext(p, (struct fpreg *)(void *)&mcp->__fpregs);
+               vfp_setcontext(l, mcp);
        }
 #endif
 
diff -r bda9ebbf2ead -r 7953f88fdd7f sys/arch/arm/arm32/cpu.c
--- a/sys/arch/arm/arm32/cpu.c  Wed Dec 05 17:21:55 2012 +0000
+++ b/sys/arch/arm/arm32/cpu.c  Wed Dec 05 19:05:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.90 2012/11/30 08:15:45 msaitoh Exp $ */
+/*     $NetBSD: cpu.c,v 1.91 2012/12/05 19:05:45 matt Exp $    */
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -46,7 +46,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.90 2012/11/30 08:15:45 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.91 2012/12/05 19:05:45 matt Exp $");
 
 #include <sys/systm.h>
 #include <sys/conf.h>
@@ -60,11 +60,6 @@
 #include <arm/cpuconf.h>
 #include <arm/undefined.h>
 
-#ifdef ARMFPE
-#include <machine/bootconfig.h> /* For boot args */
-#include <arm/fpe-arm/armfpe.h>
-#endif
-
 char cpu_model[256];
 
 #ifdef MULTIPROCESSOR
@@ -209,39 +204,6 @@
        }
 #endif
 
-#ifdef ARMFPE
-       /*
-        * Ok now we test for an FPA
-        * At this point no floating point emulator has been installed.
-        * This means any FP instruction will cause undefined exception.
-        * We install a temporay coproc 1 handler which will modify
-        * undefined_test if it is called.
-        * We then try to read the FP status register. If undefined_test
-        * has been decremented then the instruction was not handled by
-        * an FPA so we know the FPA is missing. If undefined_test is
-        * still 1 then we know the instruction was handled by an FPA.
-        * We then remove our test handler and look at the
-        * FP status register for identification.
-        */
- 
-       /*
-        * Ok if ARMFPE is defined and the boot options request the 
-        * ARM FPE then it will be installed as the FPE.
-        * This is just while I work on integrating the new FPE.
-        * It means the new FPE gets installed if compiled int (ARMFPE
-        * defined) and also gives me a on/off option when I boot in
-        * case the new FPE is causing panics.
-        */
-
-
-       int usearmfpe = 1;
-       if (boot_args)
-               get_bootconf_option(boot_args, "armfpe",
-                   BOOTOPT_TYPE_BOOLEAN, &usearmfpe);
-       if (usearmfpe)
-               initialise_arm_fpe();
-#endif
-
        vfp_attach();           /* XXX SMP */
 }
 
diff -r bda9ebbf2ead -r 7953f88fdd7f sys/arch/arm/arm32/cpuswitch.S
--- a/sys/arch/arm/arm32/cpuswitch.S    Wed Dec 05 17:21:55 2012 +0000
+++ b/sys/arch/arm/arm32/cpuswitch.S    Wed Dec 05 19:05:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpuswitch.S,v 1.73 2012/11/08 08:22:56 skrll Exp $     */
+/*     $NetBSD: cpuswitch.S,v 1.74 2012/12/05 19:05:45 matt Exp $      */
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -89,7 +89,7 @@
 #include <machine/asm.h>
 #include <machine/cpu.h>
 
-       RCSID("$NetBSD: cpuswitch.S,v 1.73 2012/11/08 08:22:56 skrll Exp $")
+       RCSID("$NetBSD: cpuswitch.S,v 1.74 2012/12/05 19:05:45 matt Exp $")
 
 /* LINTSTUB: include <sys/param.h> */
        
@@ -277,17 +277,6 @@
        /* rem: r6 = new lwp */
        /* rem: r7 = new pcb */
 
-#ifdef ARMFPE
-       add     r0, r7, #(PCB_SIZE) & 0x00ff
-       add     r0, r0, #(PCB_SIZE) & 0xff00 
-       bl      _C_LABEL(arm_fpe_core_changecontext)
-#endif
-
-       /* rem: r4 = old lwp */
-       /* rem: r5 = new lwp's proc */
-       /* rem: r6 = new lwp */
-       /* rem: r7 = new PCB */
-
        /* 
         * Check for restartable atomic sequences (RAS).
         */
diff -r bda9ebbf2ead -r 7953f88fdd7f sys/arch/arm/arm32/vm_machdep.c
--- a/sys/arch/arm/arm32/vm_machdep.c   Wed Dec 05 17:21:55 2012 +0000
+++ b/sys/arch/arm/arm32/vm_machdep.c   Wed Dec 05 19:05:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.61 2012/10/23 22:50:00 matt Exp $     */
+/*     $NetBSD: vm_machdep.c,v 1.62 2012/12/05 19:05:45 matt Exp $     */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.61 2012/10/23 22:50:00 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.62 2012/12/05 19:05:45 matt Exp $");
 
 #include "opt_armfpe.h"
 #include "opt_pmap_debug.h"
@@ -69,10 +69,6 @@
 #include <machine/reg.h>
 #include <machine/vmparam.h>
 
-#ifdef ARMFPE
-#include <arm/fpe-arm/armfpe.h>
-#endif
-
 extern pv_addr_t systempage;
 
 int process_read_regs(struct proc *p, struct reg *regs);
@@ -164,12 +160,6 @@
        }
 #endif /* PMAP_DEBUG */
 
-#ifdef ARMFPE
-       /* Initialise a new FP context for p2 and copy the context from p1 */
-       arm_fpe_core_initcontext(FP_CONTEXT(l2));
-       arm_fpe_copycontext(FP_CONTEXT(l1), FP_CONTEXT(l2));
-#endif /* ARMFPE */
-
        struct trapframe *tf = (struct trapframe *)pcb2->pcb_sp - 1;
        lwp_settrapframe(l2, tf);
        *tf = *lwp_trapframe(l1);
@@ -201,23 +191,16 @@
 void
 cpu_lwp_free(struct lwp *l, int proc)
 {
-#ifdef ARMFPE
-       /* Abort any active FP operation and deactivate the context */
-       arm_fpe_core_abort(FP_CONTEXT(l), NULL, NULL);
-       arm_fpe_core_changecontext(0);
-#endif /* ARMFPE */
-
 #ifdef STACKCHECKS
        /* Report how much stack has been used - debugging */
-       if (l) {
-               u_char *ptr;
-               int loop;
+       struct pcb * const pcb = lwp_getpcb(l);
+       u_char *ptr;
+       u_int loop;
 
-               ptr = (u_char *)pcb + USPACE_SVC_STACK_BOTTOM;
-               for (loop = 0; loop < (USPACE_SVC_STACK_TOP - USPACE_SVC_STACK_BOTTOM)



Home | Main Index | Thread Index | Old Index