Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mips/mips split 'options SOFTFLOAT' to



details:   https://anonhg.NetBSD.org/src/rev/6c6c507d3a4e
branches:  trunk
changeset: 480316:6c6c507d3a4e
user:      shin <shin%NetBSD.org@localhost>
date:      Sun Jan 09 08:01:54 2000 +0000

description:
split 'options SOFTFLOAT' to

        NOFP            don't touch FPU registers in kernel
        SOFTFLOAT       emulate FPU instructions in kernel

diffstat:

 sys/arch/mips/mips/locore.S          |  12 +++++++-----
 sys/arch/mips/mips/mips_machdep.c    |   6 +++---
 sys/arch/mips/mips/process_machdep.c |  10 +++++-----
 sys/arch/mips/mips/trap.c            |  12 ++++++++++--
 sys/arch/mips/mips/vm_machdep.c      |   8 ++++----
 5 files changed, 29 insertions(+), 19 deletions(-)

diffs (218 lines):

diff -r f3ff8994f0bc -r 6c6c507d3a4e sys/arch/mips/mips/locore.S
--- a/sys/arch/mips/mips/locore.S       Sun Jan 09 07:59:51 2000 +0000
+++ b/sys/arch/mips/mips/locore.S       Sun Jan 09 08:01:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.83 1999/12/29 04:41:12 castor Exp $       */
+/*     $NetBSD: locore.S,v 1.84 2000/01/09 08:01:54 shin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -110,7 +110,7 @@
        nop
 #endif /* R3900_CACHE_DISABLE */
        
-#ifdef SOFTFLOAT /* No FPU; avoid touching FPU registers */
+#ifdef NOFPU /* No FPU; avoid touching FPU registers */
        li      t0, 0                           # Disable interrupts and
        mtc0    t0, MIPS_COP_0_STATUS           # the fp coprocessor
 #ifdef HPCMIPS_L1CACHE_DISABLE
@@ -128,7 +128,7 @@
        nop                                     # wait for new SR
        nop                                     # to be effective
        nop
-#ifdef SOFTFLOAT /* No FPU; avoid touching FPU registers */
+#ifdef NOFPU /* No FPU; avoid touching FPU registers */
        add     t1, zero, zero
 #else  
        cfc1    t1, MIPS_FPU_ID                 # read FPU ID register
@@ -1019,7 +1019,7 @@
 END(mips_read_causereg)
 
 
-#ifndef SOFTFLOAT
+#if !defined(NOFPU) && !defined(SOFTFLOAT)
 /*
  * void switchfpregs(struct proc *old, struct proc *new)
  *
@@ -1197,8 +1197,9 @@
        j       ra
        mtc0    v0, MIPS_COP_0_STATUS   # Restore the status register.
 END(savefpregs)
-#endif /* !SOFTFLOAT */
+#endif /* !defined(NOFPU) && !defined(SOFTFLOAT) */
 
+#if !defined(NOFPU) || defined(SOFTFLOAT)
 /*----------------------------------------------------------------------------
  *
  * MachFPInterrupt --
@@ -1363,6 +1364,7 @@
 
 #endif
 END(MachFPInterrupt)
+#endif /* !defined(NOFPU) || defined(SOFTFLOAT) */
 
 
 #ifndef DDB_TRACE
diff -r f3ff8994f0bc -r 6c6c507d3a4e sys/arch/mips/mips/mips_machdep.c
--- a/sys/arch/mips/mips/mips_machdep.c Sun Jan 09 07:59:51 2000 +0000
+++ b/sys/arch/mips/mips/mips_machdep.c Sun Jan 09 08:01:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mips_machdep.c,v 1.61 1999/12/22 05:54:18 tsubai Exp $ */
+/*     $NetBSD: mips_machdep.c,v 1.62 2000/01/09 08:01:54 shin Exp $   */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.61 1999/12/22 05:54:18 tsubai Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.62 2000/01/09 08:01:54 shin Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_ultrix.h"
@@ -764,7 +764,7 @@
        /* Save the floating-pointstate, if necessary, then copy it. */
        ksc.sc_fpused = p->p_md.md_flags & MDP_FPUSED;
        if (ksc.sc_fpused) {
-#ifndef SOFTFLOAT
+#if !defined(NOFPU) && !defined(SOFTFLOAT)
                /* if FPU has current state, save it first */
                if (p == fpcurproc)
                        savefpregs(p);
diff -r f3ff8994f0bc -r 6c6c507d3a4e sys/arch/mips/mips/process_machdep.c
--- a/sys/arch/mips/mips/process_machdep.c      Sun Jan 09 07:59:51 2000 +0000
+++ b/sys/arch/mips/mips/process_machdep.c      Sun Jan 09 08:01:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: process_machdep.c,v 1.11 1999/11/18 06:47:49 jun Exp $ */
+/*     $NetBSD: process_machdep.c,v 1.12 2000/01/09 08:01:54 shin Exp $        */
 
 /*
  * Copyright (c) 1994 Adam Glass
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.11 1999/11/18 06:47:49 jun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.12 2000/01/09 08:01:54 shin Exp $");
 
 /*
  * This file may seem a bit stylized, but that so that it's easier to port.
@@ -80,7 +80,7 @@
 
 extern struct proc *fpcurproc;                 /* trap.c */
 
-#ifndef SOFTFLOAT
+#if !defined(NOFPU) && !defined(SOFTFLOAT)
 extern void savefpregs __P((struct proc *));
 #endif
 
@@ -113,7 +113,7 @@
        struct fpreg *regs;
 {
        if (p->p_md.md_flags & MDP_FPUSED) {
-#ifndef SOFTFLOAT
+#if !defined(NOFPU) && !defined(SOFTFLOAT)
                if (p == fpcurproc)
                        savefpregs(p);
 #endif
@@ -133,7 +133,7 @@
        if ((p->p_md.md_flags & MDP_FPUSED) == 0)       /* XXX */
                return EINVAL;
 
-#ifndef SOFTFLOAT
+#if !defined(NOFPU) && !defined(SOFTFLOAT)
        if (p->p_md.md_flags & MDP_FPUSED) {
                if (p == fpcurproc)
                        savefpregs(p);
diff -r f3ff8994f0bc -r 6c6c507d3a4e sys/arch/mips/mips/trap.c
--- a/sys/arch/mips/mips/trap.c Sun Jan 09 07:59:51 2000 +0000
+++ b/sys/arch/mips/mips/trap.c Sun Jan 09 08:01:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.117 1999/12/22 04:54:16 jun Exp $   */
+/*     $NetBSD: trap.c,v 1.118 2000/01/09 08:01:54 shin Exp $  */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.117 1999/12/22 04:54:16 jun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.118 2000/01/09 08:01:54 shin Exp $");
 
 #include "opt_cputype.h"       /* which mips CPU levels do we support? */
 #include "opt_inet.h"
@@ -675,6 +675,10 @@
                sig = SIGILL;
                break; /* SIGNAL */
        case T_COP_UNUSABLE+T_USER:
+#if defined(NOFPU) && !defined(SOFTFLOAT)
+               sig = SIGILL;
+               break; /* SIGNAL */
+#endif
                if ((cause & MIPS_CR_COP_ERR) != 0x10000000) {
                        sig = SIGILL;   /* only FPU instructions allowed */
                        break; /* SIGNAL */
@@ -694,7 +698,9 @@
                return; /* GEN */
        case T_FPE+T_USER:
                /* dealfpu(status, cause, opc); */
+#if !defined(NOFPU) || defined(SOFTFLOAT)
                MachFPInterrupt(status, cause, opc, p->p_md.md_regs);
+#endif
                userret(p, opc, sticks);
                return; /* GEN */
        case T_OVFLOW+T_USER:
@@ -847,6 +853,7 @@
        userret(p, pc, p->p_sticks);
 }
 
+#if !defined(NOFPU) || defined(SOFTFLOAT)
 /* XXX XXX XXX */
 #define        set_cp0sr(x)                    \
 {                                      \
@@ -922,6 +929,7 @@
        set_cp0sr(status &~ MIPS_SR_COP_1_BIT);
        return;
 }
+#endif /* !defined(NOFPU) || defined(SOFTFLOAT) */
 
 /*
  * Analyse 'next' PC address taking account of branch/jump instructions
diff -r f3ff8994f0bc -r 6c6c507d3a4e sys/arch/mips/mips/vm_machdep.c
--- a/sys/arch/mips/mips/vm_machdep.c   Sun Jan 09 07:59:51 2000 +0000
+++ b/sys/arch/mips/mips/vm_machdep.c   Sun Jan 09 08:01:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.45 1999/12/04 21:20:51 ragge Exp $    */
+/*     $NetBSD: vm_machdep.c,v 1.46 2000/01/09 08:01:55 shin Exp $     */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.45 1999/12/04 21:20:51 ragge Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.46 2000/01/09 08:01:55 shin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -103,7 +103,7 @@
        if (p1 != curproc && p1 != &proc0)
                panic("cpu_fork: curproc");
 #endif
-#ifndef SOFTFLOAT
+#if !defined(NOFPU) && !defined(SOFTFLOAT)
        if (p1 == fpcurproc)
                savefpregs(p1);
 #endif
@@ -231,7 +231,7 @@
 
        cpustate.frame = *(struct frame *)p->p_md.md_regs;
        if (p->p_md.md_flags & MDP_FPUSED) {
-#ifndef SOFTFLOAT
+#if !defined(NOFPU) && !defined(SOFTFLOAT)
                if (p == fpcurproc)
                        savefpregs(p);
 #endif



Home | Main Index | Thread Index | Old Index