diff options
author | n_hibma <n_hibma@FreeBSD.org> | 1999-10-05 21:19:41 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 1999-10-05 21:19:41 +0000 |
commit | 279ad3002560565c3597b5ce3b202b05e84d2336 (patch) | |
tree | 76ab8404197c22cd43727f75dfd4c905913dbedf | |
parent | 2ab0ef31d01ca8929aad6b876fe2097123ebf833 (diff) | |
download | FreeBSD-src-279ad3002560565c3597b5ce3b202b05e84d2336.zip FreeBSD-src-279ad3002560565c3597b5ce3b202b05e84d2336.tar.gz |
Removal of sys/device.h
- Move intrhook stuff into kernel.h
- Remove all occurrences of #device <device.h>
- Add kernel.h were necessary (nowhere)
- delete device.h
This file contained the structures for cfdata (old style config) and is no
longer used. It was included by most drivers.
It confuses the remote debugger as the definition of 'struct device' in
device.h is found before the one in bus_private.h.
32 files changed, 22 insertions, 186 deletions
diff --git a/sbin/ccdconfig/ccdconfig.c b/sbin/ccdconfig/ccdconfig.c index 6b83620..c5ccd8f 100644 --- a/sbin/ccdconfig/ccdconfig.c +++ b/sbin/ccdconfig/ccdconfig.c @@ -40,7 +40,6 @@ static const char rcsid[] = #include <sys/param.h> #include <sys/linker.h> #include <sys/disklabel.h> -#include <sys/device.h> #include <sys/stat.h> #include <sys/module.h> #include <ctype.h> diff --git a/sys/alpha/alpha/cpuconf.c b/sys/alpha/alpha/cpuconf.c index b9b2b31..4a92ae9 100644 --- a/sys/alpha/alpha/cpuconf.c +++ b/sys/alpha/alpha/cpuconf.c @@ -32,7 +32,6 @@ */ #include <sys/param.h> -#include <sys/device.h> #include <sys/systm.h> #include <machine/cpuconf.h> #include <machine/rpb.h> diff --git a/sys/alpha/alpha/dec_2100_a50.c b/sys/alpha/alpha/dec_2100_a50.c index e948cfc..9a5df7d 100644 --- a/sys/alpha/alpha/dec_2100_a50.c +++ b/sys/alpha/alpha/dec_2100_a50.c @@ -1,4 +1,5 @@ /* $NetBSD: dec_2100_a50.c,v 1.39 1998/04/17 02:45:19 mjacob Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University. @@ -37,7 +38,6 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/device.h> #include <sys/termios.h> #include <machine/rpb.h> diff --git a/sys/alpha/alpha/dec_3000_300.c b/sys/alpha/alpha/dec_3000_300.c index 1c465dc..f135560 100644 --- a/sys/alpha/alpha/dec_3000_300.c +++ b/sys/alpha/alpha/dec_3000_300.c @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /* * Copyright (c) 1997 by Matthew Jacob * NASA AMES Research Center. @@ -32,7 +33,6 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/device.h> #include <sys/termios.h> #include <machine/rpb.h> diff --git a/sys/alpha/alpha/dec_3000_500.c b/sys/alpha/alpha/dec_3000_500.c index f9b6770..e4f68bf 100644 --- a/sys/alpha/alpha/dec_3000_500.c +++ b/sys/alpha/alpha/dec_3000_500.c @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /* * Copyright (c) 1997 by Matthew Jacob * NASA AMES Research Center. @@ -32,7 +33,6 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/device.h> #include <sys/termios.h> #include <machine/rpb.h> diff --git a/sys/alpha/alpha/dec_axppci_33.c b/sys/alpha/alpha/dec_axppci_33.c index 98970b9..44bd5d2 100644 --- a/sys/alpha/alpha/dec_axppci_33.c +++ b/sys/alpha/alpha/dec_axppci_33.c @@ -35,7 +35,6 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/device.h> #include <sys/termios.h> #include <machine/rpb.h> diff --git a/sys/alpha/alpha/dec_eb164.c b/sys/alpha/alpha/dec_eb164.c index 2088407..cdbee6a 100644 --- a/sys/alpha/alpha/dec_eb164.c +++ b/sys/alpha/alpha/dec_eb164.c @@ -35,7 +35,6 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/device.h> #include <sys/termios.h> #include <machine/rpb.h> diff --git a/sys/alpha/alpha/dec_eb64plus.c b/sys/alpha/alpha/dec_eb64plus.c index 19a7bd5..429fec2 100644 --- a/sys/alpha/alpha/dec_eb64plus.c +++ b/sys/alpha/alpha/dec_eb64plus.c @@ -52,7 +52,6 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/device.h> #include <sys/termios.h> #include <machine/rpb.h> diff --git a/sys/alpha/alpha/dec_kn20aa.c b/sys/alpha/alpha/dec_kn20aa.c index df06bea..1956f81 100644 --- a/sys/alpha/alpha/dec_kn20aa.c +++ b/sys/alpha/alpha/dec_kn20aa.c @@ -1,4 +1,5 @@ /* $NetBSD: dec_kn20aa.c,v 1.38 1998/04/17 02:45:19 mjacob Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University. @@ -34,7 +35,6 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/device.h> #include <sys/termios.h> #include <machine/rpb.h> diff --git a/sys/alpha/alpha/dec_kn8ae.c b/sys/alpha/alpha/dec_kn8ae.c index d205d38..44caf94 100644 --- a/sys/alpha/alpha/dec_kn8ae.c +++ b/sys/alpha/alpha/dec_kn8ae.c @@ -35,7 +35,6 @@ #include <sys/param.h> #include <sys/systm.h> -#include <sys/device.h> #include <sys/termios.h> #include <machine/rpb.h> diff --git a/sys/alpha/alpha/dec_st550.c b/sys/alpha/alpha/dec_st550.c index 853730c..37a79ab 100644 --- a/sys/alpha/alpha/dec_st550.c +++ b/sys/alpha/alpha/dec_st550.c @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /* * Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University. * All rights reserved. @@ -40,7 +41,6 @@ #include <sys/bus.h> #include <machine/intr.h> -#include <sys/device.h> #include <sys/termios.h> #include <machine/rpb.h> diff --git a/sys/alpha/alpha/dec_st6600.c b/sys/alpha/alpha/dec_st6600.c index 1175b5c..e7c7416 100644 --- a/sys/alpha/alpha/dec_st6600.c +++ b/sys/alpha/alpha/dec_st6600.c @@ -34,7 +34,6 @@ #include <sys/bus.h> #include <machine/intr.h> -#include <sys/device.h> #include <sys/termios.h> #include <machine/rpb.h> diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c index 1e4d07d..0de8133 100644 --- a/sys/alpha/alpha/interrupt.c +++ b/sys/alpha/alpha/interrupt.c @@ -51,7 +51,6 @@ #include <machine/intr.h> #ifdef EVCNT_COUNTERS -#include <sys/device.h> struct evcnt clock_intr_evcnt; /* event counter for clock intrs. */ #else #include <machine/intrcnt.h> diff --git a/sys/alpha/tlsb/tlsbmem.c b/sys/alpha/tlsb/tlsbmem.c index c46306c..6d61e09 100644 --- a/sys/alpha/tlsb/tlsbmem.c +++ b/sys/alpha/tlsb/tlsbmem.c @@ -1,4 +1,5 @@ /* $NetBSD: tlsbmem.c,v 1.6 1998/01/12 10:21:25 thorpej Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 1997 by Matthew Jacob @@ -41,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: tlsbmem.c,v 1.6 1998/01/12 10:21:25 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> -#include <sys/device.h> #include <sys/malloc.h> #include <machine/autoconf.h> diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 0c3909d..03ba677 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -32,7 +32,6 @@ #include <sys/systm.h> #include <sys/types.h> #include <sys/malloc.h> -#include <sys/device.h> #include <sys/kernel.h> #include <sys/time.h> #include <sys/conf.h> diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c index d3c2a20..7ac31f3 100644 --- a/sys/compat/svr4/svr4_stream.c +++ b/sys/compat/svr4/svr4_stream.c @@ -65,7 +65,6 @@ #include <sys/ktrace.h> #include <sys/proc.h> #include <sys/vnode.h> -#include <sys/device.h> #include <sys/stat.h> #include <sys/sysproto.h> diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index 4ca4e81..7d3cc1e 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -33,7 +33,6 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/proc.h> -#include <sys/device.h> #include <sys/malloc.h> #include <sys/buf.h> #include <sys/conf.h> diff --git a/sys/dev/ata/atapi-all.c b/sys/dev/ata/atapi-all.c index a88db27..f600108 100644 --- a/sys/dev/ata/atapi-all.c +++ b/sys/dev/ata/atapi-all.c @@ -36,7 +36,6 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/buf.h> -#include <sys/device.h> #include <sys/malloc.h> #include <sys/devicestat.h> #include <pci/pcivar.h> diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c index 897bb2d..662dc86 100644 --- a/sys/dev/ata/atapi-fd.c +++ b/sys/dev/ata/atapi-fd.c @@ -33,7 +33,6 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/proc.h> -#include <sys/device.h> #include <sys/malloc.h> #include <sys/buf.h> #include <sys/conf.h> diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c index 9d2ef86..c4cc2bd 100644 --- a/sys/dev/ccd/ccd.c +++ b/sys/dev/ccd/ccd.c @@ -103,7 +103,6 @@ #include <sys/sysctl.h> #include <sys/disklabel.h> #include <ufs/ffs/fs.h> -#include <sys/device.h> #include <sys/devicestat.h> #include <sys/fcntl.h> #include <sys/vnode.h> diff --git a/sys/dev/ida/ida.c b/sys/dev/ida/ida.c index 0209203..769205f 100644 --- a/sys/dev/ida/ida.c +++ b/sys/dev/ida/ida.c @@ -47,7 +47,6 @@ #include <sys/buf.h> #include <sys/bus.h> -#include <sys/device.h> #include <sys/devicestat.h> #if NPCI > 0 diff --git a/sys/dev/ida/ida_disk.c b/sys/dev/ida/ida_disk.c index 492010a..bca8abf 100644 --- a/sys/dev/ida/ida_disk.c +++ b/sys/dev/ida/ida_disk.c @@ -38,7 +38,6 @@ #include <sys/buf.h> #include <sys/bus.h> #include <sys/conf.h> -#include <sys/device.h> #include <sys/devicestat.h> #include <sys/disklabel.h> #include <sys/diskslice.h> diff --git a/sys/dev/ida/ida_pci.c b/sys/dev/ida/ida_pci.c index 70007fb..4e97181 100644 --- a/sys/dev/ida/ida_pci.c +++ b/sys/dev/ida/ida_pci.c @@ -33,7 +33,6 @@ #include <sys/buf.h> #include <sys/bus.h> -#include <sys/device.h> #include <sys/devicestat.h> #include <machine/bus_memio.h> diff --git a/sys/dev/vinum/vinumhdr.h b/sys/dev/vinum/vinumhdr.h index 91f8742..ebb7b44 100644 --- a/sys/dev/vinum/vinumhdr.h +++ b/sys/dev/vinum/vinumhdr.h @@ -55,7 +55,6 @@ #include <sys/disklabel.h> #include <ufs/ffs/fs.h> #include <sys/mount.h> -#include <sys/device.h> #include <sys/syslog.h> #include <sys/fcntl.h> #include <sys/vnode.h> diff --git a/sys/dev/vinum/vinumparser.c b/sys/dev/vinum/vinumparser.c index 48ec43b..9487ce7 100644 --- a/sys/dev/vinum/vinumparser.c +++ b/sys/dev/vinum/vinumparser.c @@ -71,7 +71,6 @@ #include <sys/disklabel.h> #include <sys/mount.h> #include <sys/conf.h> -#include <sys/device.h> #include <sys/buf.h> #include <dev/vinum/vinumvar.h> diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c index 9d2ef86..c4cc2bd 100644 --- a/sys/geom/geom_ccd.c +++ b/sys/geom/geom_ccd.c @@ -103,7 +103,6 @@ #include <sys/sysctl.h> #include <sys/disklabel.h> #include <ufs/ffs/fs.h> -#include <sys/device.h> #include <sys/devicestat.h> #include <sys/fcntl.h> #include <sys/vnode.h> diff --git a/sys/i386/isa/bs/bsif.h b/sys/i386/isa/bs/bsif.h index 0c63478..193e2f9 100644 --- a/sys/i386/isa/bs/bsif.h +++ b/sys/i386/isa/bs/bsif.h @@ -1,4 +1,5 @@ /* $NecBSD: bsif.h,v 1.5 1997/10/23 20:52:34 honda Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) HONDA Naofumi, KATO Takenori, 1996. All rights reserved. * @@ -105,7 +106,6 @@ #ifdef __FreeBSD__ #include <sys/conf.h> -#include <sys/device.h> #include <vm/vm_extern.h> #include <vm/vm_kern.h> #include <vm/pmap.h> diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c index 6e9051c..9bbb7b4 100644 --- a/sys/kern/subr_autoconf.c +++ b/sys/kern/subr_autoconf.c @@ -47,7 +47,6 @@ #include <sys/param.h> #include <sys/kernel.h> #include <sys/systm.h> -#include <sys/device.h> /* * Autoconfiguration subroutines. diff --git a/sys/pci/ida_pci.c b/sys/pci/ida_pci.c index 70007fb..4e97181 100644 --- a/sys/pci/ida_pci.c +++ b/sys/pci/ida_pci.c @@ -33,7 +33,6 @@ #include <sys/buf.h> #include <sys/bus.h> -#include <sys/device.h> #include <sys/devicestat.h> #include <machine/bus_memio.h> diff --git a/sys/svr4/svr4_stream.c b/sys/svr4/svr4_stream.c index d3c2a20..7ac31f3 100644 --- a/sys/svr4/svr4_stream.c +++ b/sys/svr4/svr4_stream.c @@ -65,7 +65,6 @@ #include <sys/ktrace.h> #include <sys/proc.h> #include <sys/vnode.h> -#include <sys/device.h> #include <sys/stat.h> #include <sys/sysproto.h> diff --git a/sys/sys/device.h b/sys/sys/device.h deleted file mode 100644 index fc5ce33..0000000 --- a/sys/sys/device.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * 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, Lawrence Berkeley Laboratory. - * - * 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. - * - * @(#)device.h 8.2 (Berkeley) 2/17/94 - * $FreeBSD$ - */ - -#ifndef _SYS_DEVICE_H_ -#define _SYS_DEVICE_H_ - -#include <sys/queue.h> - -/* - * Minimal device structures. - * Note that all ``system'' device types are listed here. - */ -enum devclass { - DV_DULL, /* generic, no special info */ - DV_CPU, /* CPU (carries resource utilization) */ - DV_DISK, /* disk drive (label, etc) */ - DV_IFNET, /* network interface */ - DV_TAPE, /* tape device */ - DV_TTY /* serial line interface (?) */ -}; - -struct device { - enum devclass dv_class; /* this device's classification */ - struct device *dv_next; /* next in list of all */ - struct cfdata *dv_cfdata; /* config data that found us */ - int dv_unit; /* device unit number */ - char dv_xname[16]; /* external name (name + unit) */ - struct device *dv_parent; /* pointer to parent device */ -}; - -/* `event' counters (use zero or more per device instance, as needed) */ -struct evcnt { - struct evcnt *ev_next; /* linked list */ - struct device *ev_dev; /* associated device */ - int ev_count; /* how many have occurred */ - char ev_name[8]; /* what to call them (systat display) */ -}; - -/* - * Configuration data (i.e., data placed in ioconf.c). - */ -struct cfdata { - struct cfdriver *cf_driver; /* config driver */ - short cf_unit; /* unit number */ - short cf_fstate; /* finding state (below) */ - int *cf_loc; /* locators (machine dependent) */ - int cf_flags; /* flags from config */ - short *cf_parents; /* potential parents */ - void (**cf_ivstubs) __P((void)); - /* config-generated vectors, if any */ -}; -#define FSTATE_NOTFOUND 0 /* has not been found */ -#define FSTATE_FOUND 1 /* has been found */ -#define FSTATE_STAR 2 /* duplicable */ - -typedef int (*cfmatch_t) __P((struct device *, struct cfdata *, void *)); - -/* - * `configuration' driver (what the machine-independent autoconf uses). - * As devices are found, they are applied against all the potential matches. - * The one with the best match is taken, and a device structure (plus any - * other data desired) is allocated. Pointers to these are placed into - * an array of pointers. The array itself must be dynamic since devices - * can be found long after the machine is up and running. - */ -struct cfdriver { - void **cd_devs; /* devices found */ - char *cd_name; /* device name */ - cfmatch_t cd_match; /* returns a match level */ - void (*cd_attach) __P((struct device *, struct device *, void *)); - enum devclass cd_class; /* device classification */ - size_t cd_devsize; /* size of dev data (for malloc) */ - void *cd_aux; /* additional driver, if any */ - int cd_ndevs; /* size of cd_devs array */ -}; - -struct intr_config_hook { - TAILQ_ENTRY(intr_config_hook) ich_links; - void (*ich_func) __P((void *arg)); - void *ich_arg; -}; - -/* - * Configuration printing functions, and their return codes. The second - * argument is NULL if the device was configured; otherwise it is the name - * of the parent device. The return value is ignored if the device was - * configured, so most functions can return UNCONF unconditionally. - */ -typedef int (*cfprint_t) __P((void *, char *)); -#define QUIET 0 /* print nothing */ -#define UNCONF 1 /* print " not configured\n" */ -#define UNSUPP 2 /* print " not supported\n" */ - -/* - * Pseudo-device attach information (function + number of pseudo-devs). - */ -struct pdevinit { - void (*pdev_attach) __P((int)); - int pdev_count; -}; - -extern struct device *alldevs; /* head of list of all devices */ -extern struct evcnt *allevents; /* head of list of all events */ - -struct cfdata *config_search __P((cfmatch_t, struct device *, void *)); -struct cfdata *config_rootsearch __P((cfmatch_t, char *, void *)); -int config_found __P((struct device *, void *, cfprint_t)); -int config_rootfound __P((char *, void *)); -void config_attach __P((struct device *, struct cfdata *, void *, cfprint_t)); -void evcnt_attach __P((struct device *, const char *, struct evcnt *)); -int config_intrhook_establish __P((struct intr_config_hook *hook)); -void config_intrhook_disestablish __P((struct intr_config_hook *hook)); - -#endif /* !_SYS_DEVICE_H_ */ diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index c6d984c..1dbc215 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -49,6 +49,9 @@ #ifdef KERNEL +/* for intrhook below */ +#include <sys/queue.h> + /* Global variables for the kernel. */ /* 1.1 */ @@ -286,4 +289,16 @@ SYSINIT(__Tunable_init_ ## var, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, __Tunable_ ## extern struct linker_set execsw_set; + + + +struct intr_config_hook { + TAILQ_ENTRY(intr_config_hook) ich_links; + void (*ich_func) __P((void *arg)); + void *ich_arg; +}; + +int config_intrhook_establish __P((struct intr_config_hook *hook)); +void config_intrhook_disestablish __P((struct intr_config_hook *hook)); + #endif /* !_SYS_KERNEL_H_*/ |