freebsd-dev/sys/i386/isa/isa_device.h
David Greenman 8912c0ed61 Bruce Evans' dynamic interrupt support.
/usr/src/sys/i386/isa/clock.c:
	o Garrett's statclock changes.
	o Wire xxxintr, not Vclk.
	o Wire using register_intr(), not setidt().

/usr/src/sys/i386/isa/icu.s:
	o Garrett's statclock changes.
	o Removed unused variable high_imask.
	o Fake int 8 for rtc as well as int 0 for clk.  Required for kernel
	  profiling with statclock, harmless otherwise.

/usr/src/sys/i386/isa/isa.c:
	o Allow isdp->id_irq and other things in *isdp to be changed by
	  probes.  Changing interrupts later requires direct calls to
	  register_intr() and unregister_intr() and more care.
	  ALLOW_CONFLICT_* is brought over from 1.1.5, except
	  ALLOW_CONFLICT_IRQ is not supported.  IRQ conflict checking is
	  delayed until after probing so that drivers can change the IRQ
	  to a free one; real conflicts require more cooperation between
	  drivers to handle.
	o Too many details to list.
	o This file requires splitting and a lot more work.

/usr/src/sys/i386/isa/isa_device.h:
	o Declare more things more completely.

/usr/src/sys/i386/isa/sio.c:
	o Prepare to register interrupt handlers as fast.

/usr/src/sys/i386/isa/vector.s:
	o Generate entry code for 16 fast interrupt handlers and 16 normal
	  interrupt handlers.  Changed some constants to variables:
	  # $unit is now intr_unit[intr].  Type is int.  Someday it should
	    be a cookie suitable for the handler (e.g., a struct com_s for
	    sio).
	  # $handler is now intr_handler[intr].
	  # intrcnt_actv[id_num] is now *intr_countp[intr].  The indirection
	    is required to get a contiguous range of counters for vmstat
	    and so that the drivers depend more in the driver than on the
	    interrupt number (drivers could take turns using an interrupt
	    and the counts would remain correct).  There is a separate
	    counter for each device and for each stray interrupt.  In
	    1.1.5, stray interrupt 7 clobbers the count for device 7 or
	    something worse if there is no device 7 :-(.
	  # mask is now intr_mask[intr] (was already indirect).
	 o Entry points are now _XintrI and _XfastintrI (I = intr = 0-15),
	   not _VdevU (U = unit).
	 o Removed BUILD_VECTORS stuff.  There's a trace of it left for
	   the string table for vmstat but config now generates the
	   string in one piece because nothing more is required.
	 o Removed old handling of stray interrupts and older comments
	   about it.

Submitted by:	 Bruce Evans
1994-08-18 05:09:36 +00:00

132 lines
5.2 KiB
C

/*-
* 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: isa_device.h,v 1.5 1994/01/04 20:06:30 nate Exp $
*/
#ifndef _I386_ISA_ISA_DEVICE_H_
#define _I386_ISA_ISA_DEVICE_H_ 1
/*
* ISA Bus Autoconfiguration
*/
#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));
/*
* Per device structure.
*/
struct isa_device {
int id_id; /* device id */
struct isa_driver *id_driver;
short 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() */
};
/*
* 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 */
};
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 */
u_long *intr_countp[]; /* indirectors into intrcnt[] */
inthand2_t *intr_handler[]; /* C entry points of intr handlers */
u_int intr_mask[]; /* sets of intrs masked during handling of 1 */
int intr_unit[]; /* cookies to pass to intr handlers */
extern struct isa_device isa_devtab_bio[], isa_devtab_tty[], isa_devtab_net[],
isa_devtab_null[], isa_biotab_wdc[], isa_biotab_fdc[];
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,
inthand2_t *handler, u_int mask, int unit));
int unregister_intr __P((int intr, inthand2_t *handler));
#endif /* _I386_ISA_ISA_DEVICE_H_ */