summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorasami <asami@FreeBSD.org>1996-09-07 02:14:47 +0000
committerasami <asami@FreeBSD.org>1996-09-07 02:14:47 +0000
commit148ce94bebd89be1aab174e5e4af889f43ffdd6d (patch)
tree76c7c637f26dd9c707e9bc4cb86db9ba6765d078 /sys
parent7b9ecd2de3dd0e21793ef47de26c51dbf4b2dff9 (diff)
downloadFreeBSD-src-148ce94bebd89be1aab174e5e4af889f43ffdd6d.zip
FreeBSD-src-148ce94bebd89be1aab174e5e4af889f43ffdd6d.tar.gz
Yet another merge. Remove support.s by deleting memcopy. Remove
autoconf.c by merging icu.h. Fix a couple of typos. Submitted by: The FreeBSD(98) Development Team.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/isa/icu.h17
-rw-r--r--sys/conf/Makefile.pc984
-rw-r--r--sys/conf/files.pc9811
-rw-r--r--sys/i386/isa/icu.h17
-rw-r--r--sys/pc98/boot/biosboot/boot2.S9
-rw-r--r--sys/pc98/cbus/clock.c14
-rw-r--r--sys/pc98/cbus/pcrtc.c14
-rw-r--r--sys/pc98/cbus/sio.c4
-rw-r--r--sys/pc98/conf/GENERIC84
-rw-r--r--sys/pc98/conf/GENERIC9884
-rw-r--r--sys/pc98/conf/Makefile.pc984
-rw-r--r--sys/pc98/conf/files.pc9811
-rw-r--r--sys/pc98/i386/autoconf.c405
-rw-r--r--sys/pc98/i386/machdep.c10
-rw-r--r--sys/pc98/i386/microtime.s5
-rw-r--r--sys/pc98/i386/support.s1198
-rw-r--r--sys/pc98/i386/trap.c17
-rw-r--r--sys/pc98/pc98/clock.c14
-rw-r--r--sys/pc98/pc98/icu.h125
-rw-r--r--sys/pc98/pc98/if_ed.c6
-rw-r--r--sys/pc98/pc98/if_fe.c6
-rw-r--r--sys/pc98/pc98/machdep.c10
-rw-r--r--sys/pc98/pc98/mse.c6
-rw-r--r--sys/pc98/pc98/npx.c9
-rw-r--r--sys/pc98/pc98/pc98.c6
-rw-r--r--sys/pc98/pc98/pcibus.c6
-rw-r--r--sys/pc98/pc98/random_machdep.c5
-rw-r--r--sys/pc98/pc98/sbic55.c2
-rw-r--r--sys/pc98/pc98/sbic55.c.new2
-rw-r--r--sys/pc98/pc98/sio.c4
-rw-r--r--sys/pc98/pc98/syscons.c36
-rw-r--r--sys/pc98/pc98/vector.s5
-rw-r--r--sys/pccard/pccard.c4
-rw-r--r--sys/pccard/pcic.c4
34 files changed, 238 insertions, 1920 deletions
diff --git a/sys/amd64/isa/icu.h b/sys/amd64/isa/icu.h
index a68269b..3b3dcdf 100644
--- a/sys/amd64/isa/icu.h
+++ b/sys/amd64/isa/icu.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)icu.h 5.6 (Berkeley) 5/9/91
- * $Id: icu.h,v 1.6 1994/09/18 23:18:32 bde Exp $
+ * $Id: icu.h,v 1.7 1994/10/01 02:56:11 davidg Exp $
*/
/*
@@ -57,14 +57,22 @@ extern unsigned imen; /* interrupt mask enable */
#define INTRMASK(msk,s) (msk |= (s))
#define INTRUNMASK(msk,s) (msk &= ~(s))
#if 0
+#ifdef PC98
+#define SET_ICUS() (outb(IO_ICU1 + 2, imen), outb(IU_ICU2 + 2, imen >> 8))
+#else /* IBM-PC */
#define SET_ICUS() (outb(IO_ICU1 + 1, imen), outb(IU_ICU2 + 1, imen >> 8))
+#endif /* PC98 */
#else
/*
* XXX - IO_ICU* are defined in isa.h, not icu.h, and nothing much bothers to
* include isa.h, while too many things include icu.h.
*/
+#ifdef PC98
+#define SET_ICUS() (outb(0x02, imen), outb(0x0a, imen >> 8))
+#else
#define SET_ICUS() (outb(0x21, imen), outb(0xa1, imen >> 8))
#endif
+#endif
#endif /* LOCORE */
@@ -89,6 +97,13 @@ extern unsigned imen; /* interrupt mask enable */
#define IRQ6 0x0040
#define IRQ7 0x0080 /* lowest - parallel printer */
+#ifdef PC98
+#undef IRQ2
+#define IRQ2 0x0004
+#undef IRQ_SLAVE
+#define IRQ_SLAVE 0x0080
+#endif
+
/*
* Interrupt Control offset into Interrupt descriptor table (IDT)
*/
diff --git a/sys/conf/Makefile.pc98 b/sys/conf/Makefile.pc98
index bc262d2..10f5742 100644
--- a/sys/conf/Makefile.pc98
+++ b/sys/conf/Makefile.pc98
@@ -3,7 +3,7 @@
# Makefile.i386 -- with config changes.
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.i386 7.1 5/10/91
-# $Id: Makefile.pc98,v 1.3 1996/08/30 10:42:49 asami Exp $
+# $Id: Makefile.pc98,v 1.4 1996/09/03 10:23:11 asami Exp $
#
# Makefile for FreeBSD
#
@@ -172,7 +172,7 @@ install:
install -c -m 555 -o root -g wheel -fschg kernel /
ioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h \
- ${I386}/isa/isa_device.h ${PC98}/pc98/pc98.h ${PC98}/pc98/icu.h
+ ${I386}/isa/isa_device.h ${PC98}/pc98/pc98.h ${I386}/isa/icu.h
${CC} -c ${CFLAGS} ioconf.c
param.c: $S/conf/param.c
diff --git a/sys/conf/files.pc98 b/sys/conf/files.pc98
index 47027cd..fb7d0d4 100644
--- a/sys/conf/files.pc98
+++ b/sys/conf/files.pc98
@@ -2,7 +2,7 @@
# files marked standard are always included.
#
# modified for PC-9801 after:
-# $Id: files.pc98,v 1.4 1996/09/03 10:23:12 asami Exp $
+# $Id: files.pc98,v 1.5 1996/09/04 09:52:08 asami Exp $
#
aic7xxx_asm optional ahc device-driver \
dependency "$S/dev/aic7xxx/aic7xxx_asm.c" \
@@ -35,8 +35,8 @@ i386/apm/apm_setup.s optional apm
#i386/eisa/aic7770.c optional ahc device-driver
#i386/eisa/aha1742.c optional ahb device-driver
#i386/eisa/bt74x.c optional bt device-driver
-#i386/eisa/eisaconf.c optional eisa
-pc98/i386/autoconf.c standard device-driver
+i386/eisa/eisaconf.c optional eisa
+i386/i386/autoconf.c standard device-driver
i386/i386/cons.c standard
i386/i386/db_disasm.c optional ddb
i386/i386/db_interface.c optional ddb
@@ -56,7 +56,7 @@ pc98/i386/microtime.s standard
i386/i386/perfmon.c optional perfmon
pc98/i386/pmap.c standard
i386/i386/procfs_machdep.c standard
-pc98/i386/support.s standard
+i386/i386/support.s standard
i386/i386/swtch.s standard
i386/i386/sys_machdep.c standard
pc98/i386/trap.c standard
@@ -118,8 +118,7 @@ pc98/pc98/if_fe.c optional fe device-driver
#i386/isa/if_sr.c optional sr device-driver
#pc98/isa/if_ze.c optional ze device-driver
i386/isa/if_zp.c optional zp device-driver
-pc98/pc98/pc98.c optional nec device-driver
-pc98/pc98/pc98.c optional epson device-driver
+pc98/pc98/pc98.c optional isa device-driver
pc98/isa/istallion.c optional stli device-driver
pc98/isa/joy.c optional joy device-driver
pc98/pc98/labpc.c optional labpc device-driver
diff --git a/sys/i386/isa/icu.h b/sys/i386/isa/icu.h
index a68269b..3b3dcdf 100644
--- a/sys/i386/isa/icu.h
+++ b/sys/i386/isa/icu.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)icu.h 5.6 (Berkeley) 5/9/91
- * $Id: icu.h,v 1.6 1994/09/18 23:18:32 bde Exp $
+ * $Id: icu.h,v 1.7 1994/10/01 02:56:11 davidg Exp $
*/
/*
@@ -57,14 +57,22 @@ extern unsigned imen; /* interrupt mask enable */
#define INTRMASK(msk,s) (msk |= (s))
#define INTRUNMASK(msk,s) (msk &= ~(s))
#if 0
+#ifdef PC98
+#define SET_ICUS() (outb(IO_ICU1 + 2, imen), outb(IU_ICU2 + 2, imen >> 8))
+#else /* IBM-PC */
#define SET_ICUS() (outb(IO_ICU1 + 1, imen), outb(IU_ICU2 + 1, imen >> 8))
+#endif /* PC98 */
#else
/*
* XXX - IO_ICU* are defined in isa.h, not icu.h, and nothing much bothers to
* include isa.h, while too many things include icu.h.
*/
+#ifdef PC98
+#define SET_ICUS() (outb(0x02, imen), outb(0x0a, imen >> 8))
+#else
#define SET_ICUS() (outb(0x21, imen), outb(0xa1, imen >> 8))
#endif
+#endif
#endif /* LOCORE */
@@ -89,6 +97,13 @@ extern unsigned imen; /* interrupt mask enable */
#define IRQ6 0x0040
#define IRQ7 0x0080 /* lowest - parallel printer */
+#ifdef PC98
+#undef IRQ2
+#define IRQ2 0x0004
+#undef IRQ_SLAVE
+#define IRQ_SLAVE 0x0080
+#endif
+
/*
* Interrupt Control offset into Interrupt descriptor table (IDT)
*/
diff --git a/sys/pc98/boot/biosboot/boot2.S b/sys/pc98/boot/biosboot/boot2.S
index 1374ad6..48ca722 100644
--- a/sys/pc98/boot/biosboot/boot2.S
+++ b/sys/pc98/boot/biosboot/boot2.S
@@ -61,11 +61,6 @@ ENTRY(boot2)
mov %ax, %es
data32
shll $4, %eax
-#ifdef NAMEBLOCK
- addr32
- data32
- movl %esp, EXT(dflt_name)
-#endif
/* fix up GDT entries for bootstrap */
#define FIXUP(gdt_index) \
@@ -173,6 +168,10 @@ ENTRY(boot2)
rep
stosb
+#ifdef NAMEBLOCK
+ movl %esp, EXT(dflt_name)
+#endif
+
movzbl %dl, %edx /* discard head (%dh) and random high bits */
pushl %edx
call EXT(boot)
diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c
index b9547fd..e0f9221 100644
--- a/sys/pc98/cbus/clock.c
+++ b/sys/pc98/cbus/clock.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
- * $Id: clock.c,v 1.3 1996/08/30 10:42:58 asami Exp $
+ * $Id: clock.c,v 1.4 1996/09/03 10:23:24 asami Exp $
*/
/*
@@ -46,7 +46,7 @@
/*
* modified for PC98
- * $Id: clock.c,v 1.3 1996/08/30 10:42:58 asami Exp $
+ * $Id: clock.c,v 1.4 1996/09/03 10:23:24 asami Exp $
*/
/*
@@ -68,14 +68,12 @@
#include <machine/cpu.h>
#include <machine/frame.h>
+#include <i386/isa/icu.h>
#ifdef PC98
-#include <sys/syslog.h>
-#include <pc98/pc98/icu.h>
#include <pc98/pc98/pc98.h>
#include <i386/isa/isa_device.h>
#include <pc98/pc98/timerreg.h>
#else
-#include <i386/isa/icu.h>
#include <i386/isa/isa.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/rtc.h>
@@ -742,13 +740,11 @@ startrtclock()
#ifndef AUTO_CLOCK
if (pc98_machine_type & M_8M) {
#ifndef PC98_8M
- log(LOG_EMERG,
- "you must reconfig a kernel with \"PC98_8M\" option.\n");
+ printf("you must reconfig a kernel with \"PC98_8M\" option.\n");
#endif
} else {
#ifdef PC98_8M
- log(LOG_EMERG,
- "You must reconfig a kernel without \"PC98_8M\" option.\n");
+ printf("You must reconfig a kernel without \"PC98_8M\" option.\n");
#endif
}
#else /* AUTO_CLOCK */
diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c
index b9547fd..e0f9221 100644
--- a/sys/pc98/cbus/pcrtc.c
+++ b/sys/pc98/cbus/pcrtc.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
- * $Id: clock.c,v 1.3 1996/08/30 10:42:58 asami Exp $
+ * $Id: clock.c,v 1.4 1996/09/03 10:23:24 asami Exp $
*/
/*
@@ -46,7 +46,7 @@
/*
* modified for PC98
- * $Id: clock.c,v 1.3 1996/08/30 10:42:58 asami Exp $
+ * $Id: clock.c,v 1.4 1996/09/03 10:23:24 asami Exp $
*/
/*
@@ -68,14 +68,12 @@
#include <machine/cpu.h>
#include <machine/frame.h>
+#include <i386/isa/icu.h>
#ifdef PC98
-#include <sys/syslog.h>
-#include <pc98/pc98/icu.h>
#include <pc98/pc98/pc98.h>
#include <i386/isa/isa_device.h>
#include <pc98/pc98/timerreg.h>
#else
-#include <i386/isa/icu.h>
#include <i386/isa/isa.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/rtc.h>
@@ -742,13 +740,11 @@ startrtclock()
#ifndef AUTO_CLOCK
if (pc98_machine_type & M_8M) {
#ifndef PC98_8M
- log(LOG_EMERG,
- "you must reconfig a kernel with \"PC98_8M\" option.\n");
+ printf("you must reconfig a kernel with \"PC98_8M\" option.\n");
#endif
} else {
#ifdef PC98_8M
- log(LOG_EMERG,
- "You must reconfig a kernel without \"PC98_8M\" option.\n");
+ printf("You must reconfig a kernel without \"PC98_8M\" option.\n");
#endif
}
#else /* AUTO_CLOCK */
diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c
index 98feda2..da16792 100644
--- a/sys/pc98/cbus/sio.c
+++ b/sys/pc98/cbus/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.3 1996/08/31 15:07:20 asami Exp $
+ * $Id: sio.c,v 1.4 1996/09/03 10:23:59 asami Exp $
*/
#include "opt_comconsole.h"
@@ -139,7 +139,7 @@
#ifdef PC98
#include <pc98/pc98/pc98.h>
-#include <pc98/pc98/icu.h>
+#include <i386/isa/icu.h>
#include <i386/isa/isa_device.h>
#include <pc98/pc98/sioreg.h>
#include <pc98/pc98/ic/i8251.h>
diff --git a/sys/pc98/conf/GENERIC b/sys/pc98/conf/GENERIC
index 2664e5d..5fedd9c 100644
--- a/sys/pc98/conf/GENERIC
+++ b/sys/pc98/conf/GENERIC
@@ -11,7 +11,7 @@
# device lines is present in the ./LINT configuration file. If you are
# in doubt as to the purpose or necessity of a line, check first in LINT.
#
-# $Id: GENERIC,v 1.75 1996/08/27 16:25:53 wosch Exp $
+# $Id: GENERIC98,v 1.3 1996/08/31 15:06:28 asami Exp $
# GENERIC98 -- Generic PC98 machine with WD/SBIC55 disks
@@ -76,17 +76,17 @@ options DIAGNOSTIC
config kernel root on wd0
-controller nec0
+controller isa0
controller pci0
-controller fdc0 at nec? port "IO_FD1" bio irq 11 drq 2 vector fdintr
+controller fdc0 at isa? port "IO_FD1" bio irq 11 drq 2 vector fdintr
disk fd0 at fdc0 drive 0
disk fd1 at fdc0 drive 1
disk fd2 at fdc0 drive 2
disk fd3 at fdc0 drive 3
tape ft0 at fdc0 drive 4
-controller wdc0 at nec? port "IO_WD1" bio irq 9 vector wdintr
+controller wdc0 at isa? port "IO_WD1" bio irq 9 vector wdintr
disk wd0 at wdc0 drive 0
#disk wd1 at wdc0 drive 1
#disk wd2 at wdc0 drive 2
@@ -96,10 +96,13 @@ options ATAPI # Enable ATAPI support for IDE bus
options ATAPI_STATIC #Don't do it as an LKM
device wcd #IDE CD-ROM
-controller sbic0 at nec? port "IO_SCSI" bio irq 5 drq 3 vector sbicintr
-#controller sbic0 at nec? port "IO_SCSI" bio irq 5 drq 3 flags 0xff vector sbicintr
-controller aic0 at nec? port 0x1840 bio irq 5 vector aicintr
+# A single entry for any of these controllers (ncr, ahb, ahc) is sufficient
+# for any number of installed devices.
+controller ncr0
controller ahc0
+controller sbic0 at isa? port "IO_SCSI" bio irq 5 drq 3 vector sbicintr
+#controller sbic0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0xff vector sbicintr
+controller aic0 at isa? port 0x1840 bio irq 5 vector aicintr
controller scbus0
@@ -111,49 +114,74 @@ device cd0 #Only need one of these, the code dynamically grows
device od0
-controller matcd0 at nec? port? bio
+controller matcd0 at isa? port? bio
# syscons is the default console driver, resembling an SCO console
-device sc0 at nec? port "IO_KBD" tty irq 1 vector scintr
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
#options XSERVER # include code for XFree86
# Mandatory, don't remove
-device npx0 at nec? port "IO_NPX" irq 8 vector npxintr
+device npx0 at isa? port "IO_NPX" irq 8 vector npxintr
#
# Laptop support (see LINT for more options)
#
-device apm0 at nec? disable # Advanced Power Management
+device apm0 at isa? disable # Advanced Power Management
options APM_BROKEN_STATCLOCK # Workaround some buggy APM BIOS
# PCCARD (PCMCIA) support
#controller crd0
#device pcic0 at crd?
#device pcic1 at crd?
-device lpt0 at nec? port "IO_LPT" tty
-device mse0 at nec? port "IO_MSE" tty irq 13 vector mseintr
+device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
+device sio1 at isa? port 0xd2 tty irq 5 flags 0x101 vector siointr
+device sio2 at isa? port 0x8d2 tty flags 0x101 vector siointr
-device sio0 at nec? port "IO_COM1" tty irq 4 vector siointr
-device sio1 at nec? port 0xd2 tty irq 5 flags 0x101 vector siointr
-device sio2 at nec? port 0x8d2 tty flags 0x101 vector siointr
+device lpt0 at isa? port "IO_LPT" tty
+device mse0 at isa? port "IO_MSE" tty irq 13 vector mseintr
+# Order is important here due to intrusive probes, do *not* alphabetize
+# this list of network interfaces until the probes have been fixed.
+# Right now it appears that the ie0 must be probed before ep0. See
+# revision 1.20 of this file.
+device de0
+device fxp0
+device vx0
-device ed0 at nec? port 0x00d0 net irq 6 vector edintr
-device ed1 at nec? port 0x56d0 net irq 5 vector edintr
-device ed2 at nec? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 vector edintr
-device fe0 at nec? port 0x00d0 net irq 3 vector feintr
-device zp0 at nec? port 0x0300 net irq 10 iomem 0xe0000 vector zpintr
-device ep0 at nec? port 0x00d0 net irq 6 vector epintr
+#
+# DP8390 NIC
+#
+# ed0: generic driver
+# ed1: LANEED LD-BDN
+# ed2: EGY-98
+# ed3: LGY-98
+# ed4: ICM-IF-2766/EN-2298-T
+# ed5: SIC-98
+# ed6: PC-9801-108
+# ed7: LA-98
+#
+device ed0 at isa? port 0x00d0 net irq 6 vector edintr
+device ed1 at isa? port 0x00d8 net irq 6 flags 0x20000 vector edintr
+device ed2 at isa? port 0x00d8 net irq 6 flags 0x30000 vector edintr
+device ed3 at isa? port 0x00d8 net irq 6 flags 0x40000 vector edintr
+device ed4 at isa? port 0x56d0 net irq 5 flags 0x50000 vector edintr
+device ed5 at isa? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0x60000 vector edintr
+device ed6 at isa? port 0x00d0 net irq 6 flags 0x80000 vector edintr
+device ed7 at isa? port 0x00d0 net irq 6 flags 0x90000 vector edintr
+
+device fe0 at isa? port 0x00d0 net irq 3 vector feintr
+device zp0 at isa? port 0x0300 net irq 10 iomem 0xe0000 vector zpintr
+device ep0 at isa? port 0x00d0 net irq 6 vector epintr
#controller snd0
-#device sb0 at nec? port 0x20d2 irq 10 conflicts drq 3 vector sbintr
-#device sbxvi0 at nec? drq 3
-#device sbmidi0 at nec? port 0x80d2
-#device opl0 at nec? port 0x28d2
+#device sb0 at isa? port 0x20d2 irq 10 conflicts drq 3 vector sbintr
+#device sbxvi0 at isa? drq 3
+#device sbmidi0 at isa? port 0x80d2
+#device opl0 at isa? port 0x28d2
-#device pcm0 at nec? port 0xa460 irq 12 vector pcmintr
+#device pcm0 at isa? port 0xa460 irq 12 vector pcmintr
-#device mss0 at nec? port 0xf40 irq12 drq 1 vectro adintr
+#device mss0 at isa? port 0xf40 irq12 drq 1 vectro adintr
pseudo-device loop
pseudo-device ether
diff --git a/sys/pc98/conf/GENERIC98 b/sys/pc98/conf/GENERIC98
index 2664e5d..5fedd9c 100644
--- a/sys/pc98/conf/GENERIC98
+++ b/sys/pc98/conf/GENERIC98
@@ -11,7 +11,7 @@
# device lines is present in the ./LINT configuration file. If you are
# in doubt as to the purpose or necessity of a line, check first in LINT.
#
-# $Id: GENERIC,v 1.75 1996/08/27 16:25:53 wosch Exp $
+# $Id: GENERIC98,v 1.3 1996/08/31 15:06:28 asami Exp $
# GENERIC98 -- Generic PC98 machine with WD/SBIC55 disks
@@ -76,17 +76,17 @@ options DIAGNOSTIC
config kernel root on wd0
-controller nec0
+controller isa0
controller pci0
-controller fdc0 at nec? port "IO_FD1" bio irq 11 drq 2 vector fdintr
+controller fdc0 at isa? port "IO_FD1" bio irq 11 drq 2 vector fdintr
disk fd0 at fdc0 drive 0
disk fd1 at fdc0 drive 1
disk fd2 at fdc0 drive 2
disk fd3 at fdc0 drive 3
tape ft0 at fdc0 drive 4
-controller wdc0 at nec? port "IO_WD1" bio irq 9 vector wdintr
+controller wdc0 at isa? port "IO_WD1" bio irq 9 vector wdintr
disk wd0 at wdc0 drive 0
#disk wd1 at wdc0 drive 1
#disk wd2 at wdc0 drive 2
@@ -96,10 +96,13 @@ options ATAPI # Enable ATAPI support for IDE bus
options ATAPI_STATIC #Don't do it as an LKM
device wcd #IDE CD-ROM
-controller sbic0 at nec? port "IO_SCSI" bio irq 5 drq 3 vector sbicintr
-#controller sbic0 at nec? port "IO_SCSI" bio irq 5 drq 3 flags 0xff vector sbicintr
-controller aic0 at nec? port 0x1840 bio irq 5 vector aicintr
+# A single entry for any of these controllers (ncr, ahb, ahc) is sufficient
+# for any number of installed devices.
+controller ncr0
controller ahc0
+controller sbic0 at isa? port "IO_SCSI" bio irq 5 drq 3 vector sbicintr
+#controller sbic0 at isa? port "IO_SCSI" bio irq 5 drq 3 flags 0xff vector sbicintr
+controller aic0 at isa? port 0x1840 bio irq 5 vector aicintr
controller scbus0
@@ -111,49 +114,74 @@ device cd0 #Only need one of these, the code dynamically grows
device od0
-controller matcd0 at nec? port? bio
+controller matcd0 at isa? port? bio
# syscons is the default console driver, resembling an SCO console
-device sc0 at nec? port "IO_KBD" tty irq 1 vector scintr
+device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
#options XSERVER # include code for XFree86
# Mandatory, don't remove
-device npx0 at nec? port "IO_NPX" irq 8 vector npxintr
+device npx0 at isa? port "IO_NPX" irq 8 vector npxintr
#
# Laptop support (see LINT for more options)
#
-device apm0 at nec? disable # Advanced Power Management
+device apm0 at isa? disable # Advanced Power Management
options APM_BROKEN_STATCLOCK # Workaround some buggy APM BIOS
# PCCARD (PCMCIA) support
#controller crd0
#device pcic0 at crd?
#device pcic1 at crd?
-device lpt0 at nec? port "IO_LPT" tty
-device mse0 at nec? port "IO_MSE" tty irq 13 vector mseintr
+device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
+device sio1 at isa? port 0xd2 tty irq 5 flags 0x101 vector siointr
+device sio2 at isa? port 0x8d2 tty flags 0x101 vector siointr
-device sio0 at nec? port "IO_COM1" tty irq 4 vector siointr
-device sio1 at nec? port 0xd2 tty irq 5 flags 0x101 vector siointr
-device sio2 at nec? port 0x8d2 tty flags 0x101 vector siointr
+device lpt0 at isa? port "IO_LPT" tty
+device mse0 at isa? port "IO_MSE" tty irq 13 vector mseintr
+# Order is important here due to intrusive probes, do *not* alphabetize
+# this list of network interfaces until the probes have been fixed.
+# Right now it appears that the ie0 must be probed before ep0. See
+# revision 1.20 of this file.
+device de0
+device fxp0
+device vx0
-device ed0 at nec? port 0x00d0 net irq 6 vector edintr
-device ed1 at nec? port 0x56d0 net irq 5 vector edintr
-device ed2 at nec? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 vector edintr
-device fe0 at nec? port 0x00d0 net irq 3 vector feintr
-device zp0 at nec? port 0x0300 net irq 10 iomem 0xe0000 vector zpintr
-device ep0 at nec? port 0x00d0 net irq 6 vector epintr
+#
+# DP8390 NIC
+#
+# ed0: generic driver
+# ed1: LANEED LD-BDN
+# ed2: EGY-98
+# ed3: LGY-98
+# ed4: ICM-IF-2766/EN-2298-T
+# ed5: SIC-98
+# ed6: PC-9801-108
+# ed7: LA-98
+#
+device ed0 at isa? port 0x00d0 net irq 6 vector edintr
+device ed1 at isa? port 0x00d8 net irq 6 flags 0x20000 vector edintr
+device ed2 at isa? port 0x00d8 net irq 6 flags 0x30000 vector edintr
+device ed3 at isa? port 0x00d8 net irq 6 flags 0x40000 vector edintr
+device ed4 at isa? port 0x56d0 net irq 5 flags 0x50000 vector edintr
+device ed5 at isa? port 0x00d0 net irq 6 iomem 0xd0000 iosiz 16384 flags 0x60000 vector edintr
+device ed6 at isa? port 0x00d0 net irq 6 flags 0x80000 vector edintr
+device ed7 at isa? port 0x00d0 net irq 6 flags 0x90000 vector edintr
+
+device fe0 at isa? port 0x00d0 net irq 3 vector feintr
+device zp0 at isa? port 0x0300 net irq 10 iomem 0xe0000 vector zpintr
+device ep0 at isa? port 0x00d0 net irq 6 vector epintr
#controller snd0
-#device sb0 at nec? port 0x20d2 irq 10 conflicts drq 3 vector sbintr
-#device sbxvi0 at nec? drq 3
-#device sbmidi0 at nec? port 0x80d2
-#device opl0 at nec? port 0x28d2
+#device sb0 at isa? port 0x20d2 irq 10 conflicts drq 3 vector sbintr
+#device sbxvi0 at isa? drq 3
+#device sbmidi0 at isa? port 0x80d2
+#device opl0 at isa? port 0x28d2
-#device pcm0 at nec? port 0xa460 irq 12 vector pcmintr
+#device pcm0 at isa? port 0xa460 irq 12 vector pcmintr
-#device mss0 at nec? port 0xf40 irq12 drq 1 vectro adintr
+#device mss0 at isa? port 0xf40 irq12 drq 1 vectro adintr
pseudo-device loop
pseudo-device ether
diff --git a/sys/pc98/conf/Makefile.pc98 b/sys/pc98/conf/Makefile.pc98
index bc262d2..10f5742 100644
--- a/sys/pc98/conf/Makefile.pc98
+++ b/sys/pc98/conf/Makefile.pc98
@@ -3,7 +3,7 @@
# Makefile.i386 -- with config changes.
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.i386 7.1 5/10/91
-# $Id: Makefile.pc98,v 1.3 1996/08/30 10:42:49 asami Exp $
+# $Id: Makefile.pc98,v 1.4 1996/09/03 10:23:11 asami Exp $
#
# Makefile for FreeBSD
#
@@ -172,7 +172,7 @@ install:
install -c -m 555 -o root -g wheel -fschg kernel /
ioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h \
- ${I386}/isa/isa_device.h ${PC98}/pc98/pc98.h ${PC98}/pc98/icu.h
+ ${I386}/isa/isa_device.h ${PC98}/pc98/pc98.h ${I386}/isa/icu.h
${CC} -c ${CFLAGS} ioconf.c
param.c: $S/conf/param.c
diff --git a/sys/pc98/conf/files.pc98 b/sys/pc98/conf/files.pc98
index 47027cd..fb7d0d4 100644
--- a/sys/pc98/conf/files.pc98
+++ b/sys/pc98/conf/files.pc98
@@ -2,7 +2,7 @@
# files marked standard are always included.
#
# modified for PC-9801 after:
-# $Id: files.pc98,v 1.4 1996/09/03 10:23:12 asami Exp $
+# $Id: files.pc98,v 1.5 1996/09/04 09:52:08 asami Exp $
#
aic7xxx_asm optional ahc device-driver \
dependency "$S/dev/aic7xxx/aic7xxx_asm.c" \
@@ -35,8 +35,8 @@ i386/apm/apm_setup.s optional apm
#i386/eisa/aic7770.c optional ahc device-driver
#i386/eisa/aha1742.c optional ahb device-driver
#i386/eisa/bt74x.c optional bt device-driver
-#i386/eisa/eisaconf.c optional eisa
-pc98/i386/autoconf.c standard device-driver
+i386/eisa/eisaconf.c optional eisa
+i386/i386/autoconf.c standard device-driver
i386/i386/cons.c standard
i386/i386/db_disasm.c optional ddb
i386/i386/db_interface.c optional ddb
@@ -56,7 +56,7 @@ pc98/i386/microtime.s standard
i386/i386/perfmon.c optional perfmon
pc98/i386/pmap.c standard
i386/i386/procfs_machdep.c standard
-pc98/i386/support.s standard
+i386/i386/support.s standard
i386/i386/swtch.s standard
i386/i386/sys_machdep.c standard
pc98/i386/trap.c standard
@@ -118,8 +118,7 @@ pc98/pc98/if_fe.c optional fe device-driver
#i386/isa/if_sr.c optional sr device-driver
#pc98/isa/if_ze.c optional ze device-driver
i386/isa/if_zp.c optional zp device-driver
-pc98/pc98/pc98.c optional nec device-driver
-pc98/pc98/pc98.c optional epson device-driver
+pc98/pc98/pc98.c optional isa device-driver
pc98/isa/istallion.c optional stli device-driver
pc98/isa/joy.c optional joy device-driver
pc98/pc98/labpc.c optional labpc device-driver
diff --git a/sys/pc98/i386/autoconf.c b/sys/pc98/i386/autoconf.c
deleted file mode 100644
index 9e0ac01..0000000
--- a/sys/pc98/i386/autoconf.c
+++ /dev/null
@@ -1,405 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * 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.
- *
- * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
- * $Id: autoconf.c,v 1.2 1996/08/30 10:42:51 asami Exp $
- */
-
-/*
- * Setup the system to run on the current machine.
- *
- * Configure() is called at boot time and initializes the vba
- * device tables and the memory controller monitoring. Available
- * devices are determined (from possibilities mentioned in ioconf.c),
- * and the drivers are initialized.
- */
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/buf.h>
-#include <sys/conf.h>
-#include <sys/dmap.h>
-#include <sys/reboot.h>
-#include <sys/kernel.h>
-#include <sys/mount.h>
-#include <sys/sysctl.h>
-
-#include <machine/cons.h>
-#include <machine/md_var.h>
-#ifdef PC98
-#include <pc98/pc98/icu.h> /* For interrupts */
-#else
-#include <i386/isa/icu.h> /* For interrupts */
-#endif
-
-#ifdef PC98
-#include "nec.h"
-#include "epson.h"
-#if NNEC > 0 || NEPSON > 0
-#include <i386/isa/isa_device.h>
-#endif
-#else /* !PC98 */
-#include "isa.h"
-#if NISA > 0
-#include <i386/isa/isa_device.h>
-#endif
-
-#include "eisa.h"
-#if NEISA > 0
-#include <i386/eisa/eisaconf.h>
-#endif
-#endif /* PC98 */
-
-#include "pci.h"
-#if NPCI > 0
-#include <pci/pcivar.h>
-#endif
-
-#include "crd.h"
-#if NCRD > 0
-#include <pccard/driver.h>
-#endif
-
-#include "scbus.h"
-#if NSCBUS > 0
-#include <scsi/scsiconf.h>
-#endif
-
-static void configure __P((void *));
-SYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure, NULL)
-
-#ifdef MFS_ROOT
-extern struct vfsops mfs_vfsops;
-#endif
-#ifdef FFS
-extern struct vfsops ufs_vfsops;
-#endif
-#ifdef LFS
-extern struct vfsops lfs_vfsops;
-#endif
-#ifdef NFS
-extern int nfs_mountroot __P((void *));
-#endif
-#ifdef CD9660
-extern int cd9660_mountroot __P((void *));
-#endif
-#ifdef MSDOSFS
-extern int msdosfs_mountroot __P((void *));
-#endif
-
-static void configure_finish __P((void));
-static void configure_start __P((void));
-static int setdumpdev __P((dev_t dev));
-static void setroot __P((void));
-
-#ifdef CD9660
-/* We need to try out all our potential CDROM drives, so we need a table. */
-static struct {
- char *name;
- int major;
-} try_cdrom[] = {
- { "cd", 6 },
- { "mcd", 7 },
- { "scd", 16 },
- { "matcd", 17 },
- { 0, 0}
-};
-
-static int find_cdrom_root __P((void *));
-
-static int
-find_cdrom_root(dummy)
- void *dummy;
-{
- int i,j,k;
-
- for (j = 0 ; j < 2; j++)
- for (k = 0 ; try_cdrom[k].name ; k++) {
- rootdev = makedev(try_cdrom[k].major,j*8);
- printf("trying rootdev=0x%lx (%s%d)\n",
- rootdev, try_cdrom[k].name,j);
- i = (*cd9660_mountroot)((void *)NULL);
- if (!i) return i;
- }
- return EINVAL;
-}
-#endif /* CD9660 */
-
-static void
-configure_start()
-{
-#if NSCBUS > 0
- scsi_configure_start();
-#endif
-}
-
-static void
-configure_finish()
-{
-#if NSCBUS > 0
- scsi_configure_finish();
-#endif
-}
-
-/*
- * Determine i/o configuration for a machine.
- */
-static void
-configure(dummy)
- void *dummy;
-{
-
- configure_start();
-
- /* Allow all routines to decide for themselves if they want intrs */
- enable_intr();
- INTREN(IRQ_SLAVE);
-
-#if NCRD > 0
- /* Before isa_configure to avoid ISA drivers finding our cards */
- pccard_configure();
-#endif
-#ifdef PC98
-#if NNEC > 0 || NEPSON > 0
- isa_configure();
-#endif
-#else /* IBM-PC */
-#if NEISA > 0
- eisa_configure();
-#endif
-#endif /* PC98 */
-
-#if NPCI > 0
- pci_configure();
-#endif
-
-#ifndef PC98
-#if NISA > 0
- isa_configure();
-#endif
-#endif /* !PC98 */
-
- if (setdumpdev(dumpdev) != 0)
- dumpdev = NODEV;
-
- configure_finish();
-
- cninit_finish();
-
- if (bootverbose)
- printf("Device configuration finished.\n");
-
-#ifdef CD9660
- if ((boothowto & RB_CDROM) && !mountroot) {
- if (bootverbose)
- printf("Considering CD-ROM root f/s.\n");
- mountroot = find_cdrom_root;
- }
-#endif
-
-#ifdef NFS
- if (!mountroot && nfs_diskless_valid) {
- if (bootverbose)
- printf("Considering NFS root f/s.\n");
- mountroot = nfs_mountroot;
- }
-#endif /* NFS */
-
-#ifdef MFS_ROOT
- if (!mountroot) {
- if (bootverbose)
- printf("Considering MFS root f/s.\n");
- mountroot = vfs_mountroot; /* XXX goes away*/
- mountrootvfsops = &mfs_vfsops;
- /*
- * Ignore the -a flag if this kernel isn't compiled
- * with a generic root/swap configuration: if we skip
- * setroot() and we aren't a generic kernel, chaos
- * will ensue because setconf() will be a no-op.
- * (rootdev is always initialized to NODEV in a
- * generic configuration, so we test for that.)
- */
- if ((boothowto & RB_ASKNAME) == 0 || rootdev != NODEV)
- setroot();
- }
-#endif
-#ifdef FFS
- if (!mountroot) {
- if (bootverbose)
- printf("Considering FFS root f/s.\n");
- mountroot = vfs_mountroot; /* XXX goes away*/
- mountrootvfsops = &ufs_vfsops;
- /*
- * Ignore the -a flag if this kernel isn't compiled
- * with a generic root/swap configuration: if we skip
- * setroot() and we aren't a generic kernel, chaos
- * will ensue because setconf() will be a no-op.
- * (rootdev is always initialized to NODEV in a
- * generic configuration, so we test for that.)
- */
- if ((boothowto & RB_ASKNAME) == 0 || rootdev != NODEV)
- setroot();
- }
-#endif
-#ifdef LFS
- if (!mountroot) {
- if (bootverbose)
- printf("Considering LFS root f/s.\n");
- mountroot = vfs_mountroot; /* XXX goes away*/
- mountrootvfsops = &lfs_vfsops;
- /*
- * Ignore the -a flag if this kernel isn't compiled
- * with a generic root/swap configuration: if we skip
- * setroot() and we aren't a generic kernel, chaos
- * will ensue because setconf() will be a no-op.
- * (rootdev is always initialized to NODEV in a
- * generic configuration, so we test for that.)
- */
- if ((boothowto & RB_ASKNAME) == 0 || rootdev != NODEV)
- setroot();
- }
-#endif
-
- if (!mountroot) {
- panic("Nobody wants to mount my root for me");
- }
-
- setconf();
- cold = 0;
- if (bootverbose)
- printf("configure() finished.\n");
-}
-
-static int
-setdumpdev(dev)
- dev_t dev;
-{
- int maj, psize;
- long newdumplo;
-
- if (dev == NODEV) {
- dumpdev = dev;
- return (0);
- }
- maj = major(dev);
- if (maj >= nblkdev)
- return (ENXIO);
- if (bdevsw[maj] == NULL)
- return (ENXIO); /* XXX is this right? */
- if (bdevsw[maj]->d_psize == NULL)
- return (ENXIO); /* XXX should be ENODEV ? */
- psize = bdevsw[maj]->d_psize(dev);
- if (psize == -1)
- return (ENXIO); /* XXX should be ENODEV ? */
- newdumplo = psize - Maxmem * PAGE_SIZE / DEV_BSIZE;
- if (newdumplo < 0)
- return (ENOSPC);
- dumpdev = dev;
- dumplo = newdumplo;
- return (0);
-}
-
-u_long bootdev = 0; /* not a dev_t - encoding is different */
-
-static char devname[][2] = {
- {'w','d'}, /* 0 = wd */
- {'s','w'}, /* 1 = sw */
-#define FDMAJOR 2
- {'f','d'}, /* 2 = fd */
- {'w','t'}, /* 3 = wt */
- {'s','d'}, /* 4 = sd -- new SCSI system */
-};
-
-#define PARTITIONMASK 0x7
-#define PARTITIONSHIFT 3
-#define FDUNITSHIFT 6
-#define RAW_PART 2
-
-/*
- * Attempt to find the device from which we were booted.
- * If we can do so, and not instructed not to do so,
- * change rootdev to correspond to the load device.
- */
-static void
-setroot()
-{
- int majdev, mindev, unit, part, adaptor;
- dev_t orootdev;
-
-/*printf("howto %x bootdev %x ", boothowto, bootdev);*/
- if (boothowto & RB_DFLTROOT ||
- (bootdev & B_MAGICMASK) != (u_long)B_DEVMAGIC)
- return;
- majdev = (bootdev >> B_TYPESHIFT) & B_TYPEMASK;
- if (majdev > sizeof(devname) / sizeof(devname[0]))
- return;
- adaptor = (bootdev >> B_ADAPTORSHIFT) & B_ADAPTORMASK;
- unit = (bootdev >> B_UNITSHIFT) & B_UNITMASK;
- if (majdev == FDMAJOR) {
- part = RAW_PART;
- mindev = unit << FDUNITSHIFT;
- }
- else {
- part = (bootdev >> B_PARTITIONSHIFT) & B_PARTITIONMASK;
- mindev = (unit << PARTITIONSHIFT) + part;
- }
- orootdev = rootdev;
- rootdev = makedev(majdev, mindev);
- /*
- * If the original rootdev is the same as the one
- * just calculated, don't need to adjust the swap configuration.
- */
- if (rootdev == orootdev)
- return;
- printf("changing root device to %c%c%d%c\n",
- devname[majdev][0], devname[majdev][1],
- mindev >> (majdev == FDMAJOR ? FDUNITSHIFT : PARTITIONSHIFT),
- part + 'a');
-}
-
-static int
-sysctl_kern_dumpdev SYSCTL_HANDLER_ARGS
-{
- int error;
- dev_t ndumpdev;
-
- ndumpdev = dumpdev;
- error = sysctl_handle_opaque(oidp, &ndumpdev, sizeof ndumpdev, req);
- if (error == 0 && req->newptr != NULL)
- error = setdumpdev(ndumpdev);
- return (error);
-}
-
-SYSCTL_PROC(_kern, KERN_DUMPDEV, dumpdev, CTLTYPE_OPAQUE|CTLFLAG_RW,
- 0, sizeof dumpdev, sysctl_kern_dumpdev, "I", "");
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c
index a7c4dbc..21f3eb7 100644
--- a/sys/pc98/i386/machdep.c
+++ b/sys/pc98/i386/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.4 1996/09/03 10:23:16 asami Exp $
+ * $Id: machdep.c,v 1.5 1996/09/04 09:52:18 asami Exp $
*/
#include "npx.h"
@@ -1068,18 +1068,10 @@ init386(first)
setidt(0x80, &IDTVEC(int0x80_syscall),
SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL));
-#ifdef PC98
-#include "nec.h"
-#include "epson.h"
-#if NNEC > 0 || NEPSON > 0
- isa_defaultirq();
-#endif
-#else /* IBM-PC */
#include "isa.h"
#if NISA >0
isa_defaultirq();
#endif
-#endif
rand_initialize();
r_gdt.rd_limit = sizeof(gdt) - 1;
diff --git a/sys/pc98/i386/microtime.s b/sys/pc98/i386/microtime.s
index 71d9d2c..012c3c6 100644
--- a/sys/pc98/i386/microtime.s
+++ b/sys/pc98/i386/microtime.s
@@ -32,18 +32,17 @@
* SUCH DAMAGE.
*
* from: Steve McCanne's microtime code
- * $Id: microtime.s,v 1.2 1996/07/23 07:45:55 asami Exp $
+ * $Id: microtime.s,v 1.16 1996/08/02 20:17:50 bde Exp $
*/
#include <machine/asmacros.h>
#include <machine/clock.h>
+#include <i386/isa/icu.h>
#ifdef PC98
-#include <pc98/pc98/icu.h>
#include <pc98/pc98/pc98.h>
#include <pc98/pc98/timerreg.h>
#else
-#include <i386/isa/icu.h>
#include <i386/isa/isa.h>
#include <i386/isa/timerreg.h>
#endif
diff --git a/sys/pc98/i386/support.s b/sys/pc98/i386/support.s
deleted file mode 100644
index 3a86735..0000000
--- a/sys/pc98/i386/support.s
+++ /dev/null
@@ -1,1198 +0,0 @@
-/*-
- * Copyright (c) 1993 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. 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.
- *
- * $Id: support.s,v 1.1.1.1 1996/06/14 10:04:41 asami Exp $
- */
-
-#include "assym.s" /* system definitions */
-#include "errno.h" /* error return codes */
-#include "machine/asmacros.h" /* miscellaneous asm macros */
-#include "machine/cputypes.h" /* types of CPUs */
-#include "machine/specialreg.h"
-
-#define KDSEL 0x10 /* kernel data selector */
-#define IDXSHIFT 10
-
-
- .data
- .globl _bzero
-_bzero: .long _generic_bzero
-
- .text
-
-/*
- * bcopy family
- * void bzero(void *base, u_int cnt)
- */
-
-ENTRY(generic_bzero)
- pushl %edi
- movl 8(%esp),%edi
- movl 12(%esp),%ecx
- xorl %eax,%eax
- shrl $2,%ecx
- cld
- rep
- stosl
- movl 12(%esp),%ecx
- andl $3,%ecx
- rep
- stosb
- popl %edi
- ret
-
-#if defined(I486_CPU)
-ENTRY(i486_bzero)
- movl 4(%esp),%edx
- movl 8(%esp),%ecx
- xorl %eax,%eax
-/*
- * do 64 byte chunks first
- *
- * XXX this is probably over-unrolled at least for DX2's
- */
-2:
- cmpl $64,%ecx
- jb 3f
- movl %eax,(%edx)
- movl %eax,4(%edx)
- movl %eax,8(%edx)
- movl %eax,12(%edx)
- movl %eax,16(%edx)
- movl %eax,20(%edx)
- movl %eax,24(%edx)
- movl %eax,28(%edx)
- movl %eax,32(%edx)
- movl %eax,36(%edx)
- movl %eax,40(%edx)
- movl %eax,44(%edx)
- movl %eax,48(%edx)
- movl %eax,52(%edx)
- movl %eax,56(%edx)
- movl %eax,60(%edx)
- addl $64,%edx
- subl $64,%ecx
- jnz 2b
- ret
-
-/*
- * do 16 byte chunks
- */
- SUPERALIGN_TEXT
-3:
- cmpl $16,%ecx
- jb 4f
- movl %eax,(%edx)
- movl %eax,4(%edx)
- movl %eax,8(%edx)
- movl %eax,12(%edx)
- addl $16,%edx
- subl $16,%ecx
- jnz 3b
- ret
-
-/*
- * do 4 byte chunks
- */
- SUPERALIGN_TEXT
-4:
- cmpl $4,%ecx
- jb 5f
- movl %eax,(%edx)
- addl $4,%edx
- subl $4,%ecx
- jnz 4b
- ret
-
-/*
- * do 1 byte chunks
- * a jump table seems to be faster than a loop or more range reductions
- *
- * XXX need a const section for non-text
- */
- SUPERALIGN_TEXT
-jtab:
- .long do0
- .long do1
- .long do2
- .long do3
-
- SUPERALIGN_TEXT
-5:
- jmp jtab(,%ecx,4)
-
- SUPERALIGN_TEXT
-do3:
- movw %ax,(%edx)
- movb %al,2(%edx)
- ret
-
- SUPERALIGN_TEXT
-do2:
- movw %ax,(%edx)
- ret
-
- SUPERALIGN_TEXT
-do1:
- movb %al,(%edx)
-
- SUPERALIGN_TEXT
-do0:
- ret
-#endif
-
-#if 0 /* Actually lowers performance in real-world cases */
-#if defined(I586_CPU) || defined(I686_CPU)
-ALTENTRY(i586_bzero)
-ENTRY(i686_bzero)
- pushl %edi
- movl 8(%esp),%edi /* destination pointer */
- movl 12(%esp),%edx /* size (in 8-bit words) */
-
- xorl %eax,%eax /* store data */
- cld
-
-/* If less than 100 bytes to write, skip tricky code. */
- cmpl $100,%edx
- movl %edx,%ecx /* needed when branch is taken! */
- jl 2f
-
-/* First write 0-3 bytes to make the pointer 32-bit aligned. */
- movl %edi,%ecx /* Copy ptr to ecx... */
- negl %ecx /* ...and negate that and... */
- andl $3,%ecx /* ...mask to get byte count. */
- subl %ecx,%edx /* adjust global byte count */
- rep
- stosb
-
- subl $32,%edx /* offset count for unrolled loop */
- movl (%edi),%ecx /* Fetch destination cache line */
-
- .align 2,0x90 /* supply 0x90 for broken assemblers */
-1:
- movl 28(%edi),%ecx /* allocate cache line for destination */
- subl $32,%edx /* decr loop count */
- movl %eax,0(%edi) /* store words pairwise */
- movl %eax,4(%edi)
- movl %eax,8(%edi)
- movl %eax,12(%edi)
- movl %eax,16(%edi)
- movl %eax,20(%edi)
- movl %eax,24(%edi)
- movl %eax,28(%edi)
-
- leal 32(%edi),%edi /* update destination pointer */
- jge 1b
- leal 32(%edx),%ecx
-
-/* Write last 0-7 full 32-bit words (up to 8 words if loop was skipped). */
-2:
- shrl $2,%ecx
- rep
- stosl
-
-/* Finally write the last 0-3 bytes. */
- movl %edx,%ecx
- andl $3,%ecx
- rep
- stosb
-
- popl %edi
- ret
-#endif
-#endif
-
-/* fillw(pat, base, cnt) */
-ENTRY(fillw)
- pushl %edi
- movl 8(%esp),%eax
- movl 12(%esp),%edi
- movl 16(%esp),%ecx
- cld
- rep
- stosw
- popl %edi
- ret
-
-ENTRY(bcopyb)
-bcopyb:
- pushl %esi
- pushl %edi
- movl 12(%esp),%esi
- movl 16(%esp),%edi
- movl 20(%esp),%ecx
- movl %edi,%eax
- subl %esi,%eax
- cmpl %ecx,%eax /* overlapping? */
- jb 1f
- cld /* nope, copy forwards */
- rep
- movsb
- popl %edi
- popl %esi
- ret
-
- ALIGN_TEXT
-1:
- addl %ecx,%edi /* copy backwards. */
- addl %ecx,%esi
- decl %edi
- decl %esi
- std
- rep
- movsb
- popl %edi
- popl %esi
- cld
- ret
-
-/*
- * (ov)bcopy(src, dst, cnt)
- * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800
- */
-ALTENTRY(ovbcopy)
-ENTRY(bcopy)
-bcopy:
- pushl %esi
- pushl %edi
- movl 12(%esp),%esi
- movl 16(%esp),%edi
- movl 20(%esp),%ecx
-
- movl %edi,%eax
- subl %esi,%eax
- cmpl %ecx,%eax /* overlapping? */
- jb 1f
- shrl $2,%ecx /* copy by 32-bit words */
- cld /* nope, copy forwards */
- rep
- movsl
- movl 20(%esp),%ecx
- andl $3,%ecx /* any bytes left? */
- rep
- movsb
- popl %edi
- popl %esi
- ret
-
- ALIGN_TEXT
-1:
- addl %ecx,%edi /* copy backwards */
- addl %ecx,%esi
- decl %edi
- decl %esi
- andl $3,%ecx /* any fractional bytes? */
- std
- rep
- movsb
- movl 20(%esp),%ecx /* copy remainder by 32-bit words */
- shrl $2,%ecx
- subl $3,%esi
- subl $3,%edi
- rep
- movsl
- popl %edi
- popl %esi
- cld
- ret
-
-
-/*
- * Note: memcpy does not support overlapping copies
- */
-ENTRY(memcpy)
- pushl %edi
- pushl %esi
- movl 12(%esp),%edi
- movl 16(%esp),%esi
- movl 20(%esp),%ecx
- movl %edi,%eax
- shrl $2,%ecx /* copy by 32-bit words */
- cld /* nope, copy forwards */
- rep
- movsl
- movl 20(%esp),%ecx
- andl $3,%ecx /* any bytes left? */
- rep
- movsb
- popl %esi
- popl %edi
- ret
-
-
-/*****************************************************************************/
-/* copyout and fubyte family */
-/*****************************************************************************/
-/*
- * Access user memory from inside the kernel. These routines and possibly
- * the math- and DOS emulators should be the only places that do this.
- *
- * We have to access the memory with user's permissions, so use a segment
- * selector with RPL 3. For writes to user space we have to additionally
- * check the PTE for write permission, because the 386 does not check
- * write permissions when we are executing with EPL 0. The 486 does check
- * this if the WP bit is set in CR0, so we can use a simpler version here.
- *
- * These routines set curpcb->onfault for the time they execute. When a
- * protection violation occurs inside the functions, the trap handler
- * returns to *curpcb->onfault instead of the function.
- */
-
-
-ENTRY(copyout) /* copyout(from_kernel, to_user, len) */
- movl _curpcb,%eax
- movl $copyout_fault,PCB_ONFAULT(%eax)
- pushl %esi
- pushl %edi
- pushl %ebx
- movl 16(%esp),%esi
- movl 20(%esp),%edi
- movl 24(%esp),%ebx
- testl %ebx,%ebx /* anything to do? */
- jz done_copyout
-
- /*
- * Check explicitly for non-user addresses. If 486 write protection
- * is being used, this check is essential because we are in kernel
- * mode so the h/w does not provide any protection against writing
- * kernel addresses.
- */
-
- /*
- * First, prevent address wrapping.
- */
- movl %edi,%eax
- addl %ebx,%eax
- jc copyout_fault
-/*
- * XXX STOP USING VM_MAXUSER_ADDRESS.
- * It is an end address, not a max, so every time it is used correctly it
- * looks like there is an off by one error, and of course it caused an off
- * by one error in several places.
- */
- cmpl $VM_MAXUSER_ADDRESS,%eax
- ja copyout_fault
-
-#if defined(I386_CPU)
-
-#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)
- cmpl $CPUCLASS_386,_cpu_class
- jne 3f
-#endif
-/*
- * We have to check each PTE for user write permission.
- * The checking may cause a page fault, so it is important to set
- * up everything for return via copyout_fault before here.
- */
- /* compute number of pages */
- movl %edi,%ecx
- andl $PAGE_MASK,%ecx
- addl %ebx,%ecx
- decl %ecx
- shrl $IDXSHIFT+2,%ecx
- incl %ecx
-
- /* compute PTE offset for start address */
- movl %edi,%edx
- shrl $IDXSHIFT,%edx
- andb $0xfc,%dl
-
-1: /* check PTE for each page */
- movb _PTmap(%edx),%al
- andb $0x07,%al /* Pages must be VALID + USERACC + WRITABLE */
- cmpb $0x07,%al
- je 2f
-
- /* simulate a trap */
- pushl %edx
- pushl %ecx
- shll $IDXSHIFT,%edx
- pushl %edx
- call _trapwrite /* trapwrite(addr) */
- popl %edx
- popl %ecx
- popl %edx
-
- testl %eax,%eax /* if not ok, return EFAULT */
- jnz copyout_fault
-
-2:
- addl $4,%edx
- decl %ecx
- jnz 1b /* check next page */
-#endif /* I386_CPU */
-
- /* bcopy(%esi, %edi, %ebx) */
-3:
- movl %ebx,%ecx
-#if defined(I586_CPU) && defined(I586_FAST_BCOPY)
- cmpl $1024,%ecx
- jbe slow_copyout
-
-#if defined(I386_CPU) || defined(I486_CPU) || defined(I686_CPU)
- cmpl $CPUCLASS_586,_cpu_class
- jne slow_copyout
-#endif /* I386_CPU || I486_CPU || I686_CPU */
-
- call fastmove
- jmp done_copyout
-
- ALIGN_TEXT
-slow_copyout:
-#endif /* I586_CPU && I586_FAST_BCOPY */
- shrl $2,%ecx
- cld
- rep
- movsl
- movb %bl,%cl
- andb $3,%cl
- rep
- movsb
-
-done_copyout:
- popl %ebx
- popl %edi
- popl %esi
- xorl %eax,%eax
- movl _curpcb,%edx
- movl %eax,PCB_ONFAULT(%edx)
- ret
-
- ALIGN_TEXT
-copyout_fault:
- popl %ebx
- popl %edi
- popl %esi
- movl _curpcb,%edx
- movl $0,PCB_ONFAULT(%edx)
- movl $EFAULT,%eax
- ret
-
-/* copyin(from_user, to_kernel, len) */
-ENTRY(copyin)
- movl _curpcb,%eax
- movl $copyin_fault,PCB_ONFAULT(%eax)
- pushl %esi
- pushl %edi
- movl 12(%esp),%esi /* caddr_t from */
- movl 16(%esp),%edi /* caddr_t to */
- movl 20(%esp),%ecx /* size_t len */
-
- /*
- * make sure address is valid
- */
- movl %esi,%edx
- addl %ecx,%edx
- jc copyin_fault
- cmpl $VM_MAXUSER_ADDRESS,%edx
- ja copyin_fault
-
-#if defined(I586_CPU) && defined(I586_FAST_BCOPY)
- cmpl $1024,%ecx
- jbe slow_copyin
-
-#if defined(I386_CPU) || defined(I486_CPU) || defined(I686_CPU)
- cmpl $CPUCLASS_586,_cpu_class
- jne slow_copyin
-#endif /* I386_CPU || I486_CPU || I686_CPU */
-
- call fastmove
- jmp done_copyin
-
- ALIGN_TEXT
-slow_copyin:
-#endif /* I586_CPU && I586_FAST_BCOPY */
- movb %cl,%al
- shrl $2,%ecx /* copy longword-wise */
- cld
- rep
- movsl
- movb %al,%cl
- andb $3,%cl /* copy remaining bytes */
- rep
- movsb
-
-#if defined(I586_CPU) && defined(I586_FAST_BCOPY)
- ALIGN_TEXT
-done_copyin:
-#endif /* I586_CPU && I586_FAST_BCOPY */
- popl %edi
- popl %esi
- xorl %eax,%eax
- movl _curpcb,%edx
- movl %eax,PCB_ONFAULT(%edx)
- ret
-
- ALIGN_TEXT
-copyin_fault:
- popl %edi
- popl %esi
- movl _curpcb,%edx
- movl $0,PCB_ONFAULT(%edx)
- movl $EFAULT,%eax
- ret
-
-#if defined(I586_CPU) && defined(I586_FAST_BCOPY)
-/* fastmove(src, dst, len)
- src in %esi
- dst in %edi
- len in %ecx
- uses %eax and %edx for tmp. storage
- */
- ALIGN_TEXT
-fastmove:
- cmpl $63,%ecx
- jbe 8f
-
- testl $7,%esi /* check if src addr is multiple of 8 */
- jnz 8f
-
- testl $7,%edi /* check if dst addr is multiple of 8 */
- jnz 8f
-
- pushl %ebp
- movl %esp,%ebp
- subl $PCB_SAVEFPU_SIZE,%esp
-
-/* if (npxproc != NULL) { */
- cmpl $0,_npxproc
- je 6f
-/* fnsave(&curpcb->pcb_savefpu); */
- movl _curpcb,%eax
- fnsave PCB_SAVEFPU(%eax)
-/* npxproc = NULL; */
- movl $0,_npxproc
-/* } */
-6:
-/* now we own the FPU. */
-
-/*
- * The process' FP state is saved in the pcb, but if we get
- * switched, the cpu_switch() will store our FP state in the
- * pcb. It should be possible to avoid all the copying for
- * this, e.g., by setting a flag to tell cpu_switch() to
- * save the state somewhere else.
- */
-/* tmp = curpcb->pcb_savefpu; */
- pushl %edi
- pushl %esi
- pushl %ecx
- leal -PCB_SAVEFPU_SIZE(%ebp),%edi
- movl _curpcb,%esi
- addl $PCB_SAVEFPU,%esi
- cld
- movl $PCB_SAVEFPU_SIZE>>2,%ecx
- rep
- movsl
- popl %ecx
- popl %esi
- popl %edi
-/* stop_emulating(); */
- clts
-/* npxproc = curproc; */
- movl _curproc,%eax
- movl %eax,_npxproc
-4:
- pushl %ecx
- cmpl $1792,%ecx
- jbe 2f
- movl $1792,%ecx
-2:
- subl %ecx,0(%esp)
- cmpl $256,%ecx
- jb 5f
- pushl %esi
- pushl %ecx
- ALIGN_TEXT
-3:
- movl 0(%esi),%eax
- movl 32(%esi),%eax
- movl 64(%esi),%eax
- movl 96(%esi),%eax
- movl 128(%esi),%eax
- movl 160(%esi),%eax
- movl 192(%esi),%eax
- movl 224(%esi),%eax
- addl $256,%esi
- subl $256,%ecx
- cmpl $256,%ecx
- jae 3b
- popl %ecx
- popl %esi
-5:
- ALIGN_TEXT
-7:
- fildq 0(%esi)
- fildq 8(%esi)
- fildq 16(%esi)
- fildq 24(%esi)
- fildq 32(%esi)
- fildq 40(%esi)
- fildq 48(%esi)
- fildq 56(%esi)
- fistpq 56(%edi)
- fistpq 48(%edi)
- fistpq 40(%edi)
- fistpq 32(%edi)
- fistpq 24(%edi)
- fistpq 16(%edi)
- fistpq 8(%edi)
- fistpq 0(%edi)
- addl $-64,%ecx
- addl $64,%esi
- addl $64,%edi
- cmpl $63,%ecx
- ja 7b
- popl %eax
- addl %eax,%ecx
- cmpl $64,%ecx
- jae 4b
-
-/* curpcb->pcb_savefpu = tmp; */
- pushl %edi
- pushl %esi
- pushl %ecx
- movl _curpcb,%edi
- addl $PCB_SAVEFPU,%edi
- leal -PCB_SAVEFPU_SIZE(%ebp),%esi
- cld
- movl $PCB_SAVEFPU_SIZE>>2,%ecx
- rep
- movsl
- popl %ecx
- popl %esi
- popl %edi
-
-/* start_emulating(); */
- smsw %ax
- orb $CR0_TS,%al
- lmsw %ax
-/* npxproc = NULL; */
- movl $0,_npxproc
- movl %ebp,%esp
- popl %ebp
-
- ALIGN_TEXT
-8:
- movb %cl,%al
- shrl $2,%ecx /* copy longword-wise */
- cld
- rep
- movsl
- movb %al,%cl
- andb $3,%cl /* copy remaining bytes */
- rep
- movsb
-
- ret
-#endif /* I586_CPU && I586_FAST_BCOPY */
-
-/*
- * fu{byte,sword,word} : fetch a byte (sword, word) from user memory
- */
-ENTRY(fuword)
- movl _curpcb,%ecx
- movl $fusufault,PCB_ONFAULT(%ecx)
- movl 4(%esp),%edx /* from */
-
- cmpl $VM_MAXUSER_ADDRESS-4,%edx /* verify address is valid */
- ja fusufault
-
- movl (%edx),%eax
- movl $0,PCB_ONFAULT(%ecx)
- ret
-
-/*
- * These two routines are called from the profiling code, potentially
- * at interrupt time. If they fail, that's okay, good things will
- * happen later. Fail all the time for now - until the trap code is
- * able to deal with this.
- */
-ALTENTRY(suswintr)
-ENTRY(fuswintr)
- movl $-1,%eax
- ret
-
-ENTRY(fusword)
- movl _curpcb,%ecx
- movl $fusufault,PCB_ONFAULT(%ecx)
- movl 4(%esp),%edx
-
- cmpl $VM_MAXUSER_ADDRESS-2,%edx
- ja fusufault
-
- movzwl (%edx),%eax
- movl $0,PCB_ONFAULT(%ecx)
- ret
-
-ENTRY(fubyte)
- movl _curpcb,%ecx
- movl $fusufault,PCB_ONFAULT(%ecx)
- movl 4(%esp),%edx
-
- cmpl $VM_MAXUSER_ADDRESS-1,%edx
- ja fusufault
-
- movzbl (%edx),%eax
- movl $0,PCB_ONFAULT(%ecx)
- ret
-
- ALIGN_TEXT
-fusufault:
- movl _curpcb,%ecx
- xorl %eax,%eax
- movl %eax,PCB_ONFAULT(%ecx)
- decl %eax
- ret
-
-/*
- * su{byte,sword,word}: write a byte (word, longword) to user memory
- */
-ENTRY(suword)
- movl _curpcb,%ecx
- movl $fusufault,PCB_ONFAULT(%ecx)
- movl 4(%esp),%edx
-
-#if defined(I386_CPU)
-
-#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)
- cmpl $CPUCLASS_386,_cpu_class
- jne 2f /* we only have to set the right segment selector */
-#endif /* I486_CPU || I586_CPU || I686_CPU */
-
- /* XXX - page boundary crossing is still not handled */
- movl %edx,%eax
- shrl $IDXSHIFT,%edx
- andb $0xfc,%dl
- movb _PTmap(%edx),%dl
- andb $0x7,%dl /* must be VALID + USERACC + WRITE */
- cmpb $0x7,%dl
- je 1f
-
- /* simulate a trap */
- pushl %eax
- call _trapwrite
- popl %edx /* remove junk parameter from stack */
- movl _curpcb,%ecx /* restore trashed register */
- testl %eax,%eax
- jnz fusufault
-1:
- movl 4(%esp),%edx
-#endif
-
-2:
- cmpl $VM_MAXUSER_ADDRESS-4,%edx /* verify address validity */
- ja fusufault
-
- movl 8(%esp),%eax
- movl %eax,(%edx)
- xorl %eax,%eax
- movl %eax,PCB_ONFAULT(%ecx)
- ret
-
-ENTRY(susword)
- movl _curpcb,%ecx
- movl $fusufault,PCB_ONFAULT(%ecx)
- movl 4(%esp),%edx
-
-#if defined(I386_CPU)
-
-#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)
- cmpl $CPUCLASS_386,_cpu_class
- jne 2f
-#endif /* I486_CPU || I586_CPU || I686_CPU */
-
- /* XXX - page boundary crossing is still not handled */
- movl %edx,%eax
- shrl $IDXSHIFT,%edx
- andb $0xfc,%dl
- movb _PTmap(%edx),%dl
- andb $0x7,%dl /* must be VALID + USERACC + WRITE */
- cmpb $0x7,%dl
- je 1f
-
- /* simulate a trap */
- pushl %eax
- call _trapwrite
- popl %edx /* remove junk parameter from stack */
- movl _curpcb,%ecx /* restore trashed register */
- testl %eax,%eax
- jnz fusufault
-1:
- movl 4(%esp),%edx
-#endif
-
-2:
- cmpl $VM_MAXUSER_ADDRESS-2,%edx /* verify address validity */
- ja fusufault
-
- movw 8(%esp),%ax
- movw %ax,(%edx)
- xorl %eax,%eax
- movl %eax,PCB_ONFAULT(%ecx)
- ret
-
-ALTENTRY(suibyte)
-ENTRY(subyte)
- movl _curpcb,%ecx
- movl $fusufault,PCB_ONFAULT(%ecx)
- movl 4(%esp),%edx
-
-#if defined(I386_CPU)
-
-#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)
- cmpl $CPUCLASS_386,_cpu_class
- jne 2f
-#endif /* I486_CPU || I586_CPU || I686_CPU */
-
- movl %edx,%eax
- shrl $IDXSHIFT,%edx
- andb $0xfc,%dl
- movb _PTmap(%edx),%dl
- andb $0x7,%dl /* must be VALID + USERACC + WRITE */
- cmpb $0x7,%dl
- je 1f
-
- /* simulate a trap */
- pushl %eax
- call _trapwrite
- popl %edx /* remove junk parameter from stack */
- movl _curpcb,%ecx /* restore trashed register */
- testl %eax,%eax
- jnz fusufault
-1:
- movl 4(%esp),%edx
-#endif
-
-2:
- cmpl $VM_MAXUSER_ADDRESS-1,%edx /* verify address validity */
- ja fusufault
-
- movb 8(%esp),%al
- movb %al,(%edx)
- xorl %eax,%eax
- movl %eax,PCB_ONFAULT(%ecx)
- ret
-
-/*
- * copyinstr(from, to, maxlen, int *lencopied)
- * copy a string from from to to, stop when a 0 character is reached.
- * return ENAMETOOLONG if string is longer than maxlen, and
- * EFAULT on protection violations. If lencopied is non-zero,
- * return the actual length in *lencopied.
- */
-ENTRY(copyinstr)
- pushl %esi
- pushl %edi
- movl _curpcb,%ecx
- movl $cpystrflt,PCB_ONFAULT(%ecx)
-
- movl 12(%esp),%esi /* %esi = from */
- movl 16(%esp),%edi /* %edi = to */
- movl 20(%esp),%edx /* %edx = maxlen */
-
- movl $VM_MAXUSER_ADDRESS,%eax
-
- /* make sure 'from' is within bounds */
- subl %esi,%eax
- jbe cpystrflt
-
- /* restrict maxlen to <= VM_MAXUSER_ADDRESS-from */
- cmpl %edx,%eax
- jae 1f
- movl %eax,%edx
- movl %eax,20(%esp)
-1:
- incl %edx
- cld
-
-2:
- decl %edx
- jz 3f
-
- lodsb
- stosb
- orb %al,%al
- jnz 2b
-
- /* Success -- 0 byte reached */
- decl %edx
- xorl %eax,%eax
- jmp cpystrflt_x
-3:
- /* edx is zero - return ENAMETOOLONG or EFAULT */
- cmpl $VM_MAXUSER_ADDRESS,%esi
- jae cpystrflt
-4:
- movl $ENAMETOOLONG,%eax
- jmp cpystrflt_x
-
-cpystrflt:
- movl $EFAULT,%eax
-
-cpystrflt_x:
- /* set *lencopied and return %eax */
- movl _curpcb,%ecx
- movl $0,PCB_ONFAULT(%ecx)
- movl 20(%esp),%ecx
- subl %edx,%ecx
- movl 24(%esp),%edx
- testl %edx,%edx
- jz 1f
- movl %ecx,(%edx)
-1:
- popl %edi
- popl %esi
- ret
-
-
-/*
- * copystr(from, to, maxlen, int *lencopied)
- */
-ENTRY(copystr)
- pushl %esi
- pushl %edi
-
- movl 12(%esp),%esi /* %esi = from */
- movl 16(%esp),%edi /* %edi = to */
- movl 20(%esp),%edx /* %edx = maxlen */
- incl %edx
- cld
-1:
- decl %edx
- jz 4f
- lodsb
- stosb
- orb %al,%al
- jnz 1b
-
- /* Success -- 0 byte reached */
- decl %edx
- xorl %eax,%eax
- jmp 6f
-4:
- /* edx is zero -- return ENAMETOOLONG */
- movl $ENAMETOOLONG,%eax
-
-6:
- /* set *lencopied and return %eax */
- movl 20(%esp),%ecx
- subl %edx,%ecx
- movl 24(%esp),%edx
- testl %edx,%edx
- jz 7f
- movl %ecx,(%edx)
-7:
- popl %edi
- popl %esi
- ret
-
-ENTRY(bcmp)
- pushl %edi
- pushl %esi
- movl 12(%esp),%edi
- movl 16(%esp),%esi
- movl 20(%esp),%edx
- xorl %eax,%eax
-
- movl %edx,%ecx
- shrl $2,%ecx
- cld /* compare forwards */
- repe
- cmpsl
- jne 1f
-
- movl %edx,%ecx
- andl $3,%ecx
- repe
- cmpsb
- je 2f
-1:
- incl %eax
-2:
- popl %esi
- popl %edi
- ret
-
-
-/*
- * Handling of special 386 registers and descriptor tables etc
- */
-/* void lgdt(struct region_descriptor *rdp); */
-ENTRY(lgdt)
- /* reload the descriptor table */
- movl 4(%esp),%eax
- lgdt (%eax)
-
- /* flush the prefetch q */
- jmp 1f
- nop
-1:
- /* reload "stale" selectors */
- movl $KDSEL,%eax
- movl %ax,%ds
- movl %ax,%es
- movl %ax,%ss
-
- /* reload code selector by turning return into intersegmental return */
- movl (%esp),%eax
- pushl %eax
-# movl $KCSEL,4(%esp)
- movl $8,4(%esp)
- lret
-
-/*
- * void lidt(struct region_descriptor *rdp);
- */
-ENTRY(lidt)
- movl 4(%esp),%eax
- lidt (%eax)
- ret
-
-/*
- * void lldt(u_short sel)
- */
-ENTRY(lldt)
- lldt 4(%esp)
- ret
-
-/*
- * void ltr(u_short sel)
- */
-ENTRY(ltr)
- ltr 4(%esp)
- ret
-
-/* ssdtosd(*ssdp,*sdp) */
-ENTRY(ssdtosd)
- pushl %ebx
- movl 8(%esp),%ecx
- movl 8(%ecx),%ebx
- shll $16,%ebx
- movl (%ecx),%edx
- roll $16,%edx
- movb %dh,%bl
- movb %dl,%bh
- rorl $8,%ebx
- movl 4(%ecx),%eax
- movw %ax,%dx
- andl $0xf0000,%eax
- orl %eax,%ebx
- movl 12(%esp),%ecx
- movl %edx,(%ecx)
- movl %ebx,4(%ecx)
- popl %ebx
- ret
-
-/* load_cr0(cr0) */
-ENTRY(load_cr0)
- movl 4(%esp),%eax
- movl %eax,%cr0
- ret
-
-/* rcr0() */
-ENTRY(rcr0)
- movl %cr0,%eax
- ret
-
-/* rcr3() */
-ENTRY(rcr3)
- movl %cr3,%eax
- ret
-
-/* void load_cr3(caddr_t cr3) */
-ENTRY(load_cr3)
- movl 4(%esp),%eax
- movl %eax,%cr3
- ret
-
-
-/*****************************************************************************/
-/* setjump, longjump */
-/*****************************************************************************/
-
-ENTRY(setjmp)
- movl 4(%esp),%eax
- movl %ebx,(%eax) /* save ebx */
- movl %esp,4(%eax) /* save esp */
- movl %ebp,8(%eax) /* save ebp */
- movl %esi,12(%eax) /* save esi */
- movl %edi,16(%eax) /* save edi */
- movl (%esp),%edx /* get rta */
- movl %edx,20(%eax) /* save eip */
- xorl %eax,%eax /* return(0); */
- ret
-
-ENTRY(longjmp)
- movl 4(%esp),%eax
- movl (%eax),%ebx /* restore ebx */
- movl 4(%eax),%esp /* restore esp */
- movl 8(%eax),%ebp /* restore ebp */
- movl 12(%eax),%esi /* restore esi */
- movl 16(%eax),%edi /* restore edi */
- movl 20(%eax),%edx /* get rta */
- movl %edx,(%esp) /* put in return frame */
- xorl %eax,%eax /* return(1); */
- incl %eax
- ret
-
-#ifdef PC98
-/* XXX:
- * bcopy always uses overlapping copy (std flag on) if dst addr < src addr.
- * However it is fatal for suspended memory io.
- */
-ENTRY(memcopy)
- pushl %esi
- pushl %edi
- movl 12(%esp),%esi
- movl 16(%esp),%edi
- movl 20(%esp),%ecx
- cld /* nope, copy forward */
- shrl $2,%ecx /* copy by 32-bit words */
- rep
- movsl
- popl %edi
- popl %esi
- ret
-#endif
-
-/*
- * Here for doing BB-profiling (gcc -a).
- * We rely on the "bbset" instead, but need a dummy function.
- */
- .text
- .align 2
-.globl ___bb_init_func
-___bb_init_func:
- movl 4(%esp),%eax
- movl $1,(%eax)
- ret
diff --git a/sys/pc98/i386/trap.c b/sys/pc98/i386/trap.c
index fb294dc..b5bf160 100644
--- a/sys/pc98/i386/trap.c
+++ b/sys/pc98/i386/trap.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
- * $Id: trap.c,v 1.4 1996/09/03 10:23:17 asami Exp $
+ * $Id: trap.c,v 1.5 1996/09/04 09:52:19 asami Exp $
*/
/*
@@ -75,16 +75,9 @@
#include <machine/psl.h>
#include <machine/reg.h>
#include <machine/trap.h>
-#ifdef PC98
-#include <machine/../isa/isa_device.h>
-
-#include "nec.h"
-#include "epson.h"
-#else
#include <machine/../isa/isa_device.h>
#include "isa.h"
-#endif
#ifdef POWERFAIL_NMI
# include <syslog.h>
@@ -282,7 +275,7 @@ trap(frame)
i = SIGFPE;
break;
-#if NNEC > 0 || NEPSON > 0
+#if NISA > 0
case T_NMI:
#ifdef POWERFAIL_NMI
goto handle_powerfail;
@@ -297,7 +290,7 @@ trap(frame)
if (isa_nmi(code) == 0) return;
panic("NMI indicates hardware failure");
#endif /* POWERFAIL_NMI */
-#endif /* NNEC > 0 */
+#endif /* NISA > 0 */
case T_OFLOW: /* integer overflow fault */
ucode = FPE_INTOVF_TRAP;
@@ -441,7 +434,7 @@ trap(frame)
#endif
break;
-#if NNEC > 0 || NEPSON > 0
+#if NISA > 0
case T_NMI:
#ifdef POWERFAIL_NMI
#ifndef TIMER_FREQ
@@ -470,7 +463,7 @@ trap(frame)
if (isa_nmi(code) == 0) return;
/* FALL THROUGH */
#endif /* POWERFAIL_NMI */
-#endif /* NNEC > 0 */
+#endif /* NISA > 0 */
}
trap_fatal(&frame);
diff --git a/sys/pc98/pc98/clock.c b/sys/pc98/pc98/clock.c
index b9547fd..e0f9221 100644
--- a/sys/pc98/pc98/clock.c
+++ b/sys/pc98/pc98/clock.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
- * $Id: clock.c,v 1.3 1996/08/30 10:42:58 asami Exp $
+ * $Id: clock.c,v 1.4 1996/09/03 10:23:24 asami Exp $
*/
/*
@@ -46,7 +46,7 @@
/*
* modified for PC98
- * $Id: clock.c,v 1.3 1996/08/30 10:42:58 asami Exp $
+ * $Id: clock.c,v 1.4 1996/09/03 10:23:24 asami Exp $
*/
/*
@@ -68,14 +68,12 @@
#include <machine/cpu.h>
#include <machine/frame.h>
+#include <i386/isa/icu.h>
#ifdef PC98
-#include <sys/syslog.h>
-#include <pc98/pc98/icu.h>
#include <pc98/pc98/pc98.h>
#include <i386/isa/isa_device.h>
#include <pc98/pc98/timerreg.h>
#else
-#include <i386/isa/icu.h>
#include <i386/isa/isa.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/rtc.h>
@@ -742,13 +740,11 @@ startrtclock()
#ifndef AUTO_CLOCK
if (pc98_machine_type & M_8M) {
#ifndef PC98_8M
- log(LOG_EMERG,
- "you must reconfig a kernel with \"PC98_8M\" option.\n");
+ printf("you must reconfig a kernel with \"PC98_8M\" option.\n");
#endif
} else {
#ifdef PC98_8M
- log(LOG_EMERG,
- "You must reconfig a kernel without \"PC98_8M\" option.\n");
+ printf("You must reconfig a kernel without \"PC98_8M\" option.\n");
#endif
}
#else /* AUTO_CLOCK */
diff --git a/sys/pc98/pc98/icu.h b/sys/pc98/pc98/icu.h
deleted file mode 100644
index 47a5f2a..0000000
--- a/sys/pc98/pc98/icu.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * 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.
- *
- * from: @(#)icu.h 5.6 (Berkeley) 5/9/91
- * $Id: icu.h,v 1.7 1994/10/01 02:56:11 davidg Exp $
- */
-
-/*
- * AT/386 Interrupt Control constants
- * W. Jolitz 8/89
- *
- * modified for PC98
- * $Id: icu.h,v 1.2 1994/03/14 10:44:07 kakefuda Exp $
- */
-
-#ifndef _PC98_PC98_ICU_H_
-#define _PC98_PC98_ICU_H_
-
-#ifndef LOCORE
-
-/*
- * Interrupt "level" mechanism variables, masks, and macros
- */
-extern unsigned imen; /* interrupt mask enable */
-
-#define INTREN(s) (imen &= ~(s), SET_ICUS())
-#define INTRDIS(s) (imen |= (s), SET_ICUS())
-#define INTRMASK(msk,s) (msk |= (s))
-#define INTRUNMASK(msk,s) (msk &= ~(s))
-#if 0
-#define SET_ICUS() (outb(IO_ICU1 + 1, imen), outb(IU_ICU2 + 1, imen >> 8))
-#else
-/*
- * XXX - IO_ICU* are defined in pc98.h, not icu.h, and nothing much bothers to
- * include pc98.h, while too many things include icu.h.
- */
-#ifdef PC98
-#define SET_ICUS() (outb(0x02, imen), outb(0x0a, imen >> 8))
-#else
-#define SET_ICUS() (outb(0x21, imen), outb(0xa1, imen >> 8))
-#endif
-#endif
-
-#endif /* LOCORE */
-
-/*
- * Interrupt enable bits - in normal order of priority (which we change)
- */
-#ifdef PC98
-#define IRQ0 0x0001 /* highest priority - timer */
-#define IRQ1 0x0002
-#define IRQ2 0x0004
-#define IRQ3 0x0008
-#define IRQ4 0x0010
-#define IRQ5 0x0020
-#define IRQ6 0x0040
-#define IRQ7 0x0080 /* OK? */
-#define IRQ_SLAVE 0x0080
-#define IRQ8 0x0100
-#define IRQ9 0x0200
-#define IRQ10 0x0400
-#define IRQ11 0x0800
-#define IRQ12 0x1000
-#define IRQ13 0x2000
-#define IRQ14 0x4000
-#define IRQ15 0x8000 /* lowest */
-#else
-#define IRQ0 0x0001 /* highest priority - timer */
-#define IRQ1 0x0002
-#define IRQ_SLAVE 0x0004
-#define IRQ8 0x0100
-#define IRQ9 0x0200
-#define IRQ2 IRQ9
-#define IRQ10 0x0400
-#define IRQ11 0x0800
-#define IRQ12 0x1000
-#define IRQ13 0x2000
-#define IRQ14 0x4000
-#define IRQ15 0x8000
-#define IRQ3 0x0008 /* this is highest after rotation */
-#define IRQ4 0x0010
-#define IRQ5 0x0020
-#define IRQ6 0x0040
-#define IRQ7 0x0080 /* lowest - parallel printer */
-#endif
-
-/*
- * Interrupt Control offset into Interrupt descriptor table (IDT)
- */
-#define ICU_OFFSET 32 /* 0-31 are processor exceptions */
-#define ICU_LEN 16 /* 32-47 are PC98 interrupts */
-
-#endif /* !_PC98_PC98_ICU_H_ */
diff --git a/sys/pc98/pc98/if_ed.c b/sys/pc98/pc98/if_ed.c
index d65a91c..7bbf39c 100644
--- a/sys/pc98/pc98/if_ed.c
+++ b/sys/pc98/pc98/if_ed.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ed.c,v 1.4 1996/08/31 15:06:47 asami Exp $
+ * $Id: if_ed.c,v 1.5 1996/09/03 10:23:30 asami Exp $
*/
/*
@@ -101,11 +101,7 @@
#include <machine/md_var.h>
#include <i386/isa/isa_device.h>
-#ifdef PC98
-#include <pc98/pc98/icu.h>
-#else
#include <i386/isa/icu.h>
-#endif
#include <i386/isa/if_edreg.h>
#ifdef PC98
diff --git a/sys/pc98/pc98/if_fe.c b/sys/pc98/pc98/if_fe.c
index 690849c..0e0144d 100644
--- a/sys/pc98/pc98/if_fe.c
+++ b/sys/pc98/pc98/if_fe.c
@@ -21,7 +21,7 @@
*/
/*
- * $Id: if_fe.c,v 1.4 1996/08/31 15:06:55 asami Exp $
+ * $Id: if_fe.c,v 1.5 1996/09/03 10:23:39 asami Exp $
*
* Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
* To be used with FreeBSD 2.x
@@ -128,11 +128,7 @@
#include <machine/clock.h>
#include <i386/isa/isa_device.h>
-#ifdef PC98
-#include <pc98/pc98/icu.h>
-#else
#include <i386/isa/icu.h>
-#endif
/* PCCARD suport */
#include "crd.h"
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c
index a7c4dbc..21f3eb7 100644
--- a/sys/pc98/pc98/machdep.c
+++ b/sys/pc98/pc98/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.4 1996/09/03 10:23:16 asami Exp $
+ * $Id: machdep.c,v 1.5 1996/09/04 09:52:18 asami Exp $
*/
#include "npx.h"
@@ -1068,18 +1068,10 @@ init386(first)
setidt(0x80, &IDTVEC(int0x80_syscall),
SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL));
-#ifdef PC98
-#include "nec.h"
-#include "epson.h"
-#if NNEC > 0 || NEPSON > 0
- isa_defaultirq();
-#endif
-#else /* IBM-PC */
#include "isa.h"
#if NISA >0
isa_defaultirq();
#endif
-#endif
rand_initialize();
r_gdt.rd_limit = sizeof(gdt) - 1;
diff --git a/sys/pc98/pc98/mse.c b/sys/pc98/pc98/mse.c
index 4450bbe..a4d9369 100644
--- a/sys/pc98/pc98/mse.c
+++ b/sys/pc98/pc98/mse.c
@@ -11,7 +11,7 @@
* this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
- * $Id: mse.c,v 1.2 1996/08/31 15:07:01 asami Exp $
+ * $Id: mse.c,v 1.3 1996/09/03 10:23:45 asami Exp $
*/
/*
* Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and
@@ -62,9 +62,7 @@
#include <machine/clock.h>
#include <i386/isa/isa_device.h>
-#ifdef PC98
-#include <pc98/pc98/icu.h>
-#endif
+#include <i386/isa/icu.h>
static int mseprobe(struct isa_device *);
diff --git a/sys/pc98/pc98/npx.c b/sys/pc98/pc98/npx.c
index 8687f34..14456a7 100644
--- a/sys/pc98/pc98/npx.c
+++ b/sys/pc98/pc98/npx.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)npx.c 7.2 (Berkeley) 5/12/91
- * $Id: npx.c,v 1.3 1996/08/31 15:07:03 asami Exp $
+ * $Id: npx.c,v 1.4 1996/09/03 10:23:46 asami Exp $
*/
#include "npx.h"
@@ -59,13 +59,12 @@
#include <machine/clock.h>
#include <machine/specialreg.h>
-#ifdef PC98
-#include <pc98/pc98/icu.h>
+#include <i386/isa/icu.h>
#include <i386/isa/isa_device.h>
+
+#ifdef PC98
#include <pc98/pc98/pc98.h>
#else
-#include <i386/isa/icu.h>
-#include <i386/isa/isa_device.h>
#include <i386/isa/isa.h>
#endif
diff --git a/sys/pc98/pc98/pc98.c b/sys/pc98/pc98/pc98.c
index 670fc18..6fa5de2 100644
--- a/sys/pc98/pc98/pc98.c
+++ b/sys/pc98/pc98/pc98.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
- * $Id: pc98.c,v 1.3 1996/08/31 15:07:05 asami Exp $
+ * $Id: pc98.c,v 1.4 1996/09/03 10:23:47 asami Exp $
*/
/*
@@ -50,7 +50,7 @@
/*
* modified for PC9801 by A.Kojima F.Ukai M.Ishii
* Kyoto University Microcomputer Club (KMC)
- * $Id: pc98.c,v 1.3 1994/03/17 23:24:40 kakefuda Exp $
+ * $Id: pc98.c,v 1.4 1996/09/03 10:23:47 asami Exp $
*/
#include "opt_auto_eoi.h"
@@ -70,7 +70,7 @@
#include <i386/isa/isa_device.h>
#ifdef PC98
#include <pc98/pc98/pc98.h>
-#include <pc98/pc98/icu.h>
+#include <i386/isa/icu.h>
#include <pc98/pc98/ic/i8237.h>
#else
#include <i386/isa/isa.h>
diff --git a/sys/pc98/pc98/pcibus.c b/sys/pc98/pc98/pcibus.c
index 2aba4a3..2e922e9 100644
--- a/sys/pc98/pc98/pcibus.c
+++ b/sys/pc98/pc98/pcibus.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: pcibus.c,v 1.2 1996/07/23 07:46:30 asami Exp $
+** $Id: pcibus.c,v 1.3 1996/09/03 10:23:51 asami Exp $
**
** pci bus subroutines for i386 architecture.
**
@@ -41,11 +41,7 @@
#include <sys/systm.h>
#include <sys/kernel.h>
-#ifdef PC98
-#include <pc98/pc98/icu.h>
-#else
#include <i386/isa/icu.h>
-#endif
#include <i386/isa/isa_device.h>
#include <pci/pcivar.h>
diff --git a/sys/pc98/pc98/random_machdep.c b/sys/pc98/pc98/random_machdep.c
index 21de608..4662b9a 100644
--- a/sys/pc98/pc98/random_machdep.c
+++ b/sys/pc98/pc98/random_machdep.c
@@ -1,7 +1,7 @@
/*
* random_machdep.c -- A strong random number generator
*
- * $Id: random_machdep.c,v 1.3 1996/08/30 10:43:08 asami Exp $
+ * $Id: random_machdep.c,v 1.4 1996/09/03 10:23:53 asami Exp $
*
* Version 0.95, last modified 18-Oct-95
*
@@ -52,13 +52,12 @@
#include <machine/clock.h>
#include <machine/random.h>
+#include <i386/isa/icu.h>
#ifdef PC98
-#include <pc98/pc98/icu.h>
#include <pc98/pc98/pc98.h>
#include <i386/isa/isa_device.h>
#include <pc98/pc98/timerreg.h>
#else
-#include <i386/isa/icu.h>
#include <i386/isa/isa.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/timerreg.h>
diff --git a/sys/pc98/pc98/sbic55.c b/sys/pc98/pc98/sbic55.c
index b1b9b8a..9f9399a 100644
--- a/sys/pc98/pc98/sbic55.c
+++ b/sys/pc98/pc98/sbic55.c
@@ -25,7 +25,7 @@
#include <pc98/pc98/pc98.h>
#include <i386/isa/isa_device.h>
-#include <pc98/pc98/icu.h>
+#include <i386/isa/icu.h>
#include <pc98/pc98/ic/i8237.h>
#include <pc98/pc98/scsireg.h>
#include <scsi/scsi_all.h>
diff --git a/sys/pc98/pc98/sbic55.c.new b/sys/pc98/pc98/sbic55.c.new
index 7c5fbf3..4462054 100644
--- a/sys/pc98/pc98/sbic55.c.new
+++ b/sys/pc98/pc98/sbic55.c.new
@@ -70,7 +70,7 @@
#include <vm/vm_param.h>
#include <vm/pmap.h>
-#include <pc98/pc98/icu.h>
+#include <i386/isa/icu.h>
#include <pc98/pc98/pc98.h>
#include <i386/isa/isa_device.h>
#include <pc98/pc98/ic/i8237.h>
diff --git a/sys/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c
index 98feda2..da16792 100644
--- a/sys/pc98/pc98/sio.c
+++ b/sys/pc98/pc98/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.3 1996/08/31 15:07:20 asami Exp $
+ * $Id: sio.c,v 1.4 1996/09/03 10:23:59 asami Exp $
*/
#include "opt_comconsole.h"
@@ -139,7 +139,7 @@
#ifdef PC98
#include <pc98/pc98/pc98.h>
-#include <pc98/pc98/icu.h>
+#include <i386/isa/icu.h>
#include <i386/isa/isa_device.h>
#include <pc98/pc98/sioreg.h>
#include <pc98/pc98/ic/i8251.h>
diff --git a/sys/pc98/pc98/syscons.c b/sys/pc98/pc98/syscons.c
index 58fe8d9..bd6702c 100644
--- a/sys/pc98/pc98/syscons.c
+++ b/sys/pc98/pc98/syscons.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.5 1996/09/03 10:24:01 asami Exp $
+ * $Id: syscons.c,v 1.6 1996/09/04 09:52:29 asami Exp $
*/
#include "sc.h"
@@ -459,6 +459,7 @@ draw_cursor_image(scr_stat *scp)
static inline void
remove_cursor_image(scr_stat *scp)
{
+#ifndef PC98
/*
u_short cursor_image, *ptr;
@@ -469,6 +470,7 @@ remove_cursor_image(scr_stat *scp)
SOS */
*(Crtat + (scp->cursor_oldpos - scp->scr_buf)) = scp->cursor_saveunder;
+#endif
}
static inline void
@@ -485,7 +487,9 @@ move_crsr(scr_stat *scp, int x, int y)
scp->xpos = x;
scp->ypos = y;
scp->cursor_pos = scp->scr_buf + scp->ypos * scp->xsize + scp->xpos;
+#ifdef PC98
scp->cursor_atr = scp->atr_buf + scp->ypos * scp->xsize + scp->xpos;
+#endif
}
static int
@@ -1705,6 +1709,7 @@ static void
clear_screen(scr_stat *scp)
{
move_crsr(scp, 0, 0);
+ scp->cursor_oldpos = scp->cursor_pos;
#ifdef PC98
fillw(scr_map[0x20], scp->scr_buf,
scp->xsize * scp->ysize);
@@ -2071,7 +2076,7 @@ scan_esc(scr_stat *scp, u_char c)
scp->cursor_atr - scp->xpos,
scp->xpos + 1);
#else
- fillw(scp->term.cur_color| scr_map[0x20],
+ fillw(scp->term.cur_color | scr_map[0x20],
scp->cursor_pos - scp->xpos,
scp->xpos + 1);
#endif
@@ -2346,6 +2351,7 @@ scan_esc(scr_stat *scp, u_char c)
scp->term.cur_color =
(scp->term.cur_color&0xF000) | (ansi_col[(n-30)&7]<<8);
scp->term.cur_attr = mask2attr(&scp->term);
+ break;
case 40: case 41: /* set bg color */
case 42: case 43: case 44:
case 45: case 46: case 47:
@@ -3070,6 +3076,10 @@ static scr_stat
scp->scr_buf = scp->cursor_pos = scp->cursor_oldpos = scp->mouse_pos =
(u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
M_DEVBUF, M_WAITOK);
+ scp->history_head = scp->history_pos = scp->history =
+ (u_short *)malloc(scp->history_size*sizeof(u_short),
+ M_DEVBUF, M_WAITOK);
+ bzero(scp->history_head, scp->history_size*sizeof(u_short));
#ifdef PC98
scp->atr_buf = scp->cursor_atr = scp->atr_buf =
(u_short *)malloc(scp->xsize*scp->ysize*sizeof(u_short),
@@ -3079,10 +3089,6 @@ static scr_stat
M_DEVBUF, M_WAITOK);
bzero(scp->his_atr_head, scp->history_size*sizeof(u_short));
#endif
- scp->history_head = scp->history_pos = scp->history =
- (u_short *)malloc(scp->history_size*sizeof(u_short),
- M_DEVBUF, M_WAITOK);
- bzero(scp->history_head, scp->history_size*sizeof(u_short));
#ifndef PC98
if (crtc_vga && video_mode_ptr)
#endif
@@ -4123,6 +4129,7 @@ set_destructive_cursor(scr_stat *scp)
static void
set_mouse_pos(scr_stat *scp)
{
+#ifndef PC98
static int last_xpos = -1, last_ypos = -1;
/*
* the margins imposed here are not ideal, we loose
@@ -4166,11 +4173,13 @@ set_mouse_pos(scr_stat *scp)
cut_buffer[i] = 0x00;
}
}
+#endif
}
static void
mouse_cut_start(scr_stat *scp)
{
+#ifndef PC98
int i;
if (scp->status & MOUSE_ENABLED) {
@@ -4193,19 +4202,23 @@ mouse_cut_start(scr_stat *scp)
remove_cutmarking(console[i]);
}
}
+#endif
}
static void
mouse_cut_end(scr_stat *scp)
{
+#ifndef PC98
if (scp->status & MOUSE_ENABLED) {
scp->status &= ~MOUSE_CUTTING;
}
+#endif
}
static void
mouse_paste(scr_stat *scp)
{
+#ifndef PC98
if (scp->status & MOUSE_ENABLED) {
struct tty *tp;
u_char *ptr = cut_buffer;
@@ -4214,6 +4227,7 @@ mouse_paste(scr_stat *scp)
while (*ptr)
(*linesw[tp->t_line].l_rint)(scr_rmap[*ptr++], tp);
}
+#endif
}
static void
@@ -4291,6 +4305,7 @@ draw_mouse_image(scr_stat *scp)
static void
remove_mouse_image(scr_stat *scp)
{
+#ifndef PC98
u_short *crt_pos = Crtat + (scp->mouse_oldpos - scp->scr_buf);
*(crt_pos) = *(scp->mouse_oldpos);
@@ -4299,11 +4314,13 @@ remove_mouse_image(scr_stat *scp)
*(crt_pos+scp->xsize+1) = *(scp->mouse_oldpos+scp->xsize+1);
mark_for_update(scp, scp->mouse_oldpos - scp->scr_buf);
mark_for_update(scp, scp->mouse_oldpos + scp->xsize + 1 - scp->scr_buf);
+#endif
}
static void
draw_cutmarking(scr_stat *scp)
{
+#ifndef PC98
u_short *ptr;
u_short och, nch;
@@ -4332,28 +4349,31 @@ draw_cutmarking(scr_stat *scp)
if (nch != och)
*(Crtat + (ptr - scp->scr_buf)) = nch;
}
+#endif
}
static void
remove_cutmarking(scr_stat *scp)
{
+#ifndef PC98
scp->mouse_cut_start = scp->mouse_cut_end = NULL;
scp->status &= ~MOUSE_CUTTING;
mark_all(scp);
+#endif
}
-#ifndef PC98
static void
save_palette(void)
{
+#ifndef PC98
int i;
outb(PALRADR, 0x00);
for (i=0x00; i<0x300; i++)
palette[i] = inb(PALDATA);
inb(crtc_addr+6); /* reset flip/flop */
-}
#endif
+}
void
load_palette(void)
diff --git a/sys/pc98/pc98/vector.s b/sys/pc98/pc98/vector.s
index d0d578a..cfa37ad 100644
--- a/sys/pc98/pc98/vector.s
+++ b/sys/pc98/pc98/vector.s
@@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
- * $Id: vector.s,v 1.20 1996/05/31 01:08:08 peter Exp $
+ * $Id: vector.s,v 1.1.1.1 1996/06/14 10:04:48 asami Exp $
*/
#include "opt_auto_eoi.h"
@@ -10,11 +10,10 @@
* vector.s,v 1.2 1994/03/14 09:44:21 kakefuda Exp
*/
+#include <i386/isa/icu.h>
#ifdef PC98
-#include <pc98/pc98/icu.h>
#include <pc98/pc98/pc98.h>
#else
-#include <i386/isa/icu.h>
#include <i386/isa/isa.h>
#endif
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c
index 7cb4dae..18e5821 100644
--- a/sys/pccard/pccard.c
+++ b/sys/pccard/pccard.c
@@ -47,13 +47,11 @@
#ifdef PC98
#include <pc98/pc98/pc98.h>
-#include <pc98/pc98/pc98_device.h>
-#include <pc98/pc98/icu.h>
#else
#include <i386/isa/isa.h>
+#endif /* PC98 */
#include <i386/isa/isa_device.h>
#include <i386/isa/icu.h>
-#endif /* PC98 */
#include "apm.h"
#if NAPM > 0
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c
index b047c8a..959f006 100644
--- a/sys/pccard/pcic.c
+++ b/sys/pccard/pcic.c
@@ -57,13 +57,11 @@
#ifdef PC98
#include <pc98/pc98/pc98.h>
-#include <pc98/pc98/pc98_device.h>
-#include <pc98/pc98/icu.h>
#else
#include <i386/isa/isa.h>
+#endif
#include <i386/isa/isa_device.h>
#include <i386/isa/icu.h>
-#endif
#include <pccard/i82365.h>
#ifdef PC98
OpenPOWER on IntegriCloud