1993-06-12 14:58:17 +00:00
|
|
|
/*-
|
|
|
|
* 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.
|
|
|
|
*
|
1993-10-16 13:48:52 +00:00
|
|
|
* from: @(#)isa_device.h 7.1 (Berkeley) 5/9/91
|
1994-11-03 04:15:04 +00:00
|
|
|
* $Id: isa_device.h,v 1.16 1994/10/25 23:06:16 se Exp $
|
1993-06-12 14:58:17 +00:00
|
|
|
*/
|
|
|
|
|
1993-11-07 17:44:34 +00:00
|
|
|
#ifndef _I386_ISA_ISA_DEVICE_H_
|
|
|
|
#define _I386_ISA_ISA_DEVICE_H_ 1
|
|
|
|
|
1993-06-12 14:58:17 +00:00
|
|
|
/*
|
|
|
|
* ISA Bus Autoconfiguration
|
|
|
|
*/
|
|
|
|
|
1994-08-18 05:09:36 +00:00
|
|
|
#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));
|
|
|
|
|
1993-06-12 14:58:17 +00:00
|
|
|
/*
|
|
|
|
* Per device structure.
|
|
|
|
*/
|
|
|
|
struct isa_device {
|
1994-08-18 05:09:36 +00:00
|
|
|
int id_id; /* device id */
|
1993-06-12 14:58:17 +00:00
|
|
|
struct isa_driver *id_driver;
|
1994-09-03 16:03:09 +00:00
|
|
|
int id_iobase; /* base i/o address */
|
1993-06-12 14:58:17 +00:00
|
|
|
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 */
|
1994-08-18 05:09:36 +00:00
|
|
|
inthand2_t *id_intr; /* interrupt interface routine */
|
1993-06-12 14:58:17 +00:00
|
|
|
int id_unit; /* unit number */
|
|
|
|
int id_flags; /* flags */
|
|
|
|
int id_scsiid; /* scsi id if needed */
|
|
|
|
int id_alive; /* device is present */
|
1994-08-18 05:09:36 +00:00
|
|
|
#define RI_FAST 1 /* fast interrupt handler */
|
|
|
|
u_int id_ri_flags; /* flags for register_intr() */
|
1994-10-01 02:56:21 +00:00
|
|
|
int id_reconfig; /* hot eject device support (such as PCMCIA) */
|
1994-11-03 04:15:04 +00:00
|
|
|
int id_enabled; /* is device enabled */
|
1993-06-12 14:58:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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 {
|
1994-08-18 05:09:36 +00:00
|
|
|
int (*probe) __P((struct isa_device *idp));
|
|
|
|
/* test whether device is present */
|
|
|
|
int (*attach) __P((struct isa_device *idp));
|
|
|
|
/* setup driver for a device */
|
1993-06-12 14:58:17 +00:00
|
|
|
char *name; /* device name */
|
1994-10-17 21:16:41 +00:00
|
|
|
int sensitive_hw; /* true if other probes confuse us */
|
1993-06-12 14:58:17 +00:00
|
|
|
};
|
|
|
|
|
1994-10-19 01:59:11 +00:00
|
|
|
#define ISA_EXTERNALLEN (sizeof(struct isa_device))
|
|
|
|
#define EISA_EXTERNALLEN (sizeof(struct isa_device) + sizeof(int))
|
|
|
|
|
|
|
|
#ifdef KERNEL
|
|
|
|
|
1994-08-18 05:09:36 +00:00
|
|
|
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 */
|
1994-08-22 15:58:40 +00:00
|
|
|
extern u_long *intr_countp[]; /* indirectors 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 */
|
1994-08-18 05:09:36 +00:00
|
|
|
|
1993-06-12 14:58:17 +00:00
|
|
|
extern struct isa_device isa_devtab_bio[], isa_devtab_tty[], isa_devtab_net[],
|
1994-01-04 20:06:30 +00:00
|
|
|
isa_devtab_null[], isa_biotab_wdc[], isa_biotab_fdc[];
|
1993-06-12 14:58:17 +00:00
|
|
|
|
1994-08-18 05:09:36 +00:00
|
|
|
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);
|
|
|
|
struct isa_device *find_isadev __P((struct isa_device *table,
|
|
|
|
struct isa_driver *driverp, int unit));
|
|
|
|
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);
|
|
|
|
void isa_configure __P((void));
|
|
|
|
void isa_defaultirq __P((void));
|
|
|
|
void isa_dmacascade __P((unsigned chan));
|
|
|
|
void isa_dmadone __P((int, caddr_t, int, int));
|
|
|
|
void isa_dmastart __P((int, caddr_t, unsigned, unsigned));
|
|
|
|
int isa_irq_pending __P((struct isa_device *dvp));
|
|
|
|
int isa_nmi __P((int cd));
|
|
|
|
int register_intr __P((int intr, int device_id, u_int flags,
|
1994-10-25 23:06:16 +00:00
|
|
|
inthand2_t *handler, u_int *maskptr, int unit));
|
1994-08-18 05:09:36 +00:00
|
|
|
int unregister_intr __P((int intr, inthand2_t *handler));
|
1993-12-19 00:55:01 +00:00
|
|
|
|
1994-10-19 00:08:07 +00:00
|
|
|
extern int isa_externalize(struct isa_device *, void *, size_t *);
|
|
|
|
extern int isa_internalize(struct isa_device *, void **, size_t *);
|
|
|
|
extern int eisa_externalize(struct isa_device *, int, void *, size_t *);
|
|
|
|
|
1994-10-19 01:59:11 +00:00
|
|
|
struct kern_devconf;
|
|
|
|
extern int isa_generic_externalize(struct proc *, struct kern_devconf *, void *, size_t);
|
|
|
|
extern int eisa_generic_externalize(struct proc *,struct kern_devconf *, void *, size_t);
|
1994-10-23 21:28:03 +00:00
|
|
|
extern struct kern_devconf kdc_isa0;
|
1994-10-19 01:59:11 +00:00
|
|
|
#endif /* KERNEL */
|
|
|
|
|
1993-11-07 17:44:34 +00:00
|
|
|
#endif /* _I386_ISA_ISA_DEVICE_H_ */
|