kern_cons.c (1021) | kern_cons.c (1549) |
---|---|
1/* 2 * Copyright (c) 1988 University of Utah. 3 * Copyright (c) 1991 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department. --- 27 unchanged lines hidden (view full) --- 36 * SUCH DAMAGE. 37 * 38 * from: @(#)cons.c 7.2 (Berkeley) 5/9/91 39 * $Id: cons.c,v 1.10 1994/01/23 19:17:17 davidg Exp $ 40 */ 41 42 43#include "sys/param.h" | 1/* 2 * Copyright (c) 1988 University of Utah. 3 * Copyright (c) 1991 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department. --- 27 unchanged lines hidden (view full) --- 36 * SUCH DAMAGE. 37 * 38 * from: @(#)cons.c 7.2 (Berkeley) 5/9/91 39 * $Id: cons.c,v 1.10 1994/01/23 19:17:17 davidg Exp $ 40 */ 41 42 43#include "sys/param.h" |
44#include <sys/systm.h> |
|
44#include "sys/proc.h" 45#include "sys/user.h" | 45#include "sys/proc.h" 46#include "sys/user.h" |
46#include "sys/systm.h" | |
47#include "sys/buf.h" 48#include "sys/ioctl.h" 49#include "sys/tty.h" 50#include "sys/file.h" 51#include "sys/conf.h" 52#include "sys/vnode.h" 53#include "machine/stdarg.h" 54 --- 62 unchanged lines hidden (view full) --- 117 struct proc *p; 118{ 119 struct vnode *vp = 0; 120 121 if (cn_tab == NULL) 122 return (0); 123 124 dev = cn_tab->cn_dev; | 47#include "sys/buf.h" 48#include "sys/ioctl.h" 49#include "sys/tty.h" 50#include "sys/file.h" 51#include "sys/conf.h" 52#include "sys/vnode.h" 53#include "machine/stdarg.h" 54 --- 62 unchanged lines hidden (view full) --- 117 struct proc *p; 118{ 119 struct vnode *vp = 0; 120 121 if (cn_tab == NULL) 122 return (0); 123 124 dev = cn_tab->cn_dev; |
125 if ((vfinddev(dev, VCHR, &vp) == 0) && vcount(vp)) | 125 if (vfinddev(dev, VCHR, &vp) && vcount(vp)) |
126 return (0); 127 128 return ((*cdevsw[major(dev)].d_open)(dev, flag, mode, p)); 129} 130 131int 132cnclose(dev, flag, mode, p) 133 dev_t dev; 134 int flag, mode; 135 struct proc *p; 136{ 137 struct vnode *vp = 0; 138 139 if (cn_tab == NULL) 140 return (0); 141 142 dev = cn_tab->cn_dev; | 126 return (0); 127 128 return ((*cdevsw[major(dev)].d_open)(dev, flag, mode, p)); 129} 130 131int 132cnclose(dev, flag, mode, p) 133 dev_t dev; 134 int flag, mode; 135 struct proc *p; 136{ 137 struct vnode *vp = 0; 138 139 if (cn_tab == NULL) 140 return (0); 141 142 dev = cn_tab->cn_dev; |
143 if ((vfinddev(dev, VCHR, &vp) == 0) && vcount(vp)) | 143 if (vfinddev(dev, VCHR, &vp) && vcount(vp)) |
144 return (0); 145 146 return ((*cdevsw[major(dev)].d_close)(dev, flag, mode, p)); 147} 148 149int 150cnread(dev, uio, flag) 151 dev_t dev; --- 93 unchanged lines hidden --- | 144 return (0); 145 146 return ((*cdevsw[major(dev)].d_close)(dev, flag, mode, p)); 147} 148 149int 150cnread(dev, uio, flag) 151 dev_t dev; --- 93 unchanged lines hidden --- |