aboutsummaryrefslogtreecommitdiff
path: root/sys/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/vm_machdep.c18
-rw-r--r--sys/i386/include/clock.h6
-rw-r--r--sys/i386/isa/aic6360.c27
-rw-r--r--sys/i386/isa/aic_98.h93
-rw-r--r--sys/i386/isa/atapi.c28
-rw-r--r--sys/i386/isa/atapi.h13
-rw-r--r--sys/i386/isa/icu.s7
-rw-r--r--sys/i386/isa/kbdtables.h143
-rw-r--r--sys/i386/isa/matcd/creative.h9
-rw-r--r--sys/i386/isa/matcd/options.h11
-rw-r--r--sys/i386/isa/pcibus.c6
-rw-r--r--sys/i386/isa/prof_machdep.c6
-rw-r--r--sys/i386/isa/random_machdep.c6
-rw-r--r--sys/i386/isa/sound/dev_table.h10
-rw-r--r--sys/i386/isa/sound/local.h12
-rw-r--r--sys/i386/isa/sound/sound_calls.h6
-rw-r--r--sys/i386/isa/sound/sound_config.h24
-rw-r--r--sys/i386/isa/timerreg.h19
-rw-r--r--sys/i386/isa/vector.s20
-rw-r--r--sys/i386/pci/pci_bus.c6
-rw-r--r--sys/i386/pci/pci_cfgreg.c6
-rw-r--r--sys/i386/pci/pci_pir.c6
22 files changed, 464 insertions, 18 deletions
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c
index 44b799d93256..62ff78410351 100644
--- a/sys/i386/i386/vm_machdep.c
+++ b/sys/i386/i386/vm_machdep.c
@@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
- * $Id: vm_machdep.c,v 1.69 1996/09/28 22:37:43 dyson Exp $
+ * $Id: vm_machdep.c,v 1.70 1996/10/15 03:16:33 dyson Exp $
*/
#include "npx.h"
@@ -66,7 +66,11 @@
#include <sys/user.h>
+#ifdef PC98
+#include <pc98/pc98/pc98.h>
+#else
#include <i386/isa/isa.h>
+#endif
#ifdef BOUNCE_BUFFERS
static vm_offset_t
@@ -90,7 +94,11 @@ static int bounceallocarraysize;
static unsigned *bounceallocarray;
static int bouncefree;
+#if defined(PC98) && defined (EPSON_BOUNCEDMA)
+#define SIXTEENMEG (3840*4096) /* 15MB boundary */
+#else
#define SIXTEENMEG (4096*4096)
+#endif
#define MAXBKVA 1024
int maxbkva = MAXBKVA*PAGE_SIZE;
@@ -748,7 +756,7 @@ cpu_reset() {
* to do the reset here would then end up in no man's land.
*/
-#ifndef BROKEN_KEYBOARD_RESET
+#if !defined(BROKEN_KEYBOARD_RESET) && !defined(PC98)
outb(IO_KBD + 4, 0xFE);
DELAY(500000); /* wait 0.5 sec to see if that did it */
printf("Keyboard reset did not work, attempting CPU shutdown\n");
@@ -761,6 +769,12 @@ cpu_reset() {
/* "good night, sweet prince .... <THUNK!>" */
invltlb();
/* NOTREACHED */
+#ifdef PC98
+ asm(" cli ");
+ outb(0x37, 0x0f); /* SHUT 0 = 0 */
+ outb(0x37, 0x0b); /* SHUT 1 = 0 */
+ outb(0xf0, 0x00); /* reset port */
+#endif
while(1);
}
diff --git a/sys/i386/include/clock.h b/sys/i386/include/clock.h
index f20902f59128..0f3427febcc8 100644
--- a/sys/i386/include/clock.h
+++ b/sys/i386/include/clock.h
@@ -3,7 +3,7 @@
* Garrett Wollman, September 1994.
* This file is in the public domain.
*
- * $Id: clock.h,v 1.19 1996/10/17 17:31:25 bde Exp $
+ * $Id: clock.h,v 1.20 1996/10/25 13:01:08 bde Exp $
*/
#ifndef _MACHINE_CLOCK_H_
@@ -65,7 +65,11 @@ int sysbeep __P((int pitch, int period));
#ifdef CLOCK_HAIR
+#ifdef PC98
+#include <pc98/pc98/pc98.h> /* XXX */
+#else
#include <i386/isa/isa.h> /* XXX */
+#endif
#include <i386/isa/timerreg.h> /* XXX */
static __inline u_int
diff --git a/sys/i386/isa/aic6360.c b/sys/i386/isa/aic6360.c
index d9de4a6836c0..46129e75ae7a 100644
--- a/sys/i386/isa/aic6360.c
+++ b/sys/i386/isa/aic6360.c
@@ -31,7 +31,7 @@
*/
/*
- * $Id: aic6360.c,v 1.22 1996/09/06 23:07:07 phk Exp $
+ * $Id: aic6360.c,v 1.23 1996/10/15 19:22:04 bde Exp $
*
* Acknowledgements: Many of the algorithms used in this driver are
* inspired by the work of Julian Elischer (julian@tfs.com) and
@@ -48,6 +48,10 @@
*/
/*
+ * PC-9801-100/AHA-1030P support by URATA S.
+ */
+
+/*
* A few customizable items:
*/
@@ -183,6 +187,9 @@
#define ST_MASK 0x3e /* bit 0,6,7 is reserved */
/* AIC6360 definitions */
+#ifdef PC98
+#include <i386/isa/aic_98.h>
+#else
#define SCSISEQ (iobase + 0x00) /* SCSI sequence control */
#define SXFRCTL0 (iobase + 0x01) /* SCSI transfer control 0 */
#define SXFRCTL1 (iobase + 0x02) /* SCSI transfer control 1 */
@@ -222,6 +229,7 @@
#define STACK (iobase + 0x1d) /* Stack */
#define TEST (iobase + 0x1e) /* Test register */
#define ID (iobase + 0x1f) /* ID register */
+#endif
#define IDSTRING "(C)1991ADAPTECAIC6360 "
@@ -609,6 +617,9 @@ static struct aic_data { /* One of these per adapter */
u_char imess[AIC_MAX_MSG_LEN + 1];
u_char *imp; /* Message pointer (for multibyte messages) */
u_char imlen;
+#ifdef PC98
+ int *aicport; /* I/O port information */
+#endif
} *aicdata[NAIC];
#define AIC_SHOWACBS 0x01
@@ -723,6 +734,15 @@ aicprobe(dev)
bzero(aic, sizeof(struct aic_data));
aicdata[unit] = aic;
aic->iobase = dev->id_iobase;
+#ifdef PC98
+ if (AIC_TYPE98(dev->id_flags) == AIC98_100) {
+ /* PC-9801-100 */
+ aic->aicport = aicport_100;
+ } else {
+ /* generic card */
+ aic->aicport = aicport_generic;
+ }
+#endif
if (aic_find(aic) != 0) {
aicdata[unit] = NULL;
@@ -730,6 +750,11 @@ aicprobe(dev)
return 0;
}
aicunit++;
+
+#ifdef PC98
+ if (AIC_TYPE98(dev->id_flags) == AIC98_100)
+ return 0x40;
+#endif
return 0x20;
}
diff --git a/sys/i386/isa/aic_98.h b/sys/i386/isa/aic_98.h
new file mode 100644
index 000000000000..8a3110113641
--- /dev/null
+++ b/sys/i386/isa/aic_98.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) KATO Takenori, 1996. 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 as
+ * the first lines of this file unmodified.
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __PC98_PC98_AIC_98_H__
+#define __PC98_PC98_AIC_98_H__
+
+
+
+/* generic card */
+static int aicport_generic[32] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
+};
+
+/* PC-9801-100 */
+static int aicport_100[32] = {
+ 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e,
+ 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
+ 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e,
+ 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e
+};
+
+#define AIC98_GENERIC 0x00
+#define AIC98_100 0x01
+
+#define AIC_TYPE98(x) ((x >> 16) & 0xff)
+
+#define SCSISEQ (iobase + aic->aicport[0x00]) /* SCSI sequence control */
+#define SXFRCTL0 (iobase + aic->aicport[0x01]) /* SCSI transfer control 0 */
+#define SXFRCTL1 (iobase + aic->aicport[0x02]) /* SCSI transfer control 1 */
+#define SCSISIGI (iobase + aic->aicport[0x03]) /* SCSI signal in */
+#define SCSISIGO (iobase + aic->aicport[0x03]) /* SCSI signal out */
+#define SCSIRATE (iobase + aic->aicport[0x04]) /* SCSI rate control */
+#define SCSIID (iobase + aic->aicport[0x05]) /* SCSI ID */
+#define SELID (iobase + aic->aicport[0x05]) /* Selection/Reselection ID */
+#define SCSIDAT (iobase + aic->aicport[0x06]) /* SCSI Latched Data */
+#define SCSIBUS (iobase + aic->aicport[0x07]) /* SCSI Data Bus*/
+#define STCNT0 (iobase + aic->aicport[0x08]) /* SCSI transfer count */
+#define STCNT1 (iobase + aic->aicport[0x09)
+#define STCNT2 (iobase + aic->aicport[0x0a)
+#define CLRSINT0 (iobase + aic->aicport[0x0b]) /* Clear SCSI interrupts 0 */
+#define SSTAT0 (iobase + aic->aicport[0x0b]) /* SCSI interrupt status 0 */
+#define CLRSINT1 (iobase + aic->aicport[0x0c]) /* Clear SCSI interrupts 1 */
+#define SSTAT1 (iobase + aic->aicport[0x0c]) /* SCSI status 1 */
+#define SSTAT2 (iobase + aic->aicport[0x0d]) /* SCSI status 2 */
+#define SCSITEST (iobase + aic->aicport[0x0e]) /* SCSI test control */
+#define SSTAT3 (iobase + aic->aicport[0x0e]) /* SCSI status 3 */
+#define CLRSERR (iobase + aic->aicport[0x0f]) /* Clear SCSI errors */
+#define SSTAT4 (iobase + aic->aicport[0x0f]) /* SCSI status 4 */
+#define SIMODE0 (iobase + aic->aicport[0x10]) /* SCSI interrupt mode 0 */
+#define SIMODE1 (iobase + aic->aicport[0x11]) /* SCSI interrupt mode 1 */
+#define DMACNTRL0 (iobase + aic->aicport[0x12]) /* DMA control 0 */
+#define DMACNTRL1 (iobase + aic->aicport[0x13]) /* DMA control 1 */
+#define DMASTAT (iobase + aic->aicport[0x14]) /* DMA status */
+#define FIFOSTAT (iobase + aic->aicport[0x15]) /* FIFO status */
+#define DMADATA (iobase + aic->aicport[0x16]) /* DMA data */
+#define DMADATAL (iobase + aic->aicport[0x16]) /* DMA data low byte */
+#define DMADATAH (iobase + aic->aicport[0x17]) /* DMA data high byte */
+#define BRSTCNTRL (iobase + aic->aicport[0x18]) /* Burst Control */
+#define DMADATALONG (iobase + aic->aicport[0x18)
+#define PORTA (iobase + aic->aicport[0x1a]) /* Port A */
+#define PORTB (iobase + aic->aicport[0x1b]) /* Port B */
+#define REV (iobase + aic->aicport[0x1c]) /* Revision (001 for 6360) */
+#define STACK (iobase + aic->aicport[0x1d]) /* Stack */
+#define TEST (iobase + aic->aicport[0x1e]) /* Test register */
+#define ID (iobase + aic->aicport[0x1f]) /* ID register */
+#endif
diff --git a/sys/i386/isa/atapi.c b/sys/i386/isa/atapi.c
index 8fde197d565a..2445dcb98a8f 100644
--- a/sys/i386/isa/atapi.c
+++ b/sys/i386/isa/atapi.c
@@ -358,7 +358,12 @@ static struct atapi_params *atapi_probe (int port, int unit)
{
struct atapi_params *ap;
char tb [DEV_BSIZE];
+#ifdef PC98
+ int cnt;
+ outb(0x432,unit%2);
+ print(("unit = %d,select %d\n",unit,unit%2));
+#endif
/* Wait for controller not busy. */
outb (port + AR_DRIVE, unit ? ARD_DRIVE1 : ARD_DRIVE0);
if (atapi_wait (port, 0) < 0) {
@@ -368,8 +373,20 @@ static struct atapi_params *atapi_probe (int port, int unit)
}
/* Issue ATAPI IDENTIFY command. */
+#ifdef PC98
+ outb (port + AR_DRIVE, unit/2 ? ARD_DRIVE1 : ARD_DRIVE0);
+
+ /* Wait for DRQ deassert. */
+ for (cnt=2000; cnt>0; --cnt)
+ if (! (inb (0x640 + AR_STATUS) & ARS_DRQ))
+ break;
+
+ outb (port + AR_COMMAND, ATAPIC_IDENTIFY);
+ DELAY(500);
+#else
outb (port + AR_DRIVE, unit ? ARD_DRIVE1 : ARD_DRIVE0);
outb (port + AR_COMMAND, ATAPIC_IDENTIFY);
+#endif
/* Check that device is present. */
if (inb (port + AR_STATUS) == 0xff) {
@@ -550,7 +567,13 @@ int atapi_start_cmd (struct atapi *ata, struct atapicmd *ac)
ac->result.error = 0;
ac->result.status = 0;
+#ifdef PC98
+ outb(0x432,(ac->unit)%2);
+ print(("(ac->unit) = %d,select %d (2) \n",(ac->unit),(ac->unit)%2));
+ outb (ata->port + AR_DRIVE, (ac->unit)/2 ? ARD_DRIVE1 : ARD_DRIVE0);
+#else
outb (ata->port + AR_DRIVE, ac->unit ? ARD_DRIVE1 : ARD_DRIVE0);
+#endif
if (atapi_wait (ata->port, 0) < 0) {
printf ("atapi%d.%d: controller not ready for cmd\n",
ata->ctrlr, ac->unit);
@@ -632,6 +655,11 @@ int atapi_intr (int ctrlr)
struct atapi *ata = atapitab + ctrlr;
struct atapicmd *ac = ata->queue;
+#ifdef PC98
+ outb(0x432,(ac->unit)%2);
+ print(("atapi_intr:(ac->unit)= %d,select %d\n",ac->unit,(ac->unit)%2));
+#endif
+
if (! ac) {
printf ("atapi%d: stray interrupt\n", ata->ctrlr);
return (0);
diff --git a/sys/i386/isa/atapi.h b/sys/i386/isa/atapi.h
index d43241be8693..5ff3d3416bb3 100644
--- a/sys/i386/isa/atapi.h
+++ b/sys/i386/isa/atapi.h
@@ -17,6 +17,18 @@
/*
* Disk Controller ATAPI register definitions.
*/
+#ifdef PC98
+#define AR_DATA 0x0 /* RW - data register (16 bits) */
+#define AR_ERROR 0x2 /* R - error register */
+#define AR_FEATURES 0x2 /* W - features */
+#define AR_IREASON 0x4 /* RW - interrupt reason */
+#define AR_TAG 0x6 /* - reserved for SAM TAG byte */
+#define AR_CNTLO 0x8 /* RW - byte count, low byte */
+#define AR_CNTHI 0xa /* RW - byte count, high byte */
+#define AR_DRIVE 0xc /* RW - drive select */
+#define AR_COMMAND 0xe /* W - command register */
+#define AR_STATUS 0xe /* R - immediate status */
+#else
#define AR_DATA 0x0 /* RW - data register (16 bits) */
#define AR_ERROR 0x1 /* R - error register */
#define AR_FEATURES 0x1 /* W - features */
@@ -27,6 +39,7 @@
#define AR_DRIVE 0x6 /* RW - drive select */
#define AR_COMMAND 0x7 /* W - command register */
#define AR_STATUS 0x7 /* R - immediate status */
+#endif
/*
* Status register bits
diff --git a/sys/i386/isa/icu.s b/sys/i386/isa/icu.s
index 1107c13b4f88..567daf112550 100644
--- a/sys/i386/isa/icu.s
+++ b/sys/i386/isa/icu.s
@@ -36,7 +36,7 @@
*
* @(#)icu.s 7.2 (Berkeley) 5/21/91
*
- * $Id: icu.s,v 1.24 1996/03/12 05:44:25 nate Exp $
+ * $Id: icu.s,v 1.25 1996/05/31 01:08:07 peter Exp $
*/
/*
@@ -278,6 +278,7 @@ vec0:
MEXITCOUNT
jmp _Xintr0 /* XXX might need _Xfastintr0 */
+#ifndef PC98
ALIGN_TEXT
vec8:
popl %eax
@@ -287,6 +288,7 @@ vec8:
cli
MEXITCOUNT
jmp _Xintr8 /* XXX might need _Xfastintr8 */
+#endif
#define BUILD_VEC(irq_num) \
ALIGN_TEXT ; \
@@ -301,6 +303,9 @@ __CONCAT(vec,irq_num): ; \
BUILD_VEC(5)
BUILD_VEC(6)
BUILD_VEC(7)
+#ifdef PC98
+ BUILD_VEC(8)
+#endif
BUILD_VEC(9)
BUILD_VEC(10)
BUILD_VEC(11)
diff --git a/sys/i386/isa/kbdtables.h b/sys/i386/isa/kbdtables.h
index 1c832cb9abf9..9f69ee4328ac 100644
--- a/sys/i386/isa/kbdtables.h
+++ b/sys/i386/isa/kbdtables.h
@@ -25,11 +25,150 @@
* (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: kbdtables.h,v 1.30 1995/12/10 13:38:53 phk Exp $
+ * $Id: kbdtables.h,v 1.31 1996/01/25 16:37:20 ache Exp $
*/
#define SET8 0x80 /* set eight bit on */
+#ifdef PC98
+/* PC-9801 keymap by kuribo@isl.melco.co.jp */
+static keymap_t key_map = { 0x80, /* PC98 keymap */
+/* alt
+ * scan cntrl alt alt cntrl
+ * code base shift cntrl shift alt shift cntrl shift spcl flgs
+ * ---------------------------------------------------------------------------
+ */
+/* sc=00 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, DBG, 0x1B, 0x02, 0x00,
+/* sc=01 */ '1', '!', '!', '!', '1', '!', '!', '!', 0x00, 0x00,
+/* sc=02 */ '2', '\"', 0x1A, 0x1A, '2', '@', 0x00, 0x00, 0x00, 0x00,
+/* sc=03 */ '3', '#', 0x1B, 0x1B, '3', '#', 0x1B, 0x1B, 0x00, 0x00,
+/* sc=04 */ '4', '$', 0x1C, 0x1C, '4', '$', 0x1C, 0x1C, 0x00, 0x00,
+/* sc=05 */ '5', '%', 0x1D, 0x1D, '5', '%', 0x1D, 0x1D, 0x00, 0x00,
+/* sc=06 */ '6', '&', 0x1E, 0x1E, '6', '^', 0x1E, 0x1E, 0x00, 0x00,
+/* sc=07 */ '7', '\'', 0x1F, 0x1F, '7', '&', '&', '&', 0x00, 0x00,
+/* sc=08 */ '8', '(', 0x7F, 0x7F, '8', '*', 0x08, 0x08, 0x00, 0x00,
+/* sc=09 */ '9', ')', '9', '9', '9', '(', '(', '(', 0x00, 0x00,
+/* sc=0a */ '0', NOP, '0', '0', '0', ')', ')', ')', 0x40, 0x00,
+/* sc=0b */ '-', '=', '-', '-', '-', '_', 0x1F, 0x1F, 0x00, 0x00,
+/* sc=0c */ '^', '`', 0x1E, 0x1E, '=', '+', '+', '+', 0x00, 0x00,
+/* sc=0d */ '\\', '|', 0x1C, 0x1C, '\\', '|', 0x1C, 0x1C, 0x00, 0x00,
+/* sc=0e */ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00,
+/* sc=0f */ '\t', '\t', '\t', '\t', '\t', '\t', '\t', '\t', 0x00, 0x00,
+/* sc=10 */ 'q', 'Q', 0x11, 0x11, 'q', 'Q', 0x11, 0x11, 0x00, 0x01,
+/* sc=11 */ 'w', 'W', 0x17, 0x17, 'w', 'W', 0x17, 0x17, 0x00, 0x01,
+/* sc=12 */ 'e', 'E', 0x05, 0x05, 'e', 'E', 0x05, 0x05, 0x00, 0x01,
+/* sc=13 */ 'r', 'R', 0x12, 0x12, 'r', 'R', 0x12, 0x12, 0x00, 0x01,
+/* sc=14 */ 't', 'T', 0x14, 0x14, 't', 'T', 0x14, 0x14, 0x00, 0x01,
+/* sc=15 */ 'y', 'Y', 0x19, 0x19, 'y', 'Y', 0x19, 0x19, 0x00, 0x01,
+/* sc=16 */ 'u', 'U', 0x15, 0x15, 'u', 'U', 0x15, 0x15, 0x00, 0x01,
+/* sc=17 */ 'i', 'I', 0x09, 0x09, 'i', 'I', 0x09, 0x09, 0x00, 0x01,
+/* sc=18 */ 'o', 'O', 0x0F, 0x0F, 'o', 'O', 0x0F, 0x0F, 0x00, 0x01,
+/* sc=19 */ 'p', 'P', 0x10, 0x10, 'p', 'P', 0x10, 0x10, 0x00, 0x01,
+/* sc=1a */ '@', '~', 0x00, 0x00, '[', '{', 0x1B, 0x1B, 0x00, 0x00,
+/* sc=1b */ '[', '{', 0x1B, 0x1B, ']', '}', 0x1D, 0x1D, 0x00, 0x00,
+/* sc=1c */ '\r', '\r', '\n', '\n', '\r', '\r', '\n', '\n', 0x00, 0x00,
+/* sc=1d */ 'a', 'A', 0x01, 0x01, 'a', 'A', 0x01, 0x01, 0x00, 0x01,
+/* sc=1e */ 's', 'S', 0x13, 0x13, 's', 'S', 0x13, 0x13, 0x00, 0x01,
+/* sc=1f */ 'd', 'D', 0x04, 0x04, 'd', 'D', 0x04, 0x04, 0x00, 0x01,
+/* sc=20 */ 'f', 'F', 0x06, 0x06, 'f', 'F', 0x06, 0x06, 0x00, 0x01,
+/* sc=21 */ 'g', 'G', 0x07, 0x07, 'g', 'G', 0x07, 0x07, 0x00, 0x01,
+/* sc=22 */ 'h', 'H', 0x08, 0x08, 'h', 'H', 0x08, 0x08, 0x00, 0x01,
+/* sc=23 */ 'j', 'J', '\n', '\n', 'j', 'J', '\n', '\n', 0x00, 0x01,
+/* sc=24 */ 'k', 'K', 0x0B, 0x0B, 'k', 'K', 0x0B, 0x0B, 0x00, 0x01,
+/* sc=25 */ 'l', 'L', 0x0C, 0x0C, 'l', 'L', 0x0C, 0x0C, 0x00, 0x01,
+/* sc=26 */ ';', '+', ';', ';', ';', ':', ';', ';', 0x00, 0x00,
+/* sc=27 */ ':', '*', ':', ':', '\'', '\"', '\'', '\'', 0x00, 0x00,
+/* sc=28 */ ']', '}', 0x1D, 0x1D, '`', '~', '~', '~', 0x00, 0x00,
+/* sc=29 */ 'z', 'Z', 0x1A, 0x1A, 'z', 'Z', 0x1A, 0x1A, 0x00, 0x01,
+/* sc=2a */ 'x', 'X', 0x18, 0x18, 'x', 'X', 0x18, 0x18, 0x00, 0x01,
+/* sc=2b */ 'c', 'C', 0x03, 0x03, 'c', 'C', 0x03, 0x03, 0x00, 0x01,
+/* sc=2c */ 'v', 'V', 0x16, 0x16, 'v', 'V', 0x16, 0x16, 0x00, 0x01,
+/* sc=2d */ 'b', 'B', 0x02, 0x02, 'b', 'B', 0x02, 0x02, 0x00, 0x01,
+/* sc=2e */ 'n', 'N', 0x0E, 0x0E, 'n', 'N', 0x0E, 0x0E, 0x00, 0x01,
+/* sc=2f */ 'm', 'M', '\r', '\r', 'm', 'M', '\r', '\r', 0x00, 0x01,
+/* sc=30 */ ',', '<', '<', '<', ',', '<', '<', '<', 0x00, 0x00,
+/* sc=31 */ '.', '>', '>', '>', '.', '>', '>', '>', 0x00, 0x00,
+/* sc=32 */ '/', '?', 0x7F, 0x7F, '/', '?', 0x7F, 0x7F, 0x00, 0x00,
+/* sc=33 */ NOP, '_', 0x1F, 0x1F, '\\', '|', 0x1C, 0x1C, 0x80, 0x00,
+/* sc=34 */ ' ', ' ', 0x00, 0x00, ' ', ' ', 0x00, 0x00, 0x00, 0x00,
+/* sc=35 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00,
+/* sc=36 */ F(51), F(51), F(51), F(51), F(51), F(51), F(51), F(51), 0xFF, 0x00,
+/* sc=37 */ F(59), F(59), F(59), F(59), F(59), F(59), F(59), F(59), 0xFF, 0x00,
+/* sc=38 */ F(60), F(60), F(60), F(60), F(60), F(60), F(60), F(60), 0xFF, 0x00,
+/* sc=39 */ 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, RBT, RBT, 0x03, 0x02,
+/* sc=3a */ F(50), F(50), F(50), F(50), F(50), F(50), F(50), F(50), 0xFF, 0x00,
+/* sc=3b */ F(53), F(53), F(53), F(53), F(53), F(53), F(53), F(53), 0xFF, 0x00,
+/* sc=3c */ F(55), F(55), F(55), F(55), F(55), F(55), F(55), F(55), 0xFF, 0x00,
+/* sc=3d */ F(58), F(58), F(58), F(58), F(58), F(58), F(58), F(58), 0xFF, 0x00,
+/* sc=3e */ F(49), F(49), F(49), F(49), F(49), F(49), F(49), F(49), 0xFF, 0x00,
+/* sc=3f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=40 */ '-', '-', '-', '-', '-', '-', '-', '-', 0x00, 0x00,
+/* sc=41 */ '/', '/', '/', '/', '/', '/', '/', '/', 0x00, 0x00,
+/* sc=42 */ '7', '7', '7', '7', '7', '7', '7', '7', 0x00, 0x00,
+/* sc=43 */ '8', '8', '8', '8', '8', '8', '8', '8', 0x00, 0x00,
+/* sc=44 */ '9', '9', '9', '9', '9', '9', '9', '9', 0x00, 0x00,
+/* sc=45 */ '*', '*', '*', '*', '*', '*', '*', '*', 0x00, 0x00,
+/* sc=46 */ '4', '4', '4', '4', '4', '4', '4', '4', 0x00, 0x00,
+/* sc=47 */ '5', '5', '5', '5', '5', '5', '5', '5', 0x00, 0x00,
+/* sc=48 */ '6', '6', '6', '6', '6', '6', '6', '6', 0x00, 0x00,
+/* sc=49 */ '+', '+', '+', '+', '+', '+', '+', '+', 0x00, 0x00,
+/* sc=4a */ '1', '1', '1', '1', '1', '1', '1', '1', 0x00, 0x00,
+/* sc=4b */ '2', '2', '2', '2', '2', '2', '2', '2', 0x00, 0x00,
+/* sc=4c */ '3', '3', '3', '3', '3', '3', '3', '3', 0x00, 0x00,
+/* sc=4d */ '=', '=', '=', '=', '=', '=', '=', '=', 0x00, 0x00,
+/* sc=4e */ '0', '0', '0', '0', '0', '0', '0', '0', 0x00, 0x00,
+/* sc=4f */ ',', ',', ',', ',', ',', ',', ',', ',', 0x00, 0x00,
+/* sc=50 */ '.', '.', '.', '.', '.', '.', '.', '.', 0x00, 0x00,
+/* sc=51 */ 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00,
+/* sc=52 */ F(11), F(23), F(35), F(47), S(11), S(11), S(11), S(11), 0xFF, 0x00,
+/* sc=53 */ F(12), F(24), F(36), F(48), S(12), S(12), S(12), S(12), 0xFF, 0x00,
+/* sc=54 */ SLK, SLK, SLK, SLK, SLK, SLK, SLK, SLK, 0xFF, 0x00,
+/* sc=55 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=56 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=57 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=58 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=59 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=5a */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=5b */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=5c */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=5d */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=5e */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=5f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=60 */ F(57), F(57), F(57), F(57), F(57), F(57), F(57), F(57), 0xFF, 0x00,
+/* sc=61 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=62 */ F( 1), F(13), F(25), F(37), S( 1), S( 1), S( 1), S( 1), 0xFF, 0x00,
+/* sc=63 */ F( 2), F(14), F(26), F(38), S( 2), S( 2), S( 2), S( 2), 0xFF, 0x00,
+/* sc=64 */ F( 3), F(15), F(27), F(39), S( 3), S( 3), S( 3), S( 3), 0xFF, 0x00,
+/* sc=65 */ F( 4), F(16), F(28), F(40), S( 4), S( 4), S( 4), S( 4), 0xFF, 0x00,
+/* sc=66 */ F( 5), F(17), F(29), F(41), S( 5), S( 5), S( 5), S( 5), 0xFF, 0x00,
+/* sc=67 */ F( 6), F(18), F(30), F(42), S( 6), S( 6), S( 6), S( 6), 0xFF, 0x00,
+/* sc=68 */ F( 7), F(19), F(31), F(43), S( 7), S( 7), S( 7), S( 7), 0xFF, 0x00,
+/* sc=69 */ F( 8), F(20), F(32), F(44), S( 8), S( 8), S( 8), S( 8), 0xFF, 0x00,
+/* sc=6a */ F( 9), F(21), F(33), F(45), S( 9), S( 9), S( 9), S( 9), 0xFF, 0x00,
+/* sc=6b */ F(10), F(22), F(34), F(46), S(10), S(10), S(10), S(10), 0xFF, 0x00,
+/* sc=6c */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=6d */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=6e */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=6f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=70 */ LSH, LSH, LSH, LSH, LSH, LSH, LSH, LSH, 0xFF, 0x00,
+/* sc=71 */ CLK, CLK, CLK, CLK, CLK, CLK, CLK, CLK, 0xFF, 0x00,
+/* sc=72 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
+/* sc=73 */ LALT, LALT, LALT, LALT, LALT, LALT, LALT, LALT, 0xFF, 0x00,
+/* sc=74 */ LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, LCTR, 0xFF, 0x00,
+/* sc=75 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=76 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=77 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=78 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=79 */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=7a */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=7b */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=7c */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=7d */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=7e */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+/* sc=7f */ NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, 0xFF, 0x00,
+};
+#endif
+
#ifdef DKKEYMAP
static keymap_t key_map = { 0x6C, /* DK iso8859 keymap */
/* alt
@@ -750,7 +889,7 @@ static keymap_t key_map = { 0xEC, /* keys number */
#endif
-#if !defined(DKKEYMAP) && !defined(UKKEYMAP) && !defined(GRKEYMAP) && !defined(SWKEYMAP) && !defined(RUKEYMAP)
+#if !defined(DKKEYMAP) && !defined(UKKEYMAP) && !defined(GRKEYMAP) && !defined(SWKEYMAP) && !defined(RUKEYMAP) && !defined(PC98)
static keymap_t key_map = { 0x6C, /* US iso8859 keymap */
/* alt
* scan cntrl alt alt cntrl
diff --git a/sys/i386/isa/matcd/creative.h b/sys/i386/isa/matcd/creative.h
index 0877a782c1af..72a12ad450ed 100644
--- a/sys/i386/isa/matcd/creative.h
+++ b/sys/i386/isa/matcd/creative.h
@@ -98,13 +98,20 @@ See matcd.c for Edit History
#define CMD 0 /*Write - commands*/
#define DATA 0 /*Read - data/status from drive*/
+#ifdef PC98
+#define PHASE 0x100 /*Write - switch between data/status*/
+#define STATUS 0x100 /*Read - bus status */
+#define RESET 0x200 /*Write - reset all attached drives*/
+#define ALTDATA 0x200 /*<20>Read - data on non Creative bds.*/
+#define SELECT 0x300 /*Write - drive select*/
+#else /* !PC98 */
#define PHASE 1 /*Write - switch between data/status*/
#define STATUS 1 /*Read - bus status*/
#define RESET 2 /*Write - reset all attached drives*/
/*Any value written will reset*/
#define ALTDATA 2 /*<20>Read - data on non Creative bds.*/
#define SELECT 3 /*Write - drive select*/
-
+#endif /*PC98*/
/* Creative PHASE port bit assignments
*/
diff --git a/sys/i386/isa/matcd/options.h b/sys/i386/isa/matcd/options.h
index af0db682504a..3fde8806ca04 100644
--- a/sys/i386/isa/matcd/options.h
+++ b/sys/i386/isa/matcd/options.h
@@ -184,6 +184,16 @@
#ifdef AUTOHUNT
static int port_hints[]={
+#ifdef PC98
+ 0x30d2,
+ 0x30d0,
+ 0x30d4,
+ 0x30d6,
+ 0x30d8,
+ 0x30da,
+ 0x30dc,
+ 0x30de,
+#else /* IBM-PC */
0x230, /*SB Pro & SB16*/
0x240, /*SB Pro & SB16*/
0x250, /*Creative omniCD standalone boards*/
@@ -205,6 +215,7 @@ static int port_hints[]={
0x670, /*IBM*/
0x690, /*IBM*/
#endif /*0*/
+#endif /* PC98 */
-1}; /*use. Table MUST end with -1*/
#endif /*AUTOHUNT*/
diff --git a/sys/i386/isa/pcibus.c b/sys/i386/isa/pcibus.c
index 42320699cffd..903214c44304 100644
--- a/sys/i386/isa/pcibus.c
+++ b/sys/i386/isa/pcibus.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: pcibus.c,v 1.25 1996/06/13 21:50:41 se Exp $
+** $Id: pcibus.c,v 1.26 1996/06/18 01:22:28 bde Exp $
**
** pci bus subroutines for i386 architecture.
**
@@ -151,7 +151,11 @@ DATA_SET (pcibus_set, i386pci);
#define CONF1_ENABLE_RES1 0x80000000ul
#define CONF2_ENABLE_PORT 0x0cf8
+#ifdef PC98
+#define CONF2_FORWARD_PORT 0x0cf9
+#else
#define CONF2_FORWARD_PORT 0x0cfa
+#endif
#define CONF2_ENABLE_CHK 0x0e
#define CONF2_ENABLE_RES 0x0e
diff --git a/sys/i386/isa/prof_machdep.c b/sys/i386/isa/prof_machdep.c
index 62c8df514b09..a8603cb7968d 100644
--- a/sys/i386/isa/prof_machdep.c
+++ b/sys/i386/isa/prof_machdep.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: prof_machdep.c,v 1.2 1996/04/08 16:41:06 wollman Exp $
+ * $Id: prof_machdep.c,v 1.3 1996/10/17 19:32:10 bde Exp $
*/
#ifdef GUPROF
@@ -40,7 +40,11 @@
#include <machine/profile.h>
#endif
+#ifdef PC98
+#include <pc98/pc98/pc98.h>
+#else
#include <i386/isa/isa.h>
+#endif
#include <i386/isa/timerreg.h>
#ifdef GUPROF
diff --git a/sys/i386/isa/random_machdep.c b/sys/i386/isa/random_machdep.c
index 227b70758d7e..7a13baf84d25 100644
--- a/sys/i386/isa/random_machdep.c
+++ b/sys/i386/isa/random_machdep.c
@@ -1,7 +1,7 @@
/*
* random_machdep.c -- A strong random number generator
*
- * $Id: random_machdep.c,v 1.11 1996/09/27 13:25:13 peter Exp $
+ * $Id: random_machdep.c,v 1.12 1996/10/09 19:47:32 bde Exp $
*
* Version 0.95, last modified 18-Oct-95
*
@@ -51,7 +51,11 @@
#include <machine/random.h>
#include <i386/isa/icu.h>
+#ifdef PC98
+#include <pc98/pc98/pc98.h>
+#else
#include <i386/isa/isa.h>
+#endif
#include <i386/isa/timerreg.h>
#define MAX_BLKDEV 4
diff --git a/sys/i386/isa/sound/dev_table.h b/sys/i386/isa/sound/dev_table.h
index 402538c89b5b..5269f63134ff 100644
--- a/sys/i386/isa/sound/dev_table.h
+++ b/sys/i386/isa/sound/dev_table.h
@@ -302,6 +302,11 @@ struct sound_timer_operations {
{SNDCARD_TRXPRO_SB, "AudioTriX (SB mode)", attach_trix_sb, probe_trix_sb},
{SNDCARD_TRXPRO_MPU, "AudioTriX MIDI", attach_trix_mpu, probe_trix_mpu},
#endif
+#ifdef PC98
+#ifndef EXCLUDE_PCM86
+ {SNDCARD_PCM86, "PC-9801-86/73", attach_pcm86, probe_pcm86},
+#endif
+#endif
{0, "*?*", NULL, NULL}
};
@@ -384,6 +389,11 @@ struct sound_timer_operations {
#ifndef EXCLUDE_YM3812
{SNDCARD_ADLIB, {FM_MONO, 0, 0}, SND_DEFAULT_ENABLE},
#endif
+#ifdef PC98
+#ifndef EXCLUDE_PCM86
+ {SNDCARD_PCM86, {0, 0, 0}, SND_DEFAULT_ENABLE},
+#endif
+#endif
{0, {0}, 0}
};
diff --git a/sys/i386/isa/sound/local.h b/sys/i386/isa/sound/local.h
index e80b780be8b8..c243e4b6f441 100644
--- a/sys/i386/isa/sound/local.h
+++ b/sys/i386/isa/sound/local.h
@@ -92,6 +92,14 @@
#define EXCLUDE_UART6850
#endif
+#ifdef PC98
+#include "pcm.h"
+#if NPCM == 0 && !defined(EXCLUDE_PCM86)
+#define EXCLUDE_PCM86
+#endif
+#endif
+
+
/* nothing but a sequencer (Adlib/OPL) ? */
#if NGUS == 0 && NSB == 0 && NSBMIDI == 0 && NPAS == 0 && NMPU == 0 && \
NUART == 0 && NMSS == 0
@@ -99,9 +107,11 @@
#define EXCLUDE_MIDI
#endif
#ifndef EXCLUDE_AUDIO
+#if !defined(PC98) || defined(EXCLUDE_PCM86) && defined(EXCLUDE_MSS)
#define EXCLUDE_AUDIO
#endif
#endif
+#endif
/* nothing but a Midi (MPU/UART) ? */
#if NGUS == 0 && NSB == 0 && NSBMIDI == 0 && NPAS == 0 && NOPL == 0 && \
@@ -111,6 +121,8 @@
#define EXCLUDE_SEQUENCER
#endif
#ifndef EXCLUDE_AUDIO
+#if !defined(PC98) || defined(EXCLUDE_PCM86) && defined(EXCLUDE_MSS)
#define EXCLUDE_AUDIO
#endif
#endif
+#endif
diff --git a/sys/i386/isa/sound/sound_calls.h b/sys/i386/isa/sound/sound_calls.h
index bfe2f446589c..d52da0b75dde 100644
--- a/sys/i386/isa/sound/sound_calls.h
+++ b/sys/i386/isa/sound/sound_calls.h
@@ -249,6 +249,12 @@ int pss_ioctl (int dev, struct fileinfo *file,
int pss_lseek (int dev, struct fileinfo *file, off_t offset, int orig);
long pss_init(long mem_start);
+#ifdef PC98
+/* From pcm86.c */
+int probe_pcm86(struct address_info *hw_config);
+long attach_pcm86(long mem_start, struct address_info *hw_config);
+#endif PC98
+
/* From aedsp16.c */
int InitAEDSP16_SBPRO(struct address_info *hw_config);
int InitAEDSP16_MSS(struct address_info *hw_config);
diff --git a/sys/i386/isa/sound/sound_config.h b/sys/i386/isa/sound/sound_config.h
index daafcbe2a0b9..2330fa94b1a1 100644
--- a/sys/i386/isa/sound/sound_config.h
+++ b/sys/i386/isa/sound/sound_config.h
@@ -79,24 +79,44 @@ If your card has nonstandard I/O address or IRQ number, change defines
for the following settings in your kernel Makefile */
#ifndef SBC_BASE
+#ifdef PC98
+#define SBC_BASE 0x20d2 /* 0x20d2 is the factory default. */
+#else
#define SBC_BASE 0x220 /* 0x220 is the factory default. */
#endif
+#endif
#ifndef SBC_IRQ
+#ifdef PC98
+#define SBC_IRQ 10 /* IQR10 is not the factory default on PC9821. */
+#else
#define SBC_IRQ 7 /* IQR7 is the factory default. */
#endif
+#endif
#ifndef SBC_DMA
+#ifdef PC98
+#define SBC_DMA 3
+#else
#define SBC_DMA 1
#endif
+#endif
#ifndef SB16_DMA
+#ifdef PC98
+#define SB16_DMA 3
+#else
#define SB16_DMA 6
#endif
+#endif
#ifndef SB16MIDI_BASE
+#ifdef PC98
+#define SB16MIDI_BASE 0x80d2
+#else
#define SB16MIDI_BASE 0x300
#endif
+#endif
#ifndef PAS_BASE
#define PAS_BASE 0x388
@@ -248,7 +268,11 @@ If your card has nonstandard I/O address or IRQ number, change defines
#define DMA_AUTOINIT 0x10
+#ifdef PC98
+#define FM_MONO 0x28d2 /* This is the I/O address used by AdLib */
+#else
#define FM_MONO 0x388 /* This is the I/O address used by AdLib */
+#endif
/* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the
driver. (There is no need to alter this) */
diff --git a/sys/i386/isa/timerreg.h b/sys/i386/isa/timerreg.h
index 5742f6601493..16fbc0b4899a 100644
--- a/sys/i386/isa/timerreg.h
+++ b/sys/i386/isa/timerreg.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: Header: timerreg.h,v 1.2 93/02/28 15:08:58 mccanne Exp
- * $Id$
+ * $Id: timerreg.h,v 1.2 1993/10/16 13:46:26 rgrimes Exp $
*/
/*
@@ -59,6 +59,7 @@
* in undefined behavior (but hopefully not fry the chip).
* Reading in this manner has no side effects.
*
+ * [IBM-PC]
* The outputs of the three timers are connected as follows:
*
* timer 0 -> irq 0
@@ -67,15 +68,31 @@
*
* Timer 0 is used to call hardclock.
* Timer 2 is used to generate console beeps.
+ *
+ * [PC-9801]
+ * The outputs of the three timers are connected as follows:
+ *
+ * timer 0 -> irq 0
+ * timer 1 -> speaker (via keyboard controller)
+ * timer 2 -> RS232C
+ *
+ * Timer 0 is used to call hardclock.
+ * Timer 1 is used to generate console beeps.
*/
/*
* Macros for specifying values to be written into a mode register.
*/
#define TIMER_CNTR0 (IO_TIMER1 + 0) /* timer 0 counter port */
+#ifdef PC98
+#define TIMER_CNTR1 0x3fdb /* timer 1 counter port */
+#define TIMER_CNTR2 (IO_TIMER1 + 4) /* timer 2 counter port */
+#define TIMER_MODE (IO_TIMER1 + 6) /* timer mode port */
+#else
#define TIMER_CNTR1 (IO_TIMER1 + 1) /* timer 1 counter port */
#define TIMER_CNTR2 (IO_TIMER1 + 2) /* timer 2 counter port */
#define TIMER_MODE (IO_TIMER1 + 3) /* timer mode port */
+#endif
#define TIMER_SEL0 0x00 /* select counter 0 */
#define TIMER_SEL1 0x40 /* select counter 1 */
#define TIMER_SEL2 0x80 /* select counter 2 */
diff --git a/sys/i386/isa/vector.s b/sys/i386/isa/vector.s
index 94691f5f7f18..0283c2a99786 100644
--- a/sys/i386/isa/vector.s
+++ b/sys/i386/isa/vector.s
@@ -1,12 +1,26 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
- * $Id: vector.s,v 1.19 1996/04/11 21:18:47 bde Exp $
+ * $Id: vector.s,v 1.20 1996/05/31 01:08:08 peter Exp $
+ */
+
+/*
+ * modified for PC98 by Kakefuda
*/
#include "opt_auto_eoi.h"
#include <i386/isa/icu.h>
+#ifdef PC98
+#include <pc98/pc98/pc98.h>
+#else
#include <i386/isa/isa.h>
+#endif
+
+#ifdef PC98
+#define ICU_IMR_OFFSET 2 /* IO_ICU{1,2} + 2 */
+#else
+#define ICU_IMR_OFFSET 1 /* IO_ICU{1,2} + 1 */
+#endif
#define ICU_EOI 0x20 /* XXX - define elsewhere */
@@ -168,7 +182,7 @@ IDTVEC(vec_name) ; \
movb _imen + IRQ_BYTE(irq_num),%al ; \
orb $IRQ_BIT(irq_num),%al ; \
movb %al,_imen + IRQ_BYTE(irq_num) ; \
- outb %al,$icu+1 ; \
+ outb %al,$icu+ICU_IMR_OFFSET ; \
enable_icus ; \
incl _cnt+V_INTR ; /* tally interrupts */ \
movl _cpl,%eax ; \
@@ -190,7 +204,7 @@ __CONCAT(Xresume,irq_num): ; \
movb _imen + IRQ_BYTE(irq_num),%al ; \
andb $~IRQ_BIT(irq_num),%al ; \
movb %al,_imen + IRQ_BYTE(irq_num) ; \
- outb %al,$icu+1 ; \
+ outb %al,$icu+ICU_IMR_OFFSET ; \
sti ; /* XXX _doreti repeats the cli/sti */ \
MEXITCOUNT ; \
/* We could usually avoid the following jmp by inlining some of */ \
diff --git a/sys/i386/pci/pci_bus.c b/sys/i386/pci/pci_bus.c
index 42320699cffd..903214c44304 100644
--- a/sys/i386/pci/pci_bus.c
+++ b/sys/i386/pci/pci_bus.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: pcibus.c,v 1.25 1996/06/13 21:50:41 se Exp $
+** $Id: pcibus.c,v 1.26 1996/06/18 01:22:28 bde Exp $
**
** pci bus subroutines for i386 architecture.
**
@@ -151,7 +151,11 @@ DATA_SET (pcibus_set, i386pci);
#define CONF1_ENABLE_RES1 0x80000000ul
#define CONF2_ENABLE_PORT 0x0cf8
+#ifdef PC98
+#define CONF2_FORWARD_PORT 0x0cf9
+#else
#define CONF2_FORWARD_PORT 0x0cfa
+#endif
#define CONF2_ENABLE_CHK 0x0e
#define CONF2_ENABLE_RES 0x0e
diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c
index 42320699cffd..903214c44304 100644
--- a/sys/i386/pci/pci_cfgreg.c
+++ b/sys/i386/pci/pci_cfgreg.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: pcibus.c,v 1.25 1996/06/13 21:50:41 se Exp $
+** $Id: pcibus.c,v 1.26 1996/06/18 01:22:28 bde Exp $
**
** pci bus subroutines for i386 architecture.
**
@@ -151,7 +151,11 @@ DATA_SET (pcibus_set, i386pci);
#define CONF1_ENABLE_RES1 0x80000000ul
#define CONF2_ENABLE_PORT 0x0cf8
+#ifdef PC98
+#define CONF2_FORWARD_PORT 0x0cf9
+#else
#define CONF2_FORWARD_PORT 0x0cfa
+#endif
#define CONF2_ENABLE_CHK 0x0e
#define CONF2_ENABLE_RES 0x0e
diff --git a/sys/i386/pci/pci_pir.c b/sys/i386/pci/pci_pir.c
index 42320699cffd..903214c44304 100644
--- a/sys/i386/pci/pci_pir.c
+++ b/sys/i386/pci/pci_pir.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: pcibus.c,v 1.25 1996/06/13 21:50:41 se Exp $
+** $Id: pcibus.c,v 1.26 1996/06/18 01:22:28 bde Exp $
**
** pci bus subroutines for i386 architecture.
**
@@ -151,7 +151,11 @@ DATA_SET (pcibus_set, i386pci);
#define CONF1_ENABLE_RES1 0x80000000ul
#define CONF2_ENABLE_PORT 0x0cf8
+#ifdef PC98
+#define CONF2_FORWARD_PORT 0x0cf9
+#else
#define CONF2_FORWARD_PORT 0x0cfa
+#endif
#define CONF2_ENABLE_CHK 0x0e
#define CONF2_ENABLE_RES 0x0e