Deleted Added
full compact
kern_cons.c (53334) kern_cons.c (55823)
1/*
2 * Copyright (c) 1988 University of Utah.
3 * Copyright (c) 1991 The Regents of the University of California.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * the Systems Programming Group of the University of Utah Computer
8 * Science Department.

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * from: @(#)cons.c 7.2 (Berkeley) 5/9/91
1/*
2 * Copyright (c) 1988 University of Utah.
3 * Copyright (c) 1991 The Regents of the University of California.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * the Systems Programming Group of the University of Utah Computer
8 * Science Department.

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * from: @(#)cons.c 7.2 (Berkeley) 5/9/91
39 * $FreeBSD: head/sys/kern/tty_cons.c 53334 1999-11-18 06:37:00Z peter $
39 * $FreeBSD: head/sys/kern/tty_cons.c 55823 2000-01-11 14:54:01Z yokota $
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/conf.h>
45#include <sys/kernel.h>
46#include <sys/reboot.h>
47#include <sys/sysctl.h>

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

92static u_char cn_is_open; /* nonzero if logical console is open */
93static int openmode, openflag; /* how /dev/console was openned */
94static u_char cn_phys_is_open; /* nonzero if physical device is open */
95static d_close_t *cn_phys_close; /* physical device close function */
96static d_open_t *cn_phys_open; /* physical device open function */
97struct consdev *cn_tab; /* physical console device info */
98static dev_t condev_t; /* represents the device private info */
99
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/conf.h>
45#include <sys/kernel.h>
46#include <sys/reboot.h>
47#include <sys/sysctl.h>

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

92static u_char cn_is_open; /* nonzero if logical console is open */
93static int openmode, openflag; /* how /dev/console was openned */
94static u_char cn_phys_is_open; /* nonzero if physical device is open */
95static d_close_t *cn_phys_close; /* physical device close function */
96static d_open_t *cn_phys_open; /* physical device open function */
97struct consdev *cn_tab; /* physical console device info */
98static dev_t condev_t; /* represents the device private info */
99
100CONS_DRIVER(cons, NULL, NULL, NULL, NULL, NULL, NULL);
100CONS_DRIVER(cons, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
101
102void
103cninit()
104{
105 struct consdev **list, *best_cp, *cp;
106
107 /*
108 * Find the first console with the highest priority.

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

418 return;
419 if (c) {
420 if (c == '\n')
421 (*cn_tab->cn_putc)(cn_tab->cn_dev, '\r');
422 (*cn_tab->cn_putc)(cn_tab->cn_dev, c);
423 }
424}
425
101
102void
103cninit()
104{
105 struct consdev **list, *best_cp, *cp;
106
107 /*
108 * Find the first console with the highest priority.

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

418 return;
419 if (c) {
420 if (c == '\n')
421 (*cn_tab->cn_putc)(cn_tab->cn_dev, '\r');
422 (*cn_tab->cn_putc)(cn_tab->cn_dev, c);
423 }
424}
425
426void
427cndbctl(on)
428 int on;
429{
430 static int refcount;
431
432 if (cn_tab == NULL)
433 return;
434 if (!on)
435 refcount--;
436 if (refcount == 0 && cn_tab->cn_dbctl != NULL)
437 (*cn_tab->cn_dbctl)(cn_tab->cn_dev, on);
438 if (on)
439 refcount++;
440}
441
426static void
427cn_drvinit(void *unused)
428{
429
430 condev_t = make_dev (&cn_cdevsw, 0,
431 UID_ROOT, GID_WHEEL, 0600, "console");
432}
433
434SYSINIT(cndev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,cn_drvinit,NULL)
435
436
442static void
443cn_drvinit(void *unused)
444{
445
446 condev_t = make_dev (&cn_cdevsw, 0,
447 UID_ROOT, GID_WHEEL, 0600, "console");
448}
449
450SYSINIT(cndev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,cn_drvinit,NULL)
451
452