Deleted Added
full compact
tty.c (192827) tty.c (193018)
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

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

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
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

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

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/kern/tty.c 192827 2009-05-26 18:33:36Z ed $");
31__FBSDID("$FreeBSD: head/sys/kern/tty.c 193018 2009-05-29 06:41:23Z ed $");
32
33#include "opt_compat.h"
34
35#include <sys/param.h>
36#include <sys/conf.h>
37#include <sys/cons.h>
38#include <sys/fcntl.h>
39#include <sys/file.h>

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

880
881/*
882 * TTY allocation and deallocation. TTY devices can be deallocated when
883 * the driver doesn't use it anymore, when the TTY isn't a session's
884 * controlling TTY and when the device node isn't opened through devfs.
885 */
886
887struct tty *
32
33#include "opt_compat.h"
34
35#include <sys/param.h>
36#include <sys/conf.h>
37#include <sys/cons.h>
38#include <sys/fcntl.h>
39#include <sys/file.h>

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

880
881/*
882 * TTY allocation and deallocation. TTY devices can be deallocated when
883 * the driver doesn't use it anymore, when the TTY isn't a session's
884 * controlling TTY and when the device node isn't opened through devfs.
885 */
886
887struct tty *
888tty_alloc(struct ttydevsw *tsw, void *sc, struct mtx *mutex)
888tty_alloc(struct ttydevsw *tsw, void *sc)
889{
889{
890
891 return (tty_alloc_mutex(tsw, sc, NULL));
892}
893
894struct tty *
895tty_alloc_mutex(struct ttydevsw *tsw, void *sc, struct mtx *mutex)
896{
890 struct tty *tp;
891
892 /* Make sure the driver defines all routines. */
893#define PATCH_FUNC(x) do { \
894 if (tsw->tsw_ ## x == NULL) \
895 tsw->tsw_ ## x = ttydevsw_def ## x; \
896} while (0)
897 PATCH_FUNC(open);

--- 1184 unchanged lines hidden ---
897 struct tty *tp;
898
899 /* Make sure the driver defines all routines. */
900#define PATCH_FUNC(x) do { \
901 if (tsw->tsw_ ## x == NULL) \
902 tsw->tsw_ ## x = ttydevsw_def ## x; \
903} while (0)
904 PATCH_FUNC(open);

--- 1184 unchanged lines hidden ---