tty.c (ce3fa4d5cfb00a586783847744282707bb3282f9) tty.c (d8b0556c6dcaf4c506039f86af2b52b29524f89e)
1/*-
2 * Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Portions of this software were developed under sponsorship from Snow
6 * B.V., the Netherlands.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 919 unchanged lines hidden (view full) ---

928 /* Allow drivers to use a custom mutex to lock the TTY. */
929 if (mutex != NULL) {
930 tp->t_mtx = mutex;
931 } else {
932 tp->t_mtx = &tp->t_mtxobj;
933 mtx_init(&tp->t_mtxobj, "ttymtx", NULL, MTX_DEF);
934 }
935
1/*-
2 * Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Portions of this software were developed under sponsorship from Snow
6 * B.V., the Netherlands.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 919 unchanged lines hidden (view full) ---

928 /* Allow drivers to use a custom mutex to lock the TTY. */
929 if (mutex != NULL) {
930 tp->t_mtx = mutex;
931 } else {
932 tp->t_mtx = &tp->t_mtxobj;
933 mtx_init(&tp->t_mtxobj, "ttymtx", NULL, MTX_DEF);
934 }
935
936 knlist_init(&tp->t_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
937 knlist_init(&tp->t_outpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
936 knlist_init_mtx(&tp->t_inpoll.si_note, tp->t_mtx);
937 knlist_init_mtx(&tp->t_outpoll.si_note, tp->t_mtx);
938
939 sx_xlock(&tty_list_sx);
940 TAILQ_INSERT_TAIL(&tty_list, tp, t_list);
941 tty_list_count++;
942 sx_xunlock(&tty_list_sx);
943
944 return (tp);
945}

--- 1155 unchanged lines hidden ---
938
939 sx_xlock(&tty_list_sx);
940 TAILQ_INSERT_TAIL(&tty_list, tp, t_list);
941 tty_list_count++;
942 sx_xunlock(&tty_list_sx);
943
944 return (tp);
945}

--- 1155 unchanged lines hidden ---