PERFORCE change 150389 for review

Ed Schouten ed at FreeBSD.org
Wed Sep 24 17:14:11 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=150389

Change 150389 by ed at ed_dull on 2008/09/24 17:13:16

	Print baud rates in debugging output.

Affected files ...

.. //depot/projects/mpsafetty/sys/kern/tty.c#48 edit

Differences ...

==== //depot/projects/mpsafetty/sys/kern/tty.c#48 (text+ko) ====

@@ -1820,6 +1820,16 @@
 	DB_PRINTSYM(close, th->th_close);
 }
 
+static void
+_db_show_termios(const char *name, const struct termios *t)
+{
+
+	db_printf("%s: iflag 0x%x oflag 0x%x cflag 0x%x "
+	    "lflag 0x%x ispeed %u ospeed %u\n", name,
+	    t->c_iflag, t->c_oflag, t->c_cflag, t->c_lflag,
+	    t->c_ispeed, t->c_ospeed);
+}
+
 /* DDB command to show TTY statistics. */
 DB_SHOW_COMMAND(tty, db_show_tty)
 {
@@ -1846,9 +1856,7 @@
 	    tp->t_outq.to_nblocks, tp->t_outq.to_quota);
 	db_printf("\tinlow: %zu\n", tp->t_inlow);
 	db_printf("\toutlow: %zu\n", tp->t_outlow);
-	db_printf("\ttermios: iflag 0x%x oflag 0x%x cflag 0x%x lflag 0x%x\n",
-	    tp->t_termios.c_iflag, tp->t_termios.c_oflag, tp->t_termios.c_cflag,
-	    tp->t_termios.c_lflag);
+	_db_show_termios("\ttermios", &tp->t_termios);
 	db_printf("\twinsize: row %u col %u xpixel %u ypixel %u\n",
 	    tp->t_winsize.ws_row, tp->t_winsize.ws_col,
 	    tp->t_winsize.ws_xpixel, tp->t_winsize.ws_ypixel);
@@ -1857,22 +1865,10 @@
 	db_printf("\tcompatflags: 0x%x\n", tp->t_compatflags);
 
 	/* Init/lock-state devices. */
-	db_printf("\ttermios_init_in: iflag 0x%x oflag 0x%x cflag 0x%x lflag "
-	    "0x%x\n", tp->t_termios_init_in.c_iflag,
-	    tp->t_termios_init_in.c_oflag, tp->t_termios_init_in.c_cflag,
-	    tp->t_termios_init_in.c_lflag);
-	db_printf("\ttermios_init_out: iflag 0x%x oflag 0x%x cflag 0x%x lflag "
-	    "0x%x\n", tp->t_termios_init_out.c_iflag,
-	    tp->t_termios_init_out.c_oflag, tp->t_termios_init_out.c_cflag,
-	    tp->t_termios_init_out.c_lflag);
-	db_printf("\ttermios_lock_in: iflag 0x%x oflag 0x%x cflag 0x%x lflag "
-	    "0x%x\n", tp->t_termios_lock_in.c_iflag,
-	    tp->t_termios_lock_in.c_oflag, tp->t_termios_lock_in.c_cflag,
-	    tp->t_termios_lock_in.c_lflag);
-	db_printf("\ttermios_lock_out: iflag 0x%x oflag 0x%x cflag 0x%x lflag "
-	    "0x%x\n", tp->t_termios_lock_out.c_iflag,
-	    tp->t_termios_lock_out.c_oflag, tp->t_termios_lock_out.c_cflag,
-	    tp->t_termios_lock_out.c_lflag);
+	_db_show_termios("\ttermios_init_in", &tp->t_termios_init_in);
+	_db_show_termios("\ttermios_init_out", &tp->t_termios_init_out);
+	_db_show_termios("\ttermios_lock_in", &tp->t_termios_lock_in);
+	_db_show_termios("\ttermios_lock_out", &tp->t_termios_lock_out);
 
 	/* Hooks */
 	_db_show_devsw("\t", tp->t_devsw);


More information about the p4-projects mailing list