Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hppa Don't KASSERT there's an FPU present. QEMU do...



details:   https://anonhg.NetBSD.org/src/rev/f413dd5e6bae
branches:  trunk
changeset: 1009198:f413dd5e6bae
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Apr 16 05:44:43 2020 +0000

description:
Don't KASSERT there's an FPU present.  QEMU doesn't have one...

diffstat:

 sys/arch/hppa/dev/cpu.c  |  15 +++++++++------
 sys/arch/hppa/hppa/fpu.c |   7 ++++---
 2 files changed, 13 insertions(+), 9 deletions(-)

diffs (64 lines):

diff -r 307e5f0524b3 -r f413dd5e6bae sys/arch/hppa/dev/cpu.c
--- a/sys/arch/hppa/dev/cpu.c   Thu Apr 16 05:22:59 2020 +0000
+++ b/sys/arch/hppa/dev/cpu.c   Thu Apr 16 05:44:43 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.1 2014/02/24 07:23:42 skrll Exp $    */
+/*     $NetBSD: cpu.c,v 1.2 2020/04/16 05:44:44 skrll Exp $    */
 
 /*     $OpenBSD: cpu.c,v 1.29 2009/02/08 18:33:28 miod Exp $   */
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.1 2014/02/24 07:23:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.2 2020/04/16 05:44:44 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -150,10 +150,13 @@
        /*
         * Describe the floating-point support.
         */
-       KASSERT(fpu_present);
-       aprint_normal("%s: %s floating point, rev %d\n", device_xname(self),
-           hppa_mod_info(HPPA_TYPE_FPU, (fpu_version >> 16) & 0x1f),
-           (fpu_version >> 11) & 0x1f);
+       if (fpu_present)
+               aprint_normal("%s: %s floating point, rev %d\n", device_xname(self),
+                   hppa_mod_info(HPPA_TYPE_FPU, (fpu_version >> 16) & 0x1f),
+                   (fpu_version >> 11) & 0x1f);
+       else
+               aprint_normal("%s: no floating point\n", device_xname(self));
+
 
        if (cpuno >= HPPA_MAXCPUS) {
                aprint_normal_dev(self, "not started\n");
diff -r 307e5f0524b3 -r f413dd5e6bae sys/arch/hppa/hppa/fpu.c
--- a/sys/arch/hppa/hppa/fpu.c  Thu Apr 16 05:22:59 2020 +0000
+++ b/sys/arch/hppa/hppa/fpu.c  Thu Apr 16 05:44:43 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu.c,v 1.26 2019/04/15 20:45:08 skrll Exp $   */
+/*     $NetBSD: fpu.c,v 1.27 2020/04/16 05:44:43 skrll Exp $   */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.26 2019/04/15 20:45:08 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.27 2020/04/16 05:44:43 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -198,7 +198,8 @@
        struct pcb *pcb = lwp_getpcb(l);
        struct cpu_info *ci = curcpu();
 
-       KASSERT(fpu_present);
+       if (!fpu_present)
+               return;
 
        /*
         * If this process' state is currently in hardware, swap it out.



Home | Main Index | Thread Index | Old Index