summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2005-05-12 12:47:41 +0000
committernyan <nyan@FreeBSD.org>2005-05-12 12:47:41 +0000
commit8f8dbdc2da58f049fb51366a3e331262cc8c4fe5 (patch)
tree478dc16086d3f36619e384c45a83b005bf957823 /sys
parenteb01a496438696a5b93ff647df5b9236900d5afe (diff)
downloadFreeBSD-src-8f8dbdc2da58f049fb51366a3e331262cc8c4fe5.zip
FreeBSD-src-8f8dbdc2da58f049fb51366a3e331262cc8c4fe5.tar.gz
- Move the NPX_DEBUG option to options.{i386,pc98} and use opt_npx.h.
- Move npx related defines to {i386,pc98}/include/npx.h to remove #include {isa,cbus}.h.
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/options1
-rw-r--r--sys/conf/options.i3861
-rw-r--r--sys/conf/options.pc981
-rw-r--r--sys/i386/include/npx.h9
-rw-r--r--sys/i386/isa/isa.h13
-rw-r--r--sys/i386/isa/npx.c6
-rw-r--r--sys/pc98/cbus/cbus.h13
-rw-r--r--sys/pc98/include/npx.h47
8 files changed, 56 insertions, 35 deletions
diff --git a/sys/conf/options b/sys/conf/options
index 1dedaf4..bdc4e40 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 405614f..28446f6 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 b270fda..3dbab73 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 484061e..894b06d 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 1173628..cafeea8 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 9a7ba17..2c7906a 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 <machine/segments.h>
#include <machine/ucontext.h>
-#ifdef PC98
-#include <pc98/cbus/cbus.h>
-#else
-#include <i386/isa/isa.h>
-#endif
#include <machine/intr_machdep.h>
#ifdef DEV_ISA
#include <isa/isavar.h>
diff --git a/sys/pc98/cbus/cbus.h b/sys/pc98/cbus/cbus.h
index 627c0e9..31a35b0 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 67c6402..c1c0712 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 <i386/npx.h>
+
+#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_ */
OpenPOWER on IntegriCloud