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.
This commit is contained in:
Nick Hibma 1999-10-05 21:19:41 +00:00
parent 694e31f79d
commit 3e2c6ca3b9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=51957
32 changed files with 22 additions and 186 deletions

View File

@ -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>

View File

@ -32,7 +32,6 @@
*/
#include <sys/param.h>
#include <sys/device.h>
#include <sys/systm.h>
#include <machine/cpuconf.h>
#include <machine/rpb.h>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -35,7 +35,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/termios.h>
#include <machine/rpb.h>

View File

@ -35,7 +35,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/termios.h>
#include <machine/rpb.h>

View File

@ -52,7 +52,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/termios.h>
#include <machine/rpb.h>

View File

@ -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>

View File

@ -35,7 +35,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/termios.h>
#include <machine/rpb.h>

View File

@ -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>

View File

@ -34,7 +34,6 @@
#include <sys/bus.h>
#include <machine/intr.h>
#include <sys/device.h>
#include <sys/termios.h>
#include <machine/rpb.h>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -47,7 +47,6 @@
#include <sys/buf.h>
#include <sys/bus.h>
#include <sys/device.h>
#include <sys/devicestat.h>
#if NPCI > 0

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -47,7 +47,6 @@
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/device.h>
/*
* Autoconfiguration subroutines.

View File

@ -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>

View File

@ -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>

View File

@ -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_ */

View File

@ -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_*/