conf.h revision 2165
1/*-
2 * Copyright (c) 1990, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in the
17 *    documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 *    must display the following acknowledgement:
20 *	This product includes software developed by the University of
21 *	California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 *    may be used to endorse or promote products derived from this software
24 *    without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 *	@(#)conf.h	8.3 (Berkeley) 1/21/94
39 * $Id: conf.h,v 1.2 1994/08/02 07:52:44 davidg Exp $
40 */
41
42#ifndef _SYS_CONF_H_
43#define _SYS_CONF_H_
44
45/*
46 * Definitions of device driver entry switches
47 */
48
49struct buf;
50struct proc;
51struct tty;
52struct uio;
53struct vnode;
54
55struct bdevsw {
56	int	(*d_open)	__P((dev_t dev, int oflags, int devtype,
57				     struct proc *p));
58	int	(*d_close)	__P((dev_t dev, int fflag, int devtype,
59				     struct proc *p));
60	int	(*d_strategy)	__P((struct buf *bp));
61	int	(*d_ioctl)	__P((dev_t dev, int cmd, caddr_t data,
62				     int fflag, struct proc *p));
63	int	(*d_dump)	();	/* parameters vary by architecture */
64	int	(*d_psize)	__P((dev_t dev));
65	int	d_flags;
66};
67
68#ifdef KERNEL
69extern struct bdevsw bdevsw[];
70#endif
71
72struct cdevsw {
73	int	(*d_open)	__P((dev_t dev, int oflags, int devtype,
74				     struct proc *p));
75	int	(*d_close)	__P((dev_t dev, int fflag, int devtype,
76				     struct proc *));
77	int	(*d_read)	__P((dev_t dev, struct uio *uio, int ioflag));
78	int	(*d_write)	__P((dev_t dev, struct uio *uio, int ioflag));
79	int	(*d_ioctl)	__P((dev_t dev, int cmd, caddr_t data,
80				     int fflag, struct proc *p));
81	int	(*d_stop)	__P((struct tty *tp, int rw));
82	int	(*d_reset)	__P((int uban));	/* XXX */
83	struct	tty *d_ttys;
84	int	(*d_select)	__P((dev_t dev, int which, struct proc *p));
85	int	(*d_mmap)	__P(());
86	int	(*d_strategy)	__P((struct buf *bp));
87};
88
89#ifdef KERNEL
90extern struct cdevsw cdevsw[];
91
92/* symbolic sleep message strings */
93extern char devopn[], devio[], devwait[], devin[], devout[];
94extern char devioc[], devcls[];
95#endif
96
97struct linesw {
98	int	(*l_open)	__P((dev_t dev, struct tty *tp));
99	int	(*l_close)	__P((struct tty *tp, int flag));
100	int	(*l_read)	__P((struct tty *tp, struct uio *uio,
101				     int flag));
102	int	(*l_write)	__P((struct tty *tp, struct uio *uio,
103				     int flag));
104	int	(*l_ioctl)	__P((struct tty *tp, int cmd, caddr_t data,
105				     int flag, struct proc *p));
106	int	(*l_rint)	__P((int c, struct tty *tp));
107	int	(*l_start)	__P((struct tty *tp));
108	int	(*l_modem)	__P((struct tty *tp, int flag));
109};
110
111#ifdef KERNEL
112extern struct linesw linesw[];
113#endif
114
115struct swdevt {
116	dev_t	sw_dev;
117	int	sw_flags;
118	int	sw_nblks;
119	struct	vnode *sw_vp;
120};
121#define	SW_FREED	0x01
122#define	SW_SEQUENTIAL	0x02
123#define sw_freed	sw_flags	/* XXX compat */
124
125#ifdef KERNEL
126extern struct swdevt swdevt[];
127#endif
128
129#endif
130