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
This commit is contained in:
parent
48bef337fc
commit
1225e2435d
@ -3,7 +3,7 @@
|
||||
# Makefile.i386 -- with config changes.
|
||||
# Copyright 1990 W. Jolitz
|
||||
# from: @(#)Makefile.i386 7.1 5/10/91
|
||||
# $Id: Makefile.pc98,v 1.2 1996/07/23 07:45:48 asami Exp $
|
||||
# $Id: Makefile.pc98,v 1.3 1996/08/30 10:42:49 asami Exp $
|
||||
#
|
||||
# Makefile for FreeBSD
|
||||
#
|
||||
@ -31,7 +31,7 @@ I386= ${S}/i386
|
||||
|
||||
CWARNFLAGS?= -W -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit \
|
||||
-Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Winline -Wunused
|
||||
-Winline -Wunused -Wpointer-arith
|
||||
#
|
||||
# The following flags are next up for working on:
|
||||
# -Wall
|
||||
@ -172,7 +172,7 @@ install:
|
||||
install -c -m 555 -o root -g wheel -fschg kernel /
|
||||
|
||||
ioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h \
|
||||
${PC98}/pc98/pc98_device.h ${PC98}/pc98/pc98.h ${PC98}/pc98/icu.h
|
||||
${I386}/isa/isa_device.h ${PC98}/pc98/pc98.h ${PC98}/pc98/icu.h
|
||||
${CC} -c ${CFLAGS} ioconf.c
|
||||
|
||||
param.c: $S/conf/param.c
|
||||
|
@ -2,7 +2,7 @@
|
||||
# files marked standard are always included.
|
||||
#
|
||||
# modified for PC-9801 after:
|
||||
# $Id: files.pc98,v 1.2 1996/07/23 07:45:49 asami Exp $
|
||||
# $Id: files.pc98,v 1.3 1996/08/31 15:06:30 asami Exp $
|
||||
#
|
||||
aic7xxx_asm optional ahc device-driver \
|
||||
dependency "$S/dev/aic7xxx/aic7xxx_asm.c" \
|
||||
@ -109,7 +109,7 @@ pc98/isa/if_ar.c optional ar device-driver
|
||||
pc98/isa/if_cx.c optional cx device-driver
|
||||
pc98/pc98/if_ed.c optional ed device-driver
|
||||
pc98/pc98/if_el.c optional el device-driver
|
||||
pc98/pc98/if_ep.c optional ep device-driver
|
||||
i386/isa/if_ep.c optional ep device-driver
|
||||
pc98/pc98/if_fe.c optional fe device-driver
|
||||
#pc98/isa/if_ie.c optional ie device-driver
|
||||
#pc98/isa/if_ix.c optional ix device-driver
|
||||
@ -117,7 +117,7 @@ pc98/pc98/if_fe.c optional fe device-driver
|
||||
#pc98/isa/if_lnc.c optional lnc device-driver
|
||||
#i386/isa/if_sr.c optional sr device-driver
|
||||
#pc98/isa/if_ze.c optional ze device-driver
|
||||
pc98/pc98/if_zp.c optional zp device-driver
|
||||
i386/isa/if_zp.c optional zp device-driver
|
||||
pc98/pc98/pc98.c optional nec device-driver
|
||||
pc98/pc98/pc98.c optional epson device-driver
|
||||
pc98/isa/istallion.c optional stli device-driver
|
||||
|
@ -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.12 1995/11/20 12:41:31 phk Exp $
|
||||
* $Id: devconf.h,v 1.13 1996/06/14 11:01:03 asami Exp $
|
||||
*/
|
||||
/*
|
||||
* devconf.h - machine-dependent device configuration table
|
||||
@ -36,7 +36,7 @@
|
||||
#define PARENTNAMELEN 32
|
||||
|
||||
#ifdef PC98
|
||||
enum machdep_devtype { MDDT_CPU, MDDT_PC98, MDDT_PCI, MDDT_SCSI,
|
||||
enum machdep_devtype { MDDT_CPU, MDDT_ISA, MDDT_PCI, MDDT_SCSI,
|
||||
MDDT_DISK, MDDT_BUS, NDEVTYPES };
|
||||
#else
|
||||
enum machdep_devtype { MDDT_CPU, MDDT_ISA, MDDT_EISA, MDDT_PCI, MDDT_SCSI,
|
||||
@ -80,12 +80,8 @@ 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)
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* random.h -- A strong random number generator
|
||||
*
|
||||
* $Id: random.h,v 1.5 1996/06/14 11:01:04 asami Exp $
|
||||
* $Id: random.h,v 1.6 1996/06/17 16:47:39 bde Exp $
|
||||
*
|
||||
* Version 0.95, last modified 18-Oct-95
|
||||
*
|
||||
@ -59,11 +59,7 @@
|
||||
#ifdef KERNEL
|
||||
|
||||
/* XXX include from the wrong place(s) for inthand2_t. */
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#endif
|
||||
|
||||
/* Interrupts to be used in the randomizing process */
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)init_main.c 8.9 (Berkeley) 1/21/94
|
||||
* $Id: init_main.c,v 1.46 1996/08/28 18:32:51 bde Exp $
|
||||
* $Id: init_main.c,v 1.47 1996/08/31 15:05:58 asami Exp $
|
||||
*/
|
||||
|
||||
#include "opt_rlimit.h"
|
||||
@ -274,7 +274,6 @@ char copyright[] =
|
||||
"Copyright (c) 1992 A.Kojima F.Ukai M.Ishii (KMC).\n"
|
||||
"\tAll rights reserved.\n\n";
|
||||
#else
|
||||
"Copyright (c) 1992-1996 FreeBSD Inc.\n"
|
||||
"Copyright (c) 1982, 1986, 1989, 1991, 1993\n\tThe Regents of the University of California. All rights reserved.\n\n";
|
||||
#endif
|
||||
#endif
|
||||
|
@ -70,7 +70,7 @@
|
||||
* Paul Mackerras (paulus@cs.anu.edu.au).
|
||||
*/
|
||||
|
||||
/* $Id: ppp_tty.c,v 1.9 1996/06/14 11:01:49 asami Exp $ */
|
||||
/* $Id: ppp_tty.c,v 1.10 1996/08/30 10:41:58 asami 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,12 +98,8 @@
|
||||
|
||||
#ifdef i386 /* fiddle with the spl locking */
|
||||
# include <machine/spl.h>
|
||||
#ifdef PC98
|
||||
# include <pc98/pc98/pc98_device.h>
|
||||
#else
|
||||
# include <i386/isa/isa_device.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_types.h>
|
||||
|
@ -1,920 +0,0 @@
|
||||
/*
|
||||
* APM (Advanced Power Management) BIOS Device Driver
|
||||
*
|
||||
* Copyright (c) 1994 UKAI, Fumitoshi.
|
||||
* Copyright (c) 1994-1995 by HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp>
|
||||
* Copyright (c) 1996 Nate Williams <nate@FreeBSD.org>
|
||||
*
|
||||
* This software may be used, modified, copied, and distributed, in
|
||||
* both source and binary form provided that the above copyright and
|
||||
* these terms are retained. Under no circumstances is the author
|
||||
* responsible for the proper functioning of this software, nor does
|
||||
* the author assume any responsibility for damages incurred with its
|
||||
* use.
|
||||
*
|
||||
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
|
||||
*
|
||||
* $Id: apm.c,v 1.2 1996/07/23 07:45:29 asami Exp $
|
||||
*/
|
||||
|
||||
#include "apm.h"
|
||||
|
||||
#if NAPM > 1
|
||||
#error only one APM device may be configured
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/kernel.h>
|
||||
#ifdef DEVFS
|
||||
#include <sys/devfsext.h>
|
||||
#endif /*DEVFS*/
|
||||
#include <sys/systm.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/vnode.h>
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#endif
|
||||
#include <machine/apm_bios.h>
|
||||
#include <machine/segments.h>
|
||||
#include <machine/clock.h>
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_param.h>
|
||||
#include <vm/pmap.h>
|
||||
#include <sys/syslog.h>
|
||||
#include <sys/devconf.h>
|
||||
#include <i386/apm/apm_setup.h>
|
||||
|
||||
static int apm_display_off __P((void));
|
||||
static int apm_int __P((u_long *eax, u_long *ebx, u_long *ecx));
|
||||
static void apm_resume __P((void));
|
||||
|
||||
/* static data */
|
||||
struct apm_softc {
|
||||
int initialized, active;
|
||||
int always_halt_cpu, slow_idle_cpu;
|
||||
int disabled, disengaged;
|
||||
u_int minorversion, majorversion;
|
||||
u_int cs32_base, cs16_base, ds_base;
|
||||
u_int cs_limit, ds_limit;
|
||||
u_int cs_entry;
|
||||
u_int intversion;
|
||||
struct apmhook sc_suspend;
|
||||
struct apmhook sc_resume;
|
||||
#ifdef DEVFS
|
||||
void *sc_devfs_token;
|
||||
#endif
|
||||
};
|
||||
|
||||
static struct kern_devconf kdc_apm = {
|
||||
0, 0, 0, /* filled in by dev_attach */
|
||||
"apm", 0, { MDDT_ISA, 0 },
|
||||
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
|
||||
&kdc_isa0, /* parent */
|
||||
0, /* parentdata */
|
||||
DC_UNCONFIGURED, /* state */
|
||||
"Advanced Power Management BIOS",
|
||||
DC_CLS_MISC /* class */
|
||||
};
|
||||
|
||||
|
||||
static struct apm_softc apm_softc;
|
||||
static struct apmhook *hook[NAPM_HOOK]; /* XXX */
|
||||
|
||||
#define is_enabled(foo) ((foo) ? "enabled" : "disabled")
|
||||
|
||||
/* Map version number to integer (keeps ordering of version numbers) */
|
||||
#define INTVERSION(major, minor) ((major)*100 + (minor))
|
||||
|
||||
static timeout_t apm_timeout;
|
||||
static d_open_t apmopen;
|
||||
static d_close_t apmclose;
|
||||
static d_ioctl_t apmioctl;
|
||||
|
||||
#define CDEV_MAJOR 39
|
||||
static struct cdevsw apm_cdevsw =
|
||||
{ apmopen, apmclose, noread, nowrite, /*39*/
|
||||
apmioctl, nostop, nullreset, nodevtotty,/* APM */
|
||||
seltrue, nommap, NULL , "apm" ,NULL, -1};
|
||||
|
||||
static void
|
||||
apm_registerdev(struct isa_device *id)
|
||||
{
|
||||
if (kdc_apm.kdc_isa)
|
||||
return;
|
||||
kdc_apm.kdc_state = DC_UNCONFIGURED;
|
||||
kdc_apm.kdc_unit = 0;
|
||||
kdc_apm.kdc_isa = id;
|
||||
dev_attach(&kdc_apm);
|
||||
}
|
||||
|
||||
/* setup APM GDT discriptors */
|
||||
static void
|
||||
setup_apm_gdt(u_int code32_base, u_int code16_base, u_int data_base, u_int code_limit, u_int data_limit)
|
||||
{
|
||||
/* setup 32bit code segment */
|
||||
gdt_segs[GAPMCODE32_SEL].ssd_base = code32_base;
|
||||
gdt_segs[GAPMCODE32_SEL].ssd_limit = code_limit;
|
||||
|
||||
/* setup 16bit code segment */
|
||||
gdt_segs[GAPMCODE16_SEL].ssd_base = code16_base;
|
||||
gdt_segs[GAPMCODE16_SEL].ssd_limit = code_limit;
|
||||
|
||||
/* setup data segment */
|
||||
gdt_segs[GAPMDATA_SEL ].ssd_base = data_base;
|
||||
gdt_segs[GAPMDATA_SEL ].ssd_limit = data_limit;
|
||||
|
||||
/* reflect these changes on physical GDT */
|
||||
ssdtosd(gdt_segs + GAPMCODE32_SEL, &gdt[GAPMCODE32_SEL].sd);
|
||||
ssdtosd(gdt_segs + GAPMCODE16_SEL, &gdt[GAPMCODE16_SEL].sd);
|
||||
ssdtosd(gdt_segs + GAPMDATA_SEL , &gdt[GAPMDATA_SEL ].sd);
|
||||
}
|
||||
|
||||
/* 48bit far pointer */
|
||||
static struct addr48 {
|
||||
u_long offset;
|
||||
u_short segment;
|
||||
} apm_addr;
|
||||
|
||||
static int apm_errno;
|
||||
|
||||
inline
|
||||
int
|
||||
apm_int(u_long *eax, u_long *ebx, u_long *ecx)
|
||||
{
|
||||
u_long cf;
|
||||
__asm __volatile("
|
||||
pushfl
|
||||
cli
|
||||
lcall _apm_addr
|
||||
movl $0, %3
|
||||
jnc 1f
|
||||
incl %3
|
||||
1:
|
||||
popfl
|
||||
"
|
||||
: "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=D" (cf)
|
||||
: "0" (*eax), "1" (*ebx), "2" (*ecx)
|
||||
: "dx", "si", "memory"
|
||||
);
|
||||
apm_errno = ((*eax) >> 8) & 0xff;
|
||||
return cf;
|
||||
}
|
||||
|
||||
|
||||
/* enable/disable power management */
|
||||
static int
|
||||
apm_enable_disable_pm(struct apm_softc *sc, int enable)
|
||||
{
|
||||
u_long eax, ebx, ecx;
|
||||
|
||||
eax = (APM_BIOS << 8) | APM_ENABLEDISABLEPM;
|
||||
|
||||
if (sc->intversion >= INTVERSION(1, 1)) {
|
||||
ebx = PMDV_ALLDEV;
|
||||
} else {
|
||||
ebx = 0xffff; /* APM version 1.0 only */
|
||||
}
|
||||
ecx = enable;
|
||||
return apm_int(&eax, &ebx, &ecx);
|
||||
}
|
||||
|
||||
/* Tell APM-BIOS that WE will do 1.1 and see what they say... */
|
||||
static void
|
||||
apm_driver_version(void)
|
||||
{
|
||||
u_long eax, ebx, ecx;
|
||||
|
||||
eax = (APM_BIOS << 8) | APM_DRVVERSION;
|
||||
ebx = 0x0;
|
||||
ecx = 0x0101;
|
||||
if(!apm_int(&eax, &ebx, &ecx))
|
||||
apm_version = eax & 0xffff;
|
||||
}
|
||||
|
||||
/* engage/disengage power management (APM 1.1 or later) */
|
||||
static int
|
||||
apm_engage_disengage_pm(struct apm_softc *sc, int engage)
|
||||
{
|
||||
u_long eax, ebx, ecx;
|
||||
|
||||
eax = (APM_BIOS << 8) | APM_ENGAGEDISENGAGEPM;
|
||||
ebx = PMDV_ALLDEV;
|
||||
ecx = engage;
|
||||
return(apm_int(&eax, &ebx, &ecx));
|
||||
}
|
||||
|
||||
/* get PM event */
|
||||
static u_int
|
||||
apm_getevent(struct apm_softc *sc)
|
||||
{
|
||||
u_long eax, ebx, ecx;
|
||||
|
||||
eax = (APM_BIOS << 8) | APM_GETPMEVENT;
|
||||
|
||||
ebx = 0;
|
||||
ecx = 0;
|
||||
if (apm_int(&eax, &ebx, &ecx))
|
||||
return PMEV_NOEVENT;
|
||||
|
||||
return ebx & 0xffff;
|
||||
}
|
||||
|
||||
/* suspend entire system */
|
||||
static int
|
||||
apm_suspend_system(struct apm_softc *sc)
|
||||
{
|
||||
u_long eax, ebx, ecx;
|
||||
|
||||
eax = (APM_BIOS << 8) | APM_SETPWSTATE;
|
||||
ebx = PMDV_ALLDEV;
|
||||
ecx = PMST_SUSPEND;
|
||||
|
||||
if (apm_int(&eax, &ebx, &ecx)) {
|
||||
printf("Entire system suspend failure: errcode = %ld\n",
|
||||
0xff & (eax >> 8));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Display control */
|
||||
/*
|
||||
* Experimental implementation: My laptop machine can't handle this function
|
||||
* If your laptop can control the display via APM, please inform me.
|
||||
* HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp>
|
||||
*/
|
||||
static int
|
||||
apm_display_off(void)
|
||||
{
|
||||
u_long eax, ebx, ecx;
|
||||
|
||||
eax = (APM_BIOS << 8) | APM_SETPWSTATE;
|
||||
ebx = PMDV_2NDSTORAGE0;
|
||||
ecx = PMST_STANDBY;
|
||||
if (apm_int(&eax, &ebx, &ecx)) {
|
||||
printf("Display off failure: errcode = %ld\n",
|
||||
0xff & (eax >> 8));
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* APM Battery low handler */
|
||||
static void
|
||||
apm_battery_low(struct apm_softc *sc)
|
||||
{
|
||||
printf("\007\007 * * * BATTERY IS LOW * * * \007\007");
|
||||
}
|
||||
|
||||
/* APM hook manager */
|
||||
static struct apmhook *
|
||||
apm_add_hook(struct apmhook **list, struct apmhook *ah)
|
||||
{
|
||||
int s;
|
||||
struct apmhook *p, *prev;
|
||||
|
||||
#ifdef APM_DEBUG
|
||||
printf("Add hook \"%s\"\n", ah->ah_name);
|
||||
#endif
|
||||
|
||||
s = splhigh();
|
||||
if (ah == NULL) {
|
||||
panic("illegal apm_hook!");
|
||||
}
|
||||
prev = NULL;
|
||||
for (p = *list; p != NULL; prev = p, p = p->ah_next) {
|
||||
if (p->ah_order > ah->ah_order) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (prev == NULL) {
|
||||
ah->ah_next = *list;
|
||||
*list = ah;
|
||||
} else {
|
||||
ah->ah_next = prev->ah_next;
|
||||
prev->ah_next = ah;
|
||||
}
|
||||
splx(s);
|
||||
return ah;
|
||||
}
|
||||
|
||||
static void
|
||||
apm_del_hook(struct apmhook **list, struct apmhook *ah)
|
||||
{
|
||||
int s;
|
||||
struct apmhook *p, *prev;
|
||||
|
||||
s = splhigh();
|
||||
prev = NULL;
|
||||
for (p = *list; p != NULL; prev = p, p = p->ah_next) {
|
||||
if (p == ah) {
|
||||
goto deleteit;
|
||||
}
|
||||
}
|
||||
panic("Tried to delete unregistered apm_hook.");
|
||||
goto nosuchnode;
|
||||
deleteit:
|
||||
if (prev != NULL) {
|
||||
prev->ah_next = p->ah_next;
|
||||
} else {
|
||||
*list = p->ah_next;
|
||||
}
|
||||
nosuchnode:
|
||||
splx(s);
|
||||
}
|
||||
|
||||
|
||||
/* APM driver calls some functions automatically */
|
||||
static void
|
||||
apm_execute_hook(struct apmhook *list)
|
||||
{
|
||||
struct apmhook *p;
|
||||
|
||||
for (p = list; p != NULL; p = p->ah_next) {
|
||||
#ifdef APM_DEBUG
|
||||
printf("Execute APM hook \"%s.\"\n", p->ah_name);
|
||||
#endif
|
||||
if ((*(p->ah_fun))(p->ah_arg)) {
|
||||
printf("Warning: APM hook \"%s\" failed", p->ah_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* establish an apm hook */
|
||||
struct apmhook *
|
||||
apm_hook_establish(int apmh, struct apmhook *ah)
|
||||
{
|
||||
if (apmh < 0 || apmh >= NAPM_HOOK)
|
||||
return NULL;
|
||||
|
||||
return apm_add_hook(&hook[apmh], ah);
|
||||
}
|
||||
|
||||
/* disestablish an apm hook */
|
||||
void
|
||||
apm_hook_disestablish(int apmh, struct apmhook *ah)
|
||||
{
|
||||
if (apmh < 0 || apmh >= NAPM_HOOK)
|
||||
return;
|
||||
|
||||
apm_del_hook(&hook[apmh], ah);
|
||||
}
|
||||
|
||||
|
||||
static struct timeval suspend_time;
|
||||
static struct timeval diff_time;
|
||||
|
||||
static int
|
||||
apm_default_resume(void *arg)
|
||||
{
|
||||
int pl;
|
||||
u_int second, minute, hour;
|
||||
struct timeval resume_time, tmp_time;
|
||||
|
||||
/* modified for adjkerntz */
|
||||
pl = splsoftclock();
|
||||
inittodr(0); /* adjust time to RTC */
|
||||
microtime(&resume_time);
|
||||
tmp_time = time; /* because 'time' is volatile */
|
||||
timevaladd(&tmp_time, &diff_time);
|
||||
time = tmp_time;
|
||||
splx(pl);
|
||||
second = resume_time.tv_sec - suspend_time.tv_sec;
|
||||
hour = second / 3600;
|
||||
second %= 3600;
|
||||
minute = second / 60;
|
||||
second %= 60;
|
||||
log(LOG_NOTICE, "resumed from suspended mode (slept %02d:%02d:%02d)\n",
|
||||
hour, minute, second);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
apm_default_suspend(void *arg)
|
||||
{
|
||||
int pl;
|
||||
|
||||
pl = splsoftclock();
|
||||
microtime(&diff_time);
|
||||
inittodr(0);
|
||||
microtime(&suspend_time);
|
||||
timevalsub(&diff_time, &suspend_time);
|
||||
splx(pl);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void apm_processevent(struct apm_softc *);
|
||||
|
||||
/*
|
||||
* Public interface to the suspend/resume:
|
||||
*
|
||||
* Execute suspend and resume hook before and after sleep, respectively.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
apm_suspend(void)
|
||||
{
|
||||
struct apm_softc *sc = &apm_softc;
|
||||
|
||||
if (!sc)
|
||||
return;
|
||||
|
||||
if (sc->initialized) {
|
||||
apm_execute_hook(hook[APM_HOOK_SUSPEND]);
|
||||
apm_suspend_system(sc);
|
||||
apm_processevent(sc);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
apm_resume(void)
|
||||
{
|
||||
struct apm_softc *sc = &apm_softc;
|
||||
|
||||
if (!sc)
|
||||
return;
|
||||
|
||||
if (sc->initialized) {
|
||||
apm_execute_hook(hook[APM_HOOK_RESUME]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* get APM information */
|
||||
static int
|
||||
apm_get_info(struct apm_softc *sc, apm_info_t aip)
|
||||
{
|
||||
u_long eax, ebx, ecx;
|
||||
|
||||
eax = (APM_BIOS << 8) | APM_GETPWSTATUS;
|
||||
ebx = PMDV_ALLDEV;
|
||||
ecx = 0;
|
||||
|
||||
if (apm_int(&eax, &ebx, &ecx))
|
||||
return 1;
|
||||
|
||||
aip->ai_acline = (ebx >> 8) & 0xff;
|
||||
aip->ai_batt_stat = ebx & 0xff;
|
||||
aip->ai_batt_life = ecx & 0xff;
|
||||
aip->ai_major = (u_int)sc->majorversion;
|
||||
aip->ai_minor = (u_int)sc->minorversion;
|
||||
aip->ai_status = (u_int)sc->active;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* inform APM BIOS that CPU is idle */
|
||||
void
|
||||
apm_cpu_idle(void)
|
||||
{
|
||||
struct apm_softc *sc = &apm_softc;
|
||||
|
||||
if (sc->active) {
|
||||
u_long eax, ebx, ecx;
|
||||
|
||||
eax = (APM_BIOS <<8) | APM_CPUIDLE;
|
||||
ecx = ebx = 0;
|
||||
apm_int(&eax, &ebx, &ecx);
|
||||
}
|
||||
/*
|
||||
* Some APM implementation halts CPU in BIOS, whenever
|
||||
* "CPU-idle" function are invoked, but swtch() of
|
||||
* FreeBSD halts CPU, therefore, CPU is halted twice
|
||||
* in the sched loop. It makes the interrupt latency
|
||||
* terribly long and be able to cause a serious problem
|
||||
* in interrupt processing. We prevent it by removing
|
||||
* "hlt" operation from swtch() and managed it under
|
||||
* APM driver.
|
||||
*/
|
||||
if (!sc->active || sc->always_halt_cpu) {
|
||||
__asm("hlt"); /* wait for interrupt */
|
||||
}
|
||||
}
|
||||
|
||||
/* inform APM BIOS that CPU is busy */
|
||||
void
|
||||
apm_cpu_busy(void)
|
||||
{
|
||||
struct apm_softc *sc = &apm_softc;
|
||||
|
||||
/*
|
||||
* The APM specification says this is only necessary if your BIOS
|
||||
* slows down the processor in the idle task, otherwise it's not
|
||||
* necessary.
|
||||
*/
|
||||
if (sc->slow_idle_cpu && sc->active) {
|
||||
u_long eax, ebx, ecx;
|
||||
|
||||
eax = (APM_BIOS <<8) | APM_CPUBUSY;
|
||||
ecx = ebx = 0;
|
||||
apm_int(&eax, &ebx, &ecx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* APM timeout routine:
|
||||
*
|
||||
* This routine is automatically called by timer once per second.
|
||||
*/
|
||||
|
||||
static void
|
||||
apm_timeout(void *arg)
|
||||
{
|
||||
struct apm_softc *sc = arg;
|
||||
|
||||
apm_processevent(sc);
|
||||
if (sc->active == 1) {
|
||||
timeout(apm_timeout, (void *)sc, hz - 1 ); /* More than 1 Hz */
|
||||
}
|
||||
}
|
||||
|
||||
/* enable APM BIOS */
|
||||
static void
|
||||
apm_event_enable(struct apm_softc *sc)
|
||||
{
|
||||
#ifdef APM_DEBUG
|
||||
printf("called apm_event_enable()\n");
|
||||
#endif
|
||||
if (sc->initialized) {
|
||||
sc->active = 1;
|
||||
apm_timeout(sc);
|
||||
}
|
||||
}
|
||||
|
||||
/* disable APM BIOS */
|
||||
static void
|
||||
apm_event_disable(struct apm_softc *sc)
|
||||
{
|
||||
#ifdef APM_DEBUG
|
||||
printf("called apm_event_disable()\n");
|
||||
#endif
|
||||
if (sc->initialized) {
|
||||
untimeout(apm_timeout, NULL);
|
||||
sc->active = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* halt CPU in scheduling loop */
|
||||
static void
|
||||
apm_halt_cpu(struct apm_softc *sc)
|
||||
{
|
||||
if (sc->initialized) {
|
||||
sc->always_halt_cpu = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* don't halt CPU in scheduling loop */
|
||||
static void
|
||||
apm_not_halt_cpu(struct apm_softc *sc)
|
||||
{
|
||||
if (sc->initialized) {
|
||||
sc->always_halt_cpu = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* device driver definitions */
|
||||
static int apmprobe (struct isa_device *);
|
||||
static int apmattach(struct isa_device *);
|
||||
struct isa_driver apmdriver = {
|
||||
apmprobe, apmattach, "apm" };
|
||||
|
||||
/*
|
||||
* probe APM (dummy):
|
||||
*
|
||||
* APM probing routine is placed on locore.s and apm_init.S because
|
||||
* this process forces the CPU to turn to real mode or V86 mode.
|
||||
* Current version uses real mode, but on future version, we want
|
||||
* to use V86 mode in APM initialization.
|
||||
*/
|
||||
|
||||
static int
|
||||
apmprobe(struct isa_device *dvp)
|
||||
{
|
||||
if ( dvp->id_unit > 0 ) {
|
||||
printf("apm: Only one APM driver supported.\n");
|
||||
return 0;
|
||||
}
|
||||
apm_registerdev(dvp);
|
||||
switch (apm_version) {
|
||||
case APMINI_CANTFIND:
|
||||
/* silent */
|
||||
return 0;
|
||||
case APMINI_NOT32BIT:
|
||||
printf("apm: 32bit connection is not supported.\n");
|
||||
return 0;
|
||||
case APMINI_CONNECTERR:
|
||||
printf("apm: 32-bit connection error.\n");
|
||||
return 0;
|
||||
}
|
||||
#ifdef APM_BROKEN_STATCLOCK
|
||||
statclock_disable = 1;
|
||||
#endif
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/* Process APM event */
|
||||
static void
|
||||
apm_processevent(struct apm_softc *sc)
|
||||
{
|
||||
int apm_event;
|
||||
|
||||
#ifdef APM_DEBUG
|
||||
# define OPMEV_DEBUGMESSAGE(symbol) case symbol: \
|
||||
printf("Received APM Event: " #symbol "\n");
|
||||
#else
|
||||
# define OPMEV_DEBUGMESSAGE(symbol) case symbol:
|
||||
#endif
|
||||
do {
|
||||
apm_event = apm_getevent(sc);
|
||||
switch (apm_event) {
|
||||
OPMEV_DEBUGMESSAGE(PMEV_STANDBYREQ);
|
||||
apm_suspend();
|
||||
break;
|
||||
OPMEV_DEBUGMESSAGE(PMEV_SUSPENDREQ);
|
||||
apm_suspend();
|
||||
break;
|
||||
OPMEV_DEBUGMESSAGE(PMEV_USERSUSPENDREQ);
|
||||
apm_suspend();
|
||||
break;
|
||||
OPMEV_DEBUGMESSAGE(PMEV_CRITSUSPEND);
|
||||
apm_suspend();
|
||||
break;
|
||||
OPMEV_DEBUGMESSAGE(PMEV_NORMRESUME);
|
||||
apm_resume();
|
||||
break;
|
||||
OPMEV_DEBUGMESSAGE(PMEV_CRITRESUME);
|
||||
apm_resume();
|
||||
break;
|
||||
OPMEV_DEBUGMESSAGE(PMEV_STANDBYRESUME);
|
||||
apm_resume();
|
||||
break;
|
||||
OPMEV_DEBUGMESSAGE(PMEV_BATTERYLOW);
|
||||
apm_battery_low(sc);
|
||||
apm_suspend();
|
||||
break;
|
||||
OPMEV_DEBUGMESSAGE(PMEV_POWERSTATECHANGE);
|
||||
break;
|
||||
OPMEV_DEBUGMESSAGE(PMEV_UPDATETIME);
|
||||
inittodr(0); /* adjust time to RTC */
|
||||
break;
|
||||
OPMEV_DEBUGMESSAGE(PMEV_NOEVENT);
|
||||
break;
|
||||
default:
|
||||
printf("Unknown Original APM Event 0x%x\n", apm_event);
|
||||
break;
|
||||
}
|
||||
} while (apm_event != PMEV_NOEVENT);
|
||||
}
|
||||
|
||||
/*
|
||||
* Attach APM:
|
||||
*
|
||||
* Initialize APM driver (APM BIOS itself has been initialized in locore.s)
|
||||
*/
|
||||
|
||||
static int
|
||||
apmattach(struct isa_device *dvp)
|
||||
{
|
||||
#define APM_KERNBASE KERNBASE
|
||||
struct apm_softc *sc = &apm_softc;
|
||||
#ifdef APM_DSVALUE_BUG
|
||||
caddr_t apm_bios_work;
|
||||
|
||||
/*
|
||||
* XXX - Malloc enough space for the APM DS, and then copy the
|
||||
* current DS into the new space since the DS setup by the
|
||||
* APM bios is going to get wiped out.
|
||||
*/
|
||||
apm_bios_work = (caddr_t)malloc(apm_ds_limit, M_DEVBUF, M_NOWAIT);
|
||||
bcopy((caddr_t)((apm_ds_base << 4) + APM_KERNBASE), apm_bios_work,
|
||||
apm_ds_limit);
|
||||
#endif /* APM_DSVALUE_BUG */
|
||||
|
||||
sc->initialized = 0;
|
||||
|
||||
/* Must be externally enabled */
|
||||
sc->active = 0;
|
||||
|
||||
/* setup APM parameters */
|
||||
sc->cs16_base = (apm_cs16_base << 4) + APM_KERNBASE;
|
||||
sc->cs32_base = (apm_cs32_base << 4) + APM_KERNBASE;
|
||||
sc->ds_base = (apm_ds_base << 4) + APM_KERNBASE;
|
||||
sc->cs_limit = apm_cs_limit;
|
||||
sc->ds_limit = apm_ds_limit;
|
||||
sc->cs_entry = apm_cs_entry;
|
||||
|
||||
#ifdef APM_DSVALUE_BUG
|
||||
/* Set the DS base to point to the newly made copy of the APM DS */
|
||||
sc->ds_base = (u_int)apm_bios_work;
|
||||
#endif /* APM_DSVALUE_BUG */
|
||||
|
||||
/* Always call HLT in idle loop */
|
||||
sc->always_halt_cpu = 1;
|
||||
|
||||
sc->slow_idle_cpu = ((apm_flags & APM_CPUIDLE_SLOW) != 0);
|
||||
sc->disabled = ((apm_flags & APM_DISABLED) != 0);
|
||||
sc->disengaged = ((apm_flags & APM_DISENGAGED) != 0);
|
||||
|
||||
/* print bootstrap messages */
|
||||
#ifdef APM_DEBUG
|
||||
printf("apm: APM BIOS version %04x\n", apm_version);
|
||||
printf("apm: Code32 0x%08x, Code16 0x%08x, Data 0x%08x\n",
|
||||
sc->cs32_base, sc->cs16_base, sc->ds_base);
|
||||
printf("apm: Code entry 0x%08x, Idling CPU %s, Management %s\n",
|
||||
sc->cs_entry, is_enabled(sc->slow_idle_cpu),
|
||||
is_enabled(!sc->disabled));
|
||||
printf("apm: CS_limit=0x%x, DS_limit=0x%x\n",
|
||||
sc->cs_limit, sc->ds_limit);
|
||||
#endif /* APM_DEBUG */
|
||||
|
||||
#ifdef 0
|
||||
/* Workaround for some buggy APM BIOS implementations */
|
||||
sc->cs_limit = 0xffff;
|
||||
sc->ds_limit = 0xffff;
|
||||
#endif
|
||||
|
||||
/* setup GDT */
|
||||
setup_apm_gdt(sc->cs32_base, sc->cs16_base, sc->ds_base,
|
||||
sc->cs_limit, sc->ds_limit);
|
||||
|
||||
/* setup entry point 48bit pointer */
|
||||
apm_addr.segment = GSEL(GAPMCODE32_SEL, SEL_KPL);
|
||||
apm_addr.offset = sc->cs_entry;
|
||||
|
||||
#ifdef FORCE_APM10
|
||||
apm_version = 0x100;
|
||||
sc->majorversion = 1;
|
||||
sc->minorversion = 0;
|
||||
sc->intversion = INTVERSION(sc->majorversion, sc->minorversion);
|
||||
printf("apm: running in APM 1.0 compatible mode\n");
|
||||
kcd_apm.kdc_description =
|
||||
"Advanced Power Management BIOS (1.0 compatability mode)",
|
||||
#else
|
||||
/* Try to kick bios into 1.1 or greater mode */
|
||||
apm_driver_version();
|
||||
sc->minorversion = ((apm_version & 0x00f0) >> 4) * 10 +
|
||||
((apm_version & 0x000f) >> 0);
|
||||
sc->majorversion = ((apm_version & 0xf000) >> 12) * 10 +
|
||||
((apm_version & 0x0f00) >> 8);
|
||||
|
||||
sc->intversion = INTVERSION(sc->majorversion, sc->minorversion);
|
||||
|
||||
if (sc->intversion >= INTVERSION(1, 1)) {
|
||||
#ifdef APM_DEBUG
|
||||
printf("apm: Engaged control %s\n", is_enabled(!sc->disengaged));
|
||||
#endif
|
||||
}
|
||||
|
||||
printf("apm: found APM BIOS version %d.%d\n",
|
||||
sc->majorversion, sc->minorversion);
|
||||
#endif /* FORCE_APM10 */
|
||||
|
||||
#ifdef APM_DEBUG
|
||||
printf("apm: Slow Idling CPU %s\n", is_enabled(sc->slow_idle_cpu));
|
||||
#endif
|
||||
|
||||
/* enable power management */
|
||||
if (sc->disabled) {
|
||||
if (apm_enable_disable_pm(sc, 1)) {
|
||||
#ifdef APM_DEBUG
|
||||
printf("apm: *Warning* enable function failed! [%x]\n",
|
||||
apm_errno);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* engage power managment (APM 1.1 or later) */
|
||||
if (sc->intversion >= INTVERSION(1, 1) && sc->disengaged) {
|
||||
if (apm_engage_disengage_pm(sc, 1)) {
|
||||
#ifdef APM_DEBUG
|
||||
printf("apm: *Warning* engage function failed err=[%x]",
|
||||
apm_errno);
|
||||
printf(" (Docked or using external power?).\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* default suspend hook */
|
||||
sc->sc_suspend.ah_fun = apm_default_suspend;
|
||||
sc->sc_suspend.ah_arg = sc;
|
||||
sc->sc_suspend.ah_name = "default suspend";
|
||||
sc->sc_suspend.ah_order = APM_MAX_ORDER;
|
||||
|
||||
/* default resume hook */
|
||||
sc->sc_resume.ah_fun = apm_default_resume;
|
||||
sc->sc_resume.ah_arg = sc;
|
||||
sc->sc_resume.ah_name = "default resume";
|
||||
sc->sc_resume.ah_order = APM_MIN_ORDER;
|
||||
|
||||
apm_hook_establish(APM_HOOK_SUSPEND, &sc->sc_suspend);
|
||||
apm_hook_establish(APM_HOOK_RESUME , &sc->sc_resume);
|
||||
|
||||
apm_event_enable(sc);
|
||||
kdc_apm.kdc_state = DC_IDLE;
|
||||
|
||||
sc->initialized = 1;
|
||||
|
||||
#ifdef DEVFS
|
||||
sc->sc_devfs_token =
|
||||
devfs_add_devswf(&apm_cdevsw, 0, DV_CHR, 0, 0, 0600, "apm");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
apmopen(dev_t dev, int flag, int fmt, struct proc *p)
|
||||
{
|
||||
struct apm_softc *sc = &apm_softc;
|
||||
|
||||
if (minor(dev) != 0 || !sc->initialized)
|
||||
return (ENXIO);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
apmclose(dev_t dev, int flag, int fmt, struct proc *p)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
apmioctl(dev_t dev, int cmd, caddr_t addr, int flag, struct proc *p)
|
||||
{
|
||||
struct apm_softc *sc = &apm_softc;
|
||||
int error = 0;
|
||||
|
||||
if (minor(dev) != 0 || !sc->initialized)
|
||||
return (ENXIO);
|
||||
#ifdef APM_DEBUG
|
||||
printf("APM ioctl: cmd = 0x%x\n", cmd);
|
||||
#endif
|
||||
switch (cmd) {
|
||||
case APMIO_SUSPEND:
|
||||
if ( sc->active) {
|
||||
apm_suspend();
|
||||
} else {
|
||||
error = EINVAL;
|
||||
}
|
||||
break;
|
||||
case APMIO_GETINFO:
|
||||
if (apm_get_info(sc, (apm_info_t)addr)) {
|
||||
error = ENXIO;
|
||||
}
|
||||
break;
|
||||
case APMIO_ENABLE:
|
||||
kdc_apm.kdc_state = DC_BUSY;
|
||||
apm_event_enable(sc);
|
||||
break;
|
||||
case APMIO_DISABLE:
|
||||
kdc_apm.kdc_state = DC_IDLE;
|
||||
apm_event_disable(sc);
|
||||
break;
|
||||
case APMIO_HALTCPU:
|
||||
apm_halt_cpu(sc);
|
||||
break;
|
||||
case APMIO_NOTHALTCPU:
|
||||
apm_not_halt_cpu(sc);
|
||||
break;
|
||||
case APMIO_DISPLAYOFF:
|
||||
if (apm_display_off()) {
|
||||
error = ENXIO;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
break;
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
static apm_devsw_installed = 0;
|
||||
|
||||
static void
|
||||
apm_drvinit(void *unused)
|
||||
{
|
||||
dev_t dev;
|
||||
|
||||
if( ! apm_devsw_installed ) {
|
||||
dev = makedev(CDEV_MAJOR,0);
|
||||
cdevsw_add(&dev,&apm_cdevsw,NULL);
|
||||
apm_devsw_installed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
SYSINIT(apmdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,apm_drvinit,NULL)
|
@ -31,7 +31,7 @@
|
||||
#include <machine/cpufunc.h>
|
||||
#include <sys/reboot.h>
|
||||
#ifdef PC98
|
||||
#include "../../pc98/pc98_device.h"
|
||||
#include "../../pc98/pc98_bios.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -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_ */
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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 */
|
||||
|
@ -3,7 +3,7 @@
|
||||
# Makefile.i386 -- with config changes.
|
||||
# Copyright 1990 W. Jolitz
|
||||
# from: @(#)Makefile.i386 7.1 5/10/91
|
||||
# $Id: Makefile.pc98,v 1.2 1996/07/23 07:45:48 asami Exp $
|
||||
# $Id: Makefile.pc98,v 1.3 1996/08/30 10:42:49 asami Exp $
|
||||
#
|
||||
# Makefile for FreeBSD
|
||||
#
|
||||
@ -31,7 +31,7 @@ I386= ${S}/i386
|
||||
|
||||
CWARNFLAGS?= -W -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit \
|
||||
-Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Winline -Wunused
|
||||
-Winline -Wunused -Wpointer-arith
|
||||
#
|
||||
# The following flags are next up for working on:
|
||||
# -Wall
|
||||
@ -172,7 +172,7 @@ install:
|
||||
install -c -m 555 -o root -g wheel -fschg kernel /
|
||||
|
||||
ioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h \
|
||||
${PC98}/pc98/pc98_device.h ${PC98}/pc98/pc98.h ${PC98}/pc98/icu.h
|
||||
${I386}/isa/isa_device.h ${PC98}/pc98/pc98.h ${PC98}/pc98/icu.h
|
||||
${CC} -c ${CFLAGS} ioconf.c
|
||||
|
||||
param.c: $S/conf/param.c
|
||||
|
@ -2,7 +2,7 @@
|
||||
# files marked standard are always included.
|
||||
#
|
||||
# modified for PC-9801 after:
|
||||
# $Id: files.pc98,v 1.2 1996/07/23 07:45:49 asami Exp $
|
||||
# $Id: files.pc98,v 1.3 1996/08/31 15:06:30 asami Exp $
|
||||
#
|
||||
aic7xxx_asm optional ahc device-driver \
|
||||
dependency "$S/dev/aic7xxx/aic7xxx_asm.c" \
|
||||
@ -109,7 +109,7 @@ pc98/isa/if_ar.c optional ar device-driver
|
||||
pc98/isa/if_cx.c optional cx device-driver
|
||||
pc98/pc98/if_ed.c optional ed device-driver
|
||||
pc98/pc98/if_el.c optional el device-driver
|
||||
pc98/pc98/if_ep.c optional ep device-driver
|
||||
i386/isa/if_ep.c optional ep device-driver
|
||||
pc98/pc98/if_fe.c optional fe device-driver
|
||||
#pc98/isa/if_ie.c optional ie device-driver
|
||||
#pc98/isa/if_ix.c optional ix device-driver
|
||||
@ -117,7 +117,7 @@ pc98/pc98/if_fe.c optional fe device-driver
|
||||
#pc98/isa/if_lnc.c optional lnc device-driver
|
||||
#i386/isa/if_sr.c optional sr device-driver
|
||||
#pc98/isa/if_ze.c optional ze device-driver
|
||||
pc98/pc98/if_zp.c optional zp device-driver
|
||||
i386/isa/if_zp.c optional zp device-driver
|
||||
pc98/pc98/pc98.c optional nec device-driver
|
||||
pc98/pc98/pc98.c optional epson device-driver
|
||||
pc98/isa/istallion.c optional stli device-driver
|
||||
|
@ -1,4 +1,4 @@
|
||||
$Id: majors.pc98,v 1.1.1.1 1996/06/14 10:04:40 asami Exp $
|
||||
$Id: majors.pc98,v 1.2 1996/07/23 07:45:50 asami Exp $
|
||||
|
||||
Hopefully, this list will one day be obsoleted by DEVFS, but for now
|
||||
this is the current allocation of device major numbers.
|
||||
@ -114,3 +114,4 @@ chrdev name comments
|
||||
74 ccd concatenated disk
|
||||
75 stli Stallion (intelligent cdk based) (gerg@stallion.oz.au)
|
||||
76 scc IBM Smart Capture Card (ohashi@mickey.ai.kyutech.ac.jp)
|
||||
77 cyy Cyclades Ye/PCI serial card
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
|
||||
* $Id: autoconf.c,v 1.1.1.1 1996/06/14 10:04:40 asami Exp $
|
||||
* $Id: autoconf.c,v 1.2 1996/08/30 10:42:51 asami Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -67,7 +67,7 @@
|
||||
#include "nec.h"
|
||||
#include "epson.h"
|
||||
#if NNEC > 0 || NEPSON > 0
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <i386/isa/isa_device.h>
|
||||
#endif
|
||||
#else /* !PC98 */
|
||||
#include "isa.h"
|
||||
@ -192,7 +192,7 @@ configure(dummy)
|
||||
#endif
|
||||
#ifdef PC98
|
||||
#if NNEC > 0 || NEPSON > 0
|
||||
pc98_configure();
|
||||
isa_configure();
|
||||
#endif
|
||||
#else /* IBM-PC */
|
||||
#if NEISA > 0
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||
* $Id: machdep.c,v 1.2 1996/07/23 07:45:54 asami Exp $
|
||||
* $Id: machdep.c,v 1.3 1996/08/30 10:42:53 asami Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
@ -113,11 +113,10 @@
|
||||
#include <machine/perfmon.h>
|
||||
#endif
|
||||
|
||||
#include <i386/isa/isa_device.h>
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <pc98/pc98/pc98_machdep.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <i386/isa/rtc.h>
|
||||
#endif
|
||||
#include <machine/random.h>
|
||||
@ -1073,7 +1072,7 @@ init386(first)
|
||||
#include "nec.h"
|
||||
#include "epson.h"
|
||||
#if NNEC > 0 || NEPSON > 0
|
||||
pc98_defaultirq();
|
||||
isa_defaultirq();
|
||||
#endif
|
||||
#else /* IBM-PC */
|
||||
#include "isa.h"
|
||||
@ -1115,14 +1114,41 @@ init386(first)
|
||||
biosextmem = rtcin(RTC_EXTLO)+ (rtcin(RTC_EXTHI)<<8);
|
||||
|
||||
/*
|
||||
* Print a warning if the official BIOS interface disagrees
|
||||
* with the hackish interface used above. Eventually only
|
||||
* the official interface should be used.
|
||||
* Print a warning and set it to the safest value if the official
|
||||
* BIOS interface (bootblock supplied) disagrees with the
|
||||
* hackish interface used above. Eventually only the official
|
||||
* interface should be used. This is necessary for some machines
|
||||
* who 'steal' memory from the basemem for use as BIOS memory.
|
||||
*/
|
||||
if (bootinfo.bi_memsizes_valid) {
|
||||
if (bootinfo.bi_basemem != biosbasemem)
|
||||
printf("BIOS basemem (%ldK) != RTC basemem (%dK)\n",
|
||||
if (bootinfo.bi_basemem != biosbasemem) {
|
||||
vm_offset_t pa, va, tmpva;
|
||||
vm_size_t size;
|
||||
unsigned *pte;
|
||||
|
||||
printf("BIOS basemem (%ldK) != RTC basemem (%dK), ",
|
||||
bootinfo.bi_basemem, biosbasemem);
|
||||
printf("setting to BIOS value.\n");
|
||||
biosbasemem = bootinfo.bi_basemem;
|
||||
/*
|
||||
* XXX - Map this 'hole' of memory in the same manner
|
||||
* as the ISA_HOLE (read/write/non-cacheable), since
|
||||
* the BIOS 'fudges' it to become part of the ISA_HOLE.
|
||||
* This code is similar to the code used in
|
||||
* pmap_mapdev, but since no memory needs to be
|
||||
* allocated we simply change the mapping.
|
||||
*/
|
||||
pa = biosbasemem * 1024;
|
||||
va = pa + KERNBASE;
|
||||
size = roundup(ISA_HOLE_START - pa, PAGE_SIZE);
|
||||
for (tmpva = va; size > 0;) {
|
||||
pte = (unsigned *)vtopte(tmpva);
|
||||
*pte = pa | PG_RW | PG_V | PG_N;
|
||||
size -= PAGE_SIZE;
|
||||
tmpva += PAGE_SIZE;
|
||||
pa += PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
if (bootinfo.bi_extmem != biosextmem)
|
||||
printf("BIOS extmem (%ldK) != RTC extmem (%dK)\n",
|
||||
bootinfo.bi_extmem, biosextmem);
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
|
||||
* $Id: trap.c,v 1.2 1996/07/23 07:45:59 asami Exp $
|
||||
* $Id: trap.c,v 1.3 1996/08/30 10:42:54 asami Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -76,7 +76,7 @@
|
||||
#include <machine/reg.h>
|
||||
#include <machine/trap.h>
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <machine/../isa/isa_device.h>
|
||||
|
||||
#include "nec.h"
|
||||
#include "epson.h"
|
||||
@ -294,11 +294,7 @@ trap(frame)
|
||||
return;
|
||||
#endif /* DDB */
|
||||
/* machine/parity/power fail/"kitchen sink" faults */
|
||||
#ifdef PC98
|
||||
if (pc98_nmi(code) == 0) return;
|
||||
#else
|
||||
if (isa_nmi(code) == 0) return;
|
||||
#endif
|
||||
panic("NMI indicates hardware failure");
|
||||
#endif /* POWERFAIL_NMI */
|
||||
#endif /* NNEC > 0 */
|
||||
@ -471,11 +467,7 @@ trap(frame)
|
||||
return;
|
||||
#endif /* DDB */
|
||||
/* machine/parity/power fail/"kitchen sink" faults */
|
||||
#ifdef PC98
|
||||
if (pc98_nmi(code) == 0) return;
|
||||
#else
|
||||
if (isa_nmi(code) == 0) return;
|
||||
#endif
|
||||
/* FALL THROUGH */
|
||||
#endif /* POWERFAIL_NMI */
|
||||
#endif /* NNEC > 0 */
|
||||
|
@ -46,7 +46,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: userconfig.c,v 1.2 1996/08/30 10:42:55 asami Exp $
|
||||
** $Id: userconfig.c,v 1.3 1996/08/31 15:06:33 asami Exp $
|
||||
**/
|
||||
|
||||
/**
|
||||
@ -118,25 +118,14 @@
|
||||
#include <machine/cons.h>
|
||||
#include <machine/md_var.h>
|
||||
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#endif
|
||||
|
||||
#include <pci/pcivar.h>
|
||||
|
||||
#ifdef PC98
|
||||
static struct isa_device *devtabs[] = { pc98_devtab_bio, pc98_devtab_tty, pc98_devtab_net,
|
||||
pc98_devtab_null, NULL };
|
||||
|
||||
static struct isa_device *isa_devlist; /* list read by dset to extract changes */
|
||||
#else
|
||||
static struct isa_device *devtabs[] = { isa_devtab_bio, isa_devtab_tty, isa_devtab_net,
|
||||
isa_devtab_null, NULL };
|
||||
|
||||
static struct isa_device *isa_devlist; /* list read by dset to extract changes */
|
||||
#endif
|
||||
|
||||
#define putchar(x) cnputc(x)
|
||||
#define getchar() cngetc()
|
||||
@ -2205,7 +2194,7 @@ visuserconfig(void)
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: userconfig.c,v 1.2 1996/08/30 10:42:55 asami Exp $
|
||||
* $Id: userconfig.c,v 1.43 1996/08/10 22:06:09 joerg Exp $
|
||||
*/
|
||||
|
||||
#include "scbus.h"
|
||||
@ -2425,17 +2414,10 @@ static int
|
||||
list_devices(CmdParm *parms)
|
||||
{
|
||||
lineno = 0;
|
||||
#ifdef PC98
|
||||
lsdevtab(&pc98_devtab_bio[0]);
|
||||
lsdevtab(&pc98_devtab_tty[0]);
|
||||
lsdevtab(&pc98_devtab_net[0]);
|
||||
lsdevtab(&pc98_devtab_null[0]);
|
||||
#else
|
||||
lsdevtab(&isa_devtab_bio[0]);
|
||||
lsdevtab(&isa_devtab_tty[0]);
|
||||
lsdevtab(&isa_devtab_net[0]);
|
||||
lsdevtab(&isa_devtab_null[0]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2599,23 +2581,6 @@ lsdevtab(struct isa_device *dt)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PC98
|
||||
static struct isa_device *
|
||||
find_device(char *devname, int unit)
|
||||
{
|
||||
struct isa_device *ret;
|
||||
|
||||
if ((ret = search_devtable(&pc98_devtab_bio[0], devname, unit)) != NULL)
|
||||
return ret;
|
||||
if ((ret = search_devtable(&pc98_devtab_tty[0], devname, unit)) != NULL)
|
||||
return ret;
|
||||
if ((ret = search_devtable(&pc98_devtab_net[0], devname, unit)) != NULL)
|
||||
return ret;
|
||||
if ((ret = search_devtable(&pc98_devtab_null[0], devname, unit)) != NULL)
|
||||
return ret;
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
static struct isa_device *
|
||||
find_device(char *devname, int unit)
|
||||
{
|
||||
@ -2631,7 +2596,6 @@ find_device(char *devname, int unit)
|
||||
return ret;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct isa_device *
|
||||
search_devtable(struct isa_device *dt, char *devname, int unit)
|
||||
|
@ -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.1.1.1 1996/06/14 10:04:42 asami Exp $
|
||||
* $Id: vm_machdep.c,v 1.2 1996/07/23 07:46:03 asami Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
@ -68,7 +68,6 @@
|
||||
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98.h>
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#else
|
||||
#include <i386/isa/isa.h>
|
||||
#endif
|
||||
|
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: aic6360.c,v 1.1.1.1 1996/06/14 10:04:42 asami Exp $
|
||||
* $Id: aic6360.c,v 1.2 1996/08/31 15:06:38 asami Exp $
|
||||
*
|
||||
* Acknowledgements: Many of the algorithms used in this driver are
|
||||
* inspired by the work of Julian Elischer (julian@tfs.com) and
|
||||
@ -130,11 +130,7 @@
|
||||
|
||||
#include <sys/devconf.h>
|
||||
#include <machine/clock.h>
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#endif
|
||||
|
||||
#include <sys/kernel.h>
|
||||
|
||||
@ -740,15 +736,9 @@ static struct scsi_device aic_dev = {
|
||||
|
||||
static struct kern_devconf kdc_aic[NAIC] = { {
|
||||
0, 0, 0, /* filled in by dev_attach */
|
||||
#ifdef PC98
|
||||
"aic", 0, { MDDT_PC98, 0, "bio" },
|
||||
pc98_generic_externalize, 0, 0, PC98_EXTERNALLEN,
|
||||
&kdc_nec0, /* parent */
|
||||
#else
|
||||
"aic", 0, { MDDT_ISA, 0, "bio" },
|
||||
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
|
||||
&kdc_isa0, /* parent */
|
||||
#endif
|
||||
0, /* parentdata */
|
||||
DC_UNCONFIGURED, /* start out in unconfig state */
|
||||
"Adaptec AIC-6360 SCSI host adapter chipset",
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ft.c - QIC-40/80 floppy tape driver
|
||||
* $Id: ft.c,v 1.2 1996/07/23 07:46:13 asami Exp $
|
||||
* $Id: ft.c,v 1.3 1996/08/31 15:06:44 asami Exp $
|
||||
*
|
||||
* 01/19/95 ++sg
|
||||
* Cleaned up recalibrate/seek code at attach time for FreeBSD 2.x.
|
||||
@ -82,13 +82,12 @@
|
||||
|
||||
#include <machine/clock.h>
|
||||
|
||||
#include <i386/isa/isa_device.h>
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <pc98/pc98/fdreg.h>
|
||||
#include <pc98/pc98/fdc.h>
|
||||
#include <pc98/pc98/ftreg.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <i386/isa/fdreg.h>
|
||||
#include <i386/isa/fdc.h>
|
||||
#include <i386/isa/rtc.h>
|
||||
@ -1184,11 +1183,7 @@ restate:
|
||||
|
||||
case 1: /* Start DMA */
|
||||
/* Tape is now moving and in position-- start DMA now! */
|
||||
#ifdef PC98
|
||||
pc98_dmastart(B_READ, ft->xptr, QCV_BLKSIZE, 2);
|
||||
#else
|
||||
isa_dmastart(B_READ, ft->xptr, QCV_BLKSIZE, 2);
|
||||
#endif
|
||||
out_fdc(fdcu, 0x66); /* read */
|
||||
#ifdef PC98
|
||||
out_fdc(fdcu, 3);
|
||||
@ -1208,11 +1203,7 @@ restate:
|
||||
case 2: /* DMA completed */
|
||||
/* Transfer complete, get status */
|
||||
for (i = 0; i < 7; i++) rddta[i] = in_fdc(fdcu);
|
||||
#ifdef PC98
|
||||
pc98_dmadone(B_READ, ft->xptr, QCV_BLKSIZE, 2);
|
||||
#else
|
||||
isa_dmadone(B_READ, ft->xptr, QCV_BLKSIZE, 2);
|
||||
#endif
|
||||
|
||||
#if FTDBGALL
|
||||
/* Compute where the controller thinks we are */
|
||||
@ -1317,11 +1308,7 @@ restate:
|
||||
|
||||
case 1: /* Start DMA */
|
||||
/* Tape is now moving and in position-- start DMA now! */
|
||||
#ifdef PC98
|
||||
pc98_dmastart(B_WRITE, ft->xptr, QCV_BLKSIZE, 2);
|
||||
#else
|
||||
isa_dmastart(B_WRITE, ft->xptr, QCV_BLKSIZE, 2);
|
||||
#endif
|
||||
out_fdc(fdcu, 0x45); /* write */
|
||||
#ifdef PC98
|
||||
out_fdc(fdcu, 3);
|
||||
@ -1341,11 +1328,7 @@ restate:
|
||||
case 2: /* DMA completed */
|
||||
/* Transfer complete, get status */
|
||||
for (i = 0; i < 7; i++) rddta[i] = in_fdc(fdcu);
|
||||
#ifdef PC98
|
||||
pc98_dmadone(B_WRITE, ft->xptr, QCV_BLKSIZE, 2);
|
||||
#else
|
||||
isa_dmadone(B_WRITE, ft->xptr, QCV_BLKSIZE, 2);
|
||||
#endif
|
||||
|
||||
#if FTDBGALL
|
||||
/* Compute where the controller thinks we are */
|
||||
|
@ -24,7 +24,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_ed.c,v 1.3 1996/08/30 10:42:59 asami Exp $
|
||||
* $Id: if_ed.c,v 1.4 1996/08/31 15:06:47 asami Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -100,11 +100,10 @@
|
||||
#include <machine/clock.h>
|
||||
#include <machine/md_var.h>
|
||||
|
||||
#include <i386/isa/isa_device.h>
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <pc98/pc98/icu.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <i386/isa/icu.h>
|
||||
#endif
|
||||
#include <i386/isa/if_edreg.h>
|
||||
@ -399,15 +398,9 @@ static unsigned short ed_hpp_intr_mask[] = {
|
||||
|
||||
static struct kern_devconf kdc_ed_template = {
|
||||
0, 0, 0, /* filled in by dev_attach */
|
||||
#ifdef PC98
|
||||
"ed", 0, { MDDT_PC98, 0, "net" },
|
||||
pc98_generic_externalize, 0, 0, PC98_EXTERNALLEN,
|
||||
&kdc_nec0, /* parent */
|
||||
#else
|
||||
"ed", 0, { MDDT_ISA, 0, "net" },
|
||||
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
|
||||
&kdc_isa0, /* parent */
|
||||
#endif
|
||||
0, /* parentdata */
|
||||
DC_UNCONFIGURED, /* state */
|
||||
"", /* description */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,464 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met: 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer. 2. 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.
|
||||
*
|
||||
* if_epreg.h,v 1.4 1994/11/13 10:12:37 gibbs Exp Modified by:
|
||||
*
|
||||
October 2, 1994
|
||||
|
||||
Modified by: Andres Vega Garcia
|
||||
|
||||
INRIA - Sophia Antipolis, France
|
||||
e-mail: avega@sophia.inria.fr
|
||||
finger: avega@pax.inria.fr
|
||||
|
||||
*/
|
||||
/*
|
||||
* $Id: if_epreg.h,v 1.2 1996/07/23 07:46:18 asami Exp $
|
||||
*
|
||||
* Promiscuous mode added and interrupt logic slightly changed
|
||||
* to reduce the number of adapter failures. Transceiver select
|
||||
* logic changed to use value from EEPROM. Autoconfiguration
|
||||
* features added.
|
||||
* Done by:
|
||||
* Serge Babkin
|
||||
* Chelindbank (Chelyabinsk, Russia)
|
||||
* babkin@hq.icb.chel.su
|
||||
*/
|
||||
|
||||
/*
|
||||
* Pccard support for 3C589 by:
|
||||
* HAMADA Naoki
|
||||
* nao@tom-yam.or.jp
|
||||
*/
|
||||
|
||||
/*
|
||||
* Ethernet software status per interface.
|
||||
*/
|
||||
struct ep_softc {
|
||||
struct arpcom arpcom; /* Ethernet common part */
|
||||
short ep_io_addr; /* i/o bus address */
|
||||
#define MAX_MBS 8 /* # of mbufs we keep around */
|
||||
struct mbuf *mb[MAX_MBS]; /* spare mbuf storage. */
|
||||
int next_mb; /* Which mbuf to use next. */
|
||||
int last_mb; /* Last mbuf. */
|
||||
struct mbuf *top, *mcur;
|
||||
short tx_start_thresh; /* Current TX_start_thresh. */
|
||||
short tx_rate;
|
||||
short tx_counter;
|
||||
short rx_early_thresh; /* Current RX_early_thresh. */
|
||||
short rx_latency;
|
||||
short rx_avg_pkt;
|
||||
short cur_len;
|
||||
u_short ep_connectors; /* Connectors on this card. */
|
||||
u_char ep_connector; /* Configured connector. */
|
||||
int stat; /* some flags */
|
||||
int gone; /* adapter is not present (for PCCARD) */
|
||||
#define F_RX_FIRST 0x1
|
||||
#define F_WAIT_TRAIL 0x2
|
||||
#define F_RX_TRAILER 0x4
|
||||
#define F_PROMISC 0x8
|
||||
|
||||
#define F_ACCESS_32_BITS 0x100
|
||||
|
||||
struct ep_board *epb;
|
||||
|
||||
int unit;
|
||||
|
||||
struct kern_devconf* kdc;
|
||||
|
||||
#ifdef EP_LOCAL_STATS
|
||||
short tx_underrun;
|
||||
short rx_no_first;
|
||||
short rx_no_mbuf;
|
||||
short rx_bpf_disc;
|
||||
short rx_overrunf;
|
||||
short rx_overrunl;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct ep_board {
|
||||
int epb_addr; /* address of this board */
|
||||
char epb_used; /* was this entry already used for configuring ? */
|
||||
/* data from EEPROM for later use */
|
||||
u_short eth_addr[3]; /* Ethernet address */
|
||||
u_short prod_id; /* product ID */
|
||||
u_short res_cfg; /* resource configuration */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Some global constants
|
||||
*/
|
||||
#define TX_INIT_RATE 16
|
||||
#define TX_INIT_MAX_RATE 64
|
||||
#define RX_INIT_LATENCY 64
|
||||
#define RX_INIT_EARLY_THRESH 64
|
||||
#define MIN_RX_EARLY_THRESHF 16 /* not less than ether_header */
|
||||
#define MIN_RX_EARLY_THRESHL 4
|
||||
|
||||
#define EEPROMSIZE 0x40
|
||||
#define MAX_EEPROMBUSY 1000
|
||||
#define EP_LAST_TAG 0xd7
|
||||
#define EP_MAX_BOARDS 16
|
||||
#define EP_ID_PORT 0x100
|
||||
#define EP_IOSIZE 16 /* 16 bytes of I/O space used. */
|
||||
|
||||
/*
|
||||
* some macros to acces long named fields
|
||||
*/
|
||||
#define IS_BASE (is->id_iobase)
|
||||
#define BASE (sc->ep_io_addr)
|
||||
|
||||
/*
|
||||
* Commands to read/write EEPROM trough EEPROM command register (Window 0,
|
||||
* Offset 0xa)
|
||||
*/
|
||||
#define EEPROM_CMD_RD 0x0080 /* Read: Address required (5 bits) */
|
||||
#define EEPROM_CMD_WR 0x0040 /* Write: Address required (5 bits) */
|
||||
#define EEPROM_CMD_ERASE 0x00c0 /* Erase: Address required (5 bits) */
|
||||
#define EEPROM_CMD_EWEN 0x0030 /* Erase/Write Enable: No data required */
|
||||
|
||||
#define EEPROM_BUSY (1<<15)
|
||||
#define EEPROM_TST_MODE (1<<14)
|
||||
|
||||
/*
|
||||
* Some short functions, worth to let them be a macro
|
||||
*/
|
||||
#define is_eeprom_busy(b) (inw((b)+EP_W0_EEPROM_COMMAND)&EEPROM_BUSY)
|
||||
#define GO_WINDOW(x) outw(BASE+EP_COMMAND, WINDOW_SELECT|(x))
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* These define the EEPROM data structure. They are used in the probe
|
||||
* function to verify the existence of the adapter after having sent
|
||||
* the ID_Sequence.
|
||||
*
|
||||
* There are others but only the ones we use are defined here.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#define EEPROM_NODE_ADDR_0 0x0 /* Word */
|
||||
#define EEPROM_NODE_ADDR_1 0x1 /* Word */
|
||||
#define EEPROM_NODE_ADDR_2 0x2 /* Word */
|
||||
#define EEPROM_PROD_ID 0x3 /* 0x9[0-f]50 */
|
||||
#define EEPROM_MFG_ID 0x7 /* 0x6d50 */
|
||||
#define EEPROM_ADDR_CFG 0x8 /* Base addr */
|
||||
#define EEPROM_RESOURCE_CFG 0x9 /* IRQ. Bits 12-15 */
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* These are the registers for the 3Com 3c509 and their bit patterns when *
|
||||
* applicable. They have been taken out the the "EtherLink III Parallel *
|
||||
* Tasking EISA and ISA Technical Reference" "Beta Draft 10/30/92" manual *
|
||||
* from 3com. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#define EP_COMMAND 0x0e /* Write. BASE+0x0e is always a
|
||||
* command reg. */
|
||||
#define EP_STATUS 0x0e /* Read. BASE+0x0e is always status
|
||||
* reg. */
|
||||
#define EP_WINDOW 0x0f /* Read. BASE+0x0f is always window
|
||||
* reg. */
|
||||
/*
|
||||
* Window 0 registers. Setup.
|
||||
*/
|
||||
/* Write */
|
||||
#define EP_W0_EEPROM_DATA 0x0c
|
||||
#define EP_W0_EEPROM_COMMAND 0x0a
|
||||
#define EP_W0_RESOURCE_CFG 0x08
|
||||
#define EP_W0_ADDRESS_CFG 0x06
|
||||
#define EP_W0_CONFIG_CTRL 0x04
|
||||
/* Read */
|
||||
#define EP_W0_PRODUCT_ID 0x02
|
||||
#define EP_W0_MFG_ID 0x00
|
||||
|
||||
/*
|
||||
* Window 1 registers. Operating Set.
|
||||
*/
|
||||
/* Write */
|
||||
#define EP_W1_TX_PIO_WR_2 0x02
|
||||
#define EP_W1_TX_PIO_WR_1 0x00
|
||||
/* Read */
|
||||
#define EP_W1_FREE_TX 0x0c
|
||||
#define EP_W1_TX_STATUS 0x0b /* byte */
|
||||
#define EP_W1_TIMER 0x0a /* byte */
|
||||
#define EP_W1_RX_STATUS 0x08
|
||||
#define EP_W1_RX_PIO_RD_2 0x02
|
||||
#define EP_W1_RX_PIO_RD_1 0x00
|
||||
|
||||
/*
|
||||
* Window 2 registers. Station Address Setup/Read
|
||||
*/
|
||||
/* Read/Write */
|
||||
#define EP_W2_ADDR_5 0x05
|
||||
#define EP_W2_ADDR_4 0x04
|
||||
#define EP_W2_ADDR_3 0x03
|
||||
#define EP_W2_ADDR_2 0x02
|
||||
#define EP_W2_ADDR_1 0x01
|
||||
#define EP_W2_ADDR_0 0x00
|
||||
|
||||
/*
|
||||
* Window 3 registers. FIFO Management.
|
||||
*/
|
||||
/* Read */
|
||||
#define EP_W3_FREE_TX 0x0c
|
||||
#define EP_W3_FREE_RX 0x0a
|
||||
|
||||
/*
|
||||
* Window 4 registers. Diagnostics.
|
||||
*/
|
||||
/* Read/Write */
|
||||
#define EP_W4_MEDIA_TYPE 0x0a
|
||||
#define EP_W4_CTRLR_STATUS 0x08
|
||||
#define EP_W4_NET_DIAG 0x06
|
||||
#define EP_W4_FIFO_DIAG 0x04
|
||||
#define EP_W4_HOST_DIAG 0x02
|
||||
#define EP_W4_TX_DIAG 0x00
|
||||
|
||||
/*
|
||||
* Window 5 Registers. Results and Internal status.
|
||||
*/
|
||||
/* Read */
|
||||
#define EP_W5_READ_0_MASK 0x0c
|
||||
#define EP_W5_INTR_MASK 0x0a
|
||||
#define EP_W5_RX_FILTER 0x08
|
||||
#define EP_W5_RX_EARLY_THRESH 0x06
|
||||
#define EP_W5_TX_AVAIL_THRESH 0x02
|
||||
#define EP_W5_TX_START_THRESH 0x00
|
||||
|
||||
/*
|
||||
* Window 6 registers. Statistics.
|
||||
*/
|
||||
/* Read/Write */
|
||||
#define TX_TOTAL_OK 0x0c
|
||||
#define RX_TOTAL_OK 0x0a
|
||||
#define TX_DEFERRALS 0x08
|
||||
#define RX_FRAMES_OK 0x07
|
||||
#define TX_FRAMES_OK 0x06
|
||||
#define RX_OVERRUNS 0x05
|
||||
#define TX_COLLISIONS 0x04
|
||||
#define TX_AFTER_1_COLLISION 0x03
|
||||
#define TX_AFTER_X_COLLISIONS 0x02
|
||||
#define TX_NO_SQE 0x01
|
||||
#define TX_CD_LOST 0x00
|
||||
|
||||
/****************************************
|
||||
*
|
||||
* Register definitions.
|
||||
*
|
||||
****************************************/
|
||||
|
||||
/*
|
||||
* Command register. All windows.
|
||||
*
|
||||
* 16 bit register.
|
||||
* 15-11: 5-bit code for command to be executed.
|
||||
* 10-0: 11-bit arg if any. For commands with no args;
|
||||
* this can be set to anything.
|
||||
*/
|
||||
#define GLOBAL_RESET (u_short) 0x0000 /* Wait at least 1ms
|
||||
* after issuing */
|
||||
#define WINDOW_SELECT (u_short) (0x1<<11)
|
||||
#define START_TRANSCEIVER (u_short) (0x2<<11) /* Read ADDR_CFG reg to
|
||||
* determine whether
|
||||
* this is needed. If
|
||||
* so; wait 800 uSec
|
||||
* before using trans-
|
||||
* ceiver. */
|
||||
#define RX_DISABLE (u_short) (0x3<<11) /* state disabled on
|
||||
* power-up */
|
||||
#define RX_ENABLE (u_short) (0x4<<11)
|
||||
#define RX_RESET (u_short) (0x5<<11)
|
||||
#define RX_DISCARD_TOP_PACK (u_short) (0x8<<11)
|
||||
#define TX_ENABLE (u_short) (0x9<<11)
|
||||
#define TX_DISABLE (u_short) (0xa<<11)
|
||||
#define TX_RESET (u_short) (0xb<<11)
|
||||
#define REQ_INTR (u_short) (0xc<<11)
|
||||
#define SET_INTR_MASK (u_short) (0xe<<11)
|
||||
#define SET_RD_0_MASK (u_short) (0xf<<11)
|
||||
#define SET_RX_FILTER (u_short) (0x10<<11)
|
||||
#define FIL_INDIVIDUAL (u_short) (0x1)
|
||||
#define FIL_GROUP (u_short) (0x2)
|
||||
#define FIL_BRDCST (u_short) (0x4)
|
||||
#define FIL_ALL (u_short) (0x8)
|
||||
#define SET_RX_EARLY_THRESH (u_short) (0x11<<11)
|
||||
#define SET_TX_AVAIL_THRESH (u_short) (0x12<<11)
|
||||
#define SET_TX_START_THRESH (u_short) (0x13<<11)
|
||||
#define STATS_ENABLE (u_short) (0x15<<11)
|
||||
#define STATS_DISABLE (u_short) (0x16<<11)
|
||||
#define STOP_TRANSCEIVER (u_short) (0x17<<11)
|
||||
/*
|
||||
* The following C_* acknowledge the various interrupts. Some of them don't
|
||||
* do anything. See the manual.
|
||||
*/
|
||||
#define ACK_INTR (u_short) (0x6800)
|
||||
#define C_INTR_LATCH (u_short) (ACK_INTR|0x1)
|
||||
#define C_CARD_FAILURE (u_short) (ACK_INTR|0x2)
|
||||
#define C_TX_COMPLETE (u_short) (ACK_INTR|0x4)
|
||||
#define C_TX_AVAIL (u_short) (ACK_INTR|0x8)
|
||||
#define C_RX_COMPLETE (u_short) (ACK_INTR|0x10)
|
||||
#define C_RX_EARLY (u_short) (ACK_INTR|0x20)
|
||||
#define C_INT_RQD (u_short) (ACK_INTR|0x40)
|
||||
#define C_UPD_STATS (u_short) (ACK_INTR|0x80)
|
||||
#define C_MASK (u_short) 0xFF /* mask of C_* */
|
||||
|
||||
/*
|
||||
* Status register. All windows.
|
||||
*
|
||||
* 15-13: Window number(0-7).
|
||||
* 12: Command_in_progress.
|
||||
* 11: reserved.
|
||||
* 10: reserved.
|
||||
* 9: reserved.
|
||||
* 8: reserved.
|
||||
* 7: Update Statistics.
|
||||
* 6: Interrupt Requested.
|
||||
* 5: RX Early.
|
||||
* 4: RX Complete.
|
||||
* 3: TX Available.
|
||||
* 2: TX Complete.
|
||||
* 1: Adapter Failure.
|
||||
* 0: Interrupt Latch.
|
||||
*/
|
||||
#define S_INTR_LATCH (u_short) (0x1)
|
||||
#define S_CARD_FAILURE (u_short) (0x2)
|
||||
#define S_TX_COMPLETE (u_short) (0x4)
|
||||
#define S_TX_AVAIL (u_short) (0x8)
|
||||
#define S_RX_COMPLETE (u_short) (0x10)
|
||||
#define S_RX_EARLY (u_short) (0x20)
|
||||
#define S_INT_RQD (u_short) (0x40)
|
||||
#define S_UPD_STATS (u_short) (0x80)
|
||||
#define S_MASK (u_short) 0xFF /* mask of S_* */
|
||||
#define S_5_INTS (S_CARD_FAILURE|S_TX_COMPLETE|\
|
||||
S_TX_AVAIL|S_RX_COMPLETE|S_RX_EARLY)
|
||||
#define S_COMMAND_IN_PROGRESS (u_short) (0x1000)
|
||||
|
||||
/* Address Config. Register.
|
||||
* Window 0/Port 06
|
||||
*/
|
||||
|
||||
#define ACF_CONNECTOR_BITS 14
|
||||
#define ACF_CONNECTOR_UTP 0
|
||||
#define ACF_CONNECTOR_AUI 1
|
||||
#define ACF_CONNECTOR_BNC 3
|
||||
|
||||
/* Resource configuration register.
|
||||
* Window 0/Port 08
|
||||
*
|
||||
*/
|
||||
|
||||
#define SET_IRQ(base,irq) outw((base) + EP_W0_RESOURCE_CFG, \
|
||||
((inw((base) + EP_W0_RESOURCE_CFG) & 0x0fff) | \
|
||||
((u_short)(irq)<<12)) ) /* set IRQ i */
|
||||
|
||||
/*
|
||||
* FIFO Registers.
|
||||
* RX Status. Window 1/Port 08
|
||||
*
|
||||
* 15: Incomplete or FIFO empty.
|
||||
* 14: 1: Error in RX Packet 0: Incomplete or no error.
|
||||
* 13-11: Type of error.
|
||||
* 1000 = Overrun.
|
||||
* 1011 = Run Packet Error.
|
||||
* 1100 = Alignment Error.
|
||||
* 1101 = CRC Error.
|
||||
* 1001 = Oversize Packet Error (>1514 bytes)
|
||||
* 0010 = Dribble Bits.
|
||||
* (all other error codes, no errors.)
|
||||
*
|
||||
* 10-0: RX Bytes (0-1514)
|
||||
*/
|
||||
#define ERR_RX_INCOMPLETE (u_short) (0x1<<15)
|
||||
#define ERR_RX (u_short) (0x1<<14)
|
||||
#define ERR_RX_OVERRUN (u_short) (0x8<<11)
|
||||
#define ERR_RX_RUN_PKT (u_short) (0xb<<11)
|
||||
#define ERR_RX_ALIGN (u_short) (0xc<<11)
|
||||
#define ERR_RX_CRC (u_short) (0xd<<11)
|
||||
#define ERR_RX_OVERSIZE (u_short) (0x9<<11)
|
||||
#define ERR_RX_DRIBBLE (u_short) (0x2<<11)
|
||||
|
||||
/*
|
||||
* FIFO Registers.
|
||||
* TX Status. Window 1/Port 0B
|
||||
*
|
||||
* Reports the transmit status of a completed transmission. Writing this
|
||||
* register pops the transmit completion stack.
|
||||
*
|
||||
* Window 1/Port 0x0b.
|
||||
*
|
||||
* 7: Complete
|
||||
* 6: Interrupt on successful transmission requested.
|
||||
* 5: Jabber Error (TP Only, TX Reset required. )
|
||||
* 4: Underrun (TX Reset required. )
|
||||
* 3: Maximum Collisions.
|
||||
* 2: TX Status Overflow.
|
||||
* 1-0: Undefined.
|
||||
*
|
||||
*/
|
||||
#define TXS_COMPLETE 0x80
|
||||
#define TXS_SUCCES_INTR_REQ 0x40
|
||||
#define TXS_JABBER 0x20
|
||||
#define TXS_UNDERRUN 0x10
|
||||
#define TXS_MAX_COLLISION 0x8
|
||||
#define TXS_STATUS_OVERFLOW 0x4
|
||||
|
||||
/*
|
||||
* Configuration control register.
|
||||
* Window 0/Port 04
|
||||
*/
|
||||
/* Read */
|
||||
#define IS_AUI (1<<13)
|
||||
#define IS_BNC (1<<12)
|
||||
#define IS_UTP (1<<9)
|
||||
/* Write */
|
||||
#define ENABLE_DRQ_IRQ 0x0001
|
||||
#define W0_P4_CMD_RESET_ADAPTER 0x4
|
||||
#define W0_P4_CMD_ENABLE_ADAPTER 0x1
|
||||
/*
|
||||
* Media type and status.
|
||||
* Window 4/Port 0A
|
||||
*/
|
||||
#define ENABLE_UTP 0xc0
|
||||
#define DISABLE_UTP 0x0
|
||||
|
||||
/*
|
||||
* Misc defines for various things.
|
||||
*/
|
||||
#define ACTIVATE_ADAPTER_TO_CONFIG 0xff /* to the id_port */
|
||||
#define MFG_ID 0x6d50 /* in EEPROM and W0 ADDR_CONFIG */
|
||||
#define PROD_ID 0x9150
|
||||
|
||||
#define AUI 0x1
|
||||
#define BNC 0x2
|
||||
#define UTP 0x4
|
||||
|
||||
#define RX_BYTES_MASK (u_short) (0x07ff)
|
||||
|
||||
extern struct ep_board ep_board[];
|
||||
extern int ep_boards;
|
||||
extern u_long ep_unit;
|
||||
extern struct ep_softc *ep_alloc __P((int unit, struct ep_board *epb));
|
||||
extern void ep_free __P((struct ep_softc *sc));
|
||||
extern void ep_intr __P((void *sc));
|
||||
extern int ep_attach __P((struct ep_softc *sc));
|
||||
|
||||
extern u_int16_t get_e __P((struct ep_softc *sc, int offset));
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: if_fe.c,v 1.3 1996/08/30 10:43:02 asami Exp $
|
||||
* $Id: if_fe.c,v 1.4 1996/08/31 15:06:55 asami Exp $
|
||||
*
|
||||
* Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
|
||||
* To be used with FreeBSD 2.x
|
||||
@ -127,11 +127,10 @@
|
||||
|
||||
#include <machine/clock.h>
|
||||
|
||||
#include <i386/isa/isa_device.h>
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <pc98/pc98/icu.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <i386/isa/icu.h>
|
||||
#endif
|
||||
|
||||
@ -305,15 +304,9 @@ struct isa_driver fedriver =
|
||||
static struct kern_devconf const fe_kdc_template =
|
||||
{
|
||||
0, 0, 0,
|
||||
#ifdef PC98
|
||||
"fe", 0, { MDDT_PC98, 0, "net" },
|
||||
pc98_generic_externalize, 0, 0, PC98_EXTERNALLEN,
|
||||
&kdc_nec0, /* This is an ISA device. */
|
||||
#else
|
||||
"fe", 0, { MDDT_ISA, 0, "net" },
|
||||
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
|
||||
&kdc_isa0, /* This is an ISA device. */
|
||||
#endif
|
||||
0,
|
||||
DC_UNCONFIGURED, /* Not yet configured. */
|
||||
"Ethernet (MB8696x)", /* Tentative description (filled in later.) */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,293 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. 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.
|
||||
*
|
||||
* $Id: if_zpreg.h,v 1.1.1.1 1996/06/14 10:04:44 asami Exp $
|
||||
*/
|
||||
/**************************************************************************
|
||||
* *
|
||||
* These define the EEPROM data structure. They are used in the probe
|
||||
* function to verify the existence of the adapter after having sent
|
||||
* the ID_Sequence.
|
||||
*
|
||||
* There are others but only the ones we use are defined here.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#define EEPROM_NODE_ADDR_0 0x0 /* Word */
|
||||
#define EEPROM_NODE_ADDR_1 0x1 /* Word */
|
||||
#define EEPROM_NODE_ADDR_2 0x2 /* Word */
|
||||
#define EEPROM_PROD_ID 0x3 /* 0x9[0-f]50 */
|
||||
#define EEPROM_MFG_ID 0x7 /* 0x6d50 */
|
||||
#define EEPROM_ADDR_CFG 0x8 /* Base addr */
|
||||
#define EEPROM_RESOURCE_CFG 0x9 /* IRQ. Bits 12-15 */
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* These are the registers for the 3Com 3c509 and their bit patterns when *
|
||||
* applicable. They have been taken out the the "EtherLink III Parallel *
|
||||
* Tasking EISA and ISA Technical Reference" "Beta Draft 10/30/92" manual *
|
||||
* from 3com. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#define EP_COMMAND 0x0e /* Write. BASE+0x0e is always a command reg. */
|
||||
#define EP_STATUS 0x0e /* Read. BASE+0x0e is always status reg. */
|
||||
#define EP_WINDOW 0x0f /* Read. BASE+0x0f is always window reg. */
|
||||
/*
|
||||
* Window 0 registers. Setup.
|
||||
*/
|
||||
/* Write */
|
||||
#define EP_W0_EEPROM_DATA 0x0c
|
||||
#define EP_W0_EEPROM_COMMAND 0x0a
|
||||
#define EP_W0_RESOURCE_CFG 0x08
|
||||
#define EP_W0_ADDRESS_CFG 0x06
|
||||
#define EP_W0_CONFIG_CTRL 0x04
|
||||
/* Read */
|
||||
#define EP_W0_PRODUCT_ID 0x02
|
||||
#define EP_W0_MFG_ID 0x00
|
||||
|
||||
/*
|
||||
* Window 1 registers. Operating Set.
|
||||
*/
|
||||
/* Write */
|
||||
#define EP_W1_TX_PIO_WR_2 0x02
|
||||
#define EP_W1_TX_PIO_WR_1 0x00
|
||||
/* Read */
|
||||
#define EP_W1_FREE_TX 0x0c
|
||||
#define EP_W1_TX_STATUS 0x0b /* byte */
|
||||
#define EP_W1_TIMER 0x0a /* byte */
|
||||
#define EP_W1_RX_STATUS 0x08
|
||||
#define EP_W1_RX_PIO_RD_2 0x02
|
||||
#define EP_W1_RX_PIO_RD_1 0x00
|
||||
|
||||
/*
|
||||
* Window 2 registers. Station Address Setup/Read
|
||||
*/
|
||||
/* Read/Write */
|
||||
#define EP_W2_ADDR_5 0x05
|
||||
#define EP_W2_ADDR_4 0x04
|
||||
#define EP_W2_ADDR_3 0x03
|
||||
#define EP_W2_ADDR_2 0x02
|
||||
#define EP_W2_ADDR_1 0x01
|
||||
#define EP_W2_ADDR_0 0x00
|
||||
|
||||
/*
|
||||
* Window 3 registers. FIFO Management.
|
||||
*/
|
||||
/* Read */
|
||||
#define EP_W3_FREE_TX 0x0c
|
||||
#define EP_W3_FREE_RX 0x0a
|
||||
|
||||
/*
|
||||
* Window 4 registers. Diagnostics.
|
||||
*/
|
||||
/* Read/Write */
|
||||
#define EP_W4_MEDIA_TYPE 0x0a
|
||||
#define EP_W4_CTRLR_STATUS 0x08
|
||||
#define EP_W4_NET_DIAG 0x06
|
||||
#define EP_W4_FIFO_DIAG 0x04
|
||||
#define EP_W4_HOST_DIAG 0x02
|
||||
#define EP_W4_TX_DIAG 0x00
|
||||
|
||||
/*
|
||||
* Window 5 Registers. Results and Internal status.
|
||||
*/
|
||||
/* Read */
|
||||
#define EP_W5_READ_0_MASK 0x0c
|
||||
#define EP_W5_INTR_MASK 0x0a
|
||||
#define EP_W5_RX_FILTER 0x08
|
||||
#define EP_W5_RX_EARLY_THRESH 0x06
|
||||
#define EP_W5_TX_AVAIL_THRESH 0x02
|
||||
#define EP_W5_TX_START_THRESH 0x00
|
||||
|
||||
/*
|
||||
* Window 6 registers. Statistics.
|
||||
*/
|
||||
/* Read/Write */
|
||||
#define TX_TOTAL_OK 0x0c
|
||||
#define RX_TOTAL_OK 0x0a
|
||||
#define TX_DEFERRALS 0x08
|
||||
#define RX_FRAMES_OK 0x07
|
||||
#define TX_FRAMES_OK 0x06
|
||||
#define RX_OVERRUNS 0x05
|
||||
#define TX_COLLISIONS 0x04
|
||||
#define TX_AFTER_1_COLLISION 0x03
|
||||
#define TX_AFTER_X_COLLISIONS 0x02
|
||||
#define TX_NO_SQE 0x01
|
||||
#define TX_CD_LOST 0x00
|
||||
|
||||
/****************************************
|
||||
*
|
||||
* Register definitions.
|
||||
*
|
||||
****************************************/
|
||||
|
||||
/*
|
||||
* Command register. All windows.
|
||||
*
|
||||
* 16 bit register.
|
||||
* 15-11: 5-bit code for command to be executed.
|
||||
* 10-0: 11-bit arg if any. For commands with no args;
|
||||
* this can be set to anything.
|
||||
*/
|
||||
#define GLOBAL_RESET (u_short) 0x0000 /* Wait at least 1ms after issuing */
|
||||
#define WINDOW_SELECT (u_short) (0x1<<11)
|
||||
#define START_TRANSCEIVER (u_short) (0x2<<11) /* Read ADDR_CFG reg to determine
|
||||
whether this is needed. If so;
|
||||
wait 800 uSec before using trans-
|
||||
ceiver. */
|
||||
#define RX_DISABLE (u_short) (0x3<<11) /* state disabled on power-up */
|
||||
#define RX_ENABLE (u_short) (0x4<<11)
|
||||
#define RX_RESET (u_short) (0x5<<11)
|
||||
#define RX_DISCARD_TOP_PACK (u_short) (0x8<<11)
|
||||
#define TX_ENABLE (u_short) (0x9<<11)
|
||||
#define TX_DISABLE (u_short) (0xa<<11)
|
||||
#define TX_RESET (u_short) (0xb<<11)
|
||||
#define REQ_INTR (u_short) (0xc<<11)
|
||||
/*
|
||||
* The following C_* acknowledge the various interrupts.
|
||||
* Some of them don't do anything. See the manual.
|
||||
*/
|
||||
#define ACK_INTR (u_short) (0x6800)
|
||||
# define C_INTR_LATCH (u_short) (ACK_INTR|0x1)
|
||||
# define C_CARD_FAILURE (u_short) (ACK_INTR|0x2)
|
||||
# define C_TX_COMPLETE (u_short) (ACK_INTR|0x4)
|
||||
# define C_TX_AVAIL (u_short) (ACK_INTR|0x8)
|
||||
# define C_RX_COMPLETE (u_short) (ACK_INTR|0x10)
|
||||
# define C_RX_EARLY (u_short) (ACK_INTR|0x20)
|
||||
# define C_INT_RQD (u_short) (ACK_INTR|0x40)
|
||||
# define C_UPD_STATS (u_short) (ACK_INTR|0x80)
|
||||
#define SET_INTR_MASK (u_short) (0xe<<11)
|
||||
#define SET_RD_0_MASK (u_short) (0xf<<11)
|
||||
#define SET_RX_FILTER (u_short) (0x10<<11)
|
||||
# define FIL_INDIVIDUAL (u_short) (0x1)
|
||||
# define FIL_GROUP (u_short) (0x2)
|
||||
# define FIL_BRDCST (u_short) (0x4)
|
||||
# define FIL_ALL (u_short) (0x8)
|
||||
#define SET_RX_EARLY_THRESH (u_short) (0x11<<11)
|
||||
#define SET_TX_AVAIL_THRESH (u_short) (0x12<<11)
|
||||
#define SET_TX_START_THRESH (u_short) (0x13<<11)
|
||||
#define STATS_ENABLE (u_short) (0x15<<11)
|
||||
#define STATS_DISABLE (u_short) (0x16<<11)
|
||||
#define STOP_TRANSCEIVER (u_short) (0x17<<11)
|
||||
|
||||
/*
|
||||
* Status register. All windows.
|
||||
*
|
||||
* 15-13: Window number(0-7).
|
||||
* 12: Command_in_progress.
|
||||
* 11: reserved.
|
||||
* 10: reserved.
|
||||
* 9: reserved.
|
||||
* 8: reserved.
|
||||
* 7: Update Statistics.
|
||||
* 6: Interrupt Requested.
|
||||
* 5: RX Early.
|
||||
* 4: RX Complete.
|
||||
* 3: TX Available.
|
||||
* 2: TX Complete.
|
||||
* 1: Adapter Failure.
|
||||
* 0: Interrupt Latch.
|
||||
*/
|
||||
#define S_INTR_LATCH (u_short) (0x1)
|
||||
#define S_CARD_FAILURE (u_short) (0x2)
|
||||
#define S_TX_COMPLETE (u_short) (0x4)
|
||||
#define S_TX_AVAIL (u_short) (0x8)
|
||||
#define S_RX_COMPLETE (u_short) (0x10)
|
||||
#define S_RX_EARLY (u_short) (0x20)
|
||||
#define S_INT_RQD (u_short) (0x40)
|
||||
#define S_UPD_STATS (u_short) (0x80)
|
||||
#define S_COMMAND_IN_PROGRESS (u_short) (0x1000)
|
||||
|
||||
/*
|
||||
* FIFO Registers. RX Status.
|
||||
*
|
||||
* 15: Incomplete or FIFO empty.
|
||||
* 14: 1: Error in RX Packet 0: Incomplete or no error.
|
||||
* 13-11: Type of error.
|
||||
* 1000 = Overrun.
|
||||
* 1011 = Run Packet Error.
|
||||
* 1100 = Alignment Error.
|
||||
* 1101 = CRC Error.
|
||||
* 1001 = Oversize Packet Error (>1514 bytes)
|
||||
* 0010 = Dribble Bits.
|
||||
* (all other error codes, no errors.)
|
||||
*
|
||||
* 10-0: RX Bytes (0-1514)
|
||||
*/
|
||||
#define ERR_INCOMPLETE (u_short) (0x8000)
|
||||
#define ERR_RX (u_short) (0x4000)
|
||||
#define ERR_RX_PACKET (u_short) (0x2000)
|
||||
#define ERR_OVERRUN (u_short) (0x1000)
|
||||
#define ERR_RUNT (u_short) (0x1300)
|
||||
#define ERR_ALIGNMENT (u_short) (0x1400)
|
||||
#define ERR_CRC (u_short) (0x1500)
|
||||
#define ERR_OVERSIZE (u_short) (0x1100)
|
||||
#define ERR_DRIBBLE (u_short) (0x200)
|
||||
|
||||
/*
|
||||
* TX Status
|
||||
*
|
||||
* Reports the transmit status of a completed transmission. Writing this
|
||||
* register pops the transmit completion stack.
|
||||
*
|
||||
* Window 1/Port 0x0b.
|
||||
*
|
||||
* 7: Complete
|
||||
* 6: Interrupt on successful transmission requested.
|
||||
* 5: Jabber Error (TP Only, TX Reset required. )
|
||||
* 4: Underrun (TX Reset required. )
|
||||
* 3: Maximum Collisions.
|
||||
* 2: TX Status Overflow.
|
||||
* 1-0: Undefined.
|
||||
*
|
||||
*/
|
||||
#define TXS_COMPLETE 0x80
|
||||
#define TXS_INTR_REQ 0x40
|
||||
#define TXS_JABBER 0x20
|
||||
#define TXS_UNDERRUN 0x10
|
||||
#define TXS_MAX_COLLISION 0x8
|
||||
#define TXS_STATUS_OVERFLOW 0x4
|
||||
|
||||
/*
|
||||
* Misc defines for various things.
|
||||
*/
|
||||
#define TAG_ADAPTER_0 0xd0
|
||||
#define ACTIVATE_ADAPTER_TO_CONFIG 0xff
|
||||
#define ENABLE_DRQ_IRQ 0x0001
|
||||
#define MFG_ID 0x6d50
|
||||
#define PROD_ID 0x9150
|
||||
#define BASE sc->ep_io_addr
|
||||
#define GO_WINDOW(x) outw(BASE+EP_COMMAND, WINDOW_SELECT|x)
|
||||
#define AUI 0x1
|
||||
#define BNC 0x2
|
||||
#define UTP 0x4
|
||||
#define IS_AUI (1<<13)
|
||||
#define IS_BNC (1<<12)
|
||||
#define IS_UTP (1<<9)
|
||||
#define EEPROM_BUSY (1<<15)
|
||||
#define EEPROM_TST_MODE (1<<14)
|
||||
#define READ_EEPROM (1<<7)
|
||||
#define ENABLE_UTP 0xc0
|
||||
#define DISABLE_UTP 0x0
|
||||
#define RX_BYTES_MASK (u_short) (0x07ff)
|
@ -46,7 +46,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: unknown origin, 386BSD 0.1
|
||||
* $Id: lpt.c,v 1.2 1996/07/23 07:46:24 asami Exp $
|
||||
* $Id: lpt.c,v 1.3 1996/08/31 15:06:59 asami Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -126,7 +126,7 @@
|
||||
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98.h>
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <pc98/pc98/lptreg.h>
|
||||
#else /* !PC98 */
|
||||
#include <i386/isa/isa.h>
|
||||
@ -321,15 +321,9 @@ static struct cdevsw lpt_cdevsw =
|
||||
|
||||
static struct kern_devconf kdc_lpt[NLPT] = { {
|
||||
0, 0, 0, /* filled in by dev_attach */
|
||||
#ifdef PC98
|
||||
"lpt", 0, { MDDT_PC98, 0, "tty" },
|
||||
pc98_generic_externalize, 0, 0, PC98_EXTERNALLEN,
|
||||
&kdc_nec0, /* parent */
|
||||
#else
|
||||
"lpt", 0, { MDDT_ISA, 0, "tty" },
|
||||
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
|
||||
&kdc_isa0, /* parent */
|
||||
#endif
|
||||
0, /* parentdata */
|
||||
DC_UNCONFIGURED, /* state */
|
||||
"Parallel printer adapter",
|
||||
@ -342,11 +336,7 @@ lpt_registerdev(struct isa_device *id)
|
||||
if(id->id_unit)
|
||||
kdc_lpt[id->id_unit] = kdc_lpt[0];
|
||||
kdc_lpt[id->id_unit].kdc_unit = id->id_unit;
|
||||
#ifdef PC98
|
||||
kdc_lpt[id->id_unit].kdc_pc98 = id;
|
||||
#else
|
||||
kdc_lpt[id->id_unit].kdc_isa = id;
|
||||
#endif
|
||||
dev_attach(&kdc_lpt[id->id_unit]);
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
|
||||
* $Id: machdep.c,v 1.2 1996/07/23 07:45:54 asami Exp $
|
||||
* $Id: machdep.c,v 1.3 1996/08/30 10:42:53 asami Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
@ -113,11 +113,10 @@
|
||||
#include <machine/perfmon.h>
|
||||
#endif
|
||||
|
||||
#include <i386/isa/isa_device.h>
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <pc98/pc98/pc98_machdep.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <i386/isa/rtc.h>
|
||||
#endif
|
||||
#include <machine/random.h>
|
||||
@ -1073,7 +1072,7 @@ init386(first)
|
||||
#include "nec.h"
|
||||
#include "epson.h"
|
||||
#if NNEC > 0 || NEPSON > 0
|
||||
pc98_defaultirq();
|
||||
isa_defaultirq();
|
||||
#endif
|
||||
#else /* IBM-PC */
|
||||
#include "isa.h"
|
||||
@ -1115,14 +1114,41 @@ init386(first)
|
||||
biosextmem = rtcin(RTC_EXTLO)+ (rtcin(RTC_EXTHI)<<8);
|
||||
|
||||
/*
|
||||
* Print a warning if the official BIOS interface disagrees
|
||||
* with the hackish interface used above. Eventually only
|
||||
* the official interface should be used.
|
||||
* Print a warning and set it to the safest value if the official
|
||||
* BIOS interface (bootblock supplied) disagrees with the
|
||||
* hackish interface used above. Eventually only the official
|
||||
* interface should be used. This is necessary for some machines
|
||||
* who 'steal' memory from the basemem for use as BIOS memory.
|
||||
*/
|
||||
if (bootinfo.bi_memsizes_valid) {
|
||||
if (bootinfo.bi_basemem != biosbasemem)
|
||||
printf("BIOS basemem (%ldK) != RTC basemem (%dK)\n",
|
||||
if (bootinfo.bi_basemem != biosbasemem) {
|
||||
vm_offset_t pa, va, tmpva;
|
||||
vm_size_t size;
|
||||
unsigned *pte;
|
||||
|
||||
printf("BIOS basemem (%ldK) != RTC basemem (%dK), ",
|
||||
bootinfo.bi_basemem, biosbasemem);
|
||||
printf("setting to BIOS value.\n");
|
||||
biosbasemem = bootinfo.bi_basemem;
|
||||
/*
|
||||
* XXX - Map this 'hole' of memory in the same manner
|
||||
* as the ISA_HOLE (read/write/non-cacheable), since
|
||||
* the BIOS 'fudges' it to become part of the ISA_HOLE.
|
||||
* This code is similar to the code used in
|
||||
* pmap_mapdev, but since no memory needs to be
|
||||
* allocated we simply change the mapping.
|
||||
*/
|
||||
pa = biosbasemem * 1024;
|
||||
va = pa + KERNBASE;
|
||||
size = roundup(ISA_HOLE_START - pa, PAGE_SIZE);
|
||||
for (tmpva = va; size > 0;) {
|
||||
pte = (unsigned *)vtopte(tmpva);
|
||||
*pte = pa | PG_RW | PG_V | PG_N;
|
||||
size -= PAGE_SIZE;
|
||||
tmpva += PAGE_SIZE;
|
||||
pa += PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
if (bootinfo.bi_extmem != biosextmem)
|
||||
printf("BIOS extmem (%ldK) != RTC extmem (%dK)\n",
|
||||
bootinfo.bi_extmem, biosextmem);
|
||||
|
@ -337,7 +337,7 @@ static char MATCDVERSION[]="Version 1(26) 18-Oct-95";
|
||||
static char MATCDCOPYRIGHT[] = "Matsushita CD-ROM driver, Copr. 1994,1995 Frank Durda IV";
|
||||
/* The proceeding strings may not be changed*/
|
||||
|
||||
/* $Id: matcd.c,v 1.2 1996/07/30 18:56:16 asami Exp $ */
|
||||
/* $Id: matcd.c,v 1.3 1996/08/31 15:07:38 asami Exp $ */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
Include declarations
|
||||
@ -493,15 +493,9 @@ struct matcd_read2 {
|
||||
|
||||
static struct kern_devconf kdc_matcd[TOTALDRIVES] = { {
|
||||
0,0,0, /*Filled in by dev_attach*/
|
||||
#ifdef PC98
|
||||
"matcdc",0,{MDDT_PC98,0,"bio"},
|
||||
pc98_generic_externalize,0,0,PC98_EXTERNALLEN,
|
||||
&kdc_nec0, /*<12>Parent*/
|
||||
#else
|
||||
"matcdc",0,{MDDT_ISA,0,"bio"},
|
||||
isa_generic_externalize,0,0,ISA_EXTERNALLEN,
|
||||
&kdc_isa0, /*<12>Parent*/
|
||||
#endif
|
||||
0, /*<12>Parent Data*/
|
||||
DC_IDLE, /*<12>Status*/
|
||||
"Matsushita CD-ROM Controller" /*<12>This is the description*/
|
||||
@ -1360,11 +1354,7 @@ static inline void matcd_register(struct isa_device *id)
|
||||
kdc_matcd[id->id_unit]=kdc_matcd[0];
|
||||
}
|
||||
kdc_matcd[id->id_unit].kdc_unit=id->id_unit;
|
||||
#ifdef PC98
|
||||
kdc_matcd[id->id_unit].kdc_pc98=id;
|
||||
#else
|
||||
kdc_matcd[id->id_unit].kdc_isa=id;
|
||||
#endif
|
||||
dev_attach(&kdc_matcd[id->id_unit]);
|
||||
return;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
* $Id: mse.c,v 1.1.1.1 1996/06/14 10:04:45 asami Exp $
|
||||
* $Id: mse.c,v 1.2 1996/08/31 15:07:01 asami Exp $
|
||||
*/
|
||||
/*
|
||||
* Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and
|
||||
@ -61,11 +61,9 @@
|
||||
|
||||
#include <machine/clock.h>
|
||||
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <pc98/pc98/icu.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/icu.h>
|
||||
#endif
|
||||
|
||||
|
||||
@ -261,15 +259,9 @@ static struct mse_types {
|
||||
|
||||
static struct kern_devconf kdc_mse[NMSE] = { {
|
||||
0, 0, 0, /* filled in by dev_attach */
|
||||
#ifdef PC98
|
||||
"mse", 0, { MDDT_PC98, 0, "tty" },
|
||||
pc98_generic_externalize, 0, 0, PC98_EXTERNALLEN,
|
||||
&kdc_nec0, /* parent */
|
||||
#else
|
||||
"mse", 0, { MDDT_ISA, 0, "tty" },
|
||||
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
|
||||
&kdc_isa0, /* parent */
|
||||
#endif
|
||||
0, /* parentdata */
|
||||
DC_UNCONFIGURED, /* state */
|
||||
"ATI or Logitech bus mouse adapter",
|
||||
@ -282,11 +274,7 @@ mse_registerdev(struct isa_device *id)
|
||||
if(id->id_unit)
|
||||
kdc_mse[id->id_unit] = kdc_mse[0];
|
||||
kdc_mse[id->id_unit].kdc_unit = id->id_unit;
|
||||
#ifdef PC98
|
||||
kdc_mse[id->id_unit].kdc_pc98 = id;
|
||||
#else
|
||||
kdc_mse[id->id_unit].kdc_isa = id;
|
||||
#endif
|
||||
dev_attach(&kdc_mse[id->id_unit]);
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)npx.c 7.2 (Berkeley) 5/12/91
|
||||
* $Id: npx.c,v 1.2 1996/07/23 07:46:26 asami Exp $
|
||||
* $Id: npx.c,v 1.3 1996/08/31 15:07:03 asami Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
@ -61,7 +61,7 @@
|
||||
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/icu.h>
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <pc98/pc98/pc98.h>
|
||||
#else
|
||||
#include <i386/isa/icu.h>
|
||||
@ -175,15 +175,9 @@ _probetrap:
|
||||
|
||||
static struct kern_devconf kdc_npx[NNPX] = { {
|
||||
0, 0, 0, /* filled in by dev_attach */
|
||||
#ifdef PC98
|
||||
"npx", 0, { MDDT_PC98, 0 },
|
||||
pc98_generic_externalize, 0, 0, PC98_EXTERNALLEN,
|
||||
&kdc_nec0, /* parent */
|
||||
#else
|
||||
"npx", 0, { MDDT_ISA, 0 },
|
||||
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
|
||||
&kdc_isa0, /* parent */
|
||||
#endif
|
||||
0, /* parentdata */
|
||||
DC_UNCONFIGURED, /* state */
|
||||
"Floating-point unit",
|
||||
@ -199,11 +193,7 @@ npx_registerdev(struct isa_device *id)
|
||||
if (unit != 0)
|
||||
kdc_npx[unit] = kdc_npx[0];
|
||||
kdc_npx[unit].kdc_unit = unit;
|
||||
#ifdef PC98
|
||||
kdc_npx[unit].kdc_pc98 = id;
|
||||
#else
|
||||
kdc_npx[unit].kdc_isa = id;
|
||||
#endif
|
||||
dev_attach(&kdc_npx[unit]);
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
|
||||
* $Id: pc98.c,v 1.2 1996/07/23 07:46:28 asami Exp $
|
||||
* $Id: pc98.c,v 1.3 1996/08/31 15:07:05 asami Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -42,7 +42,7 @@
|
||||
*
|
||||
* 92/08/18 Frank P. MacLachlan (fpm@crash.cts.com):
|
||||
* Fixed uninitialized variable problem and added code to deal
|
||||
* with DMA page boundaries in pc98_dmarangecheck(). Fixed word
|
||||
* with DMA page boundaries in isa_dmarangecheck(). Fixed word
|
||||
* mode DMA count compution and reorganized DMA setup code in
|
||||
* isa_dmastart()
|
||||
*/
|
||||
@ -50,7 +50,7 @@
|
||||
/*
|
||||
* modified for PC9801 by A.Kojima F.Ukai M.Ishii
|
||||
* Kyoto University Microcomputer Club (KMC)
|
||||
* $Id: pc98.c,v 1.2 1996/07/23 07:46:28 asami Exp $
|
||||
* $Id: pc98.c,v 1.3 1994/03/17 23:24:40 kakefuda Exp $
|
||||
*/
|
||||
|
||||
#include "opt_auto_eoi.h"
|
||||
@ -67,13 +67,12 @@
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_param.h>
|
||||
#include <vm/pmap.h>
|
||||
#include <i386/isa/isa_device.h>
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <pc98/pc98/pc98.h>
|
||||
#include <pc98/pc98/icu.h>
|
||||
#include <pc98/pc98/ic/i8237.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <i386/isa/isa.h>
|
||||
#include <i386/isa/icu.h>
|
||||
#include <i386/isa/ic/i8237.h>
|
||||
@ -115,7 +114,7 @@ void ddb_outb __P((unsigned int addr, unsigned char dt));
|
||||
extern struct kern_devconf kdc_cpu0;
|
||||
|
||||
#ifdef PC98
|
||||
struct kern_devconf kdc_nec0 = {
|
||||
struct kern_devconf kdc_isa0 = {
|
||||
0, 0, 0, /* filled in by dev_attach */
|
||||
"nec", 0, { MDDT_BUS, 0 },
|
||||
0, 0, 0, BUS_EXTERNALLEN,
|
||||
@ -165,7 +164,7 @@ static void conflict __P((struct isa_device *dvp, struct isa_device *tmpdvp,
|
||||
char const *format));
|
||||
static int haveseen __P((struct isa_device *dvp, struct isa_device *tmpdvp,
|
||||
u_int checkbits));
|
||||
static int pc98_dmarangecheck __P((caddr_t va, u_int length, int chan));
|
||||
static int isa_dmarangecheck __P((caddr_t va, u_int length, int chan));
|
||||
static inthand2_t pc98_strayintr;
|
||||
#else
|
||||
static void config_isadev __P((struct isa_device *isdp, u_int *mp));
|
||||
@ -281,29 +280,29 @@ haveseen(dvp, tmpdvp, checkbits)
|
||||
* conflicts with the current device.
|
||||
*/
|
||||
int
|
||||
haveseen_pc98dev(dvp, checkbits)
|
||||
haveseen_isadev(dvp, checkbits)
|
||||
struct isa_device *dvp;
|
||||
u_int checkbits;
|
||||
{
|
||||
struct isa_device *tmpdvp;
|
||||
int status = 0;
|
||||
|
||||
for (tmpdvp = pc98_devtab_tty; tmpdvp->id_driver; tmpdvp++) {
|
||||
for (tmpdvp = isa_devtab_tty; tmpdvp->id_driver; tmpdvp++) {
|
||||
status |= haveseen(dvp, tmpdvp, checkbits);
|
||||
if (status)
|
||||
return status;
|
||||
}
|
||||
for (tmpdvp = pc98_devtab_bio; tmpdvp->id_driver; tmpdvp++) {
|
||||
for (tmpdvp = isa_devtab_bio; tmpdvp->id_driver; tmpdvp++) {
|
||||
status |= haveseen(dvp, tmpdvp, checkbits);
|
||||
if (status)
|
||||
return status;
|
||||
}
|
||||
for (tmpdvp = pc98_devtab_net; tmpdvp->id_driver; tmpdvp++) {
|
||||
for (tmpdvp = isa_devtab_net; tmpdvp->id_driver; tmpdvp++) {
|
||||
status |= haveseen(dvp, tmpdvp, checkbits);
|
||||
if (status)
|
||||
return status;
|
||||
}
|
||||
for (tmpdvp = pc98_devtab_null; tmpdvp->id_driver; tmpdvp++) {
|
||||
for (tmpdvp = isa_devtab_null; tmpdvp->id_driver; tmpdvp++) {
|
||||
status |= haveseen(dvp, tmpdvp, checkbits);
|
||||
if (status)
|
||||
return status;
|
||||
@ -315,38 +314,38 @@ haveseen_pc98dev(dvp, checkbits)
|
||||
* Configure all PC98 devices
|
||||
*/
|
||||
void
|
||||
pc98_configure() {
|
||||
isa_configure() {
|
||||
struct isa_device *dvp;
|
||||
|
||||
dev_attach(&kdc_nec0);
|
||||
dev_attach(&kdc_isa0);
|
||||
|
||||
splhigh();
|
||||
printf("Probing for devices on the PC98 bus:\n");
|
||||
/* First probe all the sensitive probes */
|
||||
for (dvp = pc98_devtab_tty; dvp->id_driver; dvp++)
|
||||
for (dvp = isa_devtab_tty; dvp->id_driver; dvp++)
|
||||
if (dvp->id_driver->sensitive_hw)
|
||||
config_pc98dev(dvp, &tty_imask);
|
||||
for (dvp = pc98_devtab_bio; dvp->id_driver; dvp++)
|
||||
for (dvp = isa_devtab_bio; dvp->id_driver; dvp++)
|
||||
if (dvp->id_driver->sensitive_hw)
|
||||
config_pc98dev(dvp, &bio_imask);
|
||||
for (dvp = pc98_devtab_net; dvp->id_driver; dvp++)
|
||||
for (dvp = isa_devtab_net; dvp->id_driver; dvp++)
|
||||
if (dvp->id_driver->sensitive_hw)
|
||||
config_pc98dev(dvp, &net_imask);
|
||||
for (dvp = pc98_devtab_null; dvp->id_driver; dvp++)
|
||||
for (dvp = isa_devtab_null; dvp->id_driver; dvp++)
|
||||
if (dvp->id_driver->sensitive_hw)
|
||||
config_pc98dev(dvp, (u_int *)NULL);
|
||||
|
||||
/* Then all the bad ones */
|
||||
for (dvp = pc98_devtab_tty; dvp->id_driver; dvp++)
|
||||
for (dvp = isa_devtab_tty; dvp->id_driver; dvp++)
|
||||
if (!dvp->id_driver->sensitive_hw)
|
||||
config_pc98dev(dvp, &tty_imask);
|
||||
for (dvp = pc98_devtab_bio; dvp->id_driver; dvp++)
|
||||
for (dvp = isa_devtab_bio; dvp->id_driver; dvp++)
|
||||
if (!dvp->id_driver->sensitive_hw)
|
||||
config_pc98dev(dvp, &bio_imask);
|
||||
for (dvp = pc98_devtab_net; dvp->id_driver; dvp++)
|
||||
for (dvp = isa_devtab_net; dvp->id_driver; dvp++)
|
||||
if (!dvp->id_driver->sensitive_hw)
|
||||
config_pc98dev(dvp, &net_imask);
|
||||
for (dvp = pc98_devtab_null; dvp->id_driver; dvp++)
|
||||
for (dvp = isa_devtab_null; dvp->id_driver; dvp++)
|
||||
if (!dvp->id_driver->sensitive_hw)
|
||||
config_pc98dev(dvp, (u_int *)NULL);
|
||||
|
||||
@ -384,13 +383,13 @@ pc98_configure() {
|
||||
* unregister_intr() will have to adjust the masks for _all_
|
||||
* interrupts and for tty_imask, etc.
|
||||
*/
|
||||
for (dvp = pc98_devtab_tty; dvp->id_driver; dvp++)
|
||||
for (dvp = isa_devtab_tty; dvp->id_driver; dvp++)
|
||||
register_imask(dvp, tty_imask);
|
||||
for (dvp = pc98_devtab_bio; dvp->id_driver; dvp++)
|
||||
for (dvp = isa_devtab_bio; dvp->id_driver; dvp++)
|
||||
register_imask(dvp, bio_imask);
|
||||
for (dvp = pc98_devtab_net; dvp->id_driver; dvp++)
|
||||
for (dvp = isa_devtab_net; dvp->id_driver; dvp++)
|
||||
register_imask(dvp, net_imask);
|
||||
for (dvp = pc98_devtab_null; dvp->id_driver; dvp++)
|
||||
for (dvp = isa_devtab_null; dvp->id_driver; dvp++)
|
||||
register_imask(dvp, SWI_CLOCK_MASK);
|
||||
spl0();
|
||||
}
|
||||
@ -409,7 +408,7 @@ config_pc98dev(isdp, mp)
|
||||
}
|
||||
|
||||
void
|
||||
reconfig_pc98dev(isdp, mp)
|
||||
reconfig_isadev(isdp, mp)
|
||||
struct isa_device *isdp;
|
||||
u_int *mp;
|
||||
{
|
||||
@ -433,7 +432,7 @@ config_pc98dev_c(isdp, mp, reconfig)
|
||||
return;
|
||||
}
|
||||
checkbits = CC_DRQ | CC_IOADDR | CC_MEMADDR;
|
||||
if (!reconfig && haveseen_pc98dev(isdp, checkbits))
|
||||
if (!reconfig && haveseen_isadev(isdp, checkbits))
|
||||
return;
|
||||
if (!reconfig && isdp->id_maddr) {
|
||||
isdp->id_maddr -= 0xa0000; /* XXX should be a define */
|
||||
@ -501,7 +500,7 @@ config_pc98dev_c(isdp, mp, reconfig)
|
||||
* a check for IRQs in the next group of checks.
|
||||
*/
|
||||
checkbits |= CC_IRQ;
|
||||
if (haveseen_pc98dev(isdp, checkbits))
|
||||
if (haveseen_isadev(isdp, checkbits))
|
||||
return;
|
||||
isdp->id_alive = id_alive;
|
||||
}
|
||||
@ -546,7 +545,7 @@ config_pc98dev_c(isdp, mp, reconfig)
|
||||
* hw.devconf interface.
|
||||
*/
|
||||
int
|
||||
pc98_externalize(struct isa_device *id, struct sysctl_req *req)
|
||||
isa_externalize(struct isa_device *id, struct sysctl_req *req)
|
||||
{
|
||||
return (SYSCTL_OUT(req, id, sizeof *id));
|
||||
}
|
||||
@ -557,7 +556,7 @@ pc98_externalize(struct isa_device *id, struct sysctl_req *req)
|
||||
* what the `internalize' routine is supposed to do.
|
||||
*/
|
||||
int
|
||||
pc98_internalize(struct isa_device *id, struct sysctl_req *req)
|
||||
isa_internalize(struct isa_device *id, struct sysctl_req *req)
|
||||
{
|
||||
struct isa_device myid;
|
||||
int rv;
|
||||
@ -573,9 +572,9 @@ pc98_internalize(struct isa_device *id, struct sysctl_req *req)
|
||||
}
|
||||
|
||||
int
|
||||
pc98_generic_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
|
||||
isa_generic_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
|
||||
{
|
||||
return pc98_externalize(kdc->kdc_pc98, req);
|
||||
return isa_externalize(kdc->kdc_isa, req);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -583,7 +582,7 @@ pc98_generic_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
|
||||
* during configuration of kernel, setup interrupt control unit
|
||||
*/
|
||||
void
|
||||
pc98_defaultirq()
|
||||
isa_defaultirq()
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -666,7 +665,7 @@ static short dmapageport[8] =
|
||||
* Setup a DMA channel's bounce buffer.
|
||||
*/
|
||||
void
|
||||
pc98_dmainit(chan, bouncebufsize)
|
||||
isa_dmainit(chan, bouncebufsize)
|
||||
int chan;
|
||||
u_int bouncebufsize;
|
||||
{
|
||||
@ -674,10 +673,10 @@ pc98_dmainit(chan, bouncebufsize)
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
if (chan & ~VALID_DMA_MASK)
|
||||
panic("pc98_dmainit: channel out of range");
|
||||
panic("isa_dmainit: channel out of range");
|
||||
|
||||
if (dma_bouncebuf[chan] != NULL)
|
||||
panic("pc98_dmainit: impossible request");
|
||||
panic("isa_dmainit: impossible request");
|
||||
#endif
|
||||
|
||||
dma_bouncebufsize[chan] = bouncebufsize;
|
||||
@ -685,7 +684,7 @@ pc98_dmainit(chan, bouncebufsize)
|
||||
/* Try malloc() first. It works better if it works. */
|
||||
buf = malloc(bouncebufsize, M_DEVBUF, M_NOWAIT);
|
||||
if (buf != NULL) {
|
||||
if (pc98_dmarangecheck(buf, bouncebufsize, chan) == 0) {
|
||||
if (isa_dmarangecheck(buf, bouncebufsize, chan) == 0) {
|
||||
dma_bouncebuf[chan] = buf;
|
||||
return;
|
||||
}
|
||||
@ -694,7 +693,7 @@ pc98_dmainit(chan, bouncebufsize)
|
||||
buf = contigmalloc(bouncebufsize, M_DEVBUF, M_NOWAIT, 0ul, 0xfffffful,
|
||||
1ul, chan & 4 ? 0x20000ul : 0x10000ul);
|
||||
if (buf == NULL)
|
||||
printf("pc98_dmainit(%d, %d) failed\n", chan, bouncebufsize);
|
||||
printf("isa_dmainit(%d, %d) failed\n", chan, bouncebufsize);
|
||||
else
|
||||
dma_bouncebuf[chan] = buf;
|
||||
}
|
||||
@ -704,16 +703,16 @@ pc98_dmainit(chan, bouncebufsize)
|
||||
* in open() or during it's initialization.
|
||||
*/
|
||||
int
|
||||
pc98_dma_acquire(chan)
|
||||
isa_dma_acquire(chan)
|
||||
int chan;
|
||||
{
|
||||
#ifdef DIAGNOSTIC
|
||||
if (chan & ~VALID_DMA_MASK)
|
||||
panic("pc98_dma_acquire: channel out of range");
|
||||
panic("isa_dma_acquire: channel out of range");
|
||||
#endif
|
||||
|
||||
if (dma_inuse & (1 << chan)) {
|
||||
printf("pc98_dma_acquire: channel %d already in use\n", chan);
|
||||
printf("isa_dma_acquire: channel %d already in use\n", chan);
|
||||
return (EBUSY);
|
||||
}
|
||||
dma_inuse |= (1 << chan);
|
||||
@ -726,15 +725,15 @@ pc98_dma_acquire(chan)
|
||||
* during close() or during it's shutdown.
|
||||
*/
|
||||
void
|
||||
pc98_dma_release(chan)
|
||||
isa_dma_release(chan)
|
||||
int chan;
|
||||
{
|
||||
#ifdef DIAGNOSTIC
|
||||
if (chan & ~VALID_DMA_MASK)
|
||||
panic("pc98_dma_release: channel out of range");
|
||||
panic("isa_dma_release: channel out of range");
|
||||
|
||||
if (dma_inuse & (1 << chan) == 0)
|
||||
printf("pc98_dma_release: channel %d not in use\n", chan);
|
||||
printf("isa_dma_release: channel %d not in use\n", chan);
|
||||
#endif
|
||||
|
||||
if (dma_busy & (1 << chan)) {
|
||||
@ -752,15 +751,15 @@ pc98_dma_release(chan)
|
||||
|
||||
#ifndef PC98
|
||||
/*
|
||||
* pc98_dmacascade(): program 8237 DMA controller channel to accept
|
||||
* isa_dmacascade(): program 8237 DMA controller channel to accept
|
||||
* external dma control by a board.
|
||||
*/
|
||||
void pc98_dmacascade(chan)
|
||||
void isa_dmacascade(chan)
|
||||
int chan;
|
||||
{
|
||||
#ifdef DIAGNOSTIC
|
||||
if (chan & ~VALID_DMA_MASK)
|
||||
panic("pc98_dmacascade: channel out of range");
|
||||
panic("isa_dmacascade: channel out of range");
|
||||
#endif
|
||||
|
||||
/* set dma channel mode, and set dma channel mode */
|
||||
@ -775,10 +774,10 @@ void pc98_dmacascade(chan)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* pc98_dmastart(): program 8237 DMA controller channel, avoid page alignment
|
||||
* isa_dmastart(): program 8237 DMA controller channel, avoid page alignment
|
||||
* problems by using a bounce buffer.
|
||||
*/
|
||||
void pc98_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
|
||||
void isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
|
||||
{
|
||||
vm_offset_t phys;
|
||||
int modeport, waport, mskport;
|
||||
@ -787,25 +786,25 @@ void pc98_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
if (chan & ~VALID_DMA_MASK)
|
||||
panic("pc98_dmastart: channel out of range");
|
||||
panic("isa_dmastart: channel out of range");
|
||||
|
||||
if ((chan < 4 && nbytes > (1<<16))
|
||||
|| (chan >= 4 && (nbytes > (1<<17) || (u_int)addr & 1)))
|
||||
panic("pc98_dmastart: impossible request");
|
||||
panic("isa_dmastart: impossible request");
|
||||
|
||||
if (dma_inuse & (1 << chan) == 0)
|
||||
printf("pc98_dmastart: channel %d not acquired\n", chan);
|
||||
printf("isa_dmastart: channel %d not acquired\n", chan);
|
||||
#endif
|
||||
|
||||
if (dma_busy & (1 << chan))
|
||||
printf("pc98_dmastart: channel %d busy\n", chan);
|
||||
printf("isa_dmastart: channel %d busy\n", chan);
|
||||
|
||||
dma_busy |= (1 << chan);
|
||||
|
||||
if (pc98_dmarangecheck(addr, nbytes, chan)) {
|
||||
if (isa_dmarangecheck(addr, nbytes, chan)) {
|
||||
if (dma_bouncebuf[chan] == NULL
|
||||
|| dma_bouncebufsize[chan] < nbytes)
|
||||
panic("pc98_dmastart: bad bounce buffer");
|
||||
panic("isa_dmastart: bad bounce buffer");
|
||||
dma_bounced |= (1 << chan);
|
||||
newaddr = dma_bouncebuf[chan];
|
||||
|
||||
@ -861,7 +860,7 @@ void pc98_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
|
||||
splx(s); /* mask off */
|
||||
}
|
||||
|
||||
void pc98_dmadone(int flags, caddr_t addr, int nbytes, int chan)
|
||||
void isa_dmadone(int flags, caddr_t addr, int nbytes, int chan)
|
||||
{
|
||||
#if defined(CYRIX_486DLC) || defined(IBM_486SLC)
|
||||
if (flags & B_READ) {
|
||||
@ -872,10 +871,10 @@ void pc98_dmadone(int flags, caddr_t addr, int nbytes, int chan)
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
if (chan & ~VALID_DMA_MASK)
|
||||
panic("pc98_dmadone: channel out of range");
|
||||
panic("isa_dmadone: channel out of range");
|
||||
|
||||
if (dma_inuse & (1 << chan) == 0)
|
||||
printf("pc98_dmadone: channel %d not acquired\n", chan);
|
||||
printf("isa_dmadone: channel %d not acquired\n", chan);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
@ -885,7 +884,7 @@ void pc98_dmadone(int flags, caddr_t addr, int nbytes, int chan)
|
||||
* leave this in, drivers that do this will print this continuously.
|
||||
*/
|
||||
if (dma_busy & (1 << chan) == 0)
|
||||
printf("pc98_dmadone: channel %d not busy\n", chan);
|
||||
printf("isa_dmadone: channel %d not busy\n", chan);
|
||||
#endif
|
||||
|
||||
if (dma_bounced & (1 << chan)) {
|
||||
@ -906,7 +905,7 @@ void pc98_dmadone(int flags, caddr_t addr, int nbytes, int chan)
|
||||
*/
|
||||
|
||||
int
|
||||
pc98_dmarangecheck(caddr_t va, u_int length, int chan) {
|
||||
isa_dmarangecheck(caddr_t va, u_int length, int chan) {
|
||||
vm_offset_t phys, priorpage = 0, endva;
|
||||
u_int dma_pgmsk = (chan & 4) ? ~(128*1024-1) : ~(64*1024-1);
|
||||
|
||||
@ -919,7 +918,7 @@ pc98_dmarangecheck(caddr_t va, u_int length, int chan) {
|
||||
#define PC98RAM_END RAM_END
|
||||
#endif
|
||||
if (phys == 0)
|
||||
panic("pc98_dmacheck: no physical page present");
|
||||
panic("isa_dmacheck: no physical page present");
|
||||
if (phys >= PC98RAM_END)
|
||||
return (1);
|
||||
if (priorpage) {
|
||||
@ -950,7 +949,7 @@ pc98_dmarangecheck(caddr_t va, u_int length, int chan) {
|
||||
* return true to panic system, false to ignore.
|
||||
*/
|
||||
int
|
||||
pc98_nmi(cd)
|
||||
isa_nmi(cd)
|
||||
int cd;
|
||||
{
|
||||
#ifdef PC98
|
||||
@ -1028,31 +1027,25 @@ pc98_strayintr(d)
|
||||
struct isa_device *
|
||||
find_display()
|
||||
{
|
||||
#ifdef PC98
|
||||
struct isa_device *dvp;
|
||||
|
||||
for (dvp = pc98_devtab_tty; dvp->id_driver != NULL; dvp++)
|
||||
#else
|
||||
struct isa_device *dvp;
|
||||
|
||||
for (dvp = isa_devtab_tty; dvp->id_driver != NULL; dvp++)
|
||||
#endif
|
||||
if (dvp->id_driver->sensitive_hw && dvp->id_enabled)
|
||||
return (dvp);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* find an PC98 device in a given pc98_devtab_* table, given
|
||||
* find an PC98 device in a given isa_devtab_* table, given
|
||||
* the table to search, the expected id_driver entry, and the unit number.
|
||||
*
|
||||
* this function is defined in pc98_device.h, and this location is debatable;
|
||||
* this function is defined in isa_device.h, and this location is debatable;
|
||||
* i put it there because it's useless w/o, and directly operates on
|
||||
* the other stuff in that file.
|
||||
*
|
||||
*/
|
||||
|
||||
struct isa_device *find_pc98dev(table, driverp, unit)
|
||||
struct isa_device *find_isadev(table, driverp, unit)
|
||||
struct isa_device *table;
|
||||
struct isa_driver *driverp;
|
||||
int unit;
|
||||
@ -1074,7 +1067,7 @@ struct isa_device *find_pc98dev(table, driverp, unit)
|
||||
* Return nonzero if a (masked) irq is pending for a given device.
|
||||
*/
|
||||
int
|
||||
pc98_irq_pending(dvp)
|
||||
isa_irq_pending(dvp)
|
||||
struct isa_device *dvp;
|
||||
{
|
||||
unsigned id_irq;
|
||||
|
@ -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_ */
|
||||
|
@ -1,248 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1991 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)isa_device.h 7.1 (Berkeley) 5/9/91
|
||||
* $Id: pc98_device.h,v 1.1.1.1 1996/06/14 10:04:45 asami Exp $
|
||||
*/
|
||||
|
||||
#ifndef _PC98_PC98_PC98_DEVICE_H_
|
||||
#define _PC98_PC98_PC98_DEVICE_H_
|
||||
|
||||
/*
|
||||
* PC98 Bus Autoconfiguration
|
||||
*/
|
||||
/*
|
||||
* modified for PC9801 by A.Kojima F.Ukai M.Ishii
|
||||
* Kyoto University Microcomputer Club (KMC)
|
||||
*/
|
||||
|
||||
#define IDTVEC(name) __CONCAT(X,name)
|
||||
|
||||
/*
|
||||
* Type of the first (asm) part of an interrupt handler.
|
||||
*/
|
||||
typedef void inthand_t __P((u_int cs, u_int ef, u_int esp, u_int ss));
|
||||
|
||||
/*
|
||||
* Usual type of the second (C) part of an interrupt handler. Some bogus
|
||||
* ones need the arg to be the interrupt frame (and not a copy of it, which
|
||||
* is all that is possible in C).
|
||||
*/
|
||||
typedef void inthand2_t __P((int unit));
|
||||
|
||||
/*
|
||||
* Bits to specify the type and amount of conflict checking.
|
||||
*/
|
||||
#define CC_ATTACH (1 << 0)
|
||||
#define CC_DRQ (1 << 1)
|
||||
#define CC_IOADDR (1 << 2)
|
||||
#define CC_IRQ (1 << 3)
|
||||
#define CC_MEMADDR (1 << 4)
|
||||
|
||||
/*
|
||||
* Per device structure.
|
||||
*
|
||||
* XXX Note: id_conflicts should either become an array of things we're
|
||||
* specifically allowed to conflict with or be subsumed into some
|
||||
* more powerful mechanism for detecting and dealing with multiple types
|
||||
* of non-fatal conflict. -jkh XXX
|
||||
*/
|
||||
struct isa_device {
|
||||
int id_id; /* device id */
|
||||
struct isa_driver *id_driver;
|
||||
int id_iobase; /* base i/o address */
|
||||
u_short id_irq; /* interrupt request */
|
||||
short id_drq; /* DMA request */
|
||||
caddr_t id_maddr; /* physical i/o memory address on bus (if any)*/
|
||||
int id_msize; /* size of i/o memory */
|
||||
inthand2_t *id_intr; /* interrupt interface routine */
|
||||
int id_unit; /* unit number */
|
||||
int id_flags; /* flags */
|
||||
int id_scsiid; /* scsi id if needed */
|
||||
int id_alive; /* device is present */
|
||||
#define RI_FAST 1 /* fast interrupt handler */
|
||||
u_int id_ri_flags; /* flags for register_intr() */
|
||||
int id_reconfig; /* hot eject device support (such as PCMCIA) */
|
||||
int id_enabled; /* is device enabled */
|
||||
int id_conflicts; /* we're allowed to conflict with things */
|
||||
struct isa_device *id_next; /* used in isa_devlist in userconfig() */
|
||||
};
|
||||
|
||||
/*
|
||||
* Per-driver structure.
|
||||
*
|
||||
* Each device driver defines entries for a set of routines
|
||||
* as well as an array of types which are acceptable to it.
|
||||
* These are used at boot time by the configuration program.
|
||||
*/
|
||||
struct isa_driver {
|
||||
int (*probe) __P((struct isa_device *idp));
|
||||
/* test whether device is present */
|
||||
int (*attach) __P((struct isa_device *idp));
|
||||
/* setup driver for a device */
|
||||
char *name; /* device name */
|
||||
int sensitive_hw; /* true if other probes confuse us */
|
||||
};
|
||||
|
||||
#define PC98_EXTERNALLEN (sizeof(struct isa_device))
|
||||
|
||||
#ifdef KERNEL
|
||||
|
||||
extern char eintrnames[]; /* end of intrnames[] */
|
||||
extern u_long intrcnt[]; /* counts for for each device and stray */
|
||||
extern char intrnames[]; /* string table containing device names */
|
||||
extern u_long *intr_countp[]; /* pointers into intrcnt[] */
|
||||
extern inthand2_t *intr_handler[]; /* C entry points of intr handlers */
|
||||
extern u_int intr_mask[]; /* sets of intrs masked during handling of 1 */
|
||||
extern int intr_unit[]; /* cookies to pass to intr handlers */
|
||||
|
||||
extern struct isa_device pc98_biotab_fdc[];
|
||||
extern struct isa_device pc98_biotab_wdc[];
|
||||
extern struct isa_device pc98_devtab_bio[];
|
||||
extern struct isa_device pc98_devtab_net[];
|
||||
extern struct isa_device pc98_devtab_null[];
|
||||
extern struct isa_device pc98_devtab_tty[];
|
||||
extern struct kern_devconf kdc_nec0;
|
||||
|
||||
struct kern_devconf;
|
||||
struct sysctl_req;
|
||||
|
||||
inthand_t
|
||||
IDTVEC(fastintr0), IDTVEC(fastintr1),
|
||||
IDTVEC(fastintr2), IDTVEC(fastintr3),
|
||||
IDTVEC(fastintr4), IDTVEC(fastintr5),
|
||||
IDTVEC(fastintr6), IDTVEC(fastintr7),
|
||||
IDTVEC(fastintr8), IDTVEC(fastintr9),
|
||||
IDTVEC(fastintr10), IDTVEC(fastintr11),
|
||||
IDTVEC(fastintr12), IDTVEC(fastintr13),
|
||||
IDTVEC(fastintr14), IDTVEC(fastintr15);
|
||||
inthand_t
|
||||
IDTVEC(intr0), IDTVEC(intr1), IDTVEC(intr2), IDTVEC(intr3),
|
||||
IDTVEC(intr4), IDTVEC(intr5), IDTVEC(intr6), IDTVEC(intr7),
|
||||
IDTVEC(intr8), IDTVEC(intr9), IDTVEC(intr10), IDTVEC(intr11),
|
||||
IDTVEC(intr12), IDTVEC(intr13), IDTVEC(intr14), IDTVEC(intr15);
|
||||
|
||||
struct isa_device *
|
||||
find_display __P((void));
|
||||
struct isa_device *
|
||||
find_pc98dev __P((struct isa_device *table, struct isa_driver *driverp,
|
||||
int unit));
|
||||
int haveseen_pc98dev __P((struct isa_device *dvp, u_int checkbits));
|
||||
void pc98_configure __P((void));
|
||||
void pc98_defaultirq __P((void));
|
||||
void pc98_dmacascade __P((int chan));
|
||||
void pc98_dmadone __P((int flags, caddr_t addr, int nbytes, int chan));
|
||||
void pc98_dmainit __P((int chan, u_int bouncebufsize));
|
||||
void pc98_dmastart __P((int flags, caddr_t addr, u_int nbytes, int chan));
|
||||
int pc98_dma_acquire __P((int chan));
|
||||
void pc98_dma_release __P((int chan));
|
||||
int pc98_externalize __P((struct isa_device *id, struct sysctl_req *req));
|
||||
int pc98_generic_externalize __P((struct kern_devconf *kdc,
|
||||
struct sysctl_req *req));
|
||||
int pc98_internalize __P((struct isa_device *id, struct sysctl_req *req));
|
||||
int pc98_irq_pending __P((struct isa_device *dvp));
|
||||
int pc98_nmi __P((int cd));
|
||||
void reconfig_pc98dev __P((struct isa_device *isdp, u_int *mp));
|
||||
int register_intr __P((int intr, int device_id, u_int flags,
|
||||
inthand2_t *handler, u_int *maskptr, int unit));
|
||||
int unregister_intr __P((int intr, inthand2_t *handler));
|
||||
int update_intr_masks __P((void));
|
||||
|
||||
#endif /* KERNEL */
|
||||
|
||||
#ifdef PC98
|
||||
#if 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
|
||||
|
||||
# ifdef KERNEL
|
||||
|
||||
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 */
|
||||
|
||||
extern u_char hireso;
|
||||
|
||||
#else
|
||||
/* OLD:386bsd-0.1-pc98-a&b */
|
||||
extern unsigned char pc98_system_parameter[0x214]; /* in pc98.c */
|
||||
#define WD_BIOS_NCYL(i) (*(unsigned short*)(&pc98_system_parameter[0x206+(i)*6]))
|
||||
#define WD_BIOS_HEAD(i) (pc98_system_parameter[0x209+(i)*6])
|
||||
#define WD_BIOS_SEC(i) (pc98_system_parameter[0x208+(i)*6])
|
||||
#define PC98_SYSTEM_PARAMETER(x) pc98_system_parameter[(x)-0x400]
|
||||
#define pc98_machine_type (pc98_system_parameter[0x210])
|
||||
#define NEC_PC98 1
|
||||
#define EPSON_PC98 2
|
||||
#define epson_machine_id (pc98_system_parameter[0x211])
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* !_PC98_PC98_PC98_DEVICE_H_ */
|
@ -40,7 +40,8 @@
|
||||
#include <vm/vm_pager.h>
|
||||
#include <vm/vm_extern.h>
|
||||
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <pc98/pc98/pc98.h>
|
||||
#include <i386/isa/isa_device.h>
|
||||
|
||||
extern int Maxmem;
|
||||
extern int Maxmem_under16M;
|
||||
|
@ -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: pcaudio.c,v 1.2 1996/07/23 07:46:29 asami Exp $
|
||||
* $Id: pcaudio.c,v 1.3 1996/08/31 15:07:08 asami Exp $
|
||||
*/
|
||||
|
||||
#include "pca.h"
|
||||
@ -46,7 +46,7 @@
|
||||
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98.h>
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <pc98/pc98/timerreg.h>
|
||||
|
||||
#include <pc98/pc98/sound/ulaw.h>
|
||||
@ -298,15 +298,9 @@ pcaprobe(struct isa_device *dvp)
|
||||
|
||||
static struct kern_devconf kdc_pca[NPCA] = { {
|
||||
0, 0, 0, /* filled in by dev_attach */
|
||||
#ifdef PC98
|
||||
"pca", 0, { MDDT_PC98, 0, "tty" },
|
||||
pc98_generic_externalize, 0, 0, PC98_EXTERNALLEN,
|
||||
&kdc_nec0, /* parent */
|
||||
#else
|
||||
"pca", 0, { MDDT_ISA, 0, "tty" },
|
||||
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
|
||||
&kdc_isa0, /* parent */
|
||||
#endif
|
||||
0, /* parentdata */
|
||||
DC_UNKNOWN, /* not supported */
|
||||
"PC speaker audio driver"
|
||||
@ -319,11 +313,7 @@ pca_registerdev(struct isa_device *id)
|
||||
if(id->id_unit)
|
||||
kdc_pca[id->id_unit] = kdc_pca[0];
|
||||
kdc_pca[id->id_unit].kdc_unit = id->id_unit;
|
||||
#ifdef PC98
|
||||
kdc_pca[id->id_unit].kdc_pc98 = id;
|
||||
#else
|
||||
kdc_pca[id->id_unit].kdc_isa = id;
|
||||
#endif
|
||||
dev_attach(&kdc_pca[id->id_unit]);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** $Id: pcibus.c,v 1.1.1.1 1996/06/14 10:04:45 asami Exp $
|
||||
** $Id: pcibus.c,v 1.2 1996/07/23 07:46:30 asami Exp $
|
||||
**
|
||||
** pci bus subroutines for i386 architecture.
|
||||
**
|
||||
@ -43,11 +43,10 @@
|
||||
|
||||
#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
|
||||
#include <i386/isa/isa_device.h>
|
||||
|
||||
#include <pci/pcivar.h>
|
||||
#include <pci/pcireg.h>
|
||||
|
@ -42,11 +42,10 @@
|
||||
#include <sys/kernel.h>
|
||||
#include <machine/clock.h>
|
||||
#endif
|
||||
#include <i386/isa/isa_device.h>
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <pc98/pc98/pcic.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <i386/isa/pcic.h>
|
||||
#endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* random_machdep.c -- A strong random number generator
|
||||
*
|
||||
* $Id: random_machdep.c,v 1.2 1996/07/23 07:46:32 asami Exp $
|
||||
* $Id: random_machdep.c,v 1.3 1996/08/30 10:43:08 asami Exp $
|
||||
*
|
||||
* Version 0.95, last modified 18-Oct-95
|
||||
*
|
||||
@ -55,7 +55,7 @@
|
||||
#ifdef PC98
|
||||
#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>
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <vm/pmap.h>
|
||||
|
||||
#include <pc98/pc98/pc98.h>
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <pc98/pc98/icu.h>
|
||||
#include <pc98/pc98/ic/i8237.h>
|
||||
#include <pc98/pc98/scsireg.h>
|
||||
@ -209,9 +209,9 @@ struct isa_driver sbicdriver = {
|
||||
|
||||
static struct kern_devconf kdc_sbic[NSBIC] = { {
|
||||
0, 0, 0, /* filled in by dev_attach */
|
||||
"sbic", 0, { MDDT_PC98, 0, "bio" },
|
||||
pc98_generic_externalize, 0, 0, PC98_EXTERNALLEN,
|
||||
&kdc_nec0, /* parent */
|
||||
"sbic", 0, { MDDT_ISA, 0, "bio" },
|
||||
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
|
||||
&kdc_isa0, /* parent */
|
||||
0, /* parentdata */
|
||||
DC_UNCONFIGURED, /* always start out here in probe */
|
||||
"55 compatible SCSI board host adapter",
|
||||
@ -235,7 +235,7 @@ static int sbicunit = 0;
|
||||
/*
|
||||
* Check if the device can be found at the port given
|
||||
* and if so, set it up ready for further work
|
||||
* as an argument, takes the pc98_device structure from
|
||||
* as an argument, takes the isa_device structure from
|
||||
* autoconf.c
|
||||
*/
|
||||
static int
|
||||
@ -869,7 +869,7 @@ sbic_request_sense(struct sbic_data *sbic, struct sbic_ccb *ccb)
|
||||
chan = sbic->sbic_dma;
|
||||
len = ccb->sense_len;
|
||||
#ifndef ALLWAYS_BOUNCE
|
||||
if(pc98_dmarangecheck((caddr_t)ccb->sense_addr,len)) {
|
||||
if(isa_dmarangecheck((caddr_t)ccb->sense_addr,len)) {
|
||||
ccb->sense_addr = (int)(sbic_bounce);
|
||||
ccb->flags |= CCB_BOUNCE;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@
|
||||
|
||||
#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/ic/i8237.h>
|
||||
#include <scsi/scsi_all.h>
|
||||
#include <scsi/scsiconf.h>
|
||||
@ -212,9 +212,9 @@ static int sbicunit = 0;
|
||||
|
||||
static struct kern_devconf kdc_sbic[NSBIC] = { {
|
||||
0, 0, 0, /* filled in by dev_attach */
|
||||
"sbic", 0, { MDDT_PC98, 0, "bio" },
|
||||
pc98_generic_externalize, 0, 0, PC98_EXTERNALLEN,
|
||||
&kdc_nec0, /* parent */
|
||||
"sbic", 0, { MDDT_ISA, 0, "bio" },
|
||||
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
|
||||
&kdc_isa0, /* parent */
|
||||
0, /* parentdata */
|
||||
DC_UNCONFIGURED, /* always start out here in probe */
|
||||
"WD33C93A based SCSI host adapter",
|
||||
|
@ -41,7 +41,7 @@
|
||||
*/
|
||||
|
||||
|
||||
/* $Id: scd.c,v 1.3 1996/07/30 18:56:08 asami Exp $ */
|
||||
/* $Id: scd.c,v 1.4 1996/08/31 15:07:16 asami Exp $ */
|
||||
|
||||
/* Please send any comments to micke@dynas.se */
|
||||
|
||||
@ -72,11 +72,7 @@
|
||||
#include <machine/clock.h>
|
||||
#include <machine/stdarg.h>
|
||||
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#endif
|
||||
#include <i386/isa/scdreg.h>
|
||||
|
||||
|
||||
@ -205,15 +201,9 @@ static struct bdevsw scd_bdevsw =
|
||||
|
||||
static struct kern_devconf kdc_scd[NSCD] = { {
|
||||
0, 0, 0, /* filled in by dev_attach */
|
||||
#ifdef PC98
|
||||
"scd", 0, { MDDT_PC98, 0, "bio" },
|
||||
pc98_generic_externalize, 0, 0, PC98_EXTERNALLEN,
|
||||
&kdc_nec0, /* parent */
|
||||
#else
|
||||
"scd", 0, { MDDT_ISA, 0, "bio" },
|
||||
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
|
||||
&kdc_isa0, /* parent */
|
||||
#endif
|
||||
0, /* parentdata */
|
||||
DC_UNCONFIGURED, /* status */
|
||||
"Sony CD-ROM drive", /* properly filled later */
|
||||
@ -226,11 +216,7 @@ scd_registerdev(struct isa_device *id)
|
||||
if(id->id_unit)
|
||||
kdc_scd[id->id_unit] = kdc_scd[0];
|
||||
kdc_scd[id->id_unit].kdc_unit = id->id_unit;
|
||||
#ifdef PC98
|
||||
kdc_scd[id->id_unit].kdc_pc98 = id;
|
||||
#else
|
||||
kdc_scd[id->id_unit].kdc_isa = id;
|
||||
#endif
|
||||
dev_attach(&kdc_scd[id->id_unit]);
|
||||
}
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -708,11 +708,7 @@ DMAbuf_start_dma (int dev, unsigned long physaddr, int count, int dma_mode)
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
|
||||
#ifdef PC98
|
||||
pc98_dmastart (B_RAW | ((dma_mode == DMA_MODE_READ) ? B_READ : B_WRITE),
|
||||
#else
|
||||
isa_dmastart (B_RAW | ((dma_mode == DMA_MODE_READ) ? B_READ : B_WRITE),
|
||||
#endif
|
||||
(caddr_t)dmap->raw_buf_phys[0],
|
||||
dmap->bytes_in_use,
|
||||
chan);
|
||||
@ -759,11 +755,7 @@ DMAbuf_start_dma (int dev, unsigned long physaddr, int count, int dma_mode)
|
||||
RESTORE_INTR (flags);
|
||||
#else
|
||||
#if defined(__FreeBSD__)
|
||||
#ifdef PC98
|
||||
pc98_dmastart ((dma_mode == DMA_MODE_READ) ? B_READ : B_WRITE,
|
||||
#else
|
||||
isa_dmastart ((dma_mode == DMA_MODE_READ) ? B_READ : B_WRITE,
|
||||
#endif
|
||||
(caddr_t)physaddr,
|
||||
count,
|
||||
chan);
|
||||
@ -842,11 +834,7 @@ DMAbuf_outputintr (int dev, int event_type)
|
||||
dmap->flags &= ~DMA_ACTIVE;
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#ifdef PC98
|
||||
pc98_dmadone(0, 0, 0, audio_devs[dev]->dmachan);
|
||||
#else
|
||||
isa_dmadone(0, 0, 0, audio_devs[dev]->dmachan);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (dmap->qlen)
|
||||
@ -891,11 +879,7 @@ DMAbuf_inputintr (int dev)
|
||||
#endif /* SVR42 */
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#ifdef PC98
|
||||
pc98_dmadone(0, 0, 0, audio_devs[dev]->dmachan);
|
||||
#else
|
||||
isa_dmadone(0, 0, 0, audio_devs[dev]->dmachan);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (dmap->qlen == (dmap->nbufs - 1))
|
||||
|
@ -30,11 +30,7 @@
|
||||
#include <sys/errno.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/buf.h>
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#endif
|
||||
#include <machine/cpufunc.h>
|
||||
#include <sys/signalvar.h>
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: soundcard.c,v 1.1.1.1 1996/06/14 10:04:54 asami Exp $
|
||||
* $Id: soundcard.c,v 1.2 1996/08/31 15:07:42 asami Exp $
|
||||
*/
|
||||
|
||||
#include "sound_config.h"
|
||||
@ -36,11 +36,7 @@
|
||||
#ifdef CONFIGURE_SOUNDCARD
|
||||
|
||||
#include "dev_table.h"
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#endif
|
||||
#include <sys/conf.h>
|
||||
#include <sys/kernel.h>
|
||||
#ifdef DEVFS
|
||||
@ -112,11 +108,7 @@ adintr(INT_HANDLER_PARMS(unit,dummy))
|
||||
if (unit_to_irq [unit] > 0)
|
||||
ad1848_interrupt(INT_HANDLER_CALL (unit_to_irq [unit]));
|
||||
else {
|
||||
#ifdef PC98
|
||||
dev = find_pc98dev (pc98_devtab_null, &mssdriver, unit);
|
||||
#else
|
||||
dev = find_isadev (isa_devtab_null, &mssdriver, unit);
|
||||
#endif
|
||||
if (!dev)
|
||||
printk ("ad1848: Couldn't determine unit\n");
|
||||
else {
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: syscons.c,v 1.3 1996/08/30 10:43:09 asami Exp $
|
||||
* $Id: syscons.c,v 1.4 1996/08/31 15:07:23 asami Exp $
|
||||
*/
|
||||
|
||||
#include "sc.h"
|
||||
@ -68,7 +68,7 @@
|
||||
#ifdef PC98
|
||||
#define KANJI
|
||||
#include <pc98/pc98/pc98.h>
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <pc98/pc98/timerreg.h>
|
||||
#include <pc98/pc98/kbdtables.h>
|
||||
#include <pc98/pc98/syscons.h>
|
||||
@ -459,15 +459,9 @@ gotack:
|
||||
|
||||
static struct kern_devconf kdc_sc[NSC] = {
|
||||
0, 0, 0, /* filled in by dev_attach */
|
||||
#ifdef PC98
|
||||
"sc", 0, { MDDT_PC98, 0, "tty" },
|
||||
pc98_generic_externalize, 0, 0, PC98_EXTERNALLEN,
|
||||
&kdc_nec0, /* parent */
|
||||
#else
|
||||
"sc", 0, { MDDT_ISA, 0, "tty" },
|
||||
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
|
||||
&kdc_isa0, /* parent */
|
||||
#endif
|
||||
0, /* parentdata */
|
||||
DC_BUSY, /* the console is almost always busy */
|
||||
"Graphics console",
|
||||
@ -480,11 +474,7 @@ sc_registerdev(struct isa_device *id)
|
||||
if(id->id_unit)
|
||||
kdc_sc[id->id_unit] = kdc_sc[0];
|
||||
kdc_sc[id->id_unit].kdc_unit = id->id_unit;
|
||||
#ifdef PC98
|
||||
kdc_sc[id->id_unit].kdc_pc98 = id;
|
||||
#else
|
||||
kdc_sc[id->id_unit].kdc_isa = id;
|
||||
#endif
|
||||
dev_attach(&kdc_sc[id->id_unit]);
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
|
||||
* $Id: wd.c,v 1.4 1996/08/30 10:43:11 asami Exp $
|
||||
* $Id: wd.c,v 1.5 1996/08/31 15:07:25 asami Exp $
|
||||
*/
|
||||
|
||||
/* TODO:
|
||||
@ -87,7 +87,7 @@
|
||||
#include <machine/md_var.h>
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98.h>
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#include <i386/isa/isa_device.h>
|
||||
#include <pc98/pc98/wdreg.h>
|
||||
#else
|
||||
#include <i386/i386/cons.h>
|
||||
@ -148,15 +148,9 @@ static struct kern_devconf kdc_wd[NWD] = { {
|
||||
|
||||
static struct kern_devconf kdc_wdc[NWDC] = { {
|
||||
0, 0, 0, /* filled in by kern_devconf.c */
|
||||
#ifdef PC98
|
||||
"wdc", 0, { MDDT_PC98, 0 },
|
||||
pc98_generic_externalize, 0, wdc_goaway, PC98_EXTERNALLEN,
|
||||
&kdc_nec0, /* parent */
|
||||
#else
|
||||
"wdc", 0, { MDDT_ISA, 0 },
|
||||
isa_generic_externalize, 0, wdc_goaway, ISA_EXTERNALLEN,
|
||||
&kdc_isa0, /* parent */
|
||||
#endif
|
||||
0, /* parentdata */
|
||||
DC_UNCONFIGURED, /* state */
|
||||
#ifdef PC98
|
||||
@ -529,7 +523,7 @@ wdattach(struct isa_device *dvp)
|
||||
kdc_wdc[dvp->id_unit].kdc_state = DC_UNKNOWN; /* XXX */
|
||||
TAILQ_INIT( &wdtab[dvp->id_unit].controller_queue);
|
||||
|
||||
for (wdup = pc98_biotab_wdc; wdup->id_driver != 0; wdup++) {
|
||||
for (wdup = isa_biotab_wdc; wdup->id_driver != 0; wdup++) {
|
||||
if (!old_epson_note) {
|
||||
if (wdup->id_iobase != dvp->id_iobase)
|
||||
continue;
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
* Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
|
||||
*
|
||||
* $Id: sd.c,v 1.91 1996/07/23 21:52:27 phk Exp $
|
||||
* $Id: sd.c,v 1.92 1996/08/02 06:10:49 peter Exp $
|
||||
*/
|
||||
|
||||
#include "opt_bounce.h"
|
||||
@ -48,6 +48,9 @@
|
||||
#include <vm/pmap.h>
|
||||
#include <machine/md_var.h>
|
||||
#include <i386/i386/cons.h> /* XXX *//* for aborting dump */
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98.h>
|
||||
#endif
|
||||
|
||||
static u_int32_t sdstrats, sdqueues;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* random.h -- A strong random number generator
|
||||
*
|
||||
* $Id: random.h,v 1.5 1996/06/14 11:01:04 asami Exp $
|
||||
* $Id: random.h,v 1.6 1996/06/17 16:47:39 bde Exp $
|
||||
*
|
||||
* Version 0.95, last modified 18-Oct-95
|
||||
*
|
||||
@ -59,11 +59,7 @@
|
||||
#ifdef KERNEL
|
||||
|
||||
/* XXX include from the wrong place(s) for inthand2_t. */
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/pc98_device.h>
|
||||
#else
|
||||
#include <i386/isa/isa_device.h>
|
||||
#endif
|
||||
|
||||
/* Interrupts to be used in the randomizing process */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user