diff options
author | asami <asami@FreeBSD.org> | 1996-06-14 11:02:28 +0000 |
---|---|---|
committer | asami <asami@FreeBSD.org> | 1996-06-14 11:02:28 +0000 |
commit | 36a1932601c730683d263ee933dd90cd6dae96bf (patch) | |
tree | d76ce0bf0a31500c82596831333ff034e969773b /sys | |
parent | 5fa995752f02a42fcb2b0ca54149fef141f98060 (diff) | |
download | FreeBSD-src-36a1932601c730683d263ee933dd90cd6dae96bf.zip FreeBSD-src-36a1932601c730683d263ee933dd90cd6dae96bf.tar.gz |
The Great PC98 Merge.
All new code is "#ifdef PC98"ed so this should make no difference to
PC/AT (and its clones) users.
Ok'd by: core
Submitted by: FreeBSD(98) development team
Diffstat (limited to 'sys')
40 files changed, 893 insertions, 35 deletions
diff --git a/sys/Makefile b/sys/Makefile index d2205c0..bfb5e9d 100644 --- a/sys/Makefile +++ b/sys/Makefile @@ -1,5 +1,9 @@ -# $Id: Makefile,v 1.3 1994/08/25 13:54:28 paul Exp $ +# $Id: Makefile,v 1.4 1995/12/26 13:57:32 bde Exp $ +.if defined(MACHINE_PC98) && ${MACHINE_PC98} == "yes" +SUBDIR= pc98/boot +.else SUBDIR= ${MACHINE}/boot +.endif .include <bsd.subdir.mk> diff --git a/sys/alpha/include/console.h b/sys/alpha/include/console.h index 1bc590c..48c522e 100644 --- a/sys/alpha/include/console.h +++ b/sys/alpha/include/console.h @@ -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: console.h,v 1.19 1995/05/30 08:00:28 rgrimes Exp $ + * $Id: console.h,v 1.20 1996/01/30 22:54:15 mpp Exp $ */ #ifndef _CONSOLE_H_ @@ -78,6 +78,10 @@ #define CONS_GETINFO _IOWR('c', 73, vid_info_t) #define CONS_GETVERS _IOR('c', 74, int) +#ifdef PC98 +#define ADJUST_CLOCK _IO('t',100) /* for 98note resume */ +#endif /* for PC98 */ + #define VT_OPENQRY _IOR('v', 1, int) #define VT_SETMODE _IOW('v', 2, vtmode_t) #define VT_GETMODE _IOR('v', 3, vtmode_t) @@ -118,6 +122,9 @@ struct mouse_info { #define KD_CGA 3 /* color graphics adapter */ #define KD_EGA 4 /* enhanced graphics adapter */ #define KD_VGA 5 /* video graphics adapter */ +#ifdef PC98 +#define KD_PC98 6 +#endif #define KD_TEXT 0 /* set text mode restore fonts */ #define KD_TEXT0 0 /* ditto */ @@ -242,6 +249,13 @@ typedef struct ssaver ssaver_t; #define MKEY 0x400 /* meta key marker (prepend ESC)*/ #define BKEY 0x800 /* backtab (ESC [ Z) */ +#ifdef PC98 +#define KB_DATA 0x41 /* kbd data port */ +#define KB_STAT 0x43 /* kbd status port */ +#define KB_BUF_FULL 0x02 /* kbd has char pending */ +#define KB_READY 0x02 /* kbd ready for command */ +#define KB_WRITE 0x43 /* kbd write command */ +#else #define KB_DATA 0x60 /* kbd data port */ #define KB_STAT 0x64 /* kbd status port */ #define KB_BUF_FULL 0x01 /* kbd has char pending */ @@ -255,8 +269,13 @@ typedef struct ssaver ssaver_t; #define KB_ACK 0xFA /* kbd acknowledge answer */ #define KB_RESEND 0xFE /* kbd resend cmd answer */ #define KB_RESET 0xFF /* kbd reset */ +#endif /* video mode definitions */ +#ifdef PC98 +#define M_PC98_80x25 98 /* PC98 80x25 */ +#define M_PC98_80x30 99 /* PC98 80x30 */ +#else #define M_B40x25 0 /* black & white 40 columns */ #define M_C40x25 1 /* color 40 columns */ #define M_B80x25 2 /* black & white 80 columns */ @@ -298,7 +317,12 @@ typedef struct ssaver ssaver_t; #define M_HGC_P0 0xe0 /* hercules graphics - page 0 @ B0000 */ #define M_HGC_P1 0xe1 /* hercules graphics - page 1 @ B8000 */ #define M_MCA_MODE 0xff /* monochrome adapter mode */ +#endif +#ifdef PC98 +#define SW_PC98_80x25 _IO('S', M_PC98_80x25) +#define SW_PC98_80x30 _IO('S', M_PC98_80x30) +#else #define SW_B40x25 _IO('S', M_B40x25) #define SW_C40x25 _IO('S', M_C40x25) #define SW_B80x25 _IO('S', M_B80x25) @@ -335,5 +359,6 @@ typedef struct ssaver ssaver_t; #define SW_CG640x480 _IO('S', M_VGA12) #define SW_VGA13 _IO('S', M_VGA13) #define SW_VGA_CG320 _IO('S', M_VGA13) +#endif #endif diff --git a/sys/amd64/include/clock.h b/sys/amd64/include/clock.h index 1467e4e..830ae13 100644 --- a/sys/amd64/include/clock.h +++ b/sys/amd64/include/clock.h @@ -3,7 +3,7 @@ * Garrett Wollman, September 1994. * This file is in the public domain. * - * $Id: clock.h,v 1.12 1996/04/22 19:40:27 nate Exp $ + * $Id: clock.h,v 1.13 1996/05/01 08:38:50 bde Exp $ */ #ifndef _MACHINE_CLOCK_H_ @@ -93,7 +93,15 @@ int acquire_timer0 __P((int rate, int acquire_timer2 __P((int mode)); int release_timer0 __P((void)); int release_timer2 __P((void)); +#ifndef PC98 int rtcin __P((int val)); +#else +int acquire_timer1 __P((int mode)); +int release_timer1 __P((void)); +void rtc_serialcombit __P((int i)); +void rtc_serialcom __P((int i)); +void rtc_outb __P((int val)); +#endif int sysbeep __P((int pitch, int period)); #endif /* KERNEL && !LOCORE */ diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 1f18615..510cacd 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.48 1996/03/31 04:05:21 bde Exp $ + * $Id: cpufunc.h,v 1.49 1996/04/07 18:30:56 bde Exp $ */ /* @@ -253,6 +253,53 @@ outw(u_int port, u_short data) __asm __volatile("outw %0,%%dx" : : "a" (data), "d" (port)); } +#ifdef PC98 +static inline u_char +epson_inb(u_int port) +{ + u_char data; + + outb(0x43f, 0x42); + data = inb(port); + outb(0x43f, 0x40); + return (data); +} + +static inline void +epson_outb(u_int port, u_char data) +{ + outb(0x43f, 0x42); + outb(port,data); + outb(0x43f, 0x40); +} + +static inline void +epson_insw(u_int port, void *addr, size_t cnt) +{ + int s; + + s = splbio(); + outb(0x43f, 0x42); + disable_intr(); + insw((u_int)port, (void *)addr, (size_t)cnt); + outb(0x43f, 0x40); + splx(s); +} + +static inline void +epson_outsw(u_int port, void *addr, size_t cnt) +{ + int s; + + s = splbio(); + outb(0x43f, 0x42); + disable_intr(); + outsw((u_int)port, (void *)addr, (size_t)cnt); + outb(0x43f, 0x40); + splx(s); +} +#endif /* PC98 */ + static __inline void pmap_update(void) { diff --git a/sys/amd64/isa/isa.h b/sys/amd64/isa/isa.h index fccfdad..11beca4 100644 --- a/sys/amd64/isa/isa.h +++ b/sys/amd64/isa/isa.h @@ -34,9 +34,13 @@ * SUCH DAMAGE. * * from: @(#)isa.h 5.7 (Berkeley) 5/9/91 - * $Id: isa.h,v 1.17 1995/11/18 09:29:39 bde Exp $ + * $Id: isa.h,v 1.18 1996/01/30 22:55:57 mpp Exp $ */ +#ifdef PC98 +#error isa.h is included from PC-9801 source +#endif + #ifndef _I386_ISA_ISA_H_ #define _I386_ISA_ISA_H_ diff --git a/sys/dev/ed/if_ed_pci.c b/sys/dev/ed/if_ed_pci.c index ce46c07..eb0391a 100644 --- a/sys/dev/ed/if_ed_pci.c +++ b/sys/dev/ed/if_ed_pci.c @@ -17,7 +17,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: if_ed_p.c,v 1.1 1996/05/18 17:56:40 se Exp $ + * $Id: if_ed_p.c,v 1.2 1996/06/11 00:51:49 alex Exp $ */ #include <pci.h> @@ -29,7 +29,11 @@ #include <sys/kernel.h> #include <pci/pcireg.h> #include <pci/pcivar.h> +#ifdef PC98 +#include <pc98/pc98/pc98_device.h> +#else #include <i386/isa/isa_device.h> +#endif #include <ed.h> diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index bec376c..90d598d 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_denode.c,v 1.16 1996/01/19 03:58:42 dyson Exp $ */ +/* $Id: msdosfs_denode.c,v 1.17 1996/06/12 03:37:42 davidg Exp $ */ /* $NetBSD: msdosfs_denode.c,v 1.9 1994/08/21 18:44:00 ws Exp $ */ /*- @@ -495,6 +495,13 @@ detrunc(dep, length, flags, cred, p) NOCRED, &bp); } else { bn = de_blk(pmp, length); +#ifdef PC98 + /* + * 1024 byte/sector support + */ + if (pmp->pm_BytesPerSec == 1024) + DETOV(dep)->v_flag |= 0x10000; +#endif error = bread(DETOV(dep), bn, pmp->pm_bpcluster, NOCRED, &bp); } diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index bc52390..db4f927 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_lookup.c,v 1.5 1995/11/07 14:06:43 phk Exp $ */ +/* $Id: msdosfs_lookup.c,v 1.6 1995/12/03 16:42:01 bde Exp $ */ /* $NetBSD: msdosfs_lookup.c,v 1.14 1994/08/21 18:44:07 ws Exp $ */ /*- @@ -172,6 +172,13 @@ msdosfs_lookup(ap) printf("msdosfs_lookup(): cache hit, vnode %08x, file %s\n", vdp, dp->de_Name); #endif +#ifdef PC98 + /* + * 1024 byte/sector support + */ + if (pmp->pm_BytesPerSec == 1024) + vdp->v_flag |= 0x10000; +#endif return 0; } vput(vdp); diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 18dc492..7ada694 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vfsops.c,v 1.11 1996/01/05 18:31:43 wollman Exp $ */ +/* $Id: msdosfs_vfsops.c,v 1.12 1996/04/03 23:05:40 gpalmer Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.19 1994/08/21 18:44:10 ws Exp $ */ /*- @@ -273,6 +273,10 @@ mountmsdosfs(devvp, mp, p) struct buf *bp0 = NULL; struct byte_bpb33 *b33; struct byte_bpb50 *b50; +#ifdef PC98 + u_int pc98_wrk; + u_int Phy_Sector_Size; +#endif /* * Multiple mounts of the same block special file aren't allowed. @@ -311,7 +315,12 @@ mountmsdosfs(devvp, mp, p) * also add some checking on the bsOemName field. So far I've seen * the following values: "IBM 3.3" "MSDOS3.3" "MSDOS5.0" */ +#ifdef PC98 + devvp->v_flag &= 0xffff; + error = bread(devvp, 0, 1024, NOCRED, &bp0); +#else error = bread(devvp, 0, 512, NOCRED, &bp0); +#endif if (error) goto error_exit; bp0->b_flags |= B_AGE; @@ -319,7 +328,14 @@ mountmsdosfs(devvp, mp, p) b33 = (struct byte_bpb33 *) bsp->bs33.bsBPB; b50 = (struct byte_bpb50 *) bsp->bs50.bsBPB; #ifdef MSDOSFS_CHECKSIG +#ifdef PC98 + if (bsp->bs50.bsBootSectSig != BOOTSIG && + bsp->bs50.bsBootSectSig != 0 && /* PC98 DOS 3.3x */ + bsp->bs50.bsBootSectSig != 15760 && /* PC98 DOS 5.0 */ + bsp->bs50.bsBootSectSig != 64070) { /* PC98 DOS 3.3B */ +#else if (bsp->bs50.bsBootSectSig != BOOTSIG) { +#endif error = EINVAL; goto error_exit; } @@ -353,7 +369,11 @@ mountmsdosfs(devvp, mp, p) /* XXX - We should probably check more values here */ if (!pmp->pm_BytesPerSec || !pmp->pm_SectPerClust || !pmp->pm_Heads || pmp->pm_Heads > 255 || +#ifdef PC98 + !pmp->pm_SecPerTrack || pmp->pm_SecPerTrack > 255) { +#else !pmp->pm_SecPerTrack || pmp->pm_SecPerTrack > 63) { +#endif error = EINVAL; goto error_exit; } @@ -365,6 +385,41 @@ mountmsdosfs(devvp, mp, p) pmp->pm_HiddenSects = getushort(b33->bpbHiddenSecs); pmp->pm_HugeSectors = pmp->pm_Sectors; } +#ifdef PC98 /* for PC98 added Satoshi Yasuda */ + Phy_Sector_Size = 512; + if ((devvp->v_rdev>>8) == 2) { /* floppy check */ + if (((devvp->v_rdev&077) == 2) && (pmp->pm_HugeSectors == 1232)) { + Phy_Sector_Size = 1024; /* 2HD */ + /* + * 1024byte/sector support + */ + devvp->v_flag |= 0x10000; + } else { + if ((((devvp->v_rdev&077) == 3) /* 2DD 8 or 9 sector */ + && (pmp->pm_HugeSectors == 1440)) /* 9 sector */ + || (((devvp->v_rdev&077) == 4) + && (pmp->pm_HugeSectors == 1280)) /* 8 sector */ + || (((devvp->v_rdev&077) == 5) + && (pmp->pm_HugeSectors == 2880))) { /* 1.44M */ + Phy_Sector_Size = 512; + } else { + if (((devvp->v_rdev&077) != 1) + && ((devvp->v_rdev&077) != 0)) { /* 2HC */ + error = EINVAL; + goto error_exit; + } + } + } + } + pc98_wrk = pmp->pm_BytesPerSec / Phy_Sector_Size; + pmp->pm_BytesPerSec = Phy_Sector_Size; + pmp->pm_SectPerClust = pmp->pm_SectPerClust * pc98_wrk; + pmp->pm_HugeSectors = pmp->pm_HugeSectors * pc98_wrk; + pmp->pm_ResSectors = pmp->pm_ResSectors * pc98_wrk; + pmp->pm_FATsecs = pmp->pm_FATsecs * pc98_wrk; + pmp->pm_SecPerTrack = pmp->pm_SecPerTrack * pc98_wrk; + pmp->pm_HiddenSects = pmp->pm_HiddenSects * pc98_wrk; +#endif /* */ pmp->pm_fatblk = pmp->pm_ResSectors; pmp->pm_rootdirblk = pmp->pm_fatblk + (pmp->pm_FATs * pmp->pm_FATsecs); @@ -420,8 +475,18 @@ mountmsdosfs(devvp, mp, p) bit <<= 1; } +#ifdef PC98 + if (Phy_Sector_Size == 512) { + pmp->pm_brbomask = 0x01ff; /* 512 byte blocks only (so far) */ + pmp->pm_bnshift = 9; /* shift right 9 bits to get bn */ + } else { + pmp->pm_brbomask = 0x03ff; + pmp->pm_bnshift = 10; + } +#else pmp->pm_brbomask = 0x01ff; /* 512 byte blocks only (so far) */ pmp->pm_bnshift = 9; /* shift right 9 bits to get bn */ +#endif /* * Release the bootsector buffer. diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 899d9f8..83efc30 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.29 1995/12/03 16:42:02 bde Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.30 1995/12/07 12:47:20 davidg Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */ /*- @@ -558,6 +558,13 @@ msdosfs_read(ap) NOCRED, &bp); } else { rablock = lbn + 1; +#ifdef PC98 + /* + * 1024byte/sector support + */ + if (pmp->pm_BytesPerSec == 1024) + vp->v_flag |= 0x10000; +#endif if (vp->v_lastr + 1 == lbn && rablock * pmp->pm_bpcluster < dep->de_FileSize) { rasize = pmp->pm_bpcluster; @@ -693,6 +700,13 @@ msdosfs_write(ap) osize = dep->de_FileSize; +#ifdef PC98 + /* + * 1024byte/sector support + */ + if (pmp->pm_BytesPerSec == 1024) + thisvp->v_flag |= 0x10000; +#endif /* * If we write beyond the end of the file, extend it to its ultimate * size ahead of the time to hopefully get a contiguous area. diff --git a/sys/i386/include/clock.h b/sys/i386/include/clock.h index 1467e4e..830ae13 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.12 1996/04/22 19:40:27 nate Exp $ + * $Id: clock.h,v 1.13 1996/05/01 08:38:50 bde Exp $ */ #ifndef _MACHINE_CLOCK_H_ @@ -93,7 +93,15 @@ int acquire_timer0 __P((int rate, int acquire_timer2 __P((int mode)); int release_timer0 __P((void)); int release_timer2 __P((void)); +#ifndef PC98 int rtcin __P((int val)); +#else +int acquire_timer1 __P((int mode)); +int release_timer1 __P((void)); +void rtc_serialcombit __P((int i)); +void rtc_serialcom __P((int i)); +void rtc_outb __P((int val)); +#endif int sysbeep __P((int pitch, int period)); #endif /* KERNEL && !LOCORE */ diff --git a/sys/i386/include/console.h b/sys/i386/include/console.h index 1bc590c..48c522e 100644 --- a/sys/i386/include/console.h +++ b/sys/i386/include/console.h @@ -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: console.h,v 1.19 1995/05/30 08:00:28 rgrimes Exp $ + * $Id: console.h,v 1.20 1996/01/30 22:54:15 mpp Exp $ */ #ifndef _CONSOLE_H_ @@ -78,6 +78,10 @@ #define CONS_GETINFO _IOWR('c', 73, vid_info_t) #define CONS_GETVERS _IOR('c', 74, int) +#ifdef PC98 +#define ADJUST_CLOCK _IO('t',100) /* for 98note resume */ +#endif /* for PC98 */ + #define VT_OPENQRY _IOR('v', 1, int) #define VT_SETMODE _IOW('v', 2, vtmode_t) #define VT_GETMODE _IOR('v', 3, vtmode_t) @@ -118,6 +122,9 @@ struct mouse_info { #define KD_CGA 3 /* color graphics adapter */ #define KD_EGA 4 /* enhanced graphics adapter */ #define KD_VGA 5 /* video graphics adapter */ +#ifdef PC98 +#define KD_PC98 6 +#endif #define KD_TEXT 0 /* set text mode restore fonts */ #define KD_TEXT0 0 /* ditto */ @@ -242,6 +249,13 @@ typedef struct ssaver ssaver_t; #define MKEY 0x400 /* meta key marker (prepend ESC)*/ #define BKEY 0x800 /* backtab (ESC [ Z) */ +#ifdef PC98 +#define KB_DATA 0x41 /* kbd data port */ +#define KB_STAT 0x43 /* kbd status port */ +#define KB_BUF_FULL 0x02 /* kbd has char pending */ +#define KB_READY 0x02 /* kbd ready for command */ +#define KB_WRITE 0x43 /* kbd write command */ +#else #define KB_DATA 0x60 /* kbd data port */ #define KB_STAT 0x64 /* kbd status port */ #define KB_BUF_FULL 0x01 /* kbd has char pending */ @@ -255,8 +269,13 @@ typedef struct ssaver ssaver_t; #define KB_ACK 0xFA /* kbd acknowledge answer */ #define KB_RESEND 0xFE /* kbd resend cmd answer */ #define KB_RESET 0xFF /* kbd reset */ +#endif /* video mode definitions */ +#ifdef PC98 +#define M_PC98_80x25 98 /* PC98 80x25 */ +#define M_PC98_80x30 99 /* PC98 80x30 */ +#else #define M_B40x25 0 /* black & white 40 columns */ #define M_C40x25 1 /* color 40 columns */ #define M_B80x25 2 /* black & white 80 columns */ @@ -298,7 +317,12 @@ typedef struct ssaver ssaver_t; #define M_HGC_P0 0xe0 /* hercules graphics - page 0 @ B0000 */ #define M_HGC_P1 0xe1 /* hercules graphics - page 1 @ B8000 */ #define M_MCA_MODE 0xff /* monochrome adapter mode */ +#endif +#ifdef PC98 +#define SW_PC98_80x25 _IO('S', M_PC98_80x25) +#define SW_PC98_80x30 _IO('S', M_PC98_80x30) +#else #define SW_B40x25 _IO('S', M_B40x25) #define SW_C40x25 _IO('S', M_C40x25) #define SW_B80x25 _IO('S', M_B80x25) @@ -335,5 +359,6 @@ typedef struct ssaver ssaver_t; #define SW_CG640x480 _IO('S', M_VGA12) #define SW_VGA13 _IO('S', M_VGA13) #define SW_VGA_CG320 _IO('S', M_VGA13) +#endif #endif diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index 1f18615..510cacd 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.48 1996/03/31 04:05:21 bde Exp $ + * $Id: cpufunc.h,v 1.49 1996/04/07 18:30:56 bde Exp $ */ /* @@ -253,6 +253,53 @@ outw(u_int port, u_short data) __asm __volatile("outw %0,%%dx" : : "a" (data), "d" (port)); } +#ifdef PC98 +static inline u_char +epson_inb(u_int port) +{ + u_char data; + + outb(0x43f, 0x42); + data = inb(port); + outb(0x43f, 0x40); + return (data); +} + +static inline void +epson_outb(u_int port, u_char data) +{ + outb(0x43f, 0x42); + outb(port,data); + outb(0x43f, 0x40); +} + +static inline void +epson_insw(u_int port, void *addr, size_t cnt) +{ + int s; + + s = splbio(); + outb(0x43f, 0x42); + disable_intr(); + insw((u_int)port, (void *)addr, (size_t)cnt); + outb(0x43f, 0x40); + splx(s); +} + +static inline void +epson_outsw(u_int port, void *addr, size_t cnt) +{ + int s; + + s = splbio(); + outb(0x43f, 0x42); + disable_intr(); + outsw((u_int)port, (void *)addr, (size_t)cnt); + outb(0x43f, 0x40); + splx(s); +} +#endif /* PC98 */ + static __inline void pmap_update(void) { diff --git a/sys/i386/include/devconf.h b/sys/i386/include/devconf.h index d4a30c9..14390b1 100644 --- a/sys/i386/include/devconf.h +++ b/sys/i386/include/devconf.h @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: devconf.h,v 1.11 1995/11/14 20:52:14 phk Exp $ + * $Id: devconf.h,v 1.12 1995/11/20 12:41:31 phk Exp $ */ /* * devconf.h - machine-dependent device configuration table @@ -35,9 +35,25 @@ #define PARENTNAMELEN 32 +#ifdef PC98 +enum machdep_devtype { MDDT_CPU, MDDT_PC98, MDDT_PCI, MDDT_SCSI, + MDDT_DISK, MDDT_BUS, NDEVTYPES }; +#else enum machdep_devtype { MDDT_CPU, MDDT_ISA, MDDT_EISA, MDDT_PCI, MDDT_SCSI, MDDT_DISK, MDDT_BUS, NDEVTYPES }; +#endif +#ifdef PC98 +#define DEVTYPENAMES { \ + "cpu", \ + "pc98", \ + "pci", \ + "scsi", \ + "disk", \ + "bus", \ + 0 \ + } +#else #define DEVTYPENAMES { \ "cpu", \ "isa", \ @@ -48,6 +64,7 @@ enum machdep_devtype { MDDT_CPU, MDDT_ISA, MDDT_EISA, MDDT_PCI, MDDT_SCSI, "bus", \ 0 \ } +#endif struct machdep_devconf { enum machdep_devtype mddc_devtype; @@ -63,8 +80,12 @@ struct machdep_devconf { #define dc_devtype dc_md.mddc_devtype #define dc_flags dc_md.mddc_flags +#ifdef PC98 +#define kdc_pc98 kdc_parentdata +#else #define kdc_isa kdc_parentdata #define kdc_eisa kdc_parentdata +#endif #define kdc_scsi kdc_parentdata #define CPU_EXTERNALLEN (0) diff --git a/sys/i386/include/random.h b/sys/i386/include/random.h index 97f6c65..73957b9 100644 --- a/sys/i386/include/random.h +++ b/sys/i386/include/random.h @@ -1,7 +1,7 @@ /* * random.h -- A strong random number generator * - * $Id: random.h,v 1.3 1995/12/29 08:04:13 markm Exp $ + * $Id: random.h,v 1.4 1996/01/30 22:54:53 mpp Exp $ * * Version 0.95, last modified 18-Oct-95 * @@ -51,9 +51,14 @@ #define _MACHINE_RANDOM_H_ 1 #if defined(KERNEL) +#ifdef PC98 +#include <pc98/pc98/icu.h> +#include <pc98/pc98/pc98_device.h> +#else #include <i386/isa/icu.h> #include <i386/isa/isa_device.h> #endif +#endif #include <sys/ioctl.h> #define MEM_SETIRQ _IOW('r', 1, u_int16_t) /* set interrupt */ diff --git a/sys/i386/include/soundcard.h b/sys/i386/include/soundcard.h index 725a023..3dcdaa1 100644 --- a/sys/i386/include/soundcard.h +++ b/sys/i386/include/soundcard.h @@ -64,6 +64,9 @@ #define SNDCARD_TRXPRO 16 #define SNDCARD_TRXPRO_SB 17 #define SNDCARD_TRXPRO_MPU 18 +#ifdef PC98 +#define SNDCARD_PCM86 19 +#endif /*********************************** * IOCTL Commands for /dev/sequencer diff --git a/sys/i386/isa/isa.h b/sys/i386/isa/isa.h index fccfdad..11beca4 100644 --- a/sys/i386/isa/isa.h +++ b/sys/i386/isa/isa.h @@ -34,9 +34,13 @@ * SUCH DAMAGE. * * from: @(#)isa.h 5.7 (Berkeley) 5/9/91 - * $Id: isa.h,v 1.17 1995/11/18 09:29:39 bde Exp $ + * $Id: isa.h,v 1.18 1996/01/30 22:55:57 mpp Exp $ */ +#ifdef PC98 +#error isa.h is included from PC-9801 source +#endif + #ifndef _I386_ISA_ISA_H_ #define _I386_ISA_ISA_H_ diff --git a/sys/i386/isa/isa_device.h b/sys/i386/isa/isa_device.h index 3347934..996a08a 100644 --- a/sys/i386/isa/isa_device.h +++ b/sys/i386/isa/isa_device.h @@ -31,9 +31,13 @@ * SUCH DAMAGE. * * from: @(#)isa_device.h 7.1 (Berkeley) 5/9/91 - * $Id: isa_device.h,v 1.28 1996/01/30 22:56:02 mpp Exp $ + * $Id: isa_device.h,v 1.29 1996/04/08 19:38:57 smpatel Exp $ */ +#ifdef PC98 +#error isa_device.h is included from PC-9801 source +#endif + #ifndef _I386_ISA_ISA_DEVICE_H_ #define _I386_ISA_ISA_DEVICE_H_ diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 2a9984e..ffc458b 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * @(#)init_main.c 8.9 (Berkeley) 1/21/94 - * $Id: init_main.c,v 1.40 1996/03/11 06:14:38 hsu Exp $ + * $Id: init_main.c,v 1.42 1996/06/11 23:50:48 dyson Exp $ */ #include "opt_rlimit.h" @@ -283,8 +283,15 @@ char copyright[] = "Copyright (c) 1982, 1986, 1989, 1991, 1993\n\tThe Regents of the University of California.\nCopyright (c) 1992 Hewlett-Packard Company\nCopyright (c) 1992 Motorola Inc.\nAll rights reserved.\n\n"; #else char copyright[] = +#ifdef PC98 +"Copyright (c) 1994-1996 FreeBSD(98) porting team.\n" +"Copyright (c) 1982, 1986, 1989, 1991, 1993\n\tThe Regents of the University of California.\n" +"Copyright (c) 1992 A.Kojima F.Ukai M.Ishii (KMC).\n" +"\tAll rights reserved.\n\n"; +#else "Copyright (c) 1982, 1986, 1989, 1991, 1993\n\tThe Regents of the University of California. All rights reserved.\n\n"; #endif +#endif static void print_caddr_t __P((void *data)); static void print_caddr_t(data) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 6b41014..0fc6b7f 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -18,7 +18,7 @@ * 5. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: vfs_bio.c,v 1.91 1996/05/24 05:21:58 dyson Exp $ + * $Id: vfs_bio.c,v 1.92 1996/05/31 00:41:37 dyson Exp $ */ /* @@ -1062,6 +1062,13 @@ loop: splx(s); allocbuf(bp, size); +#ifdef PC98 + /* + * 1024byte/sector support + */ +#define B_XXX2 0x8000000 + if (vp->v_flag & 0x10000) bp->b_flags |= B_XXX2; +#endif return (bp); } } diff --git a/sys/msdosfs/msdosfs_denode.c b/sys/msdosfs/msdosfs_denode.c index bec376c..90d598d 100644 --- a/sys/msdosfs/msdosfs_denode.c +++ b/sys/msdosfs/msdosfs_denode.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_denode.c,v 1.16 1996/01/19 03:58:42 dyson Exp $ */ +/* $Id: msdosfs_denode.c,v 1.17 1996/06/12 03:37:42 davidg Exp $ */ /* $NetBSD: msdosfs_denode.c,v 1.9 1994/08/21 18:44:00 ws Exp $ */ /*- @@ -495,6 +495,13 @@ detrunc(dep, length, flags, cred, p) NOCRED, &bp); } else { bn = de_blk(pmp, length); +#ifdef PC98 + /* + * 1024 byte/sector support + */ + if (pmp->pm_BytesPerSec == 1024) + DETOV(dep)->v_flag |= 0x10000; +#endif error = bread(DETOV(dep), bn, pmp->pm_bpcluster, NOCRED, &bp); } diff --git a/sys/msdosfs/msdosfs_lookup.c b/sys/msdosfs/msdosfs_lookup.c index bc52390..db4f927 100644 --- a/sys/msdosfs/msdosfs_lookup.c +++ b/sys/msdosfs/msdosfs_lookup.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_lookup.c,v 1.5 1995/11/07 14:06:43 phk Exp $ */ +/* $Id: msdosfs_lookup.c,v 1.6 1995/12/03 16:42:01 bde Exp $ */ /* $NetBSD: msdosfs_lookup.c,v 1.14 1994/08/21 18:44:07 ws Exp $ */ /*- @@ -172,6 +172,13 @@ msdosfs_lookup(ap) printf("msdosfs_lookup(): cache hit, vnode %08x, file %s\n", vdp, dp->de_Name); #endif +#ifdef PC98 + /* + * 1024 byte/sector support + */ + if (pmp->pm_BytesPerSec == 1024) + vdp->v_flag |= 0x10000; +#endif return 0; } vput(vdp); diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c index 18dc492..7ada694 100644 --- a/sys/msdosfs/msdosfs_vfsops.c +++ b/sys/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vfsops.c,v 1.11 1996/01/05 18:31:43 wollman Exp $ */ +/* $Id: msdosfs_vfsops.c,v 1.12 1996/04/03 23:05:40 gpalmer Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.19 1994/08/21 18:44:10 ws Exp $ */ /*- @@ -273,6 +273,10 @@ mountmsdosfs(devvp, mp, p) struct buf *bp0 = NULL; struct byte_bpb33 *b33; struct byte_bpb50 *b50; +#ifdef PC98 + u_int pc98_wrk; + u_int Phy_Sector_Size; +#endif /* * Multiple mounts of the same block special file aren't allowed. @@ -311,7 +315,12 @@ mountmsdosfs(devvp, mp, p) * also add some checking on the bsOemName field. So far I've seen * the following values: "IBM 3.3" "MSDOS3.3" "MSDOS5.0" */ +#ifdef PC98 + devvp->v_flag &= 0xffff; + error = bread(devvp, 0, 1024, NOCRED, &bp0); +#else error = bread(devvp, 0, 512, NOCRED, &bp0); +#endif if (error) goto error_exit; bp0->b_flags |= B_AGE; @@ -319,7 +328,14 @@ mountmsdosfs(devvp, mp, p) b33 = (struct byte_bpb33 *) bsp->bs33.bsBPB; b50 = (struct byte_bpb50 *) bsp->bs50.bsBPB; #ifdef MSDOSFS_CHECKSIG +#ifdef PC98 + if (bsp->bs50.bsBootSectSig != BOOTSIG && + bsp->bs50.bsBootSectSig != 0 && /* PC98 DOS 3.3x */ + bsp->bs50.bsBootSectSig != 15760 && /* PC98 DOS 5.0 */ + bsp->bs50.bsBootSectSig != 64070) { /* PC98 DOS 3.3B */ +#else if (bsp->bs50.bsBootSectSig != BOOTSIG) { +#endif error = EINVAL; goto error_exit; } @@ -353,7 +369,11 @@ mountmsdosfs(devvp, mp, p) /* XXX - We should probably check more values here */ if (!pmp->pm_BytesPerSec || !pmp->pm_SectPerClust || !pmp->pm_Heads || pmp->pm_Heads > 255 || +#ifdef PC98 + !pmp->pm_SecPerTrack || pmp->pm_SecPerTrack > 255) { +#else !pmp->pm_SecPerTrack || pmp->pm_SecPerTrack > 63) { +#endif error = EINVAL; goto error_exit; } @@ -365,6 +385,41 @@ mountmsdosfs(devvp, mp, p) pmp->pm_HiddenSects = getushort(b33->bpbHiddenSecs); pmp->pm_HugeSectors = pmp->pm_Sectors; } +#ifdef PC98 /* for PC98 added Satoshi Yasuda */ + Phy_Sector_Size = 512; + if ((devvp->v_rdev>>8) == 2) { /* floppy check */ + if (((devvp->v_rdev&077) == 2) && (pmp->pm_HugeSectors == 1232)) { + Phy_Sector_Size = 1024; /* 2HD */ + /* + * 1024byte/sector support + */ + devvp->v_flag |= 0x10000; + } else { + if ((((devvp->v_rdev&077) == 3) /* 2DD 8 or 9 sector */ + && (pmp->pm_HugeSectors == 1440)) /* 9 sector */ + || (((devvp->v_rdev&077) == 4) + && (pmp->pm_HugeSectors == 1280)) /* 8 sector */ + || (((devvp->v_rdev&077) == 5) + && (pmp->pm_HugeSectors == 2880))) { /* 1.44M */ + Phy_Sector_Size = 512; + } else { + if (((devvp->v_rdev&077) != 1) + && ((devvp->v_rdev&077) != 0)) { /* 2HC */ + error = EINVAL; + goto error_exit; + } + } + } + } + pc98_wrk = pmp->pm_BytesPerSec / Phy_Sector_Size; + pmp->pm_BytesPerSec = Phy_Sector_Size; + pmp->pm_SectPerClust = pmp->pm_SectPerClust * pc98_wrk; + pmp->pm_HugeSectors = pmp->pm_HugeSectors * pc98_wrk; + pmp->pm_ResSectors = pmp->pm_ResSectors * pc98_wrk; + pmp->pm_FATsecs = pmp->pm_FATsecs * pc98_wrk; + pmp->pm_SecPerTrack = pmp->pm_SecPerTrack * pc98_wrk; + pmp->pm_HiddenSects = pmp->pm_HiddenSects * pc98_wrk; +#endif /* */ pmp->pm_fatblk = pmp->pm_ResSectors; pmp->pm_rootdirblk = pmp->pm_fatblk + (pmp->pm_FATs * pmp->pm_FATsecs); @@ -420,8 +475,18 @@ mountmsdosfs(devvp, mp, p) bit <<= 1; } +#ifdef PC98 + if (Phy_Sector_Size == 512) { + pmp->pm_brbomask = 0x01ff; /* 512 byte blocks only (so far) */ + pmp->pm_bnshift = 9; /* shift right 9 bits to get bn */ + } else { + pmp->pm_brbomask = 0x03ff; + pmp->pm_bnshift = 10; + } +#else pmp->pm_brbomask = 0x01ff; /* 512 byte blocks only (so far) */ pmp->pm_bnshift = 9; /* shift right 9 bits to get bn */ +#endif /* * Release the bootsector buffer. diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 899d9f8..83efc30 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.29 1995/12/03 16:42:02 bde Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.30 1995/12/07 12:47:20 davidg Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */ /*- @@ -558,6 +558,13 @@ msdosfs_read(ap) NOCRED, &bp); } else { rablock = lbn + 1; +#ifdef PC98 + /* + * 1024byte/sector support + */ + if (pmp->pm_BytesPerSec == 1024) + vp->v_flag |= 0x10000; +#endif if (vp->v_lastr + 1 == lbn && rablock * pmp->pm_bpcluster < dep->de_FileSize) { rasize = pmp->pm_bpcluster; @@ -693,6 +700,13 @@ msdosfs_write(ap) osize = dep->de_FileSize; +#ifdef PC98 + /* + * 1024byte/sector support + */ + if (pmp->pm_BytesPerSec == 1024) + thisvp->v_flag |= 0x10000; +#endif /* * If we write beyond the end of the file, extend it to its ultimate * size ahead of the time to hopefully get a contiguous area. diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c index 9711e0c..b9d29b0 100644 --- a/sys/net/ppp_tty.c +++ b/sys/net/ppp_tty.c @@ -70,7 +70,7 @@ * Paul Mackerras (paulus@cs.anu.edu.au). */ -/* $Id: ppp_tty.c,v 1.7 1996/06/12 19:24:03 gpalmer Exp $ */ +/* $Id: ppp_tty.c,v 1.8 1996/06/12 20:07:09 nate Exp $ */ /* from Id: ppp_tty.c,v 1.3 1995/08/16 01:36:40 paulus Exp */ /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */ @@ -98,8 +98,12 @@ #ifdef i386 /* fiddle with the spl locking */ # include <machine/spl.h> +#ifdef PC98 +# include <i386/pc98/pc98_device.h> +#else # include <i386/isa/isa_device.h> #endif +#endif #include <net/if.h> #include <net/if_types.h> diff --git a/sys/pccard/i82365.h b/sys/pccard/i82365.h index c50c0f9..f6140ef 100644 --- a/sys/pccard/i82365.h +++ b/sys/pccard/i82365.h @@ -43,6 +43,9 @@ #define PCIC_VG469 7 #define PCIC_RF5C396 8 /* Ricoh RF5C396 */ #define PCIC_IBM_KING 9 /* IBM KING PCMCIA Controller */ +#ifdef PC98 +#define PCIC_PC98 10 +#endif /* * Address of the controllers. Each controller can manage * two PCMCIA slots. Up to 8 slots are supported in total. diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c index 3f223a8..ac6466d 100644 --- a/sys/pccard/pccard.c +++ b/sys/pccard/pccard.c @@ -47,9 +47,15 @@ #include <sys/devfsext.h> #endif /*DEVFS*/ +#ifdef PC98 +#include <pc98/pc98/pc98.h> +#include <pc98/pc98/pc98_device.h> +#include <pc98/pc98/icu.h> +#else #include <i386/isa/isa.h> #include <i386/isa/isa_device.h> #include <i386/isa/icu.h> +#endif /* PC98 */ #include "apm.h" #if NAPM > 0 @@ -480,6 +486,8 @@ allocate_driver(struct slot *sp, struct drv_desc *drvp) struct pccard_drv *dp; int err, irq = 0, s; +/* BUCHI */ + dp = find_driver(drvp->name); if (dp == 0) return(ENXIO); @@ -499,6 +507,12 @@ allocate_driver(struct slot *sp, struct drv_desc *drvp) * If an interrupt mask has been given, then check it * against the slot interrupt (if one has been allocated). */ +/* BUCHI */ +#if 0 +printf("drvp->irqmask=0x%x, dp->imask=0x%x, sp->irq=0x%x, sp->ctrl->irqs=0x%x\n", drvp->irqmask, dp->imask, sp->irq, sp->ctrl->irqs); +printf("name=%s, unit=%d, mem=0x%x, memsz=%d, iobase=0x%x, irqmask=0x%x\n", drvp->name, drvp->unit, drvp->mem, drvp->memsize, drvp->iobase, drvp->irqmask); +#endif + if (drvp->irqmask && dp->imask) { if ((sp->ctrl->irqs & drvp->irqmask)==0) return(EINVAL); diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c index 456b251..a5ffb12 100644 --- a/sys/pccard/pcic.c +++ b/sys/pccard/pcic.c @@ -28,6 +28,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* + * pcic98 : PC9801 original PCMCIA controller code for NS/A,Ne,NX/C,NR/L. + * by Noriyuki Hosobuchi <yj8n-hsbc@asahi-net.or.jp> + */ + #ifdef LKM #define NPCIC 1 #else @@ -51,11 +56,20 @@ #include <machine/clock.h> #include <machine/laptops.h> +#ifdef PC98 +#include <pc98/pc98/pc98.h> +#include <pc98/pc98/pc98_device.h> +#include <pc98/pc98/icu.h> +#else #include <i386/isa/isa.h> #include <i386/isa/isa_device.h> #include <i386/isa/icu.h> +#endif #include <pccard/i82365.h> +#ifdef PC98 +#include <pccard/pcic98reg.h> +#endif #include <pccard/card.h> #include <pccard/driver.h> #include <pccard/slot.h> @@ -295,6 +309,49 @@ pcic_memory(struct slot *slotp, int win) struct mem_desc *mp = &slotp->mem[win]; int reg = mp->window * PCIC_MEMSIZE + PCIC_MEMBASE; +#ifdef PC98 + if (sp->controller == PCIC_PC98){ + if (mp->flags & MDF_ACTIVE){ + /* slot = 0, window = 0, sys_addr = 0xda000, length = 8KB */ + unsigned char x; + + if ((unsigned long)mp->start != 0xda000){ + printf("sys_addr must be 0xda000. requested address = 0x%x\n", + mp->start); + return(EINVAL); + } + + /* omajinai ??? */ + outb(PCIC98_REG0, 0); + x = inb(PCIC98_REG1); + x &= 0xfc; + x |= 0x02; + outb(PCIC98_REG1, x); + + outw(PCIC98_REG_PAGOFS, 0); + + if (mp->flags & MDF_ATTR){ + outb(PCIC98_REG6, inb(PCIC98_REG6) | PCIC98_ATTRMEM); + }else{ + outb(PCIC98_REG6, inb(PCIC98_REG6) & (~PCIC98_ATTRMEM)); + } + + outb(PCIC98_REG_WINSEL, PCIC98_MAPWIN); + +#if 0 + if (mp->flags & MDF_16BITS == 1){ /* 16bit */ + outb(PCIC98_REG2, inb(PCIC98_REG2) & (~PCIC98_8BIT)); + }else{ /* 8bit */ + outb(PCIC98_REG2, inb(PCIC98_REG2) | PCIC98_8BIT); + } +#endif + }else{ + outb(PCIC98_REG_WINSEL, PCIC98_UNMAPWIN); + } + return 0; + } +#endif /* PC98 */ + if (mp->flags & MDF_ACTIVE) { unsigned long sys_addr = (unsigned long)mp->start >> 12; @@ -365,7 +422,46 @@ pcic_io(struct slot *slotp, int win) int mask, reg; struct pcic_slot *sp = slotp->cdata; struct io_desc *ip = &slotp->io[win]; +#ifdef PC98 + if (sp->controller == PCIC_PC98){ + unsigned char x; + +#if 0 + if (win =! 0){ + printf("pcic98:Illegal PCIC I/O window request(%d)!", win); + return(EINVAL); + } +#endif + if (ip->flags & IODF_ACTIVE){ + unsigned short base; + + x = inb(PCIC98_REG2) & 0x0f; + if (! (ip->flags & IODF_16BIT)) + x |= PCIC98_8BIT; + + if (ip->size > 16) /* 128bytes mapping */ + x |= PCIC98_MAP128; + + x |= PCIC98_IOMEMORY; + outb(PCIC98_REG2, x); + + base = 0x80d0; + outw(PCIC98_REG4, base); /* 98side IO base */ + outw(PCIC98_REG5, ip->start); /* card side IO base */ + +#ifdef PCIC_DEBUG + printf("pcic98: IO mapped 0x%04x(98) -> 0x%04x(Card) and width %d bytes\n", + base, ip->start, ip->size); +#endif + ip->start = base; + + }else{ + outb(PCIC98_REG2, inb(PCIC98_REG2) & (~PCIC98_IOMEMORY)); + } + return 0; + } +#endif switch (win) { case 0: mask = PCIC_IO0_EN; @@ -649,8 +745,52 @@ pcic_probe () if (pcic_irq > 0) putb(sp, PCIC_STAT_INT, (pcic_irq << 4) | 0xF); } +#ifdef PC98 + if (validslots == 0){ + sp = pcic_slots; slot = 0; + if (inb(PCIC98_REG0) != 0xff){ + sp->controller = PCIC_PC98; + sp->revision = 0; + cinfo.name = "PC98 Original"; + cinfo.maxmem = 1; + cinfo.maxio = 1; +/* cinfo.irqs = PCIC_INT_MASK_ALLOWED;*/ + cinfo.irqs = 0x1468; + validslots++; + sp->slot = slot; + if (kdc_pcic[slot].kdc_state == DC_UNKNOWN) { + if (slot != 0) + kdc_pcic[slot] = kdc_pcic[0]; + kdc_pcic[slot].kdc_unit = slot; + kdc_pcic[slot].kdc_state = DC_UNCONFIGURED; + kdc_pcic[slot].kdc_description = cinfo.name; + dev_attach(kdc_pcic+slot); + } + + slotp = pccard_alloc_slot(&cinfo); + if (slotp == 0){ + printf("pcic98: slotp == NULL\n"); + goto pcic98_probe_end; + } + kdc_pcic[slot].kdc_state = DC_IDLE; + slotp->cdata = sp; + sp->slotp = slotp; + + /* Check for a card in this slot */ + if (inb(PCIC98_REG1) & PCIC98_CARDEXIST){ + /* PCMCIA card exist */ + slotp->laststate = slotp->state = filled; + pccard_event(sp->slotp, card_inserted); + } else { + slotp->laststate = slotp->state = empty; + } + } + pcic98_probe_end: + } +#endif /* PC98 */ if (validslots) timeout(pcictimeout,0,hz/2); +/* BUCHI */ return(validslots); } @@ -690,6 +830,35 @@ pcic_power(struct slot *slotp) struct pcic_slot *sp = slotp->cdata; switch(sp->controller) { +#ifdef PC98 + case PCIC_PC98: + reg = inb(PCIC98_REG6) & (~PCIC98_VPP12V); + switch(slotp->pwr.vpp) { + default: + return(EINVAL); + case 50: + break; + case 120: + reg |= PCIC98_VPP12V; + break; + } + outb(PCIC98_REG6, reg); + DELAY (100*1000); + + reg = inb(PCIC98_REG2) & (~PCIC98_VCC3P3V); + switch(slotp->pwr.vcc) { + default: + return(EINVAL); + case 33: + reg |= PCIC98_VCC3P3V; + break; + case 50: + break; + } + outb(PCIC98_REG2, reg); + DELAY (100*1000); + return (0); +#endif case PCIC_PD672X: case PCIC_PD6710: case PCIC_VG468: @@ -760,7 +929,35 @@ static void pcic_mapirq (struct slot *slotp, int irq) { struct pcic_slot *sp = slotp->cdata; +#ifdef PC98 + if (sp->controller == PCIC_PC98){ + unsigned char x; + switch (irq){ + case 3: + x = PCIC98_INT0; break; + case 5: + x = PCIC98_INT1; break; + case 6: + x = PCIC98_INT2; break; + case 10: + x = PCIC98_INT4; break; + case 12: + x = PCIC98_INT5; break; + case 0: /* disable */ + x = PCIC98_INTDISABLE; + break; + default: + printf("pcic98: illegal irq %d\n", irq); + return; + } +#ifdef PCIC_DEBUG + printf("pcic98: irq=%d mapped.\n", irq); +#endif + outb(PCIC98_REG3, x); + return; + } +#endif if (irq == 0) clrb(sp, PCIC_INT_GEN, 0xF); else @@ -777,6 +974,19 @@ pcic_reset(void *chan) struct slot *slotp = chan; struct pcic_slot *sp = slotp->cdata; +#ifdef PC98 + if (sp->controller == PCIC_PC98){ + outb(PCIC98_REG0, 0); + outb(PCIC98_REG2, inb(PCIC98_REG2) & (~PCIC98_IOMEMORY)); + outb(PCIC98_REG3, PCIC98_INTDISABLE); + outb(PCIC98_REG2, inb(PCIC98_REG2) & (~PCIC98_VCC3P3V)); + outb(PCIC98_REG6, inb(PCIC98_REG6) & (~PCIC98_VPP12V)); + outb(PCIC98_REG1, 0); + + selwakeup(&slotp->selp); + return; + } +#endif switch (slotp->insert_seq) { case 0: /* Something funny happended on the way to the pub... */ return; @@ -816,6 +1026,11 @@ pcic_disable(struct slot *slotp) { struct pcic_slot *sp = slotp->cdata; +#ifdef PC98 + if (sp->controller == PCIC_PC98){ + return; + } +#endif putb(sp, PCIC_INT_GEN, 0); putb(sp, PCIC_POWER, 0); } @@ -845,6 +1060,26 @@ pcicintr(int unit) unsigned char chg; struct pcic_slot *sp = pcic_slots; +#ifdef PC98 + if (sp->controller == PCIC_PC98){ + slot = 0; + s = splhigh(); + /* Check for a card in this slot */ + if (inb(PCIC98_REG1) & PCIC98_CARDEXIST){ + if (sp->slotp->laststate != filled){ + kdc_pcic[slot].kdc_state = DC_BUSY;; + pccard_event(sp->slotp, card_inserted); + } + } else { + if (sp->slotp->laststate != empty){ + kdc_pcic[slot].kdc_state = DC_IDLE;; + pccard_event(sp->slotp, card_removed); + } + } + splx(s); + return; + } +#endif /* PC98 */ s = splhigh(); for (slot = 0; slot < PCIC_MAX_SLOTS; slot++, sp++) if (sp->slotp && (chg = getb(sp, PCIC_STAT_CHG)) != 0) diff --git a/sys/pccard/slot.h b/sys/pccard/slot.h index fb9b23e..af19e5e 100644 --- a/sys/pccard/slot.h +++ b/sys/pccard/slot.h @@ -93,7 +93,11 @@ struct pccard_drv { */ struct pccard_dev { struct pccard_dev *next; /* List of drivers */ +#ifdef PC98 + struct pc98_device isahd; /* Device details */ +#else struct isa_device isahd; /* Device details */ +#endif struct pccard_drv *drv; void *arg; /* Device argument */ struct slot *sp; /* Back pointer to slot */ diff --git a/sys/pci/if_ed_p.c b/sys/pci/if_ed_p.c index ce46c07..eb0391a 100644 --- a/sys/pci/if_ed_p.c +++ b/sys/pci/if_ed_p.c @@ -17,7 +17,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: if_ed_p.c,v 1.1 1996/05/18 17:56:40 se Exp $ + * $Id: if_ed_p.c,v 1.2 1996/06/11 00:51:49 alex Exp $ */ #include <pci.h> @@ -29,7 +29,11 @@ #include <sys/kernel.h> #include <pci/pcireg.h> #include <pci/pcivar.h> +#ifdef PC98 +#include <pc98/pc98/pc98_device.h> +#else #include <i386/isa/isa_device.h> +#endif #include <ed.h> diff --git a/sys/pci/wd82371.c b/sys/pci/wd82371.c index 72ceb19..b5fbce1 100644 --- a/sys/pci/wd82371.c +++ b/sys/pci/wd82371.c @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: wd82371.c,v 1.3 1996/04/07 17:39:17 bde Exp $ + * $Id: wd82371.c,v 1.4 1996/05/02 14:20:50 phk Exp $ */ #include "pci.h" @@ -44,7 +44,11 @@ #include <machine/pmap.h> /* for vtophys */ +#ifdef PC98 +#include <pc98/pc98/wdreg.h> +#else #include <i386/isa/wdreg.h> +#endif #include <pci/pcivar.h> #include <pci/pcireg.h> diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index 62efd5e..24223d3 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -16,7 +16,7 @@ * * New configuration setup: dufault@hda.com * - * $Id: scsiconf.c,v 1.58 1996/04/07 17:32:42 bde Exp $ + * $Id: scsiconf.c,v 1.59 1996/06/03 14:25:11 jfieber Exp $ */ #include "opt_scsi.h" @@ -29,6 +29,9 @@ #include <sys/sysctl.h> #include <sys/devconf.h> #include <sys/conf.h> +#ifdef PC98 +#include <sys/device.h> +#endif #include <machine/clock.h> @@ -619,6 +622,11 @@ scsi_assign_unit(struct scsi_link *sc_link) { int i; int found; +#ifdef PC98 + struct cfdata cf; + cf.cf_flags = 0; +#endif + found = 0; for (i = 0; scsi_dinit[i].name; i++) { if ((strcmp(sc_link->device->name, scsi_dinit[i].name) == 0) && @@ -630,6 +638,9 @@ scsi_assign_unit(struct scsi_link *sc_link) sc_link->scsibus == scsi_dinit[i].cunit) { sc_link->dev_unit = scsi_dinit[i].unit; found = 1; +#ifdef PC98 + cf.cf_flags = scsi_dinit[i].flags; +#endif if (bootverbose) printf("%s is configured at %d\n", sc_link->device->name, sc_link->dev_unit); @@ -640,6 +651,18 @@ scsi_assign_unit(struct scsi_link *sc_link) if (!found) sc_link->dev_unit = sc_link->device->free_unit++; +#ifdef PC98 + if (!found) { + for (i = 0; scsi_dinit[i].name; i++) { + if ((strcmp(sc_link->device->name, scsi_dinit[i].name) == 0) && + (scsi_dinit[i].target == SCCONF_UNSPEC)) + cf.cf_flags = scsi_dinit[i].flags; + } + } + if (sc_link->adapter->open_target_lu) + (*(sc_link->adapter->open_target_lu))(sc_link, &cf); +#endif + return sc_link->dev_unit; } diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h index d09f3a7..be3f6e0 100644 --- a/sys/scsi/scsiconf.h +++ b/sys/scsi/scsiconf.h @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * $Id: scsiconf.h,v 1.40 1996/03/10 07:13:11 gibbs Exp $ + * $Id: scsiconf.h,v 1.41 1996/03/31 03:19:09 gibbs Exp $ */ #ifndef SCSI_SCSICONF_H #define SCSI_SCSICONF_H 1 @@ -56,6 +56,9 @@ typedef int errval; struct buf; struct scsi_xfer; +#ifdef PC98 +struct cfdata; +#endif /* * These entrypoints are called by the high-end drivers to get services from @@ -66,7 +69,12 @@ struct scsi_adapter { /* 04*/ int32_t (*scsi_cmd) __P((struct scsi_xfer *xs)); /* 08*/ void (*scsi_minphys) __P((struct buf *bp)); +#ifdef PC98 +/* 12*/ int32_t (*open_target_lu) __P((struct scsi_link *sc_link, + struct cfdata *cf)); +#else /* 12*/ int32_t (*open_target_lu) __P((void)); +#endif /* 16*/ int32_t (*close_target_lu) __P((void)); /* 20*/ u_int32_t (*adapter_info) __P((int unit)); /* see definitions below */ /* 24*/ char *name; /* name of scsi bus controller */ diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 5ef8477..a78e727 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992 * - * $Id: sd.c,v 1.88 1996/05/02 14:20:54 phk Exp $ + * $Id: sd.c,v 1.89 1996/05/02 22:20:52 phk Exp $ */ #include "opt_bounce.h" @@ -52,7 +52,11 @@ static u_int32_t sdstrats, sdqueues; #define SECSIZE 512 +#ifdef PC98 +#define SDOUTSTANDING 2 +#else #define SDOUTSTANDING 4 +#endif #define SD_RETRIES 4 #define MAXTRANSFER 8 /* 1 page at a time */ @@ -738,7 +742,9 @@ sd_get_parms(unit, flags) union disk_pages pages; } scsi_sense; u_int32_t sectors; - +#ifdef PC98 + unsigned char *tmp; +#endif /* * First check if we have it all loaded */ @@ -752,6 +758,39 @@ sd_get_parms(unit, flags) scsi_cmd.op_code = MODE_SENSE; scsi_cmd.page = 4; scsi_cmd.length = 0x20; +#ifdef PC98 +#define PC98_SYSTEM_PARAMETER(x) pc98_system_parameter[(x)-0x400] + tmp = (unsigned char *)&PC98_SYSTEM_PARAMETER(0x460 + sc_link->target*4); + if ((PC98_SYSTEM_PARAMETER(0x482) & + ((1 << sc_link->target)&0xff)) != 0) { + disk_parms->sectors = *tmp; + disk_parms->cyls = ((*(tmp+3)<<8)|*(tmp+2))&0xfff; + switch (*(tmp + 3) & 0x30) { + case 0x00: + disk_parms->secsiz = 256; + printf("Warning!: not supported.\n"); + break; + case 0x10: + disk_parms->secsiz = 512; + break; + case 0x20: + disk_parms->secsiz = 1024; + printf("Warning!: not supported.\n"); + break; + default: + disk_parms->secsiz = 512; + printf("Warning!: not supported. But force to 512\n"); + } + if (*(tmp+3) & 0x40) { + disk_parms->cyls += (*(tmp+1)&0xf0)<<8; + disk_parms->heads = *(tmp+1)&0x0f; + } else { + disk_parms->heads = *(tmp+1); + } + disk_parms->disksize = disk_parms->sectors * disk_parms->heads * + disk_parms->cyls; + } else +#endif /* * If the command worked, use the results to fill out * the parameter structure diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h index d75d6d1..1645096 100644 --- a/sys/sys/disklabel.h +++ b/sys/sys/disklabel.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)disklabel.h 8.2 (Berkeley) 7/10/94 - * $Id: disklabel.h,v 1.20 1996/03/11 02:06:30 hsu Exp $ + * $Id: disklabel.h,v 1.21 1996/05/03 05:38:34 asami Exp $ */ #ifndef _SYS_DISKLABEL_H_ @@ -199,6 +199,10 @@ struct disklabel { #define DTYPE_FLOPPY 10 /* floppy */ #define DTYPE_CCD 11 /* concatenated disk */ +#ifdef PC98 +#define DSTYPE_SEC256 0x80 /* physical sector size=256*/ +#endif + #ifdef DKTYPENAMES static char *dktypenames[] = { "unknown", @@ -312,6 +316,34 @@ struct partinfo { /* DOS partition table -- located in boot block */ +#ifdef PC98 +#define DOSBBSECTOR 0 /* DOS boot block relative sector number */ +#define DOSLABELSECTOR 1 /* 0: 256b/s, 1: 512b/s */ +#define DOSPARTOFF 0 +#define NDOSPART 16 +#define DOSPTYP_386BSD 0x94 /* 386BSD partition type */ +#define MBR_PTYPE_FreeBSD 0x94 /* FreeBSD partition type */ + +struct dos_partition { + unsigned char dp_mid; +#define DOSMID_386BSD (0x14|0x80) /* 386bsd|bootable */ + unsigned char dp_sid; +#define DOSSID_386BSD (0x44|0x80) /* 386bsd|active */ + unsigned char dp_dum1; + unsigned char dp_dum2; + unsigned char dp_ipl_sct; + unsigned char dp_ipl_head; + unsigned short dp_ipl_cyl; + unsigned char dp_ssect; /* starting sector */ + unsigned char dp_shd; /* starting head */ + unsigned short dp_scyl; /* starting cylinder */ + unsigned char dp_esect; /* end sector */ + unsigned char dp_ehd; /* end head */ + unsigned short dp_ecyl; /* end cylinder */ + unsigned char dp_name[16]; +}; + +#else /* IBMPC */ #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ #define DOSPARTOFF 446 #define NDOSPART 4 @@ -329,6 +361,7 @@ struct dos_partition { unsigned long dp_start; /* absolute starting sector number */ unsigned long dp_size; /* partition size in sectors */ }; +#endif #define DPSECT(s) ((s) & 0x3f) /* isolate relevant bits of sector */ #define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */ diff --git a/sys/sys/diskmbr.h b/sys/sys/diskmbr.h index d75d6d1..1645096 100644 --- a/sys/sys/diskmbr.h +++ b/sys/sys/diskmbr.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)disklabel.h 8.2 (Berkeley) 7/10/94 - * $Id: disklabel.h,v 1.20 1996/03/11 02:06:30 hsu Exp $ + * $Id: disklabel.h,v 1.21 1996/05/03 05:38:34 asami Exp $ */ #ifndef _SYS_DISKLABEL_H_ @@ -199,6 +199,10 @@ struct disklabel { #define DTYPE_FLOPPY 10 /* floppy */ #define DTYPE_CCD 11 /* concatenated disk */ +#ifdef PC98 +#define DSTYPE_SEC256 0x80 /* physical sector size=256*/ +#endif + #ifdef DKTYPENAMES static char *dktypenames[] = { "unknown", @@ -312,6 +316,34 @@ struct partinfo { /* DOS partition table -- located in boot block */ +#ifdef PC98 +#define DOSBBSECTOR 0 /* DOS boot block relative sector number */ +#define DOSLABELSECTOR 1 /* 0: 256b/s, 1: 512b/s */ +#define DOSPARTOFF 0 +#define NDOSPART 16 +#define DOSPTYP_386BSD 0x94 /* 386BSD partition type */ +#define MBR_PTYPE_FreeBSD 0x94 /* FreeBSD partition type */ + +struct dos_partition { + unsigned char dp_mid; +#define DOSMID_386BSD (0x14|0x80) /* 386bsd|bootable */ + unsigned char dp_sid; +#define DOSSID_386BSD (0x44|0x80) /* 386bsd|active */ + unsigned char dp_dum1; + unsigned char dp_dum2; + unsigned char dp_ipl_sct; + unsigned char dp_ipl_head; + unsigned short dp_ipl_cyl; + unsigned char dp_ssect; /* starting sector */ + unsigned char dp_shd; /* starting head */ + unsigned short dp_scyl; /* starting cylinder */ + unsigned char dp_esect; /* end sector */ + unsigned char dp_ehd; /* end head */ + unsigned short dp_ecyl; /* end cylinder */ + unsigned char dp_name[16]; +}; + +#else /* IBMPC */ #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ #define DOSPARTOFF 446 #define NDOSPART 4 @@ -329,6 +361,7 @@ struct dos_partition { unsigned long dp_start; /* absolute starting sector number */ unsigned long dp_size; /* partition size in sectors */ }; +#endif #define DPSECT(s) ((s) & 0x3f) /* isolate relevant bits of sector */ #define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */ diff --git a/sys/sys/diskpc98.h b/sys/sys/diskpc98.h index d75d6d1..1645096 100644 --- a/sys/sys/diskpc98.h +++ b/sys/sys/diskpc98.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)disklabel.h 8.2 (Berkeley) 7/10/94 - * $Id: disklabel.h,v 1.20 1996/03/11 02:06:30 hsu Exp $ + * $Id: disklabel.h,v 1.21 1996/05/03 05:38:34 asami Exp $ */ #ifndef _SYS_DISKLABEL_H_ @@ -199,6 +199,10 @@ struct disklabel { #define DTYPE_FLOPPY 10 /* floppy */ #define DTYPE_CCD 11 /* concatenated disk */ +#ifdef PC98 +#define DSTYPE_SEC256 0x80 /* physical sector size=256*/ +#endif + #ifdef DKTYPENAMES static char *dktypenames[] = { "unknown", @@ -312,6 +316,34 @@ struct partinfo { /* DOS partition table -- located in boot block */ +#ifdef PC98 +#define DOSBBSECTOR 0 /* DOS boot block relative sector number */ +#define DOSLABELSECTOR 1 /* 0: 256b/s, 1: 512b/s */ +#define DOSPARTOFF 0 +#define NDOSPART 16 +#define DOSPTYP_386BSD 0x94 /* 386BSD partition type */ +#define MBR_PTYPE_FreeBSD 0x94 /* FreeBSD partition type */ + +struct dos_partition { + unsigned char dp_mid; +#define DOSMID_386BSD (0x14|0x80) /* 386bsd|bootable */ + unsigned char dp_sid; +#define DOSSID_386BSD (0x44|0x80) /* 386bsd|active */ + unsigned char dp_dum1; + unsigned char dp_dum2; + unsigned char dp_ipl_sct; + unsigned char dp_ipl_head; + unsigned short dp_ipl_cyl; + unsigned char dp_ssect; /* starting sector */ + unsigned char dp_shd; /* starting head */ + unsigned short dp_scyl; /* starting cylinder */ + unsigned char dp_esect; /* end sector */ + unsigned char dp_ehd; /* end head */ + unsigned short dp_ecyl; /* end cylinder */ + unsigned char dp_name[16]; +}; + +#else /* IBMPC */ #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ #define DOSPARTOFF 446 #define NDOSPART 4 @@ -329,6 +361,7 @@ struct dos_partition { unsigned long dp_start; /* absolute starting sector number */ unsigned long dp_size; /* partition size in sectors */ }; +#endif #define DPSECT(s) ((s) & 0x3f) /* isolate relevant bits of sector */ #define DPCYL(c, s) ((c) + (((s) & 0xc0)<<2)) /* and those that are cylinder */ diff --git a/sys/sys/diskslice.h b/sys/sys/diskslice.h index 5695c27..5f8b600 100644 --- a/sys/sys/diskslice.h +++ b/sys/sys/diskslice.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: diskslice.h,v 1.11 1996/01/27 04:18:15 bde Exp $ + * $Id: diskslice.h,v 1.12 1996/01/30 23:00:31 mpp Exp $ */ #ifndef _SYS_DISKSLICE_H_ @@ -44,6 +44,10 @@ struct diskslice { u_long ds_offset; /* starting sector */ u_long ds_size; /* number of sectors */ int ds_type; /* (foreign) slice type */ +#ifdef PC98 + int ds_subtype; /* sub slice type */ + u_char ds_name[16]; /* slice name */ +#endif struct dkbad_intern *ds_bad; /* bad sector table, if any */ struct disklabel *ds_label; /* BSD label, if any */ void *ds_bdev; /* devfs token for whole slice */ diff --git a/sys/sys/random.h b/sys/sys/random.h index 97f6c65..73957b9 100644 --- a/sys/sys/random.h +++ b/sys/sys/random.h @@ -1,7 +1,7 @@ /* * random.h -- A strong random number generator * - * $Id: random.h,v 1.3 1995/12/29 08:04:13 markm Exp $ + * $Id: random.h,v 1.4 1996/01/30 22:54:53 mpp Exp $ * * Version 0.95, last modified 18-Oct-95 * @@ -51,9 +51,14 @@ #define _MACHINE_RANDOM_H_ 1 #if defined(KERNEL) +#ifdef PC98 +#include <pc98/pc98/icu.h> +#include <pc98/pc98/pc98_device.h> +#else #include <i386/isa/icu.h> #include <i386/isa/isa_device.h> #endif +#endif #include <sys/ioctl.h> #define MEM_SETIRQ _IOW('r', 1, u_int16_t) /* set interrupt */ diff --git a/sys/sys/soundcard.h b/sys/sys/soundcard.h index 725a023..3dcdaa1 100644 --- a/sys/sys/soundcard.h +++ b/sys/sys/soundcard.h @@ -64,6 +64,9 @@ #define SNDCARD_TRXPRO 16 #define SNDCARD_TRXPRO_SB 17 #define SNDCARD_TRXPRO_MPU 18 +#ifdef PC98 +#define SNDCARD_PCM86 19 +#endif /*********************************** * IOCTL Commands for /dev/sequencer |