diff --git a/sys/arch/alpha/a12/a12dc.c b/sys/arch/alpha/a12/a12dc.c index 6a93183f5ca5..7fce7583e164 100644 --- a/sys/arch/alpha/a12/a12dc.c +++ b/sys/arch/alpha/a12/a12dc.c @@ -1,4 +1,4 @@ -/* $NetBSD: a12dc.c,v 1.24 2009/11/21 05:35:40 rmind Exp $ */ +/* $NetBSD: a12dc.c,v 1.25 2011/04/24 16:26:52 rmind Exp $ */ /* [Notice revision 2.2] * Copyright (c) 1997, 1998 Avalon Computer Systems, Inc. @@ -64,12 +64,11 @@ #ifndef BSIDE #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: a12dc.c,v 1.24 2009/11/21 05:35:40 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: a12dc.c,v 1.25 2011/04/24 16:26:52 rmind Exp $"); #include #include #include -#include #include #include @@ -158,9 +157,9 @@ a12dcattach(struct device *parent, struct device *self, void *aux) /* note that we've attached the chipset; can't have 2 A12Cs. */ a12dcfound = 1; - printf(": driver %s\n", "$Revision: 1.24 $"); + printf(": driver %s\n", "$Revision: 1.25 $"); - tp = a12dc_tty[0] = ttymalloc(); + tp = a12dc_tty[0] = tty_alloc(); tp->t_oproc = a12dcstart; tp->t_param = a12dcparam; tty_attach(tp); @@ -170,7 +169,7 @@ a12dcattach(struct device *parent, struct device *self, void *aux) } void -a12dc_init(struct a12dc_config *ccp, int mallocsafe) +a12dc_init(struct a12dc_config *ccp, int sleepsafe) { } @@ -269,7 +268,7 @@ a12dcopen(dev_t dev, int flag, int mode, struct lwp *l) #endif if (!a12dc_tty[unit]) { - tp = a12dc_tty[unit] = ttymalloc(); + tp = a12dc_tty[unit] = tty_alloc(); tty_attach(tp); } else tp = a12dc_tty[unit]; diff --git a/sys/arch/alpha/alpha/promcons.c b/sys/arch/alpha/alpha/promcons.c index fcadb5a351bc..8e2e759b5810 100644 --- a/sys/arch/alpha/alpha/promcons.c +++ b/sys/arch/alpha/alpha/promcons.c @@ -1,4 +1,4 @@ -/* $NetBSD: promcons.c,v 1.35 2009/11/21 05:35:40 rmind Exp $ */ +/* $NetBSD: promcons.c,v 1.36 2011/04/24 16:26:52 rmind Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -29,7 +29,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: promcons.c,v 1.35 2009/11/21 05:35:40 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: promcons.c,v 1.36 2011/04/24 16:26:52 rmind Exp $"); #include #include @@ -98,7 +98,7 @@ promopen(dev_t dev, int flag, int mode, struct lwp *l) s = spltty(); if (!prom_tty[unit]) { - tp = prom_tty[unit] = ttymalloc(); + tp = prom_tty[unit] = tty_alloc(); tty_attach(tp); } else tp = prom_tty[unit]; diff --git a/sys/arch/amiga/dev/ite.c b/sys/arch/amiga/dev/ite.c index f37291c78abb..f7e671d967a5 100644 --- a/sys/arch/amiga/dev/ite.c +++ b/sys/arch/amiga/dev/ite.c @@ -1,4 +1,4 @@ -/* $NetBSD: ite.c,v 1.91 2011/02/08 20:20:08 rmind Exp $ */ +/* $NetBSD: ite.c,v 1.92 2011/04/24 16:26:52 rmind Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -46,7 +46,7 @@ #include "opt_ddb.h" #include -__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.91 2011/02/08 20:20:08 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.92 2011/04/24 16:26:52 rmind Exp $"); #include #include @@ -426,7 +426,7 @@ iteopen(dev_t dev, int mode, int devtype, struct lwp *l) return ENXIO; if (ip->tp == NULL) { - tp = ip->tp = ttymalloc(); + tp = ip->tp = tty_alloc(); tty_attach(tp); } else tp = ip->tp; diff --git a/sys/arch/amiga/dev/mfc.c b/sys/arch/amiga/dev/mfc.c index 8af7556f4093..efbe467c5f1d 100644 --- a/sys/arch/amiga/dev/mfc.c +++ b/sys/arch/amiga/dev/mfc.c @@ -1,4 +1,4 @@ -/* $NetBSD: mfc.c,v 1.53 2009/10/26 19:16:54 cegger Exp $ */ +/* $NetBSD: mfc.c,v 1.54 2011/04/24 16:26:52 rmind Exp $ */ /* * Copyright (c) 1982, 1990 The Regents of the University of California. @@ -55,7 +55,7 @@ #include "opt_kgdb.h" #include -__KERNEL_RCSID(0, "$NetBSD: mfc.c,v 1.53 2009/10/26 19:16:54 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mfc.c,v 1.54 2011/04/24 16:26:52 rmind Exp $"); #include #include @@ -64,7 +64,6 @@ __KERNEL_RCSID(0, "$NetBSD: mfc.c,v 1.53 2009/10/26 19:16:54 cegger Exp $"); #include #include #include -#include #include #include #include @@ -490,7 +489,7 @@ mfcsopen(dev_t dev, int flag, int mode, struct lwp *l) if (sc->sc_tty) tp = sc->sc_tty; else { - tp = sc->sc_tty = ttymalloc(); + tp = sc->sc_tty = tty_alloc(); tty_attach(tp); } @@ -603,7 +602,7 @@ mfcsclose(dev_t dev, int flag, int mode, struct lwp *l) #if not_yet if (tp != &mfcs_cons) { remove_vbl_function(&sc->vbl_node); - ttyfree(tp); + tty_free(tp); sc->sc_tty = (struct tty *) NULL; } #endif diff --git a/sys/arch/amiga/dev/msc.c b/sys/arch/amiga/dev/msc.c index 36b933462927..02c13984905f 100644 --- a/sys/arch/amiga/dev/msc.c +++ b/sys/arch/amiga/dev/msc.c @@ -1,4 +1,4 @@ -/* $NetBSD: msc.c,v 1.42 2010/05/25 02:21:30 jklos Exp $ */ +/* $NetBSD: msc.c,v 1.43 2011/04/24 16:26:52 rmind Exp $ */ /* * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. @@ -93,7 +93,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: msc.c,v 1.42 2010/05/25 02:21:30 jklos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msc.c,v 1.43 2011/04/24 16:26:52 rmind Exp $"); #include "msc.h" @@ -104,7 +104,6 @@ __KERNEL_RCSID(0, "$NetBSD: msc.c,v 1.42 2010/05/25 02:21:30 jklos Exp $"); #include #include #include -#include #include #include #include @@ -348,7 +347,7 @@ mscopen(dev_t dev, int flag, int mode, struct lwp *l) if (!msc_tty[ttyn]) { - tp = ttymalloc(); + tp = tty_alloc(); tty_attach(tp); msc_tty[ttyn] = tp; msc_tty[ttyn+1] = (struct tty *)NULL; diff --git a/sys/arch/amiga/dev/ser.c b/sys/arch/amiga/dev/ser.c index c7319c22b973..3f4175815f5a 100644 --- a/sys/arch/amiga/dev/ser.c +++ b/sys/arch/amiga/dev/ser.c @@ -1,4 +1,4 @@ -/* $NetBSD: ser.c,v 1.78 2008/06/11 12:59:10 tsutsui Exp $ */ +/* $NetBSD: ser.c,v 1.79 2011/04/24 16:26:52 rmind Exp $ */ /* * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. @@ -40,7 +40,7 @@ #include "opt_kgdb.h" #include -__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.78 2008/06/11 12:59:10 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.79 2011/04/24 16:26:52 rmind Exp $"); #include #include @@ -49,7 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.78 2008/06/11 12:59:10 tsutsui Exp $"); #include #include #include -#include #include #include #include @@ -257,7 +256,7 @@ serattach(struct device *pdp, struct device *dp, void *auxp) if (0 == serconsole) serconsinit = 0; - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = (void (*) (struct tty *)) serstart; tp->t_param = serparam; tp->t_hwiflow = serhwiflow; @@ -419,7 +418,7 @@ ser_shutdown(struct ser_softc *sc) #if not_yet if (tp != &ser_cons) { remove_vbl_function(&ser_vbl_node); - ttyfree(tp); + tty_free(tp); ser_tty = (struct tty *) NULL; } #endif diff --git a/sys/arch/arc/dev/pccons.c b/sys/arch/arc/dev/pccons.c index caa40cd8fe42..32d352ce164e 100644 --- a/sys/arch/arc/dev/pccons.c +++ b/sys/arch/arc/dev/pccons.c @@ -1,4 +1,4 @@ -/* $NetBSD: pccons.c,v 1.57 2009/03/14 21:04:04 dsl Exp $ */ +/* $NetBSD: pccons.c,v 1.58 2011/04/24 16:26:53 rmind Exp $ */ /* $OpenBSD: pccons.c,v 1.22 1999/01/30 22:39:37 imp Exp $ */ /* NetBSD: pccons.c,v 1.89 1995/05/04 19:35:20 cgd Exp */ @@ -80,7 +80,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.57 2009/03/14 21:04:04 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pccons.c,v 1.58 2011/04/24 16:26:53 rmind Exp $"); #include "opt_ddb.h" @@ -600,7 +600,7 @@ pcopen(dev_t dev, int flag, int mode, struct lwp *l) return ENXIO; if (!sc->sc_tty) { - tp = sc->sc_tty = ttymalloc(); + tp = sc->sc_tty = tty_alloc(); } else { tp = sc->sc_tty; @@ -638,7 +638,7 @@ pcclose(dev_t dev, int flag, int mode, struct lwp *l) (*tp->t_linesw->l_close)(tp, flag); ttyclose(tp); #ifdef notyet /* XXX */ - ttyfree(tp); + tty_free(tp); #endif return 0; } diff --git a/sys/arch/arm/at91/at91dbgu.c b/sys/arch/arm/at91/at91dbgu.c index a9b3df0b43e9..4205c04d7c47 100644 --- a/sys/arch/arm/at91/at91dbgu.c +++ b/sys/arch/arm/at91/at91dbgu.c @@ -1,5 +1,5 @@ -/* $Id: at91dbgu.c,v 1.4 2010/06/19 19:47:34 matt Exp $ */ -/* $NetBSD: at91dbgu.c,v 1.4 2010/06/19 19:47:34 matt Exp $ */ +/* $Id: at91dbgu.c,v 1.5 2011/04/24 16:26:53 rmind Exp $ */ +/* $NetBSD: at91dbgu.c,v 1.5 2011/04/24 16:26:53 rmind Exp $ */ /* * @@ -83,7 +83,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: at91dbgu.c,v 1.4 2010/06/19 19:47:34 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: at91dbgu.c,v 1.5 2011/04/24 16:26:53 rmind Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -243,7 +243,7 @@ at91dbgu_attach(device_t parent, device_t self, void *aux) DBGUREG(DBGU_IER) = DBGU_INT_RXRDY; // @@@@@ } - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = at91dbgu_start; tp->t_param = at91dbgu_param; tp->t_hwiflow = at91dbgu_hwiflow; diff --git a/sys/arch/arm/at91/at91usart.c b/sys/arch/arm/at91/at91usart.c index ff31bbead885..e38ae8de56c5 100644 --- a/sys/arch/arm/at91/at91usart.c +++ b/sys/arch/arm/at91/at91usart.c @@ -1,5 +1,5 @@ -/* $Id: at91usart.c,v 1.3 2009/10/23 06:53:13 snj Exp $ */ -/* $NetBSD: at91usart.c,v 1.3 2009/10/23 06:53:13 snj Exp $ */ +/* $Id: at91usart.c,v 1.4 2011/04/24 16:26:53 rmind Exp $ */ +/* $NetBSD: at91usart.c,v 1.4 2011/04/24 16:26:53 rmind Exp $ */ /* * Copyright (c) 2007 Embedtronics Oy. All rights reserved. @@ -77,7 +77,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: at91usart.c,v 1.3 2009/10/23 06:53:13 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: at91usart.c,v 1.4 2011/04/24 16:26:53 rmind Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -109,7 +109,6 @@ __KERNEL_RCSID(0, "$NetBSD: at91usart.c,v 1.3 2009/10/23 06:53:13 snj Exp $"); #include #include #include -#include #include #include #include @@ -278,7 +277,7 @@ at91usart_attach_subr(struct at91usart_softc *sc, struct at91bus_attach_args *sa } #endif // NOTYET - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = at91usart_start; tp->t_param = at91usart_param; tp->t_hwiflow = at91usart_hwiflow; diff --git a/sys/arch/arm/ep93xx/epcom.c b/sys/arch/arm/ep93xx/epcom.c index 012854a0aabc..34c1b2488854 100644 --- a/sys/arch/arm/ep93xx/epcom.c +++ b/sys/arch/arm/ep93xx/epcom.c @@ -1,4 +1,4 @@ -/* $NetBSD: epcom.c,v 1.19 2009/03/14 14:45:55 dsl Exp $ */ +/* $NetBSD: epcom.c,v 1.20 2011/04/24 16:26:53 rmind Exp $ */ /* * Copyright (c) 1998, 1999, 2001, 2002, 2004 The NetBSD Foundation, Inc. * All rights reserved. @@ -73,7 +73,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.19 2009/03/14 14:45:55 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.20 2011/04/24 16:26:53 rmind Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -201,7 +201,7 @@ epcom_attach_subr(struct epcom_softc *sc) SET(sc->sc_swflags, TIOCFLAG_SOFTCAR); } - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = epcomstart; tp->t_param = epcomparam; tp->t_hwiflow = epcomhwiflow; diff --git a/sys/arch/arm/footbridge/footbridge_com.c b/sys/arch/arm/footbridge/footbridge_com.c index 8a1c44e181b6..e0b5129a809e 100644 --- a/sys/arch/arm/footbridge/footbridge_com.c +++ b/sys/arch/arm/footbridge/footbridge_com.c @@ -1,4 +1,4 @@ -/* $NetBSD: footbridge_com.c,v 1.32 2009/07/21 07:35:55 skrll Exp $ */ +/* $NetBSD: footbridge_com.c,v 1.33 2011/04/24 16:26:53 rmind Exp $ */ /*- * Copyright (c) 1997 Mark Brinicombe @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: footbridge_com.c,v 1.32 2009/07/21 07:35:55 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: footbridge_com.c,v 1.33 2011/04/24 16:26:53 rmind Exp $"); #include "opt_ddb.h" #include "opt_ddbparam.h" @@ -227,7 +227,7 @@ fcomopen(dev_t dev, int flag, int mode, struct lwp *l) if (!sc) return ENXIO; if (!(tp = sc->sc_tty)) - sc->sc_tty = tp = ttymalloc(); + sc->sc_tty = tp = tty_alloc(); if (!sc->sc_rxbuffer[0]) { sc->sc_rxbuffer[0] = malloc(RX_BUFFER_SIZE, M_DEVBUF, M_WAITOK); sc->sc_rxbuffer[1] = malloc(RX_BUFFER_SIZE, M_DEVBUF, M_WAITOK); diff --git a/sys/arch/arm/imx/imxuart.c b/sys/arch/arm/imx/imxuart.c index 0e1f80fd809d..1d4abdd3971a 100644 --- a/sys/arch/arm/imx/imxuart.c +++ b/sys/arch/arm/imx/imxuart.c @@ -1,4 +1,4 @@ -/* $NetBSD: imxuart.c,v 1.7 2011/01/14 02:06:23 rmind Exp $ */ +/* $NetBSD: imxuart.c,v 1.8 2011/04/24 16:26:54 rmind Exp $ */ /* * Copyright (c) 2009, 2010 Genetec Corporation. All rights reserved. @@ -96,7 +96,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.7 2011/01/14 02:06:23 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.8 2011/04/24 16:26:54 rmind Exp $"); #include "opt_imxuart.h" #include "opt_ddb.h" @@ -433,7 +433,7 @@ imxuart_attach_common(device_t parent, device_t self, } - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = imxustart; tp->t_param = imxuparam; tp->t_hwiflow = imxuhwiflow; @@ -633,7 +633,7 @@ imxuart_detach(device_t self, int flags) * Ring buffer allocation failed in the imxuart_attach_subr, * only the tty is allocated, and nothing else. */ - ttyfree(sc->sc_tty); + tty_free(sc->sc_tty); return 0; } @@ -642,7 +642,7 @@ imxuart_detach(device_t self, int flags) /* Detach and free the tty. */ tty_detach(sc->sc_tty); - ttyfree(sc->sc_tty); + tty_free(sc->sc_tty); /* Unhook the soft interrupt handler. */ softint_disestablish(sc->sc_si); diff --git a/sys/arch/arm/ixp12x0/ixp12x0_com.c b/sys/arch/arm/ixp12x0/ixp12x0_com.c index 3dee2b5ce220..806e95eca624 100644 --- a/sys/arch/arm/ixp12x0/ixp12x0_com.c +++ b/sys/arch/arm/ixp12x0/ixp12x0_com.c @@ -1,4 +1,4 @@ -/* $NetBSD: ixp12x0_com.c,v 1.37 2010/11/15 06:14:02 uebayasi Exp $ */ +/* $NetBSD: ixp12x0_com.c,v 1.38 2011/04/24 16:26:54 rmind Exp $ */ /* * Copyright (c) 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc. * All rights reserved. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.37 2010/11/15 06:14:02 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.38 2011/04/24 16:26:54 rmind Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -200,7 +200,7 @@ ixpcom_attach_subr(struct ixpcom_softc *sc) SET(sc->sc_swflags, TIOCFLAG_SOFTCAR); } - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = ixpcomstart; tp->t_param = ixpcomparam; tp->t_hwiflow = ixpcomhwiflow; diff --git a/sys/arch/arm/s3c2xx0/sscom.c b/sys/arch/arm/s3c2xx0/sscom.c index a2234632df01..80f902e0e959 100644 --- a/sys/arch/arm/s3c2xx0/sscom.c +++ b/sys/arch/arm/s3c2xx0/sscom.c @@ -1,4 +1,4 @@ -/* $NetBSD: sscom.c,v 1.32 2009/12/09 12:42:59 he Exp $ */ +/* $NetBSD: sscom.c,v 1.33 2011/04/24 16:26:54 rmind Exp $ */ /* * Copyright (c) 2002, 2003 Fujitsu Component Limited @@ -98,7 +98,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sscom.c,v 1.32 2009/12/09 12:42:59 he Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sscom.c,v 1.33 2011/04/24 16:26:54 rmind Exp $"); #include "opt_sscom.h" #include "opt_ddb.h" @@ -458,9 +458,7 @@ sscom_attach_subr(struct sscom_softc *sc) } #endif - - - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = sscomstart; tp->t_param = sscomparam; tp->t_hwiflow = sscomhwiflow; diff --git a/sys/arch/arm/sa11x0/sa11x0_com.c b/sys/arch/arm/sa11x0/sa11x0_com.c index 8eed98ffad03..81cbaea5fbbf 100644 --- a/sys/arch/arm/sa11x0/sa11x0_com.c +++ b/sys/arch/arm/sa11x0/sa11x0_com.c @@ -1,4 +1,4 @@ -/* $NetBSD: sa11x0_com.c,v 1.47 2010/08/19 15:17:53 tsutsui Exp $ */ +/* $NetBSD: sa11x0_com.c,v 1.48 2011/04/24 16:26:54 rmind Exp $ */ /*- * Copyright (c) 1998, 1999, 2001 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.47 2010/08/19 15:17:53 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.48 2011/04/24 16:26:54 rmind Exp $"); #include "opt_com.h" #include "opt_ddb.h" @@ -296,7 +296,7 @@ sacom_attach_subr(struct sacom_softc *sc) SET(sc->sc_swflags, TIOCFLAG_SOFTCAR); } - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = sacomstart; tp->t_param = sacomparam; tp->t_hwiflow = sacomhwiflow; @@ -375,7 +375,7 @@ sacom_detach(device_t dev, int flags) /* Detach and free the tty. */ tty_detach(sc->sc_tty); - ttyfree(sc->sc_tty); + tty_free(sc->sc_tty); /* Unhook the soft interrupt handler. */ softint_disestablish(sc->sc_si); diff --git a/sys/arch/atari/dev/ite.c b/sys/arch/atari/dev/ite.c index 281943215e90..90ab011c790e 100644 --- a/sys/arch/atari/dev/ite.c +++ b/sys/arch/atari/dev/ite.c @@ -1,4 +1,4 @@ -/* $NetBSD: ite.c,v 1.69 2011/02/08 20:20:10 rmind Exp $ */ +/* $NetBSD: ite.c,v 1.70 2011/04/24 16:26:54 rmind Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -44,7 +44,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.69 2011/02/08 20:20:10 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.70 2011/04/24 16:26:54 rmind Exp $"); #include "opt_ddb.h" @@ -386,7 +386,7 @@ iteopen(dev_t dev, int mode, int devtype, struct lwp *l) return (ENXIO); if (ip->tp == NULL) { - tp = ip->tp = ttymalloc(); + tp = ip->tp = tty_alloc(); tty_attach(tp); } else diff --git a/sys/arch/atari/dev/ser.c b/sys/arch/atari/dev/ser.c index ee265e744cb3..afcd33709a7f 100644 --- a/sys/arch/atari/dev/ser.c +++ b/sys/arch/atari/dev/ser.c @@ -1,4 +1,4 @@ -/* $NetBSD: ser.c,v 1.51 2010/04/10 16:07:04 tsutsui Exp $ */ +/* $NetBSD: ser.c,v 1.52 2011/04/24 16:26:55 rmind Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -93,7 +93,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.51 2010/04/10 16:07:04 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.52 2011/04/24 16:26:55 rmind Exp $"); #include "opt_ddb.h" #include "opt_mbtype.h" @@ -375,7 +375,7 @@ seropen(dev_t dev, int flag, int mode, struct lwp *l) return ENXIO; if (!sc->sc_tty) { - tp = sc->sc_tty = ttymalloc(); + tp = sc->sc_tty = tty_alloc(); tty_attach(tp); } else tp = sc->sc_tty; diff --git a/sys/arch/atari/dev/zs.c b/sys/arch/atari/dev/zs.c index 8667a8b0e5da..602771dca6f3 100644 --- a/sys/arch/atari/dev/zs.c +++ b/sys/arch/atari/dev/zs.c @@ -1,4 +1,4 @@ -/* $NetBSD: zs.c,v 1.72 2010/04/09 17:38:43 tsutsui Exp $ */ +/* $NetBSD: zs.c,v 1.73 2011/04/24 16:26:55 rmind Exp $ */ /* * Copyright (c) 1992, 1993 @@ -79,7 +79,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.72 2010/04/09 17:38:43 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.73 2011/04/24 16:26:55 rmind Exp $"); #include #include @@ -405,7 +405,7 @@ zsopen(dev_t dev, int flags, int mode, struct lwp *l) tp = cs->cs_ttyp; if (tp == NULL) { - cs->cs_ttyp = tp = ttymalloc(); + cs->cs_ttyp = tp = tty_alloc(); tty_attach(tp); tp->t_dev = dev; tp->t_oproc = zsstart; diff --git a/sys/arch/emips/ebus/dz_ebus.c b/sys/arch/emips/ebus/dz_ebus.c index 6ba70ba0a26e..4ace6d387d09 100644 --- a/sys/arch/emips/ebus/dz_ebus.c +++ b/sys/arch/emips/ebus/dz_ebus.c @@ -1,4 +1,4 @@ -/* $NetBSD: dz_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ +/* $NetBSD: dz_ebus.c,v 1.2 2011/04/24 16:26:55 rmind Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dz_ebus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dz_ebus.c,v 1.2 2011/04/24 16:26:55 rmind Exp $"); #include "opt_ddb.h" @@ -653,9 +653,9 @@ dz_ebus_attach(struct device *parent, struct device *self, void *aux) /* Initialize our softc structure. Should be done in open? */ - sc->sc_dz.dz_sc = sc; - sc->sc_dz.dz_line = 0; - sc->sc_dz.dz_tty = ttymalloc(); + sc->sc_dz.dz_sc = sc; + sc->sc_dz.dz_line = 0; + sc->sc_dz.dz_tty = tty_alloc(); evcnt_attach_dynamic(&sc->sc_rintrcnt, EVCNT_TYPE_INTR, NULL, sc->sc_dev.dv_xname, "rintr"); diff --git a/sys/arch/evbarm/dev/plcom.c b/sys/arch/evbarm/dev/plcom.c index 688c1bd060a7..ad0104bd9110 100644 --- a/sys/arch/evbarm/dev/plcom.c +++ b/sys/arch/evbarm/dev/plcom.c @@ -1,4 +1,4 @@ -/* $NetBSD: plcom.c,v 1.31 2009/12/06 21:38:42 dyoung Exp $ */ +/* $NetBSD: plcom.c,v 1.32 2011/04/24 16:26:55 rmind Exp $ */ /*- * Copyright (c) 2001 ARM Ltd @@ -94,7 +94,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.31 2009/12/06 21:38:42 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.32 2011/04/24 16:26:55 rmind Exp $"); #include "opt_plcom.h" #include "opt_ddb.h" @@ -392,7 +392,7 @@ plcom_attach_subr(struct plcom_softc *sc) if (sc->sc_fifolen > 1) SET(sc->sc_hwflags, PLCOM_HW_FIFO); - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = plcomstart; tp->t_param = plcomparam; tp->t_hwiflow = plcomhwiflow; @@ -494,7 +494,7 @@ plcom_detach(struct device *self, int flags) /* Detach and free the tty. */ tty_detach(sc->sc_tty); - ttyfree(sc->sc_tty); + tty_free(sc->sc_tty); /* Unhook the soft interrupt handler. */ softint_disestablish(sc->sc_si); diff --git a/sys/arch/evbppc/virtex/dev/xlcom.c b/sys/arch/evbppc/virtex/dev/xlcom.c index 1f09db12de9a..95659af25cef 100644 --- a/sys/arch/evbppc/virtex/dev/xlcom.c +++ b/sys/arch/evbppc/virtex/dev/xlcom.c @@ -1,4 +1,4 @@ -/* $NetBSD: xlcom.c,v 1.7 2008/06/11 23:52:36 cegger Exp $ */ +/* $NetBSD: xlcom.c,v 1.8 2011/04/24 16:26:55 rmind Exp $ */ /* * Copyright (c) 2006 Jachym Holecek @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xlcom.c,v 1.7 2008/06/11 23:52:36 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xlcom.c,v 1.8 2011/04/24 16:26:55 rmind Exp $"); #include "opt_kgdb.h" @@ -219,7 +219,7 @@ xlcom_attach(struct device *parent, struct device *self, void *aux) return ; } - tp = ttymalloc(); + tp = tty_alloc(); tp->t_dev = dev; tp->t_oproc = xlcom_start; tp->t_param = xlcom_param; diff --git a/sys/arch/hp300/dev/dcm.c b/sys/arch/hp300/dev/dcm.c index d08970af6d81..8400c39c60e8 100644 --- a/sys/arch/hp300/dev/dcm.c +++ b/sys/arch/hp300/dev/dcm.c @@ -1,4 +1,4 @@ -/* $NetBSD: dcm.c,v 1.82 2011/02/08 20:20:13 rmind Exp $ */ +/* $NetBSD: dcm.c,v 1.83 2011/04/24 16:26:55 rmind Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -78,7 +78,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dcm.c,v 1.82 2011/02/08 20:20:13 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dcm.c,v 1.83 2011/04/24 16:26:55 rmind Exp $"); #include "opt_kgdb.h" @@ -498,7 +498,7 @@ dcmopen(dev_t dev, int flag, int mode, struct lwp *l) return ENXIO; if (sc->sc_tty[port] == NULL) { - tp = sc->sc_tty[port] = ttymalloc(); + tp = sc->sc_tty[port] = tty_alloc(); tty_attach(tp); } else tp = sc->sc_tty[port]; @@ -598,7 +598,7 @@ dcmclose(dev_t dev, int flag, int mode, struct lwp *l) ttyclose(tp); #if 0 tty_detach(tp); - ttyfree(tp); + tty_free(tp); sc->sc_tty[port] == NULL; #endif return 0; diff --git a/sys/arch/hp700/dev/pdc.c b/sys/arch/hp700/dev/pdc.c index 927e7a6494ba..f6d01dd897da 100644 --- a/sys/arch/hp700/dev/pdc.c +++ b/sys/arch/hp700/dev/pdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: pdc.c,v 1.38 2011/01/13 21:15:14 skrll Exp $ */ +/* $NetBSD: pdc.c,v 1.39 2011/04/24 16:26:55 rmind Exp $ */ /* $OpenBSD: pdc.c,v 1.14 2001/04/29 21:05:43 mickey Exp $ */ @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.38 2011/01/13 21:15:14 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.39 2011/04/24 16:26:55 rmind Exp $"); #include #include @@ -262,10 +262,13 @@ pdcopen(dev_t dev, int flag, int mode, struct lwp *l) s = spltty(); - if (sc->sc_tty) + if (sc->sc_tty) { tp = sc->sc_tty; - else - tty_attach(tp = sc->sc_tty = ttymalloc()); + } else { + tp = tty_alloc(); + sc->sc_tty = tp; + tty_attach(tp); + } tp->t_oproc = pdcstart; tp->t_param = pdcparam; diff --git a/sys/arch/hpcmips/tx/txcom.c b/sys/arch/hpcmips/tx/txcom.c index f462af371780..cfd97e20a781 100644 --- a/sys/arch/hpcmips/tx/txcom.c +++ b/sys/arch/hpcmips/tx/txcom.c @@ -1,4 +1,4 @@ -/* $NetBSD: txcom.c,v 1.44 2010/07/20 15:03:53 tsutsui Exp $ */ +/* $NetBSD: txcom.c,v 1.45 2011/04/24 16:26:56 rmind Exp $ */ /*- * Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: txcom.c,v 1.44 2010/07/20 15:03:53 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: txcom.c,v 1.45 2011/04/24 16:26:56 rmind Exp $"); #include "opt_tx39uart_debug.h" @@ -230,7 +230,7 @@ txcom_attach(struct device *parent, struct device *self, void *aux) } memset(sc->sc_rbuf, 0, TXCOM_RING_SIZE); - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = txcomstart; tp->t_param = txcomparam; tp->t_hwiflow = NULL; diff --git a/sys/arch/luna68k/dev/siotty.c b/sys/arch/luna68k/dev/siotty.c index e39ac9b8422e..ba6eeff032be 100644 --- a/sys/arch/luna68k/dev/siotty.c +++ b/sys/arch/luna68k/dev/siotty.c @@ -1,4 +1,4 @@ -/* $NetBSD: siotty.c,v 1.29 2009/11/23 00:11:44 rmind Exp $ */ +/* $NetBSD: siotty.c,v 1.30 2011/04/24 16:26:56 rmind Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.29 2009/11/23 00:11:44 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.30 2011/04/24 16:26:56 rmind Exp $"); #include "opt_ddb.h" @@ -346,9 +346,9 @@ sioopen(dev_t dev, int flag, int mode, struct lwp *l) if (sc == NULL) return ENXIO; if ((tp = sc->sc_tty) == NULL) { - tp = sc->sc_tty = ttymalloc(); + tp = sc->sc_tty = tty_alloc(); tty_attach(tp); - } + } tp->t_oproc = siostart; tp->t_param = sioparam; diff --git a/sys/arch/macppc/dev/ofcons.c b/sys/arch/macppc/dev/ofcons.c index aef04af53c94..38f80188c495 100644 --- a/sys/arch/macppc/dev/ofcons.c +++ b/sys/arch/macppc/dev/ofcons.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofcons.c,v 1.24 2009/03/14 14:46:01 dsl Exp $ */ +/* $NetBSD: ofcons.c,v 1.25 2011/04/24 16:26:56 rmind Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofcons.c,v 1.24 2009/03/14 14:46:01 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofcons.c,v 1.25 2011/04/24 16:26:56 rmind Exp $"); #include #include @@ -129,7 +129,7 @@ ofcopen(dev_t dev, int flag, int mode, struct lwp *l) if (!sc) return ENXIO; if (!(tp = sc->of_tty)) - sc->of_tty = tp = ttymalloc(); + sc->of_tty = tp = tty_alloc(); tp->t_oproc = ofcstart; tp->t_param = ofcparam; tp->t_dev = dev; diff --git a/sys/arch/mips/adm5120/dev/uart.c b/sys/arch/mips/adm5120/dev/uart.c index d495b1c2cff0..f47782bd232d 100644 --- a/sys/arch/mips/adm5120/dev/uart.c +++ b/sys/arch/mips/adm5120/dev/uart.c @@ -1,4 +1,4 @@ -/* $NetBSD: uart.c,v 1.6 2009/11/21 17:40:27 rmind Exp $ */ +/* $NetBSD: uart.c,v 1.7 2011/04/24 16:26:56 rmind Exp $ */ /*- * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uart.c,v 1.6 2009/11/21 17:40:27 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uart.c,v 1.7 2011/04/24 16:26:56 rmind Exp $"); #include #include @@ -145,7 +145,7 @@ uart_attach(struct device *parent, struct device *self, void *aux) maj = cdevsw_lookup_major(&uart_cdevsw); minor = sc->sc_dev.dv_unit; - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = uart_start; tp->t_param = uart_param; sc->sc_tty = tp; diff --git a/sys/arch/mips/sibyte/dev/sbjcn.c b/sys/arch/mips/sibyte/dev/sbjcn.c index 49ccc326fb73..0874e4c59267 100644 --- a/sys/arch/mips/sibyte/dev/sbjcn.c +++ b/sys/arch/mips/sibyte/dev/sbjcn.c @@ -1,4 +1,4 @@ -/* $NetBSD: sbjcn.c,v 1.26 2011/02/01 06:13:08 matt Exp $ */ +/* $NetBSD: sbjcn.c,v 1.27 2011/04/24 16:26:56 rmind Exp $ */ /* * Copyright 2000, 2001 @@ -103,7 +103,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sbjcn.c,v 1.26 2011/02/01 06:13:08 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sbjcn.c,v 1.27 2011/04/24 16:26:56 rmind Exp $"); #define SBJCN_DEBUG @@ -304,7 +304,7 @@ sbjcn_attach_channel(struct sbjcn_softc *sc, int chan, int intr) SET(ch->ch_swflags, TIOCFLAG_SOFTCAR); } - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = sbjcn_start; tp->t_param = sbjcn_param; tp->t_hwiflow = sbjcn_hwiflow; diff --git a/sys/arch/mips/sibyte/dev/sbscn.c b/sys/arch/mips/sibyte/dev/sbscn.c index 8ba2eab5e103..c9732ddb7784 100644 --- a/sys/arch/mips/sibyte/dev/sbscn.c +++ b/sys/arch/mips/sibyte/dev/sbscn.c @@ -1,4 +1,4 @@ -/* $NetBSD: sbscn.c,v 1.34 2011/02/20 07:47:39 matt Exp $ */ +/* $NetBSD: sbscn.c,v 1.35 2011/04/24 16:26:56 rmind Exp $ */ /* * Copyright 2000, 2001 @@ -109,7 +109,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sbscn.c,v 1.34 2011/02/20 07:47:39 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sbscn.c,v 1.35 2011/04/24 16:26:56 rmind Exp $"); #define SBSCN_DEBUG @@ -335,7 +335,7 @@ sbscn_attach_channel(struct sbscn_softc *sc, int chan, int intr) SET(ch->ch_swflags, TIOCFLAG_SOFTCAR); } - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = sbscn_start; tp->t_param = sbscn_param; tp->t_hwiflow = sbscn_hwiflow; diff --git a/sys/arch/sgimips/dev/scn.c b/sys/arch/sgimips/dev/scn.c index a57e71c77656..4555bdddf615 100644 --- a/sys/arch/sgimips/dev/scn.c +++ b/sys/arch/sgimips/dev/scn.c @@ -1,4 +1,4 @@ -/* $NetBSD: scn.c,v 1.2 2009/11/21 17:40:28 rmind Exp $ */ +/* $NetBSD: scn.c,v 1.3 2011/04/24 16:26:57 rmind Exp $ */ /* * Resurrected from the old pc532 port 1/18/2009. @@ -92,7 +92,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: scn.c,v 1.2 2009/11/21 17:40:28 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scn.c,v 1.3 2011/04/24 16:26:57 rmind Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -1081,7 +1081,7 @@ scnopen(dev_t dev, int flags, int mode, struct lwp *l) tp = sc->sc_tty; if (!tp) { - tp = ttymalloc(); + tp = tty_alloc(); sc->sc_tty = sc->sc_duart->chan[sc->sc_channel].tty = tp; tty_attach(tp); } @@ -1191,7 +1191,7 @@ scnclose(dev_t dev, int flags, int mode, struct lwp *l) #if 0 if ((tp->t_state & TS_ISOPEN) == 0) { - ttyfree(tp); + tty_free(tp); sc->sc_tty = (struct tty *) NULL; } #endif diff --git a/sys/arch/sh3/dev/sci.c b/sys/arch/sh3/dev/sci.c index dc88148ddb93..ab142568bd54 100644 --- a/sys/arch/sh3/dev/sci.c +++ b/sys/arch/sh3/dev/sci.c @@ -1,4 +1,4 @@ -/* $NetBSD: sci.c,v 1.52 2009/03/14 15:36:13 dsl Exp $ */ +/* $NetBSD: sci.c,v 1.53 2011/04/24 16:26:57 rmind Exp $ */ /*- * Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu. All rights reserved. @@ -93,7 +93,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sci.c,v 1.52 2009/03/14 15:36:13 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sci.c,v 1.53 2011/04/24 16:26:57 rmind Exp $"); #include "opt_kgdb.h" #include "opt_sci.h" @@ -402,7 +402,7 @@ sci_attach(struct device *parent, struct device *self, void *aux) sc->sc_si = softint_establish(SOFTINT_SERIAL, scisoft, sc); SET(sc->sc_hwflags, SCI_HW_DEV_OK); - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = scistart; tp->t_param = sciparam; tp->t_hwiflow = NULL; diff --git a/sys/arch/sh3/dev/scif.c b/sys/arch/sh3/dev/scif.c index 2383094f83a3..6c32dfb1866a 100644 --- a/sys/arch/sh3/dev/scif.c +++ b/sys/arch/sh3/dev/scif.c @@ -1,4 +1,4 @@ -/* $NetBSD: scif.c,v 1.59 2009/04/05 00:22:53 uwe Exp $ */ +/* $NetBSD: scif.c,v 1.60 2011/04/24 16:26:57 rmind Exp $ */ /*- * Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu. All rights reserved. @@ -93,7 +93,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.59 2009/04/05 00:22:53 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.60 2011/04/24 16:26:57 rmind Exp $"); #include "opt_kgdb.h" #include "opt_scif.h" @@ -480,7 +480,7 @@ scif_attach(device_t parent, device_t self, void *aux) sc->sc_si = softint_establish(SOFTINT_SERIAL, scifsoft, sc); SET(sc->sc_hwflags, SCIF_HW_DEV_OK); - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = scifstart; tp->t_param = scifparam; tp->t_hwiflow = NULL; diff --git a/sys/arch/sparc/dev/kd.c b/sys/arch/sparc/dev/kd.c index 96faafbd9674..242ef3b492a5 100644 --- a/sys/arch/sparc/dev/kd.c +++ b/sys/arch/sparc/dev/kd.c @@ -1,4 +1,4 @@ -/* $NetBSD: kd.c,v 1.48 2008/04/28 20:23:35 martin Exp $ */ +/* $NetBSD: kd.c,v 1.49 2011/04/24 16:26:57 rmind Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.48 2008/04/28 20:23:35 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.49 2011/04/24 16:26:57 rmind Exp $"); #include "opt_kgdb.h" #include "fb.h" @@ -123,7 +123,7 @@ kd_init(struct kd_softc *kd) { struct tty *tp; - tp = ttymalloc(); + tp = tty_alloc(); callout_setfunc(&tp->t_rstrt_ch, kd_later, tp); tp->t_oproc = kdstart; tp->t_param = kdparam; diff --git a/sys/arch/sparc64/dev/kd.c b/sys/arch/sparc64/dev/kd.c index 4fc2a6cb641e..71e56bd3c16c 100644 --- a/sys/arch/sparc64/dev/kd.c +++ b/sys/arch/sparc64/dev/kd.c @@ -1,4 +1,4 @@ -/* $NetBSD: kd.c,v 1.49 2008/04/28 20:23:36 martin Exp $ */ +/* $NetBSD: kd.c,v 1.50 2011/04/24 16:26:57 rmind Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.49 2008/04/28 20:23:36 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.50 2011/04/24 16:26:57 rmind Exp $"); #include #include @@ -119,7 +119,7 @@ kd_init(struct kd_softc *kd) kd = &kd_softc; /* XXX */ - tp = ttymalloc(); + tp = tty_alloc(); callout_setfunc(&tp->t_rstrt_ch, kd_later, tp); tp->t_oproc = kdstart; tp->t_param = kdparam; diff --git a/sys/arch/sparc64/dev/pcons.c b/sys/arch/sparc64/dev/pcons.c index d2a1dab03195..f1f5d059f40c 100644 --- a/sys/arch/sparc64/dev/pcons.c +++ b/sys/arch/sparc64/dev/pcons.c @@ -1,4 +1,4 @@ -/* $NetBSD: pcons.c,v 1.29 2008/06/13 13:10:49 cegger Exp $ */ +/* $NetBSD: pcons.c,v 1.30 2011/04/24 16:26:57 rmind Exp $ */ /*- * Copyright (c) 2000 Eduardo E. Horvath @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pcons.c,v 1.29 2008/06/13 13:10:49 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pcons.c,v 1.30 2011/04/24 16:26:57 rmind Exp $"); #include "opt_ddb.h" @@ -130,7 +130,7 @@ pconsopen(dev_t dev, int flag, int mode, struct lwp *l) if (!sc) return ENXIO; if (!(tp = sc->of_tty)) - sc->of_tty = tp = ttymalloc(); + sc->of_tty = tp = tty_alloc(); tp->t_oproc = pconsstart; tp->t_param = pconsparam; tp->t_dev = dev; diff --git a/sys/arch/sparc64/dev/sab.c b/sys/arch/sparc64/dev/sab.c index 60f0b85cc9ce..6e522957ef5d 100644 --- a/sys/arch/sparc64/dev/sab.c +++ b/sys/arch/sparc64/dev/sab.c @@ -1,4 +1,4 @@ -/* $NetBSD: sab.c,v 1.45 2010/03/11 04:19:56 mrg Exp $ */ +/* $NetBSD: sab.c,v 1.46 2011/04/24 16:26:57 rmind Exp $ */ /* $OpenBSD: sab.c,v 1.7 2002/04/08 17:49:42 jason Exp $ */ /* @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.45 2010/03/11 04:19:56 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.46 2011/04/24 16:26:57 rmind Exp $"); #include "opt_kgdb.h" #include @@ -384,7 +384,7 @@ sabtty_attach(struct device *parent, struct device *self, void *aux) #endif if (!is_kgdb) { - sc->sc_tty = ttymalloc(); + sc->sc_tty = tty_alloc(); if (sc->sc_tty == NULL) { aprint_normal(": failed to allocate tty\n"); return; diff --git a/sys/arch/sun2/dev/kd.c b/sys/arch/sun2/dev/kd.c index 751b54ffd559..11a20ae189ee 100644 --- a/sys/arch/sun2/dev/kd.c +++ b/sys/arch/sun2/dev/kd.c @@ -1,4 +1,4 @@ -/* $NetBSD: kd.c,v 1.21 2008/04/28 20:23:37 martin Exp $ */ +/* $NetBSD: kd.c,v 1.22 2011/04/24 16:26:58 rmind Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.21 2008/04/28 20:23:37 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.22 2011/04/24 16:26:58 rmind Exp $"); #include #include @@ -128,7 +128,7 @@ kd_init(struct kd_softc *kd) kd = &kd_softc; /* XXX */ - tp = ttymalloc(); + tp = tty_alloc(); callout_setfunc(&tp->t_rstrt_ch, kd_later, tp); tp->t_oproc = kdstart; tp->t_param = kdparam; diff --git a/sys/arch/sun2/dev/pcons.c b/sys/arch/sun2/dev/pcons.c index b673b9e07d5f..d9a97995af8a 100644 --- a/sys/arch/sun2/dev/pcons.c +++ b/sys/arch/sun2/dev/pcons.c @@ -1,4 +1,4 @@ -/* $NetBSD: pcons.c,v 1.19 2008/07/06 13:29:50 tsutsui Exp $ */ +/* $NetBSD: pcons.c,v 1.20 2011/04/24 16:26:58 rmind Exp $ */ /*- * Copyright (c) 2000 Eduardo E. Horvath @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pcons.c,v 1.19 2008/07/06 13:29:50 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pcons.c,v 1.20 2011/04/24 16:26:58 rmind Exp $"); #include "opt_ddb.h" @@ -126,7 +126,7 @@ pconsopen(dev_t dev, int flag, int mode, struct lwp *l) if (sc == NULL) return ENXIO; if ((tp = sc->of_tty) == NULL) - sc->of_tty = tp = ttymalloc(); + sc->of_tty = tp = tty_alloc(); tp->t_oproc = pconsstart; tp->t_param = pconsparam; tp->t_dev = dev; diff --git a/sys/arch/sun3/dev/kd.c b/sys/arch/sun3/dev/kd.c index 8b833d024b71..2d27e923858d 100644 --- a/sys/arch/sun3/dev/kd.c +++ b/sys/arch/sun3/dev/kd.c @@ -1,4 +1,4 @@ -/* $NetBSD: kd.c,v 1.55 2008/04/28 20:23:37 martin Exp $ */ +/* $NetBSD: kd.c,v 1.56 2011/04/24 16:26:58 rmind Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.55 2008/04/28 20:23:37 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kd.c,v 1.56 2011/04/24 16:26:58 rmind Exp $"); #include #include @@ -108,7 +108,7 @@ kd_init(struct kd_softc *kd) { struct tty *tp; - tp = ttymalloc(); + tp = tty_alloc(); callout_setfunc(&tp->t_rstrt_ch, kd_later, tp); tp->t_oproc = kdstart; diff --git a/sys/arch/vax/vax/gencons.c b/sys/arch/vax/vax/gencons.c index aeb0a03bc87a..7708ae48d48b 100644 --- a/sys/arch/vax/vax/gencons.c +++ b/sys/arch/vax/vax/gencons.c @@ -1,4 +1,4 @@ -/* $NetBSD: gencons.c,v 1.51 2010/12/14 23:44:49 matt Exp $ */ +/* $NetBSD: gencons.c,v 1.52 2011/04/24 16:26:58 rmind Exp $ */ /* * Copyright (c) 1994 Gordon W. Ross @@ -36,7 +36,7 @@ /* All bugs are subject to removal without further notice */ #include -__KERNEL_RCSID(0, "$NetBSD: gencons.c,v 1.51 2010/12/14 23:44:49 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gencons.c,v 1.52 2011/04/24 16:26:58 rmind Exp $"); #include "opt_ddb.h" #include "opt_cputype.h" @@ -102,7 +102,7 @@ gencnopen(dev_t dev, int flag, int mode, struct lwp *l) return ENXIO; if (gc_softc[unit].gencn_tty == NULL) - gc_softc[unit].gencn_tty = ttymalloc(); + gc_softc[unit].gencn_tty = tty_alloc(); gc_softc[unit].alive = 1; gc_softc[unit].unit = unit; diff --git a/sys/arch/x68k/dev/com.c b/sys/arch/x68k/dev/com.c index 8486fd7ef876..25cb615d53e9 100644 --- a/sys/arch/x68k/dev/com.c +++ b/sys/arch/x68k/dev/com.c @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.56 2009/11/23 00:11:45 rmind Exp $ */ +/* $NetBSD: com.c,v 1.57 2011/04/24 16:26:58 rmind Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.56 2009/11/23 00:11:45 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.57 2011/04/24 16:26:58 rmind Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -393,7 +393,7 @@ comopen(dev_t dev, int flag, int mode, struct lwp *l) return ENXIO; if (!sc->sc_tty) { - tp = sc->sc_tty = ttymalloc(); + tp = sc->sc_tty = tty_alloc(); tty_attach(tp); } else tp = sc->sc_tty; @@ -528,7 +528,7 @@ comclose(dev_t dev, int flag, int mode, struct lwp *l) ttyclose(tp); #ifdef notyet /* XXXX */ if (unit != comconsole) { - ttyfree(tp); + tty_free(tp); sc->sc_tty = 0; } #endif diff --git a/sys/arch/x68k/dev/ite.c b/sys/arch/x68k/dev/ite.c index f4797a9877db..2ee6e025399b 100644 --- a/sys/arch/x68k/dev/ite.c +++ b/sys/arch/x68k/dev/ite.c @@ -1,4 +1,4 @@ -/* $NetBSD: ite.c,v 1.58 2011/02/08 20:20:25 rmind Exp $ */ +/* $NetBSD: ite.c,v 1.59 2011/04/24 16:26:58 rmind Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -45,7 +45,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.58 2011/02/08 20:20:25 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ite.c,v 1.59 2011/04/24 16:26:58 rmind Exp $"); #include "ite.h" #if NITE > 0 @@ -352,7 +352,7 @@ iteopen(dev_t dev, int mode, int devtype, struct lwp *l) if (unit >= ite_cd.cd_ndevs || (ip = getitesp(dev)) == NULL) return (ENXIO); if (!ite_tty[unit]) { - tp = ite_tty[unit] = ttymalloc(); + tp = ite_tty[unit] = tty_alloc(); tty_attach(tp); } else tp = ite_tty[unit]; @@ -396,7 +396,7 @@ iteclose(dev_t dev, int flag, int mode, struct lwp *l) ttyclose(tp); iteoff(dev, 0); #if 0 - ttyfree(tp); + tty_free(tp); ite_tty[UNIT(dev)] = (struct tty *)0; #endif return(0); diff --git a/sys/arch/xen/xen/xencons.c b/sys/arch/xen/xen/xencons.c index 55b52ce1e88d..2fac77b91daf 100644 --- a/sys/arch/xen/xen/xencons.c +++ b/sys/arch/xen/xen/xencons.c @@ -1,4 +1,4 @@ -/* $NetBSD: xencons.c,v 1.35 2009/10/23 02:32:34 snj Exp $ */ +/* $NetBSD: xencons.c,v 1.36 2011/04/24 16:26:51 rmind Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -53,7 +53,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.35 2009/10/23 02:32:34 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.36 2011/04/24 16:26:51 rmind Exp $"); #include "opt_xen.h" @@ -161,7 +161,7 @@ xencons_attach(device_t parent, device_t self, void *aux) aprint_normal(": Xen Virtual Console Driver\n"); sc->sc_dev = self; - sc->sc_tty = ttymalloc(); + sc->sc_tty = tty_alloc(); tty_attach(sc->sc_tty); sc->sc_tty->t_oproc = xencons_start; sc->sc_tty->t_param = xencons_param; @@ -249,7 +249,7 @@ xencons_close(dev_t dev, int flag, int mode, struct lwp *l) (*tp->t_linesw->l_close)(tp, flag); ttyclose(tp); #ifdef notyet /* XXX */ - ttyfree(tp); + tty_free(tp); #endif return (0); } diff --git a/sys/dev/arcbios/arcbios_tty.c b/sys/dev/arcbios/arcbios_tty.c index c0df823df993..3435a15e60bc 100644 --- a/sys/dev/arcbios/arcbios_tty.c +++ b/sys/dev/arcbios/arcbios_tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: arcbios_tty.c,v 1.21 2011/02/20 08:02:46 matt Exp $ */ +/* $NetBSD: arcbios_tty.c,v 1.22 2011/04/24 16:26:59 rmind Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: arcbios_tty.c,v 1.21 2011/02/20 08:02:46 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: arcbios_tty.c,v 1.22 2011/04/24 16:26:59 rmind Exp $"); #include #include @@ -87,7 +87,7 @@ arcbios_ttyopen(dev_t dev, int flag, int mode, struct lwp *l) s = spltty(); if (arcbios_tty[unit] == NULL) { - tp = arcbios_tty[unit] = ttymalloc(); + tp = arcbios_tty[unit] = tty_alloc(); tty_attach(tp); } else tp = arcbios_tty[unit]; diff --git a/sys/dev/dec/dz.c b/sys/dev/dec/dz.c index 5ad189d3b54a..4d9b6d276671 100644 --- a/sys/dev/dec/dz.c +++ b/sys/dev/dec/dz.c @@ -1,4 +1,4 @@ -/* $NetBSD: dz.c,v 1.39 2010/05/09 22:29:26 hans Exp $ */ +/* $NetBSD: dz.c,v 1.40 2011/04/24 16:26:59 rmind Exp $ */ /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dz.c,v 1.39 2010/05/09 22:29:26 hans Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dz.c,v 1.40 2011/04/24 16:26:59 rmind Exp $"); #include #include @@ -209,7 +209,7 @@ dzattach(struct dz_softc *sc, struct evcnt *parent_evcnt, int consline) for (n = 0; n < sc->sc_type; n++) { sc->sc_dz[n].dz_sc = sc; sc->sc_dz[n].dz_line = n; - sc->sc_dz[n].dz_tty = ttymalloc(); + sc->sc_dz[n].dz_tty = tty_alloc(); } evcnt_attach_dynamic(&sc->sc_rintrcnt, EVCNT_TYPE_INTR, parent_evcnt, diff --git a/sys/dev/ic/cd18xx.c b/sys/dev/ic/cd18xx.c index 9f459b9be733..3209986afce8 100644 --- a/sys/dev/ic/cd18xx.c +++ b/sys/dev/ic/cd18xx.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd18xx.c,v 1.27 2009/03/14 15:36:17 dsl Exp $ */ +/* $NetBSD: cd18xx.c,v 1.28 2011/04/24 16:26:59 rmind Exp $ */ /* XXXad does this even compile? */ @@ -94,7 +94,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cd18xx.c,v 1.27 2009/03/14 15:36:17 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd18xx.c,v 1.28 2011/04/24 16:26:59 rmind Exp $"); #include #include @@ -328,7 +328,7 @@ cdtty_attach(struct cd18xx_softc *sc, int port) /* XXX no console or kgdb support yet! */ /* get a tty structure */ - p->p_tty = ttymalloc(); + p->p_tty = tty_alloc(); p->p_tty->t_oproc = cdttystart; p->p_tty->t_param = cdttyparam; p->p_tty->t_hwiflow = cdttyhwiflow; diff --git a/sys/dev/ic/clmpcc.c b/sys/dev/ic/clmpcc.c index 46536fca5e74..5fc04870f0d6 100644 --- a/sys/dev/ic/clmpcc.c +++ b/sys/dev/ic/clmpcc.c @@ -1,4 +1,4 @@ -/* $NetBSD: clmpcc.c,v 1.43 2009/11/23 02:13:46 rmind Exp $ */ +/* $NetBSD: clmpcc.c,v 1.44 2011/04/24 16:26:59 rmind Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: clmpcc.c,v 1.43 2009/11/23 02:13:46 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clmpcc.c,v 1.44 2011/04/24 16:26:59 rmind Exp $"); #include "opt_ddb.h" @@ -288,7 +288,7 @@ clmpcc_attach(struct clmpcc_softc *sc) ch->ch_sc = sc; ch->ch_car = chan; - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = clmpcc_start; tp->t_param = clmpcc_param; diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index 3fb8f7a9d431..0e3af2be6e5f 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.299 2011/01/22 16:59:26 tsutsui Exp $ */ +/* $NetBSD: com.c,v 1.300 2011/04/24 16:26:59 rmind Exp $ */ /*- * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.299 2011/01/22 16:59:26 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.300 2011/04/24 16:26:59 rmind Exp $"); #include "opt_com.h" #include "opt_ddb.h" @@ -501,7 +501,7 @@ fifodelay: fifodone: - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = comstart; tp->t_param = comparam; tp->t_hwiflow = comhwiflow; @@ -670,7 +670,7 @@ com_detach(device_t self, int flags) * Ring buffer allocation failed in the com_attach_subr, * only the tty is allocated, and nothing else. */ - ttyfree(sc->sc_tty); + tty_free(sc->sc_tty); return 0; } @@ -679,7 +679,7 @@ com_detach(device_t self, int flags) /* Detach and free the tty. */ tty_detach(sc->sc_tty); - ttyfree(sc->sc_tty); + tty_free(sc->sc_tty); /* Unhook the soft interrupt handler. */ softint_disestablish(sc->sc_si); diff --git a/sys/dev/ic/cy.c b/sys/dev/ic/cy.c index 604dcbabc9aa..45c48c4a2f2c 100644 --- a/sys/dev/ic/cy.c +++ b/sys/dev/ic/cy.c @@ -1,4 +1,4 @@ -/* $NetBSD: cy.c,v 1.57 2009/11/23 02:13:46 rmind Exp $ */ +/* $NetBSD: cy.c,v 1.58 2011/04/24 16:27:00 rmind Exp $ */ /* * cy.c @@ -16,7 +16,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.57 2009/11/23 02:13:46 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.58 2011/04/24 16:27:00 rmind Exp $"); #include #include @@ -290,7 +290,7 @@ cyopen(dev_t dev, int flag, int mode, struct lwp *l) s = spltty(); if (cy->cy_tty == NULL) { - if ((cy->cy_tty = ttymalloc()) == NULL) { + if ((cy->cy_tty = tty_alloc()) == NULL) { splx(s); aprint_error_dev(sc->sc_dev, "port %d: can't allocate tty\n", diff --git a/sys/dev/ic/z8530tty.c b/sys/dev/ic/z8530tty.c index 14e61a7c6615..a4c3ef46bdb2 100644 --- a/sys/dev/ic/z8530tty.c +++ b/sys/dev/ic/z8530tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: z8530tty.c,v 1.127 2009/05/22 03:51:30 mrg Exp $ */ +/* $NetBSD: z8530tty.c,v 1.128 2011/04/24 16:27:00 rmind Exp $ */ /*- * Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999 @@ -137,7 +137,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.127 2009/05/22 03:51:30 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.128 2011/04/24 16:27:00 rmind Exp $"); #include "opt_kgdb.h" #include "opt_ntp.h" @@ -390,7 +390,7 @@ zstty_attach(device_t parent, device_t self, void *aux) #endif aprint_normal("\n"); - tp = ttymalloc(); + tp = tty_alloc(); tp->t_dev = dev; tp->t_oproc = zsstart; tp->t_param = zsparam; diff --git a/sys/dev/marvell/gtmpsc.c b/sys/dev/marvell/gtmpsc.c index c5bbbbc48622..b68b540e33ce 100644 --- a/sys/dev/marvell/gtmpsc.c +++ b/sys/dev/marvell/gtmpsc.c @@ -1,4 +1,4 @@ -/* $NetBSD: gtmpsc.c,v 1.42 2010/11/14 03:49:53 uebayasi Exp $ */ +/* $NetBSD: gtmpsc.c,v 1.43 2011/04/24 16:27:00 rmind Exp $ */ /* * Copyright (c) 2009 KIYOHARA Takashi * All rights reserved. @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gtmpsc.c,v 1.42 2010/11/14 03:49:53 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gtmpsc.c,v 1.43 2011/04/24 16:27:00 rmind Exp $"); #include "opt_kgdb.h" @@ -328,7 +328,7 @@ gtmpscattach(device_t parent, device_t self, void *aux) gtmpsc_txdesc_init(sc); gtmpsc_rxdesc_init(sc); - sc->sc_tty = tp = ttymalloc(); + sc->sc_tty = tp = tty_alloc(); tp->t_oproc = gtmpscstart; tp->t_param = gtmpscparam; tty_attach(tp); diff --git a/sys/dev/nullcons_subr.c b/sys/dev/nullcons_subr.c index 4f01b361706c..165c195f424c 100644 --- a/sys/dev/nullcons_subr.c +++ b/sys/dev/nullcons_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: nullcons_subr.c,v 1.10 2009/11/23 02:13:45 rmind Exp $ */ +/* $NetBSD: nullcons_subr.c,v 1.11 2011/04/24 16:26:59 rmind Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nullcons_subr.c,v 1.10 2009/11/23 02:13:45 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nullcons_subr.c,v 1.11 2011/04/24 16:26:59 rmind Exp $"); #include #include @@ -160,7 +160,7 @@ nullcons_newdev(struct consdev *cn) /* * Allocate tty (mostly to have sane ioctl()). */ - nulltty = ttymalloc(); + nulltty = tty_alloc(); nulltty->t_dev = makedev(cmajor, 0); tty_attach(nulltty); cn->cn_dev = nulltty->t_dev; diff --git a/sys/dev/ofw/ofcons.c b/sys/dev/ofw/ofcons.c index c5c1c6899da4..a6243af399e0 100644 --- a/sys/dev/ofw/ofcons.c +++ b/sys/dev/ofw/ofcons.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofcons.c,v 1.41 2009/05/29 20:10:39 rjs Exp $ */ +/* $NetBSD: ofcons.c,v 1.42 2011/04/24 16:27:00 rmind Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofcons.c,v 1.41 2009/05/29 20:10:39 rjs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofcons.c,v 1.42 2011/04/24 16:27:00 rmind Exp $"); #include #include @@ -122,7 +122,7 @@ ofcons_open(dev_t dev, int flag, int mode, struct lwp *l) if (!sc) return ENXIO; if (!(tp = sc->of_tty)) - sc->of_tty = tp = ttymalloc(); + sc->of_tty = tp = tty_alloc(); tp->t_oproc = ofcons_start; tp->t_param = ofcons_param; tp->t_dev = dev; diff --git a/sys/dev/pci/cz.c b/sys/dev/pci/cz.c index 02ca42ef359e..9cf794c20fd2 100644 --- a/sys/dev/pci/cz.c +++ b/sys/dev/pci/cz.c @@ -1,4 +1,4 @@ -/* $NetBSD: cz.c,v 1.54 2010/07/26 22:33:24 jym Exp $ */ +/* $NetBSD: cz.c,v 1.55 2011/04/24 16:27:00 rmind Exp $ */ /*- * Copyright (c) 2000 Zembu Labs, Inc. @@ -73,7 +73,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.54 2010/07/26 22:33:24 jym Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.55 2011/04/24 16:27:00 rmind Exp $"); #include #include @@ -412,7 +412,7 @@ cz_attach(device_t parent, device_t self, void *aux) callout_init(&sc->sc_diag_ch, 0); - tp = ttymalloc(); + tp = tty_alloc(); tp->t_dev = makedev(cdevsw_lookup_major(&cz_cdevsw), (device_unit(&cz->cz_dev) * ZFIRM_MAX_CHANNELS) + i); tp->t_oproc = czttystart; diff --git a/sys/dev/qbus/dhu.c b/sys/dev/qbus/dhu.c index 01fee7a712da..1ae051c42545 100644 --- a/sys/dev/qbus/dhu.c +++ b/sys/dev/qbus/dhu.c @@ -1,4 +1,4 @@ -/* $NetBSD: dhu.c,v 1.55 2008/06/11 17:27:59 drochner Exp $ */ +/* $NetBSD: dhu.c,v 1.56 2011/04/24 16:27:00 rmind Exp $ */ /* * Copyright (c) 2003, Hugh Graham. * Copyright (c) 1992, 1993 @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dhu.c,v 1.55 2008/06/11 17:27:59 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dhu.c,v 1.56 2011/04/24 16:27:00 rmind Exp $"); #include #include @@ -287,7 +287,8 @@ dhu_attach(device_t parent, device_t self, void *aux) for (i = 0; i < sc->sc_lines; i++) { struct tty *tp; - tp = sc->sc_dhu[i].dhu_tty = ttymalloc(); + + tp = sc->sc_dhu[i].dhu_tty = tty_alloc(); sc->sc_dhu[i].dhu_state = STATE_IDLE; bus_dmamap_create(sc->sc_dmat, tp->t_outq.c_cn, 1, tp->t_outq.c_cn, 0, BUS_DMA_ALLOCNOW|BUS_DMA_NOWAIT, diff --git a/sys/dev/qbus/dl.c b/sys/dev/qbus/dl.c index 1961a9e46e8a..8a7e9df016c0 100644 --- a/sys/dev/qbus/dl.c +++ b/sys/dev/qbus/dl.c @@ -1,4 +1,4 @@ -/* $NetBSD: dl.c,v 1.45 2009/05/12 14:43:33 cegger Exp $ */ +/* $NetBSD: dl.c,v 1.46 2011/04/24 16:27:00 rmind Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -104,7 +104,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dl.c,v 1.45 2009/05/12 14:43:33 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dl.c,v 1.46 2011/04/24 16:27:00 rmind Exp $"); #include #include @@ -244,7 +244,7 @@ dl_attach (device_t parent, device_t self, void *aux) /* Initialize our softc structure. Should be done in open? */ - sc->sc_tty = ttymalloc(); + sc->sc_tty = tty_alloc(); tty_attach(sc->sc_tty); /* Now register the TX & RX interrupt handlers */ diff --git a/sys/dev/qbus/qd.c b/sys/dev/qbus/qd.c index b8e0d1565532..3aef1e4d6ff9 100644 --- a/sys/dev/qbus/qd.c +++ b/sys/dev/qbus/qd.c @@ -1,4 +1,4 @@ -/* $NetBSD: qd.c,v 1.51 2010/11/13 13:52:10 uebayasi Exp $ */ +/* $NetBSD: qd.c,v 1.52 2011/04/24 16:27:00 rmind Exp $ */ /*- * Copyright (c) 1988 Regents of the University of California. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: qd.c,v 1.51 2010/11/13 13:52:10 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: qd.c,v 1.52 2011/04/24 16:27:00 rmind Exp $"); #include "opt_ddb.h" @@ -826,7 +826,7 @@ qdopen(dev_t dev, int flag, int mode, struct proc *p) /* If not done already, allocate tty structure */ if (qd_tty[minor_dev] == NULL) - qd_tty[minor_dev] = ttymalloc(); + qd_tty[minor_dev] = tty_alloc(); if (qd_tty[minor_dev] == NULL) return ENXIO; diff --git a/sys/dev/sbus/magma.c b/sys/dev/sbus/magma.c index 4ff2a71efd13..b145054b01e5 100644 --- a/sys/dev/sbus/magma.c +++ b/sys/dev/sbus/magma.c @@ -1,4 +1,4 @@ -/* $NetBSD: magma.c,v 1.54 2009/09/17 16:39:48 tsutsui Exp $ */ +/* $NetBSD: magma.c,v 1.55 2011/04/24 16:27:01 rmind Exp $ */ /*- * Copyright (c) 1998 Iain Hibbert @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: magma.c,v 1.54 2009/09/17 16:39:48 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: magma.c,v 1.55 2011/04/24 16:27:01 rmind Exp $"); #if 0 #define MAGMA_DEBUG @@ -842,8 +842,10 @@ mtty_attach(device_t parent, device_t dev, void *args) chan = 1; /* skip channel 0 if parmode */ mp->mp_channel = chan; - tp = ttymalloc(); - if (tp == NULL) break; + tp = tty_alloc(); + if (tp == NULL) { + break; + } tty_attach(tp); tp->t_oproc = mtty_start; tp->t_param = mtty_param; diff --git a/sys/dev/sbus/spif.c b/sys/dev/sbus/spif.c index d45f5740dc8e..b647eceb48f6 100644 --- a/sys/dev/sbus/spif.c +++ b/sys/dev/sbus/spif.c @@ -1,4 +1,4 @@ -/* $NetBSD: spif.c,v 1.25 2009/09/19 11:58:06 tsutsui Exp $ */ +/* $NetBSD: spif.c,v 1.26 2011/04/24 16:27:01 rmind Exp $ */ /* $OpenBSD: spif.c,v 1.12 2003/10/03 16:44:51 miod Exp $ */ /* @@ -41,7 +41,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: spif.c,v 1.25 2009/09/19 11:58:06 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spif.c,v 1.26 2011/04/24 16:27:01 rmind Exp $"); #include "spif.h" #if NSPIF > 0 @@ -288,7 +288,7 @@ stty_attach(device_t parent, device_t dev, void *aux) DTR_WRITE(sc, port, 0); - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = stty_start; tp->t_param = stty_param; diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c index b15b52ddd471..548e503652f3 100644 --- a/sys/dev/usb/ucom.c +++ b/sys/dev/usb/ucom.c @@ -1,4 +1,4 @@ -/* $NetBSD: ucom.c,v 1.86 2010/11/30 15:26:22 bsh Exp $ */ +/* $NetBSD: ucom.c,v 1.87 2011/04/24 16:27:01 rmind Exp $ */ /* * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.86 2010/11/30 15:26:22 bsh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.87 2011/04/24 16:27:01 rmind Exp $"); #include #include @@ -237,7 +237,7 @@ ucom_attach(device_t parent, device_t self, void *aux) sc->sc_si = softint_establish(SOFTINT_NET, ucom_softintr, sc); - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = ucomstart; tp->t_param = ucomparam; tp->t_hwiflow = ucomhwiflow; @@ -305,7 +305,7 @@ ucom_detach(device_t self, int flags) /* Detach and free the tty. */ if (tp != NULL) { tty_detach(tp); - ttyfree(tp); + tty_free(tp); sc->sc_tty = NULL; } diff --git a/sys/dev/usb/ucycom.c b/sys/dev/usb/ucycom.c index 66ad474f28d9..1b8a5681fbec 100644 --- a/sys/dev/usb/ucycom.c +++ b/sys/dev/usb/ucycom.c @@ -1,4 +1,4 @@ -/* $NetBSD: ucycom.c,v 1.32 2010/11/15 06:01:07 uebayasi Exp $ */ +/* $NetBSD: ucycom.c,v 1.33 2011/04/24 16:27:01 rmind Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ucycom.c,v 1.32 2010/11/15 06:01:07 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ucycom.c,v 1.33 2011/04/24 16:27:01 rmind Exp $"); #include #include @@ -212,7 +212,7 @@ ucycom_attach(device_t parent, device_t self, void *aux) sc->sc_msr = sc->sc_mcr = 0; /* set up tty */ - sc->sc_tty = ttymalloc(); + sc->sc_tty = tty_alloc(); sc->sc_tty->t_sc = sc; sc->sc_tty->t_oproc = ucycomstart; sc->sc_tty->t_param = ucycomparam; @@ -263,7 +263,7 @@ ucycom_detach(device_t self, int flags) if (tp != NULL) { DPRINTF(("ucycom_detach: tty_detach %p\n", tp)); tty_detach(tp); - ttyfree(tp); + tty_free(tp); sc->sc_tty = NULL; } diff --git a/sys/dev/usb/uhso.c b/sys/dev/usb/uhso.c index 8e7db160e452..c3d5e3e4eb26 100644 --- a/sys/dev/usb/uhso.c +++ b/sys/dev/usb/uhso.c @@ -1,4 +1,4 @@ -/* $NetBSD: uhso.c,v 1.4 2011/03/16 21:36:55 plunky Exp $ */ +/* $NetBSD: uhso.c,v 1.5 2011/04/24 16:27:01 rmind Exp $ */ /*- * Copyright (c) 2009 Iain Hibbert @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.4 2011/03/16 21:36:55 plunky Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.5 2011/04/24 16:27:01 rmind Exp $"); #include "opt_inet.h" @@ -1323,7 +1323,7 @@ uhso_tty_attach(struct uhso_port *hp) { struct tty *tp; - tp = ttymalloc(); + tp = tty_alloc(); tp->t_oproc = uhso_tty_start; tp->t_param = uhso_tty_param; @@ -1342,7 +1342,7 @@ uhso_tty_detach(struct uhso_port *hp) uhso_tty_clean(hp); tty_detach(hp->hp_tp); - ttyfree(hp->hp_tp); + tty_free(hp->hp_tp); hp->hp_tp = NULL; } diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index b941e1ee25dc..3a69954e7000 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay.c,v 1.133 2010/04/11 14:04:10 drochner Exp $ */ +/* $NetBSD: wsdisplay.c,v 1.134 2011/04/24 16:27:01 rmind Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.133 2010/04/11 14:04:10 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.134 2011/04/24 16:27:01 rmind Exp $"); #include "opt_wsdisplay_compat.h" #include "opt_wsmsgattrs.h" @@ -289,7 +289,7 @@ wsscreen_attach(struct wsdisplay_softc *sc, int console, const char *emul, scr->scr_dconf = dconf; - scr->scr_tty = ttymalloc(); + scr->scr_tty = tty_alloc(); tty_attach(scr->scr_tty); scr->scr_hold_screen = 0; if (WSSCREEN_HAS_EMULATOR(scr)) @@ -312,7 +312,7 @@ wsscreen_detach(struct wsscreen *scr) if (WSSCREEN_HAS_TTY(scr)) { tty_detach(scr->scr_tty); - ttyfree(scr->scr_tty); + tty_free(scr->scr_tty); } if (WSSCREEN_HAS_EMULATOR(scr)) { (*scr->scr_dconf->wsemul->detach)(scr->scr_dconf->wsemulcookie, diff --git a/sys/kern/tty.c b/sys/kern/tty.c index dc1111ddb7d3..914303bc2dc1 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: tty.c,v 1.243 2011/04/09 06:34:06 martin Exp $ */ +/* $NetBSD: tty.c,v 1.244 2011/04/24 16:26:51 rmind Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.243 2011/04/09 06:34:06 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.244 2011/04/24 16:26:51 rmind Exp $"); #include #include @@ -2637,10 +2637,10 @@ ttysleep(struct tty *tp, kcondvar_t *cv, bool catch, int timo) * This should be called ONLY once per real tty (including pty's). * eg, on the sparc, the keyboard and mouse have struct tty's that are * distinctly NOT usable as tty's, and thus should not be attached to - * the ttylist. This is why this call is not done from ttymalloc(). + * the ttylist. This is why this call is not done from tty_alloc(). * * Device drivers should attach tty's at a similar time that they are - * ttymalloc()'ed, or, for the case of statically allocated struct tty's + * allocated, or, for the case of statically allocated struct tty's * either in the attach or (first) open routine. */ void @@ -2674,10 +2674,10 @@ tty_detach(struct tty *tp) * Allocate a tty structure and its associated buffers. */ struct tty * -ttymalloc(void) +tty_alloc(void) { - struct tty *tp; - int i; + struct tty *tp; + int i; tp = kmem_zalloc(sizeof(*tp), KM_SLEEP); callout_init(&tp->t_rstrt_ch, 0); @@ -2698,9 +2698,11 @@ ttymalloc(void) tp->t_dev = NODEV; selinit(&tp->t_rsel); selinit(&tp->t_wsel); - for (i = 0; i < TTYSIG_COUNT; i++) + for (i = 0; i < TTYSIG_COUNT; i++) { sigemptyset(&tp->t_sigs[i]); - return (tp); + } + + return tp; } /* @@ -2710,7 +2712,7 @@ ttymalloc(void) * tty_attach()ed. */ void -ttyfree(struct tty *tp) +tty_free(struct tty *tp) { int i; diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 236a22c67f24..54495d604801 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -1,4 +1,4 @@ -/* $NetBSD: tty_pty.c,v 1.127 2011/04/09 12:07:06 martin Exp $ */ +/* $NetBSD: tty_pty.c,v 1.128 2011/04/24 16:26:51 rmind Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.127 2011/04/09 12:07:06 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.128 2011/04/24 16:26:51 rmind Exp $"); #include "opt_ptm.h" @@ -248,7 +248,7 @@ pty_check(int ptn) selinit(&pti->pt_selr); selinit(&pti->pt_selw); - pti->pt_tty = ttymalloc(); + pti->pt_tty = tty_alloc(); mutex_enter(&pt_softc_mutex); @@ -258,7 +258,7 @@ pty_check(int ptn) */ if (pt_softc[ptn]) { mutex_exit(&pt_softc_mutex); - ttyfree(pti->pt_tty); + tty_free(pti->pt_tty); seldestroy(&pti->pt_selr); seldestroy(&pti->pt_selw); kmem_free(pti, sizeof(*pti)); diff --git a/sys/sys/tty.h b/sys/sys/tty.h index d0f328018cde..6ea14f7ebeec 100644 --- a/sys/sys/tty.h +++ b/sys/sys/tty.h @@ -1,4 +1,4 @@ -/* $NetBSD: tty.h,v 1.86 2009/01/22 20:40:20 drochner Exp $ */ +/* $NetBSD: tty.h,v 1.87 2011/04/24 16:26:52 rmind Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -289,8 +289,8 @@ void tty_attach(struct tty *); void tty_detach(struct tty *); void tty_init(void); struct tty - *ttymalloc(void); -void ttyfree(struct tty *); + *tty_alloc(void); +void tty_free(struct tty *); u_char *firstc(struct clist *, int *); bool ttypull(struct tty *);