conf.h revision 1542
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 */ 40 41/* 42 * Definitions of device driver entry switches 43 */ 44 45struct buf; 46struct proc; 47struct tty; 48struct uio; 49struct vnode; 50 51struct bdevsw { 52 int (*d_open) __P((dev_t dev, int oflags, int devtype, 53 struct proc *p)); 54 int (*d_close) __P((dev_t dev, int fflag, int devtype, 55 struct proc *p)); 56 int (*d_strategy) __P((struct buf *bp)); 57 int (*d_ioctl) __P((dev_t dev, int cmd, caddr_t data, 58 int fflag, struct proc *p)); 59 int (*d_dump) (); /* parameters vary by architecture */ 60 int (*d_psize) __P((dev_t dev)); 61 int d_flags; 62}; 63 64#ifdef KERNEL 65extern struct bdevsw bdevsw[]; 66#endif 67 68struct cdevsw { 69 int (*d_open) __P((dev_t dev, int oflags, int devtype, 70 struct proc *p)); 71 int (*d_close) __P((dev_t dev, int fflag, int devtype, 72 struct proc *)); 73 int (*d_read) __P((dev_t dev, struct uio *uio, int ioflag)); 74 int (*d_write) __P((dev_t dev, struct uio *uio, int ioflag)); 75 int (*d_ioctl) __P((dev_t dev, int cmd, caddr_t data, 76 int fflag, struct proc *p)); 77 int (*d_stop) __P((struct tty *tp, int rw)); 78 int (*d_reset) __P((int uban)); /* XXX */ 79 struct tty *d_ttys; 80 int (*d_select) __P((dev_t dev, int which, struct proc *p)); 81 int (*d_mmap) __P(()); 82 int (*d_strategy) __P((struct buf *bp)); 83}; 84 85#ifdef KERNEL 86extern struct cdevsw cdevsw[]; 87 88/* symbolic sleep message strings */ 89extern char devopn[], devio[], devwait[], devin[], devout[]; 90extern char devioc[], devcls[]; 91#endif 92 93struct linesw { 94 int (*l_open) __P((dev_t dev, struct tty *tp)); 95 int (*l_close) __P((struct tty *tp, int flag)); 96 int (*l_read) __P((struct tty *tp, struct uio *uio, 97 int flag)); 98 int (*l_write) __P((struct tty *tp, struct uio *uio, 99 int flag)); 100 int (*l_ioctl) __P((struct tty *tp, int cmd, caddr_t data, 101 int flag, struct proc *p)); 102 int (*l_rint) __P((int c, struct tty *tp)); 103 int (*l_start) __P((struct tty *tp)); 104 int (*l_modem) __P((struct tty *tp, int flag)); 105}; 106 107#ifdef KERNEL 108extern struct linesw linesw[]; 109#endif 110 111struct swdevt { 112 dev_t sw_dev; 113 int sw_flags; 114 int sw_nblks; 115 struct vnode *sw_vp; 116}; 117#define SW_FREED 0x01 118#define SW_SEQUENTIAL 0x02 119#define sw_freed sw_flags /* XXX compat */ 120 121#ifdef KERNEL 122extern struct swdevt swdevt[]; 123#endif 124