diff --git a/sys/conf/options b/sys/conf/options index 1dedaf456b40..bdc4e40c7a6d 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -468,7 +468,6 @@ VP0_DEBUG opt_vpo.h LPT_DEBUG opt_lpt.h PLIP_DEBUG opt_plip.h LOCKF_DEBUG opt_debug_lockf.h -NPX_DEBUG opt_debug_npx.h NETATALKDEBUG opt_atalk.h SI_DEBUG opt_debug_si.h SX_DEBUG opt_debug_sx.h diff --git a/sys/conf/options.i386 b/sys/conf/options.i386 index 405614fb1e1e..28446f68f64c 100644 --- a/sys/conf/options.i386 +++ b/sys/conf/options.i386 @@ -163,3 +163,4 @@ ASR_COMPAT opt_asr.h # Debugging KDB_STOP_NMI opt_global.h +NPX_DEBUG opt_npx.h diff --git a/sys/conf/options.pc98 b/sys/conf/options.pc98 index b270fda9426d..3dbab737de27 100644 --- a/sys/conf/options.pc98 +++ b/sys/conf/options.pc98 @@ -105,3 +105,4 @@ DEV_NPX opt_npx.h # Debugging KDB_STOP_NMI opt_global.h +NPX_DEBUG opt_npx.h diff --git a/sys/i386/include/npx.h b/sys/i386/include/npx.h index 484061ea2784..894b06d2063c 100644 --- a/sys/i386/include/npx.h +++ b/sys/i386/include/npx.h @@ -137,6 +137,15 @@ union savefpu { #define __INITIAL_MXCSR__ 0x1F80 #ifdef _KERNEL + +#define IO_NPX 0x0F0 /* Numeric Coprocessor */ +#define IO_NPXSIZE 16 /* 80387/80487 NPX registers */ + +#define IRQ_NPX 13 + +/* full reset on some systems, NOP on others */ +#define npx_full_reset() outb(IO_NPX + 1, 0) + int npxdna(void); void npxdrop(void); void npxexit(struct thread *td); diff --git a/sys/i386/isa/isa.h b/sys/i386/isa/isa.h index 1173628b043a..cafeea854a07 100644 --- a/sys/i386/isa/isa.h +++ b/sys/i386/isa/isa.h @@ -65,7 +65,6 @@ #define IO_DMAPG 0x080 /* DMA Page Registers */ #define IO_ICU2 0x0A0 /* 8259A Interrupt Controller #2 */ #define IO_DMA2 0x0C0 /* 8237A DMA Controller #2 */ -#define IO_NPX 0x0F0 /* Numeric Coprocessor */ /* Cards */ #define IO_VGA 0x3C0 /* E/VGA Ports */ @@ -84,7 +83,6 @@ #define IO_CGASIZE 12 /* CGA controllers */ #define IO_MDASIZE 12 /* Monochrome display controllers */ -#define IO_NPXSIZE 16 /* 80387/80487 NPX registers */ #define IO_VGASIZE 16 /* VGA controllers */ #endif /* !IO_ISASIZES */ @@ -107,15 +105,4 @@ #define RAM_SIZE (RAM_END - RAM_BEGIN) #endif /* !RAM_BEGIN */ -/* - * IRQs - */ -#define IRQ_NPX 13 - -/* - * Npx MD defines - */ -/* full reset on some systems, NOP on others */ -#define npx_full_reset() outb(IO_NPX + 1, 0) - #endif /* !_I386_ISA_ISA_H_ */ diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c index 9a7ba1716899..2c7906adbeb0 100644 --- a/sys/i386/isa/npx.c +++ b/sys/i386/isa/npx.c @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include "opt_cpu.h" -#include "opt_debug_npx.h" #include "opt_isa.h" #include "opt_npx.h" @@ -69,11 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef PC98 -#include -#else -#include -#endif #include #ifdef DEV_ISA #include diff --git a/sys/pc98/cbus/cbus.h b/sys/pc98/cbus/cbus.h index 627c0e914a3d..31a35b03665b 100644 --- a/sys/pc98/cbus/cbus.h +++ b/sys/pc98/cbus/cbus.h @@ -63,7 +63,6 @@ #define IO_COM2 0x0B1 /* 8251A RS232C serial I/O (ext) */ #define IO_COM3 0x0B9 /* 8251A RS232C serial I/O (ext) */ #define IO_FDPORT 0x0BE /* FD I/F port (1M<->640K,EMTON) */ -#define IO_NPX 0x0F8 /* Numeric Coprocessor */ #define IO_WD1_EPSON 0x80 /* 386note Hard disk controller */ #define IO_ISAEND 0xFFFF /* - 0x3FF End of I/O Registers */ #endif /* !IO_ISABEGIN */ @@ -80,7 +79,6 @@ #define IO_LPTSIZE 8 /* LPT controllers, some use only 4 */ #define IO_LPTSIZE_EXTENDED 8 /* "Extended" LPT controllers */ #define IO_LPTSIZE_NORMAL 4 /* "Normal" LPT controllers */ -#define IO_NPXSIZE 8 /* 80387/80487 NPX registers */ #endif /* !IO_ISASIZES */ @@ -106,17 +104,6 @@ #define RAM_SIZE (RAM_END - RAM_BEGIN) #endif /* !RAM_BEGIN */ -/* - * IRQs - */ -#define IRQ_NPX 8 - -/* - * Npx MD defines - */ -/* full reset of npx: not needed on pc98 */ -#define npx_full_reset() - #define M_NEC_PC98 0x0001 #define M_EPSON_PC98 0x0002 #define M_NOT_H98 0x0010 diff --git a/sys/pc98/include/npx.h b/sys/pc98/include/npx.h index 67c64027c08c..c1c0712a26aa 100644 --- a/sys/pc98/include/npx.h +++ b/sys/pc98/include/npx.h @@ -1,6 +1,49 @@ /*- - * This file is in the public domain. + * Copyright (C) 2005 TAKAHASHI Yoshihiro. 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 AUTHOR 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 AUTHOR 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. + * + * $FreeBSD$ */ -/* $FreeBSD$ */ + +#ifndef _PC98_INCLUDE_NPX_H_ +#define _PC98_INCLUDE_NPX_H_ #include + +#ifdef _KERNEL + +#undef IO_NPX +#define IO_NPX 0x0F8 /* Numeric Coprocessor */ +#undef IO_NPXSIZE +#define IO_NPXSIZE 8 /* 80387/80487 NPX registers */ + +#undef IRQ_NPX +#define IRQ_NPX 8 + +/* full reset of npx: not needed on pc98 */ +#undef npx_full_reset +#define npx_full_reset() + +#endif /* _KERNEL */ + +#endif /* _PC98_INCLUDE_NPX_H_ */