Remove support for 'external' floating point units and the MS-DOS trunk
authordsl <dsl@NetBSD.org>
Sun, 26 Jan 2014 19:16:16 +0000
branchtrunk
changeset 224197 318697272c87
parent 224196 370722f52514
child 224198 4764f4e2eb05
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!
sys/arch/i386/acpi/npx_acpi.c
sys/arch/i386/conf/ALL
sys/arch/i386/conf/GENERIC
sys/arch/i386/conf/GENERIC_PS2TINY
sys/arch/i386/conf/GENERIC_TINY
sys/arch/i386/conf/INSTALL_FLOPPY
sys/arch/i386/conf/INSTALL_TINY
sys/arch/i386/conf/NET4501
sys/arch/i386/conf/XEN3_DOM0
sys/arch/i386/conf/XEN3_DOMU
sys/arch/i386/conf/files.i386
sys/arch/i386/i386/autoconf.c
sys/arch/i386/i386/i386_trap.S
sys/arch/i386/i386/locore.S
sys/arch/i386/i386/machdep.c
sys/arch/i386/i386/process_machdep.c
sys/arch/i386/i386/trap.c
sys/arch/i386/i386/vector.S
sys/arch/i386/include/npx.h
sys/arch/i386/isa/npx.c
sys/arch/i386/isa/npx_isa.c
sys/arch/i386/isa/npxvar.h
sys/arch/i386/pnpbios/files.pnpbios
sys/arch/i386/pnpbios/npx_pnpbios.c
sys/arch/x86/acpi/acpi_wakeup.c
sys/arch/x86/include/cpu.h
sys/arch/x86/x86/cpu.c
sys/arch/x86/x86/ipi.c
sys/arch/x86/x86/vm_machdep.c
sys/arch/xen/conf/files.xen
sys/arch/xen/i386/npx_hv.c
sys/arch/xen/x86/cpu.c
sys/arch/xen/x86/xen_ipi.c
sys/arch/xen/xen/hypervisor.c
sys/compat/linux/arch/i386/linux_machdep.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>
- * 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);
-}
--- 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
--- 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
--- 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
--- 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
--- 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
-
-# Math Coprocessor support
-npx0	at isa? port 0xf0 irq 13	# x86 math coprocessor
-
 
 # Console Devices
 
--- a/sys/arch/i386/conf/INSTALL_TINY	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/conf/INSTALL_TINY	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL_TINY,v 1.138 2013/06/30 21:38:57 rmind Exp $
+#	$NetBSD: INSTALL_TINY,v 1.139 2014/01/26 19:16:16 dsl Exp $
 #
 #	This kernel should be derived from INSTALL (which is derived
 #	from GENERIC) with some features commented out.
@@ -221,11 +221,6 @@
 # ISA Plug-and-Play bus support
 #isapnp0 at isa?
 
-# Coprocessor Support
-
-# Math Coprocessor support
-npx0	at isa? port 0xf0 irq 13	# x86 math coprocessor
-
 
 # Console Devices
 
--- a/sys/arch/i386/conf/NET4501	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/conf/NET4501	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: NET4501,v 1.82 2013/06/30 21:38:57 rmind Exp $
+# $NetBSD: NET4501,v 1.83 2014/01/26 19:16:16 dsl Exp $
 #
 # NET4501 -- kernel configuration for a Soekris Engineering net4501
 # single-board computer.
@@ -10,7 +10,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"NET4501-$Revision: 1.82 $"
+#ident 		"NET4501-$Revision: 1.83 $"
 
 maxusers	32		# estimated number of users
 
@@ -204,11 +204,6 @@
 ral*	at cardbus? function ?	# Ralink RT2x60 (802.11)
 rtw*	at cardbus? function ?	# Realtek RTL8180 (802.11)
 
-# Coprocessor Support
-
-# Math Coprocessor support
-npx0	at isa? port 0xf0 irq 13	# x86 math coprocessor
-
 # ISA serial interfaces
 com0	at isa? port 0x3f8 irq 4	# Standard PC serial ports
 com1	at isa? port 0x2f8 irq 3
--- a/sys/arch/i386/conf/XEN3_DOM0	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/conf/XEN3_DOM0	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: XEN3_DOM0,v 1.80 2013/10/23 17:26:08 matt Exp $
+#	$NetBSD: XEN3_DOM0,v 1.81 2014/01/26 19:16:16 dsl Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
@@ -211,7 +211,6 @@
 
 vcpu*		at hypervisor?		# Xen virtual CPUs
 xenbus* 	at hypervisor?		# Xen virtual bus
-npx0		at hypervisor?		# x86 math coprocessor
 
 xencons*	at hypervisor?		# Xen virtual console
 #xennet* 	at hypervisor?		# Xen virtual network interface
--- a/sys/arch/i386/conf/XEN3_DOMU	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/conf/XEN3_DOMU	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.55 2013/06/30 21:38:57 rmind Exp $
+# $NetBSD: XEN3_DOMU,v 1.56 2014/01/26 19:16:16 dsl Exp $
 
 include 	"arch/xen/conf/std.xen"
 
@@ -181,8 +181,6 @@
 
 vcpu*		at hypervisor?		# Xen virtual CPUs
 
-npx0		at hypervisor?		# x86 math coprocessor
-
 xencons*	at hypervisor?		# Xen virtual console
 
 xenbus* 	at hypervisor?		# Xen virtual bus
--- a/sys/arch/i386/conf/files.i386	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/conf/files.i386	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i386,v 1.371 2013/07/17 21:26:28 soren Exp $
+#	$NetBSD: files.i386,v 1.372 2014/01/26 19:16:16 dsl Exp $
 #
 # new style config file for i386 architecture
 #
@@ -81,6 +81,7 @@
 file	arch/i386/i386/process_machdep.c
 file	arch/i386/i386/trap.c
 file	dev/cons.c
+file	arch/i386/isa/npx.c
 
 file	arch/i386/i386/mptramp.S	multiprocessor
 
@@ -250,13 +251,6 @@
 attach	ptcd at isa
 file	dev/isa/ptcd.c			ptcd
 
-# Numeric Processing Extension; Math Co-processor
-device	npx
-file	arch/i386/isa/npx.c		npx needs-flag
-
-attach	npx at isa with npx_isa
-file	arch/i386/isa/npx_isa.c		npx_isa
-
 # PC Mice: Logitech-style and Microsoft-style
 device	lms: wsmousedev
 attach	lms at isa
@@ -444,10 +438,6 @@
 include "dev/acpi/files.acpi"
 file	arch/i386/acpi/acpi_wakeup_low.S	acpi
 
-# Numeric Processing Extension; Math Co-processor
-attach	npx at acpinodebus with npx_acpi
-file	arch/i386/acpi/npx_acpi.c		npx_acpi
-
 # Obsolete vesabios/vesafb flags
 obsolete	defflag	opt_vesabios.h	VESABIOSVERBOSE
 obsolete	defparam opt_vesafb.h	VESAFB_WIDTH VESAFB_HEIGHT VESAFB_DEPTH
--- a/sys/arch/i386/i386/autoconf.c	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/i386/autoconf.c	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.98 2012/10/03 18:58:31 dsl Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.99 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.98 2012/10/03 18:58:31 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.99 2014/01/26 19:16:17 dsl Exp $");
 
 #include "opt_compat_oldboot.h"
 #include "opt_intrdebug.h"
@@ -64,6 +64,7 @@
 #include <machine/intr.h>
 #include <machine/pcb.h>
 #include <machine/cpufunc.h>
+#include <machine/npx.h>
 
 #include "ioapic.h"
 #include "lapic.h"
@@ -118,6 +119,7 @@
 #if NIOAPIC > 0
 	ioapic_enable();
 #endif
+	fpuinit(&cpu_info_primary);
 	/* resync cr0 after FPU configuration */
 	pcb = lwp_getpcb(&lwp0);
 	pcb->pcb_cr0 = rcr0() & ~CR0_TS;
--- a/sys/arch/i386/i386/i386_trap.S	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/i386/i386_trap.S	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386_trap.S,v 1.1 2013/06/25 00:27:22 uebayasi Exp $	*/
+/*	$NetBSD: i386_trap.S,v 1.2 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -66,7 +66,7 @@
 
 #if 0
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.1 2013/06/25 00:27:22 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.2 2014/01/26 19:16:17 dsl Exp $");
 #endif
 
 /*
@@ -156,7 +156,6 @@
 IDTVEC_END(trap06)
 #endif
 IDTVEC(trap07)
-#if NNPX > 0
 	pushl	$0			# dummy error code
 	pushl	$T_DNA
 	INTRENTRY
@@ -169,12 +168,6 @@
 	testl	%eax,%eax
 	jz	calltrap
 	jmp	_C_LABEL(trapreturn)
-#else
-#ifndef XEN
-	sti
-#endif
-	ZTRAP(T_DNA)
-#endif
 IDTVEC_END(trap07)
 IDTVEC(trap08)
 	TRAP(T_DOUBLEFLT)
@@ -234,7 +227,6 @@
 IDTVEC_END(intrspurious)
 
 IDTVEC(trap10)
-#if NNPX > 0
 	/*
 	 * Handle like an interrupt so that we can call npxintr to clear the
 	 * error.  It would be better to handle npx interrupts as traps but
@@ -252,10 +244,6 @@
 	call	_C_LABEL(npxintr)
 	addl	$12,%esp
 	jmp	_C_LABEL(trapreturn)
-#else
-	sti
-	ZTRAP(T_ARITHTRAP)
-#endif
 IDTVEC_END(trap10)
 IDTVEC(trap11)
 	TRAP(T_ALIGNFLT)
--- a/sys/arch/i386/i386/locore.S	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/i386/locore.S	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.109 2014/01/11 17:05:17 christos Exp $	*/
+/*	$NetBSD: locore.S,v 1.110 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -129,7 +129,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.109 2014/01/11 17:05:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.110 2014/01/26 19:16:17 dsl Exp $");
 
 #include "opt_compat_oldboot.h"
 #include "opt_ddb.h"
@@ -139,7 +139,6 @@
 #include "opt_vm86.h"
 #include "opt_xen.h"
 
-#include "npx.h"
 #include "assym.h"
 #include "lapic.h"
 #include "ioapic.h"
@@ -1288,41 +1287,10 @@
 	cli
 	jmp	2b
 
-#if NNPX > 0
-/*
- * Special interrupt handlers.  Someday intr0-intr15 will be used to count
- * interrupts.  We'll still need a special exception 16 handler.  The busy
- * latch stuff in probintr() can be moved to npxprobe().
- */
-
-/*
- * void probeintr(void)
- */
-NENTRY(probeintr)
-	ss
-	incl	_C_LABEL(npx_intrs_while_probing)
-	pushl	%eax
-	movb	$0x20,%al	# EOI (asm in strings loses cpp features)
-	outb	%al,$0xa0	# IO_ICU2
-	outb	%al,$0x20	# IO_ICU1
-	movb	$0,%al
-	outb	%al,$0xf0	# clear BUSY# latch
-	popl	%eax
-	iret
-END(probeintr)
-
-/*
- * void probetrap(void)
- */
-NENTRY(probetrap)
-	ss
-	incl	_C_LABEL(npx_traps_while_probing)
-	fnclex
-	iret
-END(probetrap)
-
 /*
  * int npx586bug1(int a, int b)
+ * Used when checking for the FDIV bug on first generations pentiums.
+ * Anything 120MHz or above is fine.
  */
 NENTRY(npx586bug1)
 	fildl	4(%esp)		# x
@@ -1336,7 +1304,6 @@
 	popl	%eax
 	ret
 END(npx586bug1)
-#endif /* NNPX > 0 */
 
 /*
  * void sse2_idlezero_page(void *pg)
--- a/sys/arch/i386/i386/machdep.c	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/i386/machdep.c	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.742 2014/01/19 14:30:37 dsl Exp $	*/
+/*	$NetBSD: machdep.c,v 1.743 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.742 2014/01/19 14:30:37 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.743 2014/01/26 19:16:17 dsl Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -191,7 +191,6 @@
 
 #include "isa.h"
 #include "isadma.h"
-#include "npx.h"
 #include "ksyms.h"
 
 #include "cardbus.h"
@@ -869,12 +868,9 @@
 	struct trapframe *tf;
 	uint16_t control;
 
-#if NNPX > 0
 	/* If we were using the FPU, forget about it. */
-	if (pcb->pcb_fpcpu != NULL) {
-		npxsave_lwp(l, false);
-	}
-#endif
+	if (pcb->pcb_fpcpu != NULL)
+		fpusave_lwp(l, false);
 
 #ifdef USER_LDT
 	pmap_ldt_cleanup(l);
@@ -1641,16 +1637,13 @@
 	/* Save floating point register context, if any. */
 	if ((l->l_md.md_flags & MDL_USEDFPU) != 0) {
 		struct pcb *pcb = lwp_getpcb(l);
-#if NNPX > 0
 
 		/*
 		 * If this process is the current FP owner, dump its
 		 * context to the PCB first.
 		 */
-		if (pcb->pcb_fpcpu) {
-			npxsave_lwp(l, true);
-		}
-#endif
+		if (pcb->pcb_fpcpu)
+			fpusave_lwp(l, true);
 		if (i386_use_fxsave) {
 			memcpy(&mcp->__fpregs.__fp_reg_set.__fp_xmm_state.__fp_xmm,
 			    &pcb->pcb_savefpu.sv_xmm,
@@ -1742,14 +1735,11 @@
 	if ((flags & _UC_TLSBASE) != 0)
 		lwp_setprivate(l, (void *)(uintptr_t)mcp->_mc_tlsbase);
 
-#if NNPX > 0
 	/*
 	 * If we were using the FPU, forget that we were.
 	 */
-	if (pcb->pcb_fpcpu != NULL) {
-		npxsave_lwp(l, false);
-	}
-#endif
+	if (pcb->pcb_fpcpu != NULL)
+		fpusave_lwp(l, false);
 
 	/* Restore floating point register context, if any. */
 	if ((flags & _UC_FPU) != 0) {
--- a/sys/arch/i386/i386/process_machdep.c	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/i386/process_machdep.c	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: process_machdep.c,v 1.79 2014/01/25 20:12:53 dsl Exp $	*/
+/*	$NetBSD: process_machdep.c,v 1.80 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -52,11 +52,10 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.79 2014/01/25 20:12:53 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.80 2014/01/26 19:16:17 dsl Exp $");
 
 #include "opt_vm86.h"
 #include "opt_ptrace.h"
-#include "npx.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -250,9 +249,7 @@
 	union savefpu *frame = process_fpframe(l);
 
 	if (l->l_md.md_flags & MDL_USEDFPU) {
-#if NNPX > 0
-		npxsave_lwp(l, true);
-#endif
+		fpusave_lwp(l, true);
 	} else {
 		/*
 		 * Fake a FNINIT.
@@ -353,9 +350,7 @@
 	union savefpu *frame = process_fpframe(l);
 
 	if (l->l_md.md_flags & MDL_USEDFPU) {
-#if NNPX > 0
-		npxsave_lwp(l, false);
-#endif
+		fpusave_lwp(l, false);
 	} else {
 		l->l_md.md_flags |= MDL_USEDFPU;
 	}
@@ -404,13 +399,11 @@
 		return (EINVAL);
 
 	if (l->l_md.md_flags & MDL_USEDFPU) {
-#if NNPX > 0
 		struct pcb *pcb = lwp_getpcb(l);
 
 		if (pcb->pcb_fpcpu != NULL) {
-			npxsave_lwp(l, true);
+			fpusave_lwp(l, true);
 		}
-#endif
 	} else {
 		/*
 		 * Fake a FNINIT.
@@ -443,14 +436,12 @@
 		return (EINVAL);
 
 	if (l->l_md.md_flags & MDL_USEDFPU) {
-#if NNPX > 0
 		struct pcb *pcb = lwp_getpcb(l);
 
 		/* If we were using the FPU, drop it. */
 		if (pcb->pcb_fpcpu != NULL) {
-			npxsave_lwp(l, false);
+			fpusave_lwp(l, false);
 		}
-#endif
 	} else {
 		l->l_md.md_flags |= MDL_USEDFPU;
 	}
--- a/sys/arch/i386/i386/trap.c	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/i386/trap.c	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.268 2014/01/19 14:30:37 dsl Exp $	*/
+/*	$NetBSD: trap.c,v 1.269 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.268 2014/01/19 14:30:37 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.269 2014/01/26 19:16:17 dsl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -112,8 +112,6 @@
 
 #include <sys/kgdb.h>
 
-#include "npx.h"
-
 #ifdef KDTRACE_HOOKS
 #include <sys/dtrace_bsd.h>
 
@@ -586,11 +584,9 @@
 		case T_DIVIDE|T_USER:
 			ksi.ksi_code = FPE_INTDIV;
 			break;
-#if NNPX > 0
 		case T_ARITHTRAP|T_USER:
 			ksi.ksi_code = npxtrap(l);
 			break;
-#endif
 		default:
 			ksi.ksi_code = 0;
 			break;
--- a/sys/arch/i386/i386/vector.S	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/i386/vector.S	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.63 2013/11/22 01:09:11 riz Exp $	*/
+/*	$NetBSD: vector.S,v 1.64 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.63 2013/11/22 01:09:11 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.64 2014/01/26 19:16:17 dsl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -88,7 +88,6 @@
 #include "ioapic.h"
 #include "lapic.h"
 
-#include "npx.h"
 #include "assym.h"
 
 /*
--- a/sys/arch/i386/include/npx.h	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/include/npx.h	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: npx.h,v 1.31 2014/01/25 20:12:53 dsl Exp $	*/
+/*	$NetBSD: npx.h,v 1.32 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -193,10 +193,8 @@
 
 #ifdef _KERNEL
 
-void	probeintr(void);
-void	probetrap(void);
 int	npx586bug1(int, int);
-void 	npxinit(struct cpu_info *);
+void 	fpuinit(struct cpu_info *);
 void	process_xmm_to_s87(const struct fxsave *, struct save87 *);
 void	process_s87_to_xmm(const struct save87 *, struct fxsave *);
 struct lwp;
--- a/sys/arch/i386/isa/npx.c	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/isa/npx.c	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: npx.c,v 1.148 2014/01/19 14:30:37 dsl Exp $	*/
+/*	$NetBSD: npx.c,v 1.149 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npx.c,v 1.148 2014/01/19 14:30:37 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npx.c,v 1.149 2014/01/26 19:16:17 dsl Exp $");
 
 #if 0
 #define IPRINTF(x)	printf x
@@ -111,33 +111,21 @@
 #include <sys/systm.h>
 #include <sys/conf.h>
 #include <sys/cpu.h>
-#include <sys/file.h>
-#include <sys/proc.h>
-#include <sys/ioctl.h>
-#include <sys/device.h>
-#include <sys/vmmeter.h>
 #include <sys/kernel.h>
-#include <sys/bus.h>
 #include <sys/cpu.h>
-#include <sys/intr.h>
-
-#include <uvm/uvm_extern.h>
 
 #include <machine/cpufunc.h>
 #include <machine/cpuvar.h>
 #include <machine/pcb.h>
-#include <machine/trap.h>
 #include <machine/specialreg.h>
-#include <machine/pio.h>
-#include <machine/i8259.h>
 
-#include <dev/isa/isareg.h>
-#include <dev/isa/isavar.h>
-
-#include <i386/isa/npxvar.h>
 
 /*
- * 387 and 287 Numeric Coprocessor Extension (NPX) Driver.
+ * 387 Numeric Coprocessor Extension (NPX) Driver.
+ *
+ * Note that we only support 486 and later cpus, these do not support
+ * an external fpu, only the one that is part of the cpu fabric.
+ * A 486 might not have an fpu, but the 487 is a full 486.
  *
  * We do lazy initialization and switching using the TS bit in cr0 and the
  * MDL_USEDFPU bit in mdlwp.
@@ -164,7 +152,6 @@
 #define	stts() HYPERVISOR_fpu_taskswitch(1)
 #endif
 
-static	enum npx_type		npx_type;
 volatile u_int			npx_intrs_while_probing;
 volatile u_int			npx_traps_while_probing;
 
@@ -187,172 +174,42 @@
 		fnsave(&addr->sv_87);
 }
 
-static int
-npxdna_empty(struct cpu_info *ci)
-{
-
-	panic("npxdna vector not initialized");
-	return 0;
-}
-
+int    (*npxdna_func)(struct cpu_info *) = npxdna;
 
-int    (*npxdna_func)(struct cpu_info *) = npxdna_empty;
-
-#ifndef XEN
-/*
- * This calls i8259_* directly, but currently we can count on systems
- * having a i8259 compatible setup all the time. Maybe have to change
- * that in the future.
- */
-enum npx_type
-npxprobe1(bus_space_tag_t iot, bus_space_handle_t ioh, int irq)
+void
+fpuinit(struct cpu_info *ci)
 {
-	struct gate_descriptor save_idt_npxintr;
-	struct gate_descriptor save_idt_npxtrap;
-	enum npx_type rv = NPX_NONE;
-	u_long	save_eflags;
-	int control;
-	int status;
-	unsigned irqmask;
-
-	if (cpu_feature[0] & CPUID_FPU) {
-		i386_fpu_exception = 1;
-		return NPX_CPUID;
-	}
-	save_eflags = x86_read_psl();
-	x86_disable_intr();
-	save_idt_npxintr = idt[NRSVIDT + irq];
-	save_idt_npxtrap = idt[16];
-	setgate(&idt[NRSVIDT + irq], probeintr, 0, SDT_SYS386IGT, SEL_KPL,
-	    GSEL(GCODE_SEL, SEL_KPL));
-	setgate(&idt[16], probetrap, 0, SDT_SYS386TGT, SEL_KPL,
-	    GSEL(GCODE_SEL, SEL_KPL));
-
-	irqmask = i8259_setmask(~((1 << IRQ_SLAVE) | (1 << irq)));
-
-	/*
-	 * Partially reset the coprocessor, if any.  Some BIOS's don't reset
-	 * it after a warm boot.
-	 */
-	/* full reset on some systems, NOP on others */
-	bus_space_write_1(iot, ioh, 1, 0);
-	delay(1000);
-	/* clear BUSY# latch */
-	bus_space_write_1(iot, ioh, 0, 0);
+	uint16_t control;
+	uint32_t cr0;
 
-	/*
-	 * We set CR0 in locore to trap all ESC and WAIT instructions.
-	 * We have to turn off the CR0_EM bit temporarily while probing.
-	 */
-	lcr0(rcr0() & ~(CR0_EM|CR0_TS));
-	x86_enable_intr();
-
-	/*
-	 * Finish resetting the coprocessor, if any.  If there is an error
-	 * pending, then we may get a bogus IRQ13, but probeintr() will handle
-	 * it OK.  Bogus halts have never been observed, but we enabled
-	 * IRQ13 and cleared the BUSY# latch early to handle them anyway.
-	 */
+	/* Assume we have an FPU */
+	cr0 = rcr0();
+	cr0 &= ~(CR0_EM | CR0_TS);
+	cr0 |= CR0_NE | CR0_MP;
+	lcr0(cr0);
+	/* Read back the default contol word */
 	fninit();
-	delay(1000);		/* wait for any IRQ13 (fwait might hang) */
+	fnstcw(&control);
 
-	/*
-	 * Check for a status of mostly zero.
-	 */
-	status = 0x5a5a;
-	fnstsw(&status);
-	if ((status & 0xb8ff) == 0) {
-		/*
-		 * Good, now check for a proper control word.
-		 */
-		control = 0x5a5a;
-		fnstcw(&control);
-		if ((control & 0x1f3f) == 0x033f) {
-			/*
-			 * We have an npx, now divide by 0 to see if exception
-			 * 16 works.
-			 */
-			control &= ~(1 << 2);	/* enable divide by 0 trap */
-			fldcw(&control);
-			npx_traps_while_probing = npx_intrs_while_probing = 0;
-			fp_divide_by_0();
-			if (npx_traps_while_probing != 0) {
-				/*
-				 * Good, exception 16 works.
-				 */
-				rv = NPX_EXCEPTION;
-				i386_fpu_exception = 1;
-			} else if (npx_intrs_while_probing != 0) {
-				/*
-				 * Bad, we are stuck with IRQ13.
-				 */
-				rv = NPX_INTERRUPT;
-			} else {
-				/*
-				 * Worse, even IRQ13 is broken.  Use emulator.
-				 */
-				rv = NPX_BROKEN;
-			}
-		}
+	if (control != __INITIAL_NPXCW__) {
+		/* Must be a 486SX, emulate FP instructions */
+		lcr0((cr0 & ~CR0_MP) | CR0_EM);
+		aprint_normal_dev(ci->ci_dev, "no fpu\n");
+		return;
 	}
 
-	x86_disable_intr();
-	lcr0(rcr0() | (CR0_EM|CR0_TS));
-
-	irqmask = i8259_setmask(irqmask);
-
-	idt[NRSVIDT + irq] = save_idt_npxintr;
+	/* We have a valid FPU */
+	i386_fpu_present = 1;
 
-	idt[16] = save_idt_npxtrap;
-	x86_write_psl(save_eflags);
-
-	return (rv);
-}
-
-void npxinit(struct cpu_info *ci)
-{
-	lcr0(rcr0() & ~(CR0_EM|CR0_TS));
-	fninit();
 	if (npx586bug1(4195835, 3145727) != 0) {
+		/* NB 120+MHz cpus are not affected */
 		i386_fpu_fdivbug = 1;
 		aprint_normal_dev(ci->ci_dev,
 		    "WARNING: Pentium FDIV bug detected!\n");
 	}
-	lcr0(rcr0() | (CR0_TS));
-}
-#endif
 
-/*
- * Common attach routine.
- */
-void
-npxattach(struct npx_softc *sc)
-{
-
-	npx_softc = sc;
-	npx_type = sc->sc_type;
-
-#ifndef XEN
-	npxinit(&cpu_info_primary);
-#endif
-	i386_fpu_present = 1;
-	npxdna_func = npxdna;
-
-	if (!pmf_device_register(sc->sc_dev, NULL, NULL))
-		aprint_error_dev(sc->sc_dev, "couldn't establish power handler\n");
-}
-
-int
-npxdetach(device_t self, int flags)
-{
-	struct npx_softc *sc = device_private(self);
-
-	if (sc->sc_type == NPX_INTERRUPT)
-		return EBUSY;
-
-	pmf_device_deregister(self);
-	
-	return 0;
+	/* Set TS so first fp instruction faults */
+	lcr0(cr0 | CR0_TS);
 }
 
 /*
@@ -367,9 +224,10 @@
  * a status code!  So there is no way to have a non-naive SIGFPE handler.  At
  * best a handler could do an fninit followed by an fldcw of a static value.
  * fnclex would be of little use because it would leave junk on the FPU stack.
- * Returning from the handler would be even less safe than usual because
- * IRQ13 exception handling makes exceptions even less precise than usual.
+ *
+ * Only called dircetly from i386_trap.S
  */
+int npxintr(void *, struct intrframe *);
 int
 npxintr(void *arg, struct intrframe *frame)
 {
@@ -379,7 +237,6 @@
 	struct pcb *pcb;
 	ksiginfo_t ksi;
 
-
 	kpreempt_disable();
 #ifndef XEN
 	KASSERT((x86_read_psl() & PSL_I) == 0);
@@ -389,15 +246,6 @@
 	curcpu()->ci_data.cpu_ntrap++;
 	IPRINTF(("%s: fp intr\n", device_xname(ci->ci_dev)));
 
-#ifndef XEN
-	struct npx_softc *sc = npx_softc;
-	/*
-	 * Clear the interrupt latch.
-	 */
-	if (sc->sc_type == NPX_INTERRUPT)
-		bus_space_write_1(sc->sc_iot, sc->sc_ioh, 0, 0);
-#endif
-
 	/*
 	 * If we're saving, ignore the interrupt.  The FPU will generate
 	 * another one when we restore the state later.
@@ -407,9 +255,9 @@
 		return (1);
 	}
 
-	if (l == NULL || npx_type == NPX_NONE) {
-		printf("npxintr: l = %p, curproc = %p, npx_type = %d\n",
-		    l, curproc, npx_type);
+	if (l == NULL || !i386_fpu_present) {
+		printf("npxintr: l = %p, curproc = %p, fpu_present = %d\n",
+		    l, curproc, i386_fpu_present);
 		printf("npxintr: came from nowhere");
 		kpreempt_enable();
 		return 1;
@@ -496,18 +344,7 @@
 
 		trapsignal(l, &ksi);
 	} else {
-		/*
-		 * This is a nested interrupt.  This should only happen when
-		 * an IRQ13 occurs at the same time as a higher-priority
-		 * interrupt.
-		 *
-		 * XXX
-		 * Currently, we treat this like an asynchronous interrupt, but
-		 * this has disadvantages.
-		 */
-		mutex_enter(proc_lock);
-		psignal(l->l_proc, SIGFPE);
-		mutex_exit(proc_lock);
+		panic("fpu trap from kernel\n");
 	}
 
 	kpreempt_enable();
@@ -582,7 +419,7 @@
 			return 1;
 		}
 		KASSERT(fl != l);
-		npxsave_cpu(true);
+		fpusave_cpu(true);
 		KASSERT(ci->ci_fpcurlwp == NULL);
 	}
 
@@ -591,7 +428,7 @@
 		/* Explicitly disable preemption before dropping spl. */
 		KPREEMPT_DISABLE(l);
 		splx(s);
-		npxsave_lwp(l, true);
+		fpusave_lwp(l, true);
 		KASSERT(pcb->pcb_fpcpu == NULL);
 		s = splhigh();
 		KPREEMPT_ENABLE(l);
@@ -649,7 +486,7 @@
  * Save current CPU's FPU state.  Must be called at IPL_HIGH.
  */
 void
-npxsave_cpu(bool save)
+fpusave_cpu(bool save)
 {
 	struct cpu_info *ci;
 	struct lwp *l;
@@ -694,7 +531,7 @@
  * may race against it.
  */
 void
-npxsave_lwp(struct lwp *l, bool save)
+fpusave_lwp(struct lwp *l, bool save)
 {
 	struct cpu_info *oci;
 	struct pcb *pcb;
@@ -712,7 +549,7 @@
 		}
 		if (oci == curcpu()) {
 			KASSERT(oci->ci_fpcurlwp == l);
-			npxsave_cpu(save);
+			fpusave_cpu(save);
 			splx(s);
 			break;
 		}
@@ -731,7 +568,7 @@
 			spins++;
 		}
 		if (spins > 100000000) {
-			panic("npxsave_lwp: did not");
+			panic("fpusave_lwp: did not");
 		}
 	}
 
@@ -937,8 +774,8 @@
 	struct lwp *fl = ci->ci_fpcurlwp;
 
 	if (!i386_fpu_present) {
-		printf("%s: fpcurthread = %p, curthread = %p, npx_type = %d\n",
-		    __func__, fl, l, npx_type);
+		printf("%s: fpcurthread = %p, curthread = %p\n",
+		    __func__, fl, l);
 		panic("npxtrap from nowhere");
 	}
 	kpreempt_disable();
--- a/sys/arch/i386/isa/npx_isa.c	Sun Jan 26 18:24:29 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-/*	$NetBSD: npx_isa.c,v 1.22 2011/07/01 18:11:24 dyoung Exp $	*/
-
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * 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. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- *	@(#)npx.c	7.2 (Berkeley) 5/12/91
- */
-
-/*-
- * Copyright (c) 1994, 1995, 1998 Charles M. Hannum.  All rights reserved.
- * Copyright (c) 1990 William Jolitz.
- *
- * 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. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- *	@(#)npx.c	7.2 (Berkeley) 5/12/91
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npx_isa.c,v 1.22 2011/07/01 18:11:24 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/isareg.h>
-#include <dev/isa/isavar.h>
-
-#include <i386/isa/npxvar.h>
-
-int npx_isa_probe(device_t, cfdata_t, void *);
-void npx_isa_attach(device_t, device_t, void *);
-
-CFATTACH_DECL3_NEW(npx_isa, sizeof(struct npx_softc),
-    npx_isa_probe, npx_isa_attach, npxdetach, NULL, NULL, NULL,
-    DVF_DETACH_SHUTDOWN);
-
-int
-npx_isa_probe(device_t parent, cfdata_t match, void *aux)
-{
-	struct isa_attach_args *ia = aux;
-	bus_space_handle_t ioh;
-	enum npx_type result;
-
-	if (ia->ia_nio < 1)
-		return (0);
-	if (ia->ia_nirq < 1)
-		return (0);
-
-	if (ISA_DIRECT_CONFIG(ia))
-		return (0);
-
-	if (bus_space_map(ia->ia_iot, 0xf0, 16, 0, &ioh) != 0)
-		return (0);
-
-	result = npxprobe1(ia->ia_iot, ioh, ia->ia_irq[0].ir_irq);
-
-	bus_space_unmap(ia->ia_iot, ioh, 16);
-
-	if (result != NPX_NONE) {
-		/*
-		 * Remember our result -- we don't want to have to npxprobe1()
-		 * again (especially if we've zapped the IRQ).
-		 */
-		ia->ia_aux = (void *)(intptr_t)result;
-
-		ia->ia_nio = 1;
-		ia->ia_io[0].ir_addr = 0xf0;
-		ia->ia_io[0].ir_size = 16;
-
-		if (result != NPX_INTERRUPT)
-			ia->ia_nirq = 0;	/* zap the interrupt */
-		else
-			ia->ia_nirq = 1;
-
-		ia->ia_niomem = 0;
-		ia->ia_ndrq = 0;
-		return (1);
-	}
-
-	return (0);
-}
-
-void
-npx_isa_attach(device_t parent, device_t self, void *aux)
-{
-	struct npx_softc *sc = device_private(self);
-	struct isa_attach_args *ia = aux;
-
-	aprint_naive("\n");
-	aprint_normal("\n");
-
-	sc->sc_dev = self;
-	sc->sc_type = (u_long) ia->ia_aux;
-
-	switch (sc->sc_type) {
-	case NPX_INTERRUPT:
-		sc->sc_iot = ia->ia_iot;
-		if (bus_space_map(sc->sc_iot, 0xf0, 16, 0, &sc->sc_ioh))
-			panic("%s: unable to map I/O space", __func__);
-		lcr0(rcr0() & ~CR0_NE);
-		sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq,
-		    IST_EDGE, IPL_NONE, (int (*)(void *))npxintr, 0);
-		break;
-	case NPX_EXCEPTION:
-		/*FALLTHROUGH*/
-	case NPX_CPUID:
-		aprint_verbose_dev(sc->sc_dev, "%s using exception 16\n",
-		    sc->sc_type == NPX_CPUID ? "reported by CPUID;" : "");
-		sc->sc_type = NPX_EXCEPTION;
-		break;
-	case NPX_BROKEN:
-		aprint_error_dev(sc->sc_dev,
-		    "error reporting broken; not using\n");
-		sc->sc_type = NPX_NONE;
-		return;
-	case NPX_NONE:
-		return;
-	}
-
-	npxattach(sc);
-}
-
--- a/sys/arch/i386/isa/npxvar.h	Sun Jan 26 18:24:29 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*	$NetBSD: npxvar.h,v 1.8 2008/03/04 14:53:38 cube Exp $	*/
-
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * 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. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- *      @(#)npx.c       7.2 (Berkeley) 5/12/91
- */
-
-/*-
- * Copyright (c) 1994, 1995, 1998 Charles M. Hannum.  All rights reserved.
- * Copyright (c) 1990 William Jolitz.
- *
- * 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. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- *      @(#)npx.c       7.2 (Berkeley) 5/12/91
- */
-
-enum npx_type {
-	NPX_NONE = 0,
-	NPX_INTERRUPT,
-	NPX_EXCEPTION,
-	NPX_BROKEN,
-	NPX_CPUID
-};
-
-struct npx_softc {
-	device_t sc_dev;
-
-	bus_space_tag_t sc_iot;
-	bus_space_handle_t sc_ioh;
-
-	enum npx_type sc_type;
-
-	void *sc_ih;
-};
-
-enum npx_type npxprobe1(bus_space_tag_t, bus_space_handle_t, int);
-void npxattach(struct npx_softc *);
-int npxdetach(device_t, int);
-int npxintr(void *, struct intrframe *);
--- a/sys/arch/i386/pnpbios/files.pnpbios	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/i386/pnpbios/files.pnpbios	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.pnpbios,v 1.17 2006/12/09 22:45:26 uwe Exp $
+# $NetBSD: files.pnpbios,v 1.18 2014/01/26 19:16:17 dsl Exp $
 
 defflag  opt_pnpbios.h	PNPBIOSVERBOSE
 defflag  opt_pnpbios.h	PNPBIOSDEBUG
@@ -44,8 +44,5 @@
 attach	fdc at pnpbios with fdc_pnpbios
 file	arch/i386/pnpbios/fdc_pnpbios.c		fdc_pnpbios
 
-attach	npx at pnpbios with npx_pnpbios
-file	arch/i386/pnpbios/npx_pnpbios.c		npx_pnpbios
-
 attach	joy at pnpbios with joy_pnpbios
 file	arch/i386/pnpbios/joy_pnpbios.c		joy_pnpbios
--- a/sys/arch/i386/pnpbios/npx_pnpbios.c	Sun Jan 26 18:24:29 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*	$NetBSD: npx_pnpbios.c,v 1.13 2011/07/01 18:14:15 dyoung Exp $	*/
-
-/*-
- * Copyright (c) 2000 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe.
- *
- * 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. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``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 FOUNDATION OR CONTRIBUTORS
- * 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_pnpbios.c,v 1.13 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/isareg.h>
-#include <dev/isa/isavar.h>
-
-#include <i386/pnpbios/pnpbiosvar.h>
-
-#include <i386/isa/npxvar.h> 
-
-int	npx_pnpbios_match(device_t, cfdata_t, void *);
-void	npx_pnpbios_attach(device_t, device_t, void *);
-
-CFATTACH_DECL_NEW(npx_pnpbios, sizeof(struct npx_softc),
-    npx_pnpbios_match, npx_pnpbios_attach, NULL, NULL);
-
-int
-npx_pnpbios_match(device_t parent, cfdata_t match, void *aux)
-{
-	struct pnpbiosdev_attach_args *aa = aux;
-
-	if (strcmp(aa->idstr, "PNP0C04"))
-		return (0);
-
-	return (1);
-}
-
-void
-npx_pnpbios_attach(device_t parent, device_t self, void *aux)
-{
-	struct npx_softc *sc = device_private(self);
-	struct pnpbiosdev_attach_args *aa = aux;
-	int irq, ist;
-
-	sc->sc_dev = self;
-
-	if (pnpbios_io_map(aa->pbt, aa->resc, 0, &sc->sc_iot, &sc->sc_ioh)) {
-		aprint_error(": can't map i/o space\n");
-		return;
-	}
-
-	aprint_naive("\n");
-	aprint_normal("\n");
-	pnpbios_print_devres(self, aa);
-
-	if (pnpbios_getirqnum(aa->pbt, aa->resc, 0, &irq, &ist) != 0) {
-		aprint_error_dev(self, "unable to get IRQ number or type\n");
-		return;
-	}
-
-	sc->sc_type = npxprobe1(sc->sc_iot, sc->sc_ioh, irq);
-
-	switch (sc->sc_type) {
-	case NPX_INTERRUPT:
-		aprint_normal_dev(self, "interrupting at irq %d\n", irq);
-		lcr0(rcr0() & ~CR0_NE);
-		sc->sc_ih = isa_intr_establish(0/*XXX*/, irq, ist, 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;
-		return;
-	case NPX_NONE:
-		panic("npx_pnpbios_attach");
-	}
-
-	npxattach(sc);
-}
--- a/sys/arch/x86/acpi/acpi_wakeup.c	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/x86/acpi/acpi_wakeup.c	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_wakeup.c,v 1.34 2013/12/01 01:05:16 christos Exp $	*/
+/*	$NetBSD: acpi_wakeup.c,v 1.35 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.34 2013/12/01 01:05:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.35 2014/01/26 19:16:17 dsl Exp $");
 
 /*-
  * Copyright (c) 2001 Takanori Watanabe <takawata@jp.freebsd.org>
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.34 2013/12/01 01:05:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.35 2014/01/26 19:16:17 dsl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -268,12 +268,10 @@
 		return;
 
 	/* Execute Wakeup */
-#ifdef __i386__
-	npxinit(ci);
-#else
+#ifndef __i386__
 	cpu_init_msrs(ci, false);
+#endif
 	fpuinit(ci);
-#endif
 #if NLAPIC > 0
 	lapic_enable();
 	lapic_set_lvt();
@@ -309,11 +307,7 @@
 	AcpiSetFirmwareWakingVector(acpi_wakeup_paddr);
 
 	s = splhigh();
-#ifdef __i386__
-	npxsave_cpu(true);
-#else
 	fpusave_cpu(true);
-#endif
 	x86_disable_intr();
 
 #ifdef MULTIPROCESSOR
@@ -329,12 +323,10 @@
 		goto out;
 
 	/* Execute Wakeup */
-#ifdef __i386__
-	npxinit(&cpu_info_primary);
-#else
+#ifndef __i386__
 	cpu_init_msrs(&cpu_info_primary, false);
+#endif
 	fpuinit(&cpu_info_primary);
-#endif
 	i8259_reinit();
 #if NLAPIC > 0
 	lapic_enable();
--- a/sys/arch/x86/include/cpu.h	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/x86/include/cpu.h	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.58 2013/12/01 01:05:16 christos Exp $	*/
+/*	$NetBSD: cpu.h,v 1.59 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -426,8 +426,8 @@
 void	cpu_probe_features(struct cpu_info *);
 
 /* npx.c */
-void	npxsave_lwp(struct lwp *, bool);
-void	npxsave_cpu(bool);
+void	fpusave_lwp(struct lwp *, bool);
+void	fpusave_cpu(bool);
 
 /* vm_machdep.c */
 paddr_t	kvtop(void *);
--- a/sys/arch/x86/x86/cpu.c	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/x86/x86/cpu.c	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.107 2013/12/01 01:05:16 christos Exp $	*/
+/*	$NetBSD: cpu.c,v 1.108 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*-
  * Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.107 2013/12/01 01:05:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.108 2014/01/26 19:16:17 dsl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"		/* for MPDEBUG */
@@ -72,10 +72,6 @@
 #include "lapic.h"
 #include "ioapic.h"
 
-#ifdef i386
-#include "npx.h"
-#endif
-
 #include <sys/param.h>
 #include <sys/proc.h>
 #include <sys/systm.h>
@@ -849,13 +845,7 @@
 	lapic_set_lvt();
 	lapic_initclocks();
 
-#ifdef i386
-#if NNPX > 0
-	npxinit(ci);
-#endif
-#else
 	fpuinit(ci);
-#endif
 	lldt(GSYSSEL(GLDT_SEL, SEL_KPL));
 	ltr(ci->ci_tss_sel);
 
@@ -1123,13 +1113,7 @@
 	int s;
 
 	s = splhigh();
-#ifdef i386
-#if NNPX > 0
-	npxsave_cpu(true);
-#endif
-#else
 	fpusave_cpu(true);
-#endif
 	splx(s);
 }
 
--- a/sys/arch/x86/x86/ipi.c	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/x86/x86/ipi.c	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipi.c,v 1.20 2013/12/01 01:05:16 christos Exp $	*/
+/*	$NetBSD: ipi.c,v 1.21 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2008, 2009 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipi.c,v 1.20 2013/12/01 01:05:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipi.c,v 1.21 2014/01/26 19:16:17 dsl Exp $");
 
 #include "opt_mtrr.h"
 
@@ -58,16 +58,6 @@
 
 #ifdef __x86_64__
 #include <machine/fpu.h>
-static void	x86_ipi_synch_fpu(struct cpu_info *);
-#else
-/* XXXfpu */
-#include "npx.h"
-#if NNPX > 0
-static void	x86_ipi_synch_fpu(struct cpu_info *);
-#define		fpusave_cpu(x)		npxsave_cpu(x)
-#else
-#define		x86_ipi_synch_fpu	NULL
-#endif
 #endif
 
 static void	x86_ipi_halt(struct cpu_info *);
@@ -86,6 +76,8 @@
 #define	acpi_cpu_sleep	NULL
 #endif
 
+static void	x86_ipi_synch_fpu(struct cpu_info *);
+
 void (*ipifunc[X86_NIPI])(struct cpu_info *) =
 {
 	x86_ipi_halt,
@@ -180,14 +172,12 @@
 	}
 }
 
-#if defined(__x86_64__) || NNPX > 0	/* XXXfpu */
 static void
 x86_ipi_synch_fpu(struct cpu_info *ci)
 {
 
 	fpusave_cpu(true);
 }
-#endif
 
 #ifdef MTRR
 static void
--- a/sys/arch/x86/x86/vm_machdep.c	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/x86/x86/vm_machdep.c	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.19 2014/01/11 17:14:00 christos Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.20 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.19 2014/01/11 17:14:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.20 2014/01/26 19:16:17 dsl Exp $");
 
 #include "opt_mtrr.h"
 
@@ -105,13 +105,6 @@
 
 #ifdef __x86_64__
 #include <machine/fpu.h>
-#else
-#include "npx.h"
-#if NNPX > 0
-#define fpusave_lwp(x, y)	npxsave_lwp(x, y)
-#else
-#define fpusave_lwp(x, y)
-#endif
 #endif
 
 void
--- a/sys/arch/xen/conf/files.xen	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/xen/conf/files.xen	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.129 2012/10/03 18:58:32 dsl Exp $
+#	$NetBSD: files.xen,v 1.130 2014/01/26 19:16:17 dsl Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -55,6 +55,8 @@
 file	arch/i386/i386/trap.c
 file	arch/i386/i386/lock_stubs.S
 
+file	arch/i386/isa/npx.c
+
 
 file	arch/i386/i386/pmc.c			perfctrs
 
@@ -183,15 +185,6 @@
 file arch/xen/xenbus/xenbus_probe.c xenbus needs-flag
 file arch/xen/xenbus/xenbus_xs.c xenbus needs-flag
 
-ifdef i386
-# Numeric Processing Extension; Math Co-processor
-device	npx
-file	arch/i386/isa/npx.c		npx needs-flag
-
-attach	npx at xendevbus with npx_hv
-file	arch/xen/i386/npx_hv.c		npx_hv
-endif
-
 # Xen console support
 device	xencons: tty
 attach	xencons at xendevbus
--- a/sys/arch/xen/i386/npx_hv.c	Sun Jan 26 18:24:29 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*	$NetBSD: npx_hv.c,v 1.10 2011/07/17 20:54:49 joerg Exp $	*/
-
-/*
- *
- * Copyright (c) 2004 Christian Limpach.
- * 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. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * 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_hv.c,v 1.10 2011/07/17 20:54:49 joerg Exp $");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-
-#include <sys/bus.h>
-
-#include <xen/xen.h>
-#include <xen/hypervisor.h>
-
-#include <i386/isa/npxvar.h>
-
-int npx_hv_probe(device_t, cfdata_t, void *);
-void npx_hv_attach(device_t, device_t, void *);
-
-CFATTACH_DECL_NEW(npx_hv, sizeof(struct npx_softc),
-    npx_hv_probe, npx_hv_attach, NULL, NULL);
-
-int
-npx_hv_probe(device_t parent, cfdata_t match, void *aux)
-{
-	struct xen_npx_attach_args *xa = (struct xen_npx_attach_args *)aux;
-
-	if (strcmp(xa->xa_device, "npx") == 0)
-		return 1;
-	return 0;
-}
-
-void
-npx_hv_attach(device_t parent, device_t self, void *aux)
-{
-	struct npx_softc *sc = device_private(self);
-
-	sc->sc_dev = self;
-	sc->sc_type = NPX_EXCEPTION;
-
-	aprint_normal(": using exception 16\n");
-
-	npxattach(sc);
-}
--- a/sys/arch/xen/x86/cpu.c	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/xen/x86/cpu.c	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.95 2013/12/01 01:05:16 christos Exp $	*/
+/*	$NetBSD: cpu.c,v 1.96 2014/01/26 19:16:17 dsl Exp $	*/
 /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp  */
 
 /*-
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.95 2013/12/01 01:05:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.96 2014/01/26 19:16:17 dsl Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -1059,11 +1059,7 @@
         int s;
 
         s = splhigh();
-#ifdef __i386__
-        npxsave_cpu(true);
-#else   
         fpusave_cpu(true);
-#endif
         splx(s);
 }
 
--- a/sys/arch/xen/x86/xen_ipi.c	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/xen/x86/xen_ipi.c	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ipi.c,v 1.14 2013/12/01 01:05:16 christos Exp $ */
+/* $NetBSD: xen_ipi.c,v 1.15 2014/01/26 19:16:17 dsl Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -33,10 +33,10 @@
 
 /* 
  * Based on: x86/ipi.c
- * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.14 2013/12/01 01:05:16 christos Exp $"); 
+ * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.15 2014/01/26 19:16:17 dsl Exp $"); 
  */
 
-__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.14 2013/12/01 01:05:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.15 2014/01/26 19:16:17 dsl Exp $");
 
 #include <sys/types.h>
 
@@ -222,11 +222,7 @@
 	KASSERT(ci != NULL);
 	KASSERT(intrf != NULL);
 
-#ifdef __x86_64__
 	fpusave_cpu(true);
-#else
-	npxsave_cpu(true);
-#endif /* __x86_64__ */
 }
 
 static void
--- a/sys/arch/xen/xen/hypervisor.c	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/arch/xen/xen/hypervisor.c	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.c,v 1.62 2012/04/06 03:20:43 riz Exp $ */
+/* $NetBSD: hypervisor.c,v 1.63 2014/01/26 19:16:17 dsl Exp $ */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.62 2012/04/06 03:20:43 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.63 2014/01/26 19:16:17 dsl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -62,11 +62,6 @@
 
 #include "xenbus.h"
 #include "xencons.h"
-#ifndef __x86_64__
-#include "npx.h"
-#else
-#define NNPX 0
-#endif /* __x86_64__ */
 #include "isa.h"
 #include "pci.h"
 #include "acpica.h"
@@ -143,9 +138,6 @@
 #if NXBD_HYPERVISOR > 0
 	struct xbd_attach_args hac_xbd;
 #endif
-#if NNPX > 0
-	struct xen_npx_attach_args hac_xennpx;
-#endif
 #if NPCI > 0
 	struct pcibus_attach_args hac_pba;
 #if defined(DOM0OPS) && NISA > 0
@@ -264,11 +256,6 @@
 	hac.hac_xencons.xa_device = "xencons";
 	config_found_ia(self, "xendevbus", &hac.hac_xencons, hypervisor_print);
 #endif
-#if NNPX > 0
-	memset(&hac, 0, sizeof(hac));
-	hac.hac_xennpx.xa_device = "npx";
-	config_found_ia(self, "xendevbus", &hac.hac_xennpx, hypervisor_print);
-#endif
 #ifdef DOM0OPS
 #if NPCI > 0
 #if NACPICA > 0
--- a/sys/compat/linux/arch/i386/linux_machdep.c	Sun Jan 26 18:24:29 2014 +0000
+++ b/sys/compat/linux/arch/i386/linux_machdep.c	Sun Jan 26 19:16:16 2014 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_machdep.c,v 1.155 2014/01/19 14:30:38 dsl Exp $	*/
+/*	$NetBSD: linux_machdep.c,v 1.156 2014/01/26 19:16:17 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1995, 2000, 2008, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.155 2014/01/19 14:30:38 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.156 2014/01/26 19:16:17 dsl Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vm86.h"
@@ -129,11 +129,10 @@
 	struct pcb *pcb = lwp_getpcb(l);
 	struct trapframe *tf;
 
-#if NNPX > 0
 	/* If we were using the FPU, forget about it. */
-	if (npxproc == l)
-		npxdrop();
-#endif
+	if (pcb->pcb_fpcpu != NULL)
+		fpusave_lwp(l, false);
+
 
 #ifdef USER_LDT
 	pmap_ldt_cleanup(l);