From e7a8352354a1542ac0d7135c3704654e15c96020 Mon Sep 17 00:00:00 2001 From: Liming Wang Date: Fri, 12 Aug 2011 22:59:29 +0800 Subject: [PATCH] kvm tools: unify all serials' registers with the first serial To make all serials work well, unify value of the last three serials' registers with the first serial. Otherwise, using ttyS1, ttyS2, ttyS3 as console will slow the output. Signed-off-by: Liming Wang Signed-off-by: Pekka Enberg --- tools/kvm/hw/serial.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/kvm/hw/serial.c b/tools/kvm/hw/serial.c index 1199264e12e2..f817a4ee8a2a 100644 --- a/tools/kvm/hw/serial.c +++ b/tools/kvm/hw/serial.c @@ -31,6 +31,12 @@ struct serial8250_device { u8 scr; }; +#define SERIAL_REGS_SETTING \ + .iir = UART_IIR_NO_INT, \ + .lsr = UART_LSR_TEMT | UART_LSR_THRE, \ + .msr = UART_MSR_DCD | UART_MSR_DSR | UART_MSR_CTS, \ + .mcr = UART_MCR_OUT2, + static struct serial8250_device devices[] = { /* ttyS0 */ [0] = { @@ -39,10 +45,7 @@ static struct serial8250_device devices[] = { .iobase = 0x3f8, .irq = 4, - .iir = UART_IIR_NO_INT, - .lsr = UART_LSR_TEMT | UART_LSR_THRE, - .msr = UART_MSR_DCD | UART_MSR_DSR | UART_MSR_CTS, - .mcr = UART_MCR_OUT2, + SERIAL_REGS_SETTING }, /* ttyS1 */ [1] = { @@ -51,7 +54,7 @@ static struct serial8250_device devices[] = { .iobase = 0x2f8, .irq = 3, - .iir = UART_IIR_NO_INT, + SERIAL_REGS_SETTING }, /* ttyS2 */ [2] = { @@ -60,7 +63,7 @@ static struct serial8250_device devices[] = { .iobase = 0x3e8, .irq = 4, - .iir = UART_IIR_NO_INT, + SERIAL_REGS_SETTING }, /* ttyS3 */ [3] = { @@ -69,7 +72,7 @@ static struct serial8250_device devices[] = { .iobase = 0x2e8, .irq = 3, - .iir = UART_IIR_NO_INT, + SERIAL_REGS_SETTING }, }; -- 2.39.5