From owner-p4-projects@FreeBSD.ORG Tue Jul 15 03:32:39 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C926837B404; Tue, 15 Jul 2003 03:32:38 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 527C137B401 for ; Tue, 15 Jul 2003 03:32:38 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C7B0943FCB for ; Tue, 15 Jul 2003 03:32:37 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h6FAWb0U061331 for ; Tue, 15 Jul 2003 03:32:37 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h6FAWbPx061328 for perforce@freebsd.org; Tue, 15 Jul 2003 03:32:37 -0700 (PDT) Date: Tue, 15 Jul 2003 03:32:37 -0700 (PDT) Message-Id: <200307151032.h6FAWbPx061328@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 34540 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 10:32:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=34540 Change 34540 by marcel@marcel_nfs on 2003/07/15 03:31:52 Delay calling makedev() until after we called make_dev(). That way we can use MAJOR_AUTO even though we can be the console. While here, obsolete uart_tty.h. It only contains three prototypes now, which is not worth a seperate header file. Affected files ... .. //depot/projects/uart/dev/uart/uart_bus.h#5 edit .. //depot/projects/uart/dev/uart/uart_core.c#6 edit .. //depot/projects/uart/dev/uart/uart_cpu.h#2 edit .. //depot/projects/uart/dev/uart/uart_tty.c#4 edit Differences ... ==== //depot/projects/uart/dev/uart/uart_bus.h#5 (text+ko) ==== @@ -107,6 +107,10 @@ int uart_bus_detach(device_t dev); int uart_bus_probe(device_t dev, int regshft, int rclk, int rid); +int uart_tty_attach(struct uart_softc *); +int uart_tty_detach(struct uart_softc *); +void uart_tty_intr(void *arg); + static __inline int uart_rx_put(struct uart_softc *sc, int xc) { ==== //depot/projects/uart/dev/uart/uart_core.c#6 (text+ko) ==== @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -45,13 +44,9 @@ #include #include #include -#include #include "uart_if.h" -extern struct uart_devinfo uart_console; -extern struct uart_devinfo uart_dbgport; - devclass_t uart_devclass; char uart_driver_name[] = "uart"; @@ -299,8 +294,6 @@ sep = ""; device_print_prettyname(dev); if (sc->sc_console) { - ((struct consdev *)uart_console.consdev)->cn_dev = - makedev(UART_CDEV_MAJOR, device_get_unit(dev)); printf("%sconsole", sep); sep = ", "; } ==== //depot/projects/uart/dev/uart/uart_cpu.h#2 (text+ko) ==== @@ -66,6 +66,9 @@ void *consdev; /* Yedi trick. See uart_cons.c */ }; +extern struct uart_devinfo uart_console; +extern struct uart_devinfo uart_dbgport; + #define UART_DEV_CONSOLE 0 #define UART_DEV_DBGPORT 1 ==== //depot/projects/uart/dev/uart/uart_tty.c#4 (text+ko) ==== @@ -36,13 +36,14 @@ #include #include #include +#include #include #include #include #include #include -#include +#include #define CALLOUT_MASK 0x80 #define CONTROL_MASK 0x60 @@ -61,7 +62,7 @@ .d_ioctl = uart_ioctl, .d_poll = ttypoll, .d_name = uart_driver_name, - .d_maj = UART_CDEV_MAJOR, + .d_maj = MAJOR_AUTO, .d_flags = D_TTY, .d_kqfilter = ttykqfilter, }; @@ -169,6 +170,11 @@ tp->t_dev = sc->sc_si; + if (sc->sc_console) { + ((struct consdev *)uart_console.consdev)->cn_dev = + makedev(uart_cdevsw.d_maj, device_get_unit(sc->sc_dev)); + } + swi_add(&tty_ithd, uart_driver_name, uart_tty_intr, sc, SWI_TTY, INTR_TYPE_TTY, &sc->sc_softih);