Module Name: src
Committed By: martin
Date: Fri Apr 26 19:08:03 UTC 2019
Modified Files:
src/sys/arch/hppa/hppa [netbsd-8]: fpu.c machdep.c
Log Message:
Pull up following revision(s) (requested by skrll in ticket #1248):
sys/arch/hppa/hppa/machdep.c: revision 1.9
sys/arch/hppa/hppa/fpu.c: revision 1.25
Some fixes for QEMU/hppa.
Don't call desidhash_l on pcxl2 as it doesn't support it. QEMU emulates
this cpu and would trap on illegal instruction for the diag in desidhash_l
Allow a FPU to be missing... more fixes are likely here.
QEMU doesn't set C bit properly yet
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.32.1 src/sys/arch/hppa/hppa/fpu.c
cvs rdiff -u -r1.7 -r1.7.6.1 src/sys/arch/hppa/hppa/machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/hppa/hppa/fpu.c
diff -u src/sys/arch/hppa/hppa/fpu.c:1.24 src/sys/arch/hppa/hppa/fpu.c:1.24.32.1
--- src/sys/arch/hppa/hppa/fpu.c:1.24 Fri Apr 6 12:21:59 2012
+++ src/sys/arch/hppa/hppa/fpu.c Fri Apr 26 19:08:03 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: fpu.c,v 1.24 2012/04/06 12:21:59 skrll Exp $ */
+/* $NetBSD: fpu.c,v 1.24.32.1 2019/04/26 19:08:03 martin Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.24 2012/04/06 12:21:59 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.24.32.1 2019/04/26 19:08:03 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -144,6 +144,12 @@ hppa_fpu_bootstrap(u_int ccr_enable)
/* See if we have a present and functioning hardware FPU. */
fpu_present = (ccr_enable & HPPA_FPUS) == HPPA_FPUS;
+ if (!fpu_present) {
+ fpu_csw = 0;
+ curcpu()->ci_fpu_state = 0;
+
+ return;
+ }
KASSERT(fpu_present);
/* Initialize the FPU and get its version. */
Index: src/sys/arch/hppa/hppa/machdep.c
diff -u src/sys/arch/hppa/hppa/machdep.c:1.7 src/sys/arch/hppa/hppa/machdep.c:1.7.6.1
--- src/sys/arch/hppa/hppa/machdep.c:1.7 Sun Apr 2 08:31:10 2017
+++ src/sys/arch/hppa/hppa/machdep.c Fri Apr 26 19:08:03 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.7 2017/04/02 08:31:10 skrll Exp $ */
+/* $NetBSD: machdep.c,v 1.7.6.1 2019/04/26 19:08:03 martin Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.7 2017/04/02 08:31:10 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.7.6.1 2019/04/26 19:08:03 martin Exp $");
#include "opt_cputype.h"
#include "opt_ddb.h"
@@ -374,7 +374,7 @@ const struct hppa_cpu_info cpu_types[] =
{ "PA7300LC", "Velociraptor", "PCXL2",
hpcxl2, HPPA_CPU_PCXL2,
HPPA_FTRS_TLBU | HPPA_FTRS_BTLBU | HPPA_FTRS_HVT, "1.1e",
- desidhash_l, itlb_l, dtlb_l, itlbna_l, dtlbna_l, tlbd_l,
+ NULL, itlb_l, dtlb_l, itlbna_l, dtlbna_l, tlbd_l,
ibtlb_g, NULL, pbtlb_g, hpti_g },
#endif
#ifdef HP8000_CPU
@@ -809,9 +809,6 @@ cpuid(void)
if (hppa_cpu_info->hci_chip_name == NULL)
panic("bad model string for 0x%x", pdc_model.hwmodel);
- else if (hppa_cpu_info->desidhash == NULL)
- panic("no kernel support for %s",
- hppa_cpu_info->hci_chip_name);
/*
* TODO: HPT on 7200 is not currently supported
@@ -825,7 +822,10 @@ cpuid(void)
cpu_hpt_init = hppa_cpu_info->hptinit;
cpu_desidhash = hppa_cpu_info->desidhash;
- cpu_revision = (*cpu_desidhash)();
+ if (cpu_desidhash)
+ cpu_revision = (*cpu_desidhash)();
+ else
+ cpu_revision = 0;
/* force strong ordering for now */
if (hppa_cpu_ispa20_p())