Lines Matching defs:chr
184 CharDriverState *chr;
1125 static int console_puts(CharDriverState *chr, const uint8_t *buf, int len)
1127 QEMUConsole *s = chr->opaque;
1147 static void console_send_event(CharDriverState *chr, int event)
1149 QEMUConsole *s = chr->opaque;
1168 len = qemu_chr_can_read(s->chr);
1175 qemu_chr_read(s->chr, buf, len);
1224 console_puts(s->chr, (const uint8_t *) "\r", 1);
1230 console_puts(s->chr, buf, q - buf);
1232 if (s->chr->chr_read) {
1489 static void text_console_set_echo(CharDriverState *chr, bool echo)
1491 QEMUConsole *s = chr->opaque;
1496 static void text_console_do_init(CharDriverState *chr, DisplayState *ds)
1501 s = chr->opaque;
1503 chr->chr_write = console_puts;
1504 chr->chr_send_event = console_send_event;
1541 if (chr->label) {
1546 len = snprintf(msg, sizeof(msg), "%s console\r\n", chr->label);
1547 console_puts(chr, (uint8_t*)msg, len);
1551 qemu_chr_generic_open(chr);
1552 if (chr->init)
1553 chr->init(chr);
1558 CharDriverState *chr;
1563 chr = g_malloc0(sizeof(CharDriverState));
1569 text_consoles[n_text_consoles] = chr;
1587 free(chr);
1591 s->chr = chr;
1594 chr->opaque = s;
1595 chr->chr_set_echo = text_console_set_echo;
1596 return chr;