X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/0a7de7458d150b5d4dffc935ba399be265ef0a1a..HEAD:/osfmk/console/serial_general.c?ds=sidebyside diff --git a/osfmk/console/serial_general.c b/osfmk/console/serial_general.c index fb2d0d6c5..34ba2b4e4 100644 --- a/osfmk/console/serial_general.c +++ b/osfmk/console/serial_general.c @@ -72,9 +72,9 @@ serial_keyboard_start(void) { /* Go see if there are any characters pending now */ serial_keyboard_poll(); - panic("serial_keyboard_start: we can't get back here\n"); } +__dead2 void serial_keyboard_poll(void) { @@ -113,8 +113,13 @@ switch_to_video_console(void) int switch_to_serial_console(void) { + extern bool serial_console_enabled; int old_cons_ops = cons_ops_index; - cons_ops_index = SERIAL_CONS_OPS; + + if (serial_console_enabled) { + cons_ops_index = SERIAL_CONS_OPS; + } + return old_cons_ops; } @@ -156,7 +161,7 @@ console_printbuf_putc(int ch, void * arg) struct console_printbuf_state * info = (struct console_printbuf_state *)arg; info->total += 1; if (info->pos < (SERIAL_CONS_BUF_SIZE - 1)) { - info->str[info->pos] = ch; + info->str[info->pos] = (char)ch; info->pos += 1; } else { /* @@ -168,7 +173,7 @@ console_printbuf_putc(int ch, void * arg) info->str[info->pos] = '\0'; console_write(info->str, info->pos); info->pos = 0; - info->str[info->pos] = ch; + info->str[info->pos] = (char)ch; info->pos += 1; } }