Source-Changes-HG archive

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

[src/trunk]: src/sys Remove support for 'external' floating point units and t...



details:   https://anonhg.NetBSD.org/src/rev/19a88fb8874a
branches:  trunk
changeset: 793092:19a88fb8874a
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sun Jan 26 19:16:16 2014 +0000

description:
Remove support for 'external' floating point units and the MS-DOS
  compatible method of handling floating point exceptions.
Make kernel support for teh fpu non-optional (486SX should still work).
Only 386 cpus support external fpu, and i386 support was removed years ago.
This means that the npx code no longer uses port 0xf0 or interupt 13.
All the "npx at isa" lines go from the configs, arch/i386/isa/npx.c
  is now mandatory for all i386 kernels.
I've renamed npxinit() to fpuinit() and npxinit_cpu() to fpuinit_cpu()
  to match the very similar amd64 functions.
The fpu of the boot cpu is now initialised by a direct call from
  cpu_configure(), this enables FP emulation for a 486SX.
  (for amd64 the cr0 values are set in locore.S and similar).
This fixes a long-standing bug in linux_setregs() - which did not
  save the fpu regsiters if they were active.
I've test booted a single cpu i386 kernel (using anita).
amd64 builds - none of teh changes should affect it.
The i386 XEN kernels build, but I'm not sure where they set cr0, and
  it might have got lost!

diffstat:

 sys/arch/i386/acpi/npx_acpi.c              |  149 -----------------
 sys/arch/i386/conf/ALL                     |   12 +-
 sys/arch/i386/conf/GENERIC                 |   12 +-
 sys/arch/i386/conf/GENERIC_PS2TINY         |    4 +-
 sys/arch/i386/conf/GENERIC_TINY            |    7 +-
 sys/arch/i386/conf/INSTALL_FLOPPY          |    7 +-
 sys/arch/i386/conf/INSTALL_TINY            |    7 +-
 sys/arch/i386/conf/NET4501                 |    9 +-
 sys/arch/i386/conf/XEN3_DOM0               |    3 +-
 sys/arch/i386/conf/XEN3_DOMU               |    4 +-
 sys/arch/i386/conf/files.i386              |   14 +-
 sys/arch/i386/i386/autoconf.c              |    6 +-
 sys/arch/i386/i386/i386_trap.S             |   16 +-
 sys/arch/i386/i386/locore.S                |   41 +----
 sys/arch/i386/i386/machdep.c               |   26 +--
 sys/arch/i386/i386/process_machdep.c       |   21 +-
 sys/arch/i386/i386/trap.c                  |    8 +-
 sys/arch/i386/i386/vector.S                |    5 +-
 sys/arch/i386/include/npx.h                |    6 +-
 sys/arch/i386/isa/npx.c                    |  251 +++++-----------------------
 sys/arch/i386/isa/npx_isa.c                |  178 --------------------
 sys/arch/i386/isa/npxvar.h                 |   91 ----------
 sys/arch/i386/pnpbios/files.pnpbios        |    5 +-
 sys/arch/i386/pnpbios/npx_pnpbios.c        |  116 -------------
 sys/arch/x86/acpi/acpi_wakeup.c            |   22 +-
 sys/arch/x86/include/cpu.h                 |    6 +-
 sys/arch/x86/x86/cpu.c                     |   20 +--
 sys/arch/x86/x86/ipi.c                     |   18 +-
 sys/arch/x86/x86/vm_machdep.c              |   11 +-
 sys/arch/xen/conf/files.xen                |   13 +-
 sys/arch/xen/i386/npx_hv.c                 |   71 --------
 sys/arch/xen/x86/cpu.c                     |    8 +-
 sys/arch/xen/x86/xen_ipi.c                 |   10 +-
 sys/arch/xen/xen/hypervisor.c              |   17 +-
 sys/compat/linux/arch/i386/linux_machdep.c |   11 +-
 35 files changed, 122 insertions(+), 1083 deletions(-)

diffs (truncated from 2148 to 300 lines):

diff -r 2e0540138788 -r 19a88fb8874a sys/arch/i386/acpi/npx_acpi.c
--- a/sys/arch/i386/acpi/npx_acpi.c     Sun Jan 26 18:24:29 2014 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/* $NetBSD: npx_acpi.c,v 1.19 2011/07/01 18:14:15 dyoung Exp $ */
-
-/*
- * Copyright (c) 2002 Jared D. McNeill <jmcneill%invisible.ca@localhost>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npx_acpi.c,v 1.19 2011/07/01 18:14:15 dyoung Exp $");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-
-#include <sys/bus.h>
-#include <machine/cpufunc.h>
-#include <machine/intr.h>
-#include <machine/specialreg.h>
-
-#include <dev/isa/isavar.h>
-#include <dev/isa/isadmavar.h>
-
-#include <dev/acpi/acpica.h>
-#include <dev/acpi/acpireg.h>
-#include <dev/acpi/acpivar.h>
-
-#include <i386/isa/npxvar.h>
-
-static int     npx_acpi_match(device_t, cfdata_t, void *);
-static void    npx_acpi_attach(device_t, device_t, void *);
-
-CFATTACH_DECL_NEW(npx_acpi, sizeof(struct npx_softc), npx_acpi_match,
-    npx_acpi_attach, NULL, NULL);
-
-/*
- * Supported device IDs
- */
-
-static const char * const npx_acpi_ids[] = {
-       "PNP0C04",      /* Math Coprocessor */
-       NULL
-};
-
-/*
- * npx_acpi_match: autoconf(9) match routine
- */
-static int
-npx_acpi_match(device_t parent, cfdata_t match, void *aux)
-{
-       struct acpi_attach_args *aa = aux;
-
-       if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
-               return 0;
-
-       return acpi_match_hid(aa->aa_node->ad_devinfo, npx_acpi_ids);
-}
-
-/*
- * npx_acpi_attach: autoconf(9) attach routine
- */
-static void
-npx_acpi_attach(device_t parent, device_t self, void *aux)
-{
-       struct npx_softc *sc = device_private(self);
-       struct acpi_attach_args *aa = aux;
-       struct acpi_resources res;
-       struct acpi_io *io;
-       struct acpi_irq *irq;
-       ACPI_STATUS rv;
-
-       sc->sc_dev = self;
-
-       /* parse resources */
-       rv = acpi_resource_parse(sc->sc_dev, aa->aa_node->ad_handle, "_CRS",
-           &res, &acpi_resource_parse_ops_default);
-       if (ACPI_FAILURE(rv))
-               return;
-
-       /* find our i/o registers */
-       io = acpi_res_io(&res, 0);
-       if (io == NULL) {
-               aprint_error_dev(self,
-                   "unable to find i/o register resource\n");
-               goto out;
-       }
-
-       /* find our IRQ */
-       irq = acpi_res_irq(&res, 0);
-       if (irq == NULL) {
-               aprint_error_dev(self, "unable to find irq resource\n");
-               goto out;
-       }
-
-       sc->sc_iot = aa->aa_iot;
-       if (bus_space_map(sc->sc_iot, io->ar_base, io->ar_length,
-                   0, &sc->sc_ioh)) {
-               aprint_error_dev(self, "can't map i/o space\n");
-               goto out;
-       }
-
-       sc->sc_type = npxprobe1(sc->sc_iot, sc->sc_ioh, irq->ar_irq);
-
-       switch (sc->sc_type) {
-       case NPX_INTERRUPT:
-               lcr0(rcr0() & ~CR0_NE);
-               sc->sc_ih = isa_intr_establish(aa->aa_ic, irq->ar_irq,
-                   (irq->ar_type == ACPI_EDGE_SENSITIVE) ? IST_EDGE:IST_LEVEL,
-                   IPL_NONE, (int (*)(void *))npxintr, NULL);
-               break;
-       case NPX_EXCEPTION:
-               /*FALLTHROUGH*/
-       case NPX_CPUID:
-               aprint_verbose_dev(self, "%susing exception 16\n",
-                   sc->sc_type == NPX_CPUID ? "reported by CPUID; " : "");
-               sc->sc_type = NPX_EXCEPTION;
-               break;
-       case NPX_BROKEN:
-               aprint_error_dev(self, "error reporting broken; not using\n");
-               sc->sc_type = NPX_NONE;
-               goto out;
-       case NPX_NONE:
-               panic("npx_acpi_attach");
-       }
-
-       npxattach(sc);
-
- out:
-       acpi_resource_cleanup(&res);
-}
diff -r 2e0540138788 -r 19a88fb8874a sys/arch/i386/conf/ALL
--- a/sys/arch/i386/conf/ALL    Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/conf/ALL    Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.366 2013/11/23 23:36:34 riz Exp $
+# $NetBSD: ALL,v 1.367 2014/01/26 19:16:16 dsl Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "ALL-$Revision: 1.366 $"
+#ident                 "ALL-$Revision: 1.367 $"
 
 maxusers       64              # estimated number of users
 
@@ -388,7 +388,6 @@
 joy*           at acpi?                # Joystick/Game port
 lpt*           at acpi?                # Parallel port
 mpu*           at acpi?                # Roland MPU-401 MIDI UART
-npx*           at acpi?                # Math coprocessor
 pckbc*         at acpi?                # PC keyboard controller
 pcppi*         at acpi?                # AT-style speaker sound
 thinkpad*      at acpi?                # IBM/Lenovo Thinkpad hotkeys
@@ -437,7 +436,6 @@
 
 pckbc*         at pnpbios? index ?     # PC keyboard/mouse controller
 fdc*           at pnpbios? index ?     # floppy controller
-npx*           at pnpbios? index ?     # Math coprocessor
 
 # IDE controller on Toshiba Portege 3000 series (crippled PCI device)
 pciide*        at pnpbios? index ?
@@ -557,12 +555,6 @@
 cardbus*       at cardslot?
 pcmcia*        at cardslot?
 
-# Coprocessor Support
-
-# Math Coprocessor support
-npx0   at isa? port 0xf0 irq 13        # x86 math coprocessor
-
-
 # Console Devices
 
 # wscons
diff -r 2e0540138788 -r 19a88fb8874a sys/arch/i386/conf/GENERIC
--- a/sys/arch/i386/conf/GENERIC        Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/conf/GENERIC        Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1098 2013/10/26 09:16:20 nonaka Exp $
+# $NetBSD: GENERIC,v 1.1099 2014/01/26 19:16:16 dsl Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.1098 $"
+#ident                 "GENERIC-$Revision: 1.1099 $"
 
 maxusers       64              # estimated number of users
 
@@ -364,7 +364,6 @@
 joy*           at acpi?                # Joystick/Game port
 #lpt*          at acpi?                # Parallel port
 mpu*           at acpi?                # Roland MPU-401 MIDI UART
-npx*           at acpi?                # Math coprocessor
 pckbc*         at acpi?                # PC keyboard controller
 pcppi*         at acpi?                # AT-style speaker sound
 sony*          at acpi?                # Sony Miscellaneous Controller
@@ -409,7 +408,6 @@
 
 #pckbc*                at pnpbios? index ?     # PC keyboard/mouse controller
 #fdc*          at pnpbios? index ?     # floppy controller
-#npx*          at pnpbios? index ?     # Math coprocessor
 
 # IDE controller on Toshiba Portege 3000 series (crippled PCI device)
 #pciide*       at pnpbios? index ?
@@ -525,12 +523,6 @@
 cardbus*       at cardslot?
 pcmcia*        at cardslot?
 
-# Coprocessor Support
-
-# Math Coprocessor support
-npx0   at isa? port 0xf0 irq 13        # x86 math coprocessor
-
-
 # Console Devices
 
 # wscons
diff -r 2e0540138788 -r 19a88fb8874a sys/arch/i386/conf/GENERIC_PS2TINY
--- a/sys/arch/i386/conf/GENERIC_PS2TINY        Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/conf/GENERIC_PS2TINY        Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: GENERIC_PS2TINY,v 1.70 2013/06/30 21:38:57 rmind Exp $
+#      $NetBSD: GENERIC_PS2TINY,v 1.71 2014/01/26 19:16:16 dsl Exp $
 #
 #      GENERIC-style kernel config for IBM PS/2 with MCA bus. It only contains
 #      IBM PS/2 related stuff and has been generally trimmed down somewhat,
@@ -150,8 +150,6 @@
 mca0   at mainbus0
 isa0   at mainbus0
 
-#npx0  at isa? port 0xf0 irq 13        # x86 math coprocessor
-
 # wscons
 pckbc0         at isa?                 # PC keyboard controller
 options        PCKBCDEBUG
diff -r 2e0540138788 -r 19a88fb8874a sys/arch/i386/conf/GENERIC_TINY
--- a/sys/arch/i386/conf/GENERIC_TINY   Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/conf/GENERIC_TINY   Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: GENERIC_TINY,v 1.136 2013/06/30 21:38:57 rmind Exp $
+#      $NetBSD: GENERIC_TINY,v 1.137 2014/01/26 19:16:16 dsl Exp $
 #
 #      GENERIC_TINY -- suitable default for 4M machines
 #                      No EISA, PCI, or SCSI.
@@ -231,11 +231,6 @@
 # ISA Plug-and-Play PCMCIA controllers
 #pcic* at isapnp?
 
-# Coprocessor Support
-
-# Math Coprocessor support
-npx0   at isa? port 0xf0 irq 13        # x86 math coprocessor
-
 # Console Devices
 
 # wscons
diff -r 2e0540138788 -r 19a88fb8874a sys/arch/i386/conf/INSTALL_FLOPPY
--- a/sys/arch/i386/conf/INSTALL_FLOPPY Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/conf/INSTALL_FLOPPY Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: INSTALL_FLOPPY,v 1.21 2013/06/30 21:38:57 rmind Exp $
+#      $NetBSD: INSTALL_FLOPPY,v 1.22 2014/01/26 19:16:16 dsl Exp $
 #
 #      INSTALL - Installation kernel.
 #
@@ -240,11 +240,6 @@
 # ISA Plug-and-Play PCMCIA controllers
 pcic*  at isapnp?
 
-# Coprocessor Support



Home | Main Index | Thread Index | Old Index