dcons.c (130077) | dcons.c (130585) |
---|---|
1/* 2 * Copyright (C) 2003 3 * Hidetoshi Shimokawa. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * $Id: dcons.c,v 1.65 2003/10/24 03:24:55 simokawa Exp $ | 1/* 2 * Copyright (C) 2003 3 * Hidetoshi Shimokawa. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * $Id: dcons.c,v 1.65 2003/10/24 03:24:55 simokawa Exp $ |
35 * $FreeBSD: head/sys/dev/dcons/dcons.c 130077 2004-06-04 16:02:56Z phk $ | 35 * $FreeBSD: head/sys/dev/dcons/dcons.c 130585 2004-06-16 09:47:26Z phk $ |
36 */ 37 38#include <sys/param.h> 39#include <sys/kernel.h> 40#include <sys/module.h> 41#include <sys/systm.h> 42#include <sys/types.h> 43#include <sys/conf.h> --- 80 unchanged lines hidden (view full) --- 124 "dcons polling rate"); 125 126static int drv_init = 0; 127static struct callout dcons_callout; 128struct dcons_buf *dcons_buf; /* for local dconschat */ 129 130/* per device data */ 131static struct dcons_softc { | 36 */ 37 38#include <sys/param.h> 39#include <sys/kernel.h> 40#include <sys/module.h> 41#include <sys/systm.h> 42#include <sys/types.h> 43#include <sys/conf.h> --- 80 unchanged lines hidden (view full) --- 124 "dcons polling rate"); 125 126static int drv_init = 0; 127static struct callout dcons_callout; 128struct dcons_buf *dcons_buf; /* for local dconschat */ 129 130/* per device data */ 131static struct dcons_softc { |
132 dev_t dev; | 132 struct cdev *dev; |
133 struct dcons_ch o, i; 134 int brk_state; 135#define DC_GDB 1 136 int flags; 137} sc[DCONS_NPORT]; 138static void dcons_tty_start(struct tty *); 139static int dcons_tty_param(struct tty *, struct termios *); 140static void dcons_timeout(void *); --- 13 unchanged lines hidden (view full) --- 154 155#if __FreeBSD_version < 500000 156#define THREAD proc 157#else 158#define THREAD thread 159#endif 160 161static int | 133 struct dcons_ch o, i; 134 int brk_state; 135#define DC_GDB 1 136 int flags; 137} sc[DCONS_NPORT]; 138static void dcons_tty_start(struct tty *); 139static int dcons_tty_param(struct tty *, struct termios *); 140static void dcons_timeout(void *); --- 13 unchanged lines hidden (view full) --- 154 155#if __FreeBSD_version < 500000 156#define THREAD proc 157#else 158#define THREAD thread 159#endif 160 161static int |
162dcons_open(dev_t dev, int flag, int mode, struct THREAD *td) | 162dcons_open(struct cdev *dev, int flag, int mode, struct THREAD *td) |
163{ 164 struct tty *tp; 165 int unit, error, s; 166 167 unit = minor(dev); 168 if (unit != 0) 169 return (ENXIO); 170 --- 22 unchanged lines hidden (view full) --- 193 splx(s); 194 195 error = ttyld_open(tp, dev); 196 197 return (error); 198} 199 200static int | 163{ 164 struct tty *tp; 165 int unit, error, s; 166 167 unit = minor(dev); 168 if (unit != 0) 169 return (ENXIO); 170 --- 22 unchanged lines hidden (view full) --- 193 splx(s); 194 195 error = ttyld_open(tp, dev); 196 197 return (error); 198} 199 200static int |
201dcons_close(dev_t dev, int flag, int mode, struct THREAD *td) | 201dcons_close(struct cdev *dev, int flag, int mode, struct THREAD *td) |
202{ 203 int unit; 204 struct tty *tp; 205 206 unit = minor(dev); 207 if (unit != 0) 208 return (ENXIO); 209 --- 97 unchanged lines hidden (view full) --- 307} 308static void 309dcons_cnputc(struct consdev *cp, int c) 310{ 311 dcons_putc((struct dcons_softc *)cp->cn_arg, c); 312} 313#else 314static int | 202{ 203 int unit; 204 struct tty *tp; 205 206 unit = minor(dev); 207 if (unit != 0) 208 return (ENXIO); 209 --- 97 unchanged lines hidden (view full) --- 307} 308static void 309dcons_cnputc(struct consdev *cp, int c) 310{ 311 dcons_putc((struct dcons_softc *)cp->cn_arg, c); 312} 313#else 314static int |
315dcons_cngetc(dev_t dev) | 315dcons_cngetc(struct cdev *dev) |
316{ 317 return(dcons_getc((struct dcons_softc *)dev->si_drv1)); 318} 319static int | 316{ 317 return(dcons_getc((struct dcons_softc *)dev->si_drv1)); 318} 319static int |
320dcons_cncheckc(dev_t dev) | 320dcons_cncheckc(struct cdev *dev) |
321{ 322 return(dcons_checkc((struct dcons_softc *)dev->si_drv1)); 323} 324static void | 321{ 322 return(dcons_checkc((struct dcons_softc *)dev->si_drv1)); 323} 324static void |
325dcons_cnputc(dev_t dev, int c) | 325dcons_cnputc(struct cdev *dev, int c) |
326{ 327 dcons_putc((struct dcons_softc *)dev->si_drv1, c); 328} 329#endif 330 331static int 332dcons_getc(struct dcons_softc *dc) 333{ --- 288 unchanged lines hidden --- | 326{ 327 dcons_putc((struct dcons_softc *)dev->si_drv1, c); 328} 329#endif 330 331static int 332dcons_getc(struct dcons_softc *dc) 333{ --- 288 unchanged lines hidden --- |