Deleted Added
full compact
kern_cons.c (111119) kern_cons.c (111194)
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 111119 2003-02-19 05:47:46Z imp $
39 * $FreeBSD: head/sys/kern/tty_cons.c 111194 2003-02-20 20:54:45Z phk $
40 */
41
42#include "opt_ddb.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/conf.h>
47#include <sys/cons.h>

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

524 struct cn_device *cnd;
525 struct consdev *cn;
526 int c;
527
528 if (cn_mute)
529 return (-1);
530 STAILQ_FOREACH(cnd, &cn_devlist, cnd_next) {
531 cn = cnd->cnd_cn;
40 */
41
42#include "opt_ddb.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/conf.h>
47#include <sys/cons.h>

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

524 struct cn_device *cnd;
525 struct consdev *cn;
526 int c;
527
528 if (cn_mute)
529 return (-1);
530 STAILQ_FOREACH(cnd, &cn_devlist, cnd_next) {
531 cn = cnd->cnd_cn;
532 c = cn->cn_checkc(cn->cn_dev);
532 c = cn->cn_checkc(cn);
533 if (c != -1) {
534 return (c);
535 }
536 }
537 return (-1);
538}
539
540void
541cnputc(int c)
542{
543 struct cn_device *cnd;
544 struct consdev *cn;
545 char *cp;
546
547 if (cn_mute || c == '\0')
548 return;
549 STAILQ_FOREACH(cnd, &cn_devlist, cnd_next) {
550 cn = cnd->cnd_cn;
551 if (c == '\n')
533 if (c != -1) {
534 return (c);
535 }
536 }
537 return (-1);
538}
539
540void
541cnputc(int c)
542{
543 struct cn_device *cnd;
544 struct consdev *cn;
545 char *cp;
546
547 if (cn_mute || c == '\0')
548 return;
549 STAILQ_FOREACH(cnd, &cn_devlist, cnd_next) {
550 cn = cnd->cnd_cn;
551 if (c == '\n')
552 cn->cn_putc(cn->cn_dev, '\r');
553 cn->cn_putc(cn->cn_dev, c);
552 cn->cn_putc(cn, '\r');
553 cn->cn_putc(cn, c);
554 }
555#ifdef DDB
556 if (console_pausing && !db_active && (c == '\n')) {
557#else
558 if (console_pausing && (c == '\n')) {
559#endif
560 for (cp = console_pausestr; *cp != '\0'; cp++)
561 cnputc(*cp);

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

576 static int refcount;
577
578 if (!on)
579 refcount--;
580 if (refcount == 0)
581 STAILQ_FOREACH(cnd, &cn_devlist, cnd_next) {
582 cn = cnd->cnd_cn;
583 if (cn->cn_dbctl != NULL)
554 }
555#ifdef DDB
556 if (console_pausing && !db_active && (c == '\n')) {
557#else
558 if (console_pausing && (c == '\n')) {
559#endif
560 for (cp = console_pausestr; *cp != '\0'; cp++)
561 cnputc(*cp);

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

576 static int refcount;
577
578 if (!on)
579 refcount--;
580 if (refcount == 0)
581 STAILQ_FOREACH(cnd, &cn_devlist, cnd_next) {
582 cn = cnd->cnd_cn;
583 if (cn->cn_dbctl != NULL)
584 cn->cn_dbctl(cn->cn_dev, on);
584 cn->cn_dbctl(cn, on);
585 }
586 if (on)
587 refcount++;
588}
589
590static void
591cn_drvinit(void *unused)
592{
593
594 make_dev(&cn_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
595 "console");
596}
597
598SYSINIT(cndev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,cn_drvinit,NULL)
585 }
586 if (on)
587 refcount++;
588}
589
590static void
591cn_drvinit(void *unused)
592{
593
594 make_dev(&cn_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
595 "console");
596}
597
598SYSINIT(cndev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,cn_drvinit,NULL)