summaryrefslogtreecommitdiffstats
path: root/sys/pc98/cbus
diff options
context:
space:
mode:
authorasami <asami@FreeBSD.org>1996-09-03 10:24:29 +0000
committerasami <asami@FreeBSD.org>1996-09-03 10:24:29 +0000
commitbbb6994e507486b942d268c5f28330727a4d2e49 (patch)
tree25143600bc63d63f429c367f5868528bf984e44a /sys/pc98/cbus
parentf8bde85e2062bc43410f42137dd79e2359fc78c1 (diff)
downloadFreeBSD-src-bbb6994e507486b942d268c5f28330727a4d2e49.zip
FreeBSD-src-bbb6994e507486b942d268c5f28330727a4d2e49.tar.gz
Second phase of merge, get rid of more machine-independent-dependencies.
Get rid of pc98/pc98/pc98_device.h. Submitted by: The FreeBSD(98) Development Team
Diffstat (limited to 'sys/pc98/cbus')
-rw-r--r--sys/pc98/cbus/cbus.h48
-rw-r--r--sys/pc98/cbus/clock.c6
-rw-r--r--sys/pc98/cbus/fdc.c29
-rw-r--r--sys/pc98/cbus/pcrtc.c6
-rw-r--r--sys/pc98/cbus/sio.c46
5 files changed, 60 insertions, 75 deletions
diff --git a/sys/pc98/cbus/cbus.h b/sys/pc98/cbus/cbus.h
index 806c840..9630778 100644
--- a/sys/pc98/cbus/cbus.h
+++ b/sys/pc98/cbus/cbus.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.h 5.7 (Berkeley) 5/9/91
- * $Id: isa.h,v 1.18 1996/01/30 22:55:57 mpp Exp $
+ * $Id: pc98.h,v 1.1.1.1 1996/06/14 10:04:45 asami Exp $
*/
#ifndef _PC98_PC98_PC98_H_
@@ -182,4 +182,50 @@
*/
#define MADDRUNK -1
+#define PC98_VECTOR_SIZE (0x400)
+#define PC98_SYSTEM_PARAMETER_SIZE (0x230)
+
+#define PC98_SAVE_AREA(highreso_flag) (0xa1000)
+#define PC98_SAVE_AREA_ADDRESS (0x10)
+
+#define OFS_BOOT_boothowto 0x210
+#define OFS_BOOT_bootdev 0x214
+#define OFS_BOOT_cyloffset 0x218
+#define OFS_WD_BIOS_SECSIZE(i) (0x200+(i)*6)
+#define OFS_WD_BIOS_NCYL(i) (0x202+(i)*6)
+#define OFS_WD_BIOS_HEAD(i) (0x205+(i)*6)
+#define OFS_WD_BIOS_SEC(i) (0x204+(i)*6)
+#define OFS_pc98_machine_type 0x220
+#define OFS_epson_machine_id 0x224
+#define OFS_epson_bios_id 0x225
+#define OFS_epson_system_type 0x226
+
+#define M_NEC_PC98 0x0001
+#define M_EPSON_PC98 0x0002
+#define M_NOT_H98 0x0010
+#define M_H98 0x0020
+#define M_NOTE 0x0040
+#define M_NORMAL 0x1000
+#define M_HIGHRESO 0x2000
+#define M_8M 0x8000
+
+#if defined(KERNEL) && !defined(LOCORE)
+/* BIOS parameter block */
+extern unsigned char pc98_system_parameter[]; /* in locore.c */
+#define PC98_SYSTEM_PARAMETER(x) pc98_system_parameter[(x)-0x400]
+#define BOOT_boothowto (*(unsigned long*)(&pc98_system_parameter[OFS_BOOT_boothowto]))
+#define BOOT_bootdev (*(unsigned long*)(&pc98_system_parameter[OFS_BOOT_bootdev]))
+#define BOOT_cyloffset (*(unsigned long*)(&pc98_system_parameter[OFS_BOOT_cyloffset]))
+#define WD_BIOS_SECSIZE(i) (*(unsigned short*)(&pc98_system_parameter[OFS_WD_BIOS_SECSIZE(i)]))
+#define WD_BIOS_NCYL(i) (*(unsigned short*)(&pc98_system_parameter[OFS_WD_BIOS_NCYL(i)]))
+#define WD_BIOS_HEAD(i) (pc98_system_parameter[OFS_WD_BIOS_HEAD(i)])
+#define WD_BIOS_SEC(i) (pc98_system_parameter[OFS_WD_BIOS_SEC(i)])
+#define pc98_machine_type (*(unsigned long*)&pc98_system_parameter[OFS_pc98_machine_type])
+#define epson_machine_id (pc98_system_parameter[OFS_epson_machine_id])
+#define epson_bios_id (pc98_system_parameter[OFS_epson_bios_id])
+#define epson_system_type (pc98_system_parameter[OFS_epson_system_type])
+
+# define PC98_TYPE_CHECK(x) ((pc98_machine_type & (x)) == (x))
+#endif /* KERNEL */
+
#endif /* !_PC98_PC98_PC98_H_ */
diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c
index 166ba2a..b9547fd 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.2 1996/07/23 07:46:07 asami Exp $
+ * $Id: clock.c,v 1.3 1996/08/30 10:42:58 asami Exp $
*/
/*
@@ -46,7 +46,7 @@
/*
* modified for PC98
- * $Id: clock.c,v 1.2 1996/07/23 07:46:07 asami Exp $
+ * $Id: clock.c,v 1.3 1996/08/30 10:42:58 asami Exp $
*/
/*
@@ -72,7 +72,7 @@
#include <sys/syslog.h>
#include <pc98/pc98/icu.h>
#include <pc98/pc98/pc98.h>
-#include <pc98/pc98/pc98_device.h>
+#include <i386/isa/isa_device.h>
#include <pc98/pc98/timerreg.h>
#else
#include <i386/isa/icu.h>
diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c
index c4ec6ff..df520db 100644
--- a/sys/pc98/cbus/fdc.c
+++ b/sys/pc98/cbus/fdc.c
@@ -43,7 +43,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.3 1996/07/30 18:55:58 asami Exp $
+ * $Id: fd.c,v 1.4 1996/08/31 15:06:42 asami Exp $
*
*/
@@ -73,7 +73,7 @@
#include <sys/dkstat.h>
#ifdef PC98
#include <pc98/pc98/pc98.h>
-#include <pc98/pc98/pc98_device.h>
+#include <i386/isa/isa_device.h>
#include <pc98/pc98/fdreg.h>
#include <pc98/pc98/fdc.h>
#else
@@ -117,13 +117,8 @@ static struct kern_devconf kdc_fd[NFD] = { {
struct kern_devconf kdc_fdc[NFDC] = { {
0, 0, 0, /* filled in by kern_devconf.c */
-#ifdef PC98
- "fdc", 0, { MDDT_PC98, 0, "bio" },
- pc98_generic_externalize, 0, fdc_goaway, PC98_EXTERNALLEN,
-#else
"fdc", 0, { MDDT_ISA, 0, "bio" },
isa_generic_externalize, 0, fdc_goaway, ISA_EXTERNALLEN,
-#endif
0, /* parent */
0, /* parentdata */
DC_UNCONFIGURED, /* state */
@@ -152,11 +147,7 @@ fdc_registerdev(struct isa_device *dvp)
kdc_fdc[unit] = kdc_fdc[0];
kdc_fdc[unit].kdc_unit = unit;
-#ifdef PC98
- kdc_fdc[unit].kdc_parent = &kdc_nec0;
-#else
kdc_fdc[unit].kdc_parent = &kdc_isa0;
-#endif
kdc_fdc[unit].kdc_parentdata = dvp;
dev_attach(&kdc_fdc[unit]);
}
@@ -772,8 +763,8 @@ fdattach(struct isa_device *dev)
printf(" [dma is changed to #%d]", fdc->dmachan);
}
/* Acquire the DMA channel forever, The driver will do the rest */
- pc98_dma_acquire(fdc->dmachan);
- pc98_dmainit(fdc->dmachan, 128 << 3 /* XXX max secsize */);
+ isa_dma_acquire(fdc->dmachan);
+ isa_dmainit(fdc->dmachan, 128 << 3 /* XXX max secsize */);
fdc->state = DEVIDLE;
fdc_reset(fdc);
#else
@@ -788,11 +779,7 @@ fdattach(struct isa_device *dev)
TAILQ_INIT(&fdc->head);
/* check for each floppy drive */
-#ifdef PC98
- for (fdup = pc98_biotab_fdc; fdup->id_driver != 0; fdup++) {
-#else
for (fdup = isa_biotab_fdc; fdup->id_driver != 0; fdup++) {
-#endif
if (fdup->id_iobase != dev->id_iobase)
continue;
fdu = fdup->id_unit;
@@ -1869,11 +1856,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
#ifdef EPSON_NRDISK
if (fdu != nrdu) {
#endif /* EPSON_NRDISK */
-#ifdef PC98
- pc98_dmastart(bp->b_flags, bp->b_un.b_addr+fd->skip,
-#else
isa_dmastart(bp->b_flags, bp->b_un.b_addr+fd->skip,
-#endif
format ? bp->b_bcount : fdblk, fdc->dmachan);
blknum = (unsigned long)bp->b_blkno*DEV_BSIZE/fdblk
+ fd->skip/fdblk;
@@ -2003,11 +1986,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
#ifdef EPSON_NRDISK
if (fdu != nrdu) {
#endif /* EPSON_NRDISK */
-#ifdef PC98
- pc98_dmadone(bp->b_flags, bp->b_un.b_addr+fd->skip,
-#else
isa_dmadone(bp->b_flags, bp->b_un.b_addr+fd->skip,
-#endif
format ? bp->b_bcount : fdblk, fdc->dmachan);
#ifdef EPSON_NRDISK
}
diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c
index 166ba2a..b9547fd 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.2 1996/07/23 07:46:07 asami Exp $
+ * $Id: clock.c,v 1.3 1996/08/30 10:42:58 asami Exp $
*/
/*
@@ -46,7 +46,7 @@
/*
* modified for PC98
- * $Id: clock.c,v 1.2 1996/07/23 07:46:07 asami Exp $
+ * $Id: clock.c,v 1.3 1996/08/30 10:42:58 asami Exp $
*/
/*
@@ -72,7 +72,7 @@
#include <sys/syslog.h>
#include <pc98/pc98/icu.h>
#include <pc98/pc98/pc98.h>
-#include <pc98/pc98/pc98_device.h>
+#include <i386/isa/isa_device.h>
#include <pc98/pc98/timerreg.h>
#else
#include <i386/isa/icu.h>
diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c
index 461a4e6..98feda2 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.2 1996/07/23 07:46:38 asami Exp $
+ * $Id: sio.c,v 1.3 1996/08/31 15:07:20 asami Exp $
*/
#include "opt_comconsole.h"
@@ -140,7 +140,7 @@
#ifdef PC98
#include <pc98/pc98/pc98.h>
#include <pc98/pc98/icu.h>
-#include <pc98/pc98/pc98_device.h>
+#include <i386/isa/isa_device.h>
#include <pc98/pc98/sioreg.h>
#include <pc98/pc98/ic/i8251.h>
#include <pc98/pc98/ic/ns16550.h>
@@ -597,15 +597,9 @@ static struct speedtab comspeedtab[] = {
static struct kern_devconf kdc_sio[NSIO] = { {
0, 0, 0, /* filled in by dev_attach */
-#ifdef PC98
- driver_name, 0, { MDDT_PC98, 0, "tty" },
- pc98_generic_externalize, 0, 0, PC98_EXTERNALLEN,
- &kdc_nec0, /* parent */
-#else
driver_name, 0, { MDDT_ISA, 0, "tty" },
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
&kdc_isa0, /* parent */
-#endif
0, /* parentdata */
DC_UNCONFIGURED, /* state */
"Serial port",
@@ -748,22 +742,14 @@ sioregisterdev(id)
/*
* If already registered, don't try to re-register.
*/
-#ifdef PC98
- if (kdc_sio[unit].kdc_pc98)
-#else
if (kdc_sio[unit].kdc_isa)
-#endif
return;
if (unit != 0)
kdc_sio[unit] = kdc_sio[0];
kdc_sio[unit].kdc_state = DC_UNCONFIGURED;
kdc_sio[unit].kdc_description = "Serial port";
kdc_sio[unit].kdc_unit = unit;
-#ifdef PC98
- kdc_sio[unit].kdc_pc98 = id;
-#else
kdc_sio[unit].kdc_isa = id;
-#endif
dev_attach(&kdc_sio[unit]);
}
@@ -797,11 +783,7 @@ sioprobe(dev)
* from any used port that shares the interrupt vector.
* XXX the gate enable is elsewhere for some multiports.
*/
-#ifdef PC98
- for (xdev = pc98_devtab_tty; xdev->id_driver != NULL; xdev++)
-#else
for (xdev = isa_devtab_tty; xdev->id_driver != NULL; xdev++)
-#endif
if (xdev->id_driver == &siodriver && xdev->id_enabled)
#ifdef PC98
if (IS_PC98IN(xdev->id_iobase))
@@ -849,7 +831,7 @@ sioprobe(dev)
COM_INT_DISABLE
tmp = ( inb( iod.ctrl ) & ~(IEN_Rx|IEN_TxEMP|IEN_Tx));
outb( iod.ctrl, tmp|IEN_TxEMP );
- ret = pc98_irq_pending(dev) ? 4 : 0;
+ ret = isa_irq_pending(dev) ? 4 : 0;
outb( iod.ctrl, tmp );
COM_INT_ENABLE
break;
@@ -879,11 +861,7 @@ sioprobe(dev)
mcr_image = MCR_IENABLE;
#ifdef COM_MULTIPORT
if (COM_ISMULTIPORT(dev)) {
-#ifdef PC98
- idev = find_pc98dev(pc98_devtab_tty, &siodriver,
-#else
idev = find_isadev(isa_devtab_tty, &siodriver,
-#endif
COM_MPMASTER(dev));
if (idev == NULL) {
printf("sio%d: master device %d not configured\n",
@@ -1001,20 +979,11 @@ sioprobe(dev)
failures[2] = inb(iobase + com_mcr) - mcr_image;
DELAY(10000); /* Some internal modems need this time */
if (idev->id_irq != 0)
-#ifdef PC98
- failures[3] = pc98_irq_pending(idev) ? 0 : 1;
-#else
failures[3] = isa_irq_pending(idev) ? 0 : 1;
-#endif
failures[4] = (inb(iobase + com_iir) & IIR_IMASK) - IIR_TXRDY;
DELAY(1000); /* XXX */
-#ifdef PC98
- if (idev->id_irq != 0)
- failures[5] = pc98_irq_pending(idev) ? 1 : 0;
-#else
if (idev->id_irq != 0)
failures[5] = isa_irq_pending(idev) ? 1 : 0;
-#endif
failures[6] = (inb(iobase + com_iir) & IIR_IMASK) - IIR_NOPEND;
/*
@@ -1030,13 +999,8 @@ sioprobe(dev)
outb(iobase + com_cfcr, CFCR_8BITS); /* dummy to avoid bus echo */
failures[7] = inb(iobase + com_ier);
DELAY(1000); /* XXX */
-#ifdef PC98
- if (idev->id_irq != 0)
- failures[8] = pc98_irq_pending(idev) ? 1 : 0;
-#else
if (idev->id_irq != 0)
failures[8] = isa_irq_pending(idev) ? 1 : 0;
-#endif
failures[9] = (inb(iobase + com_iir) & IIR_IMASK) - IIR_NOPEND;
enable_intr();
@@ -1384,11 +1348,7 @@ determined_type: ;
if (unit == COM_MPMASTER(isdp))
printf(" master");
printf(")");
-#ifdef PC98
- com->no_irq = find_pc98dev(pc98_devtab_tty, &siodriver,
-#else
com->no_irq = find_isadev(isa_devtab_tty, &siodriver,
-#endif
COM_MPMASTER(isdp))->id_irq == 0;
}
#endif /* COM_MULTIPORT */
OpenPOWER on IntegriCloud