[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 41/47] serial: update LSR on enabling/disabling FIFOs
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 41/47] serial: update LSR on enabling/disabling FIFOs |
Date: |
Mon, 15 Dec 2014 17:38:25 +0100 |
When the transmit FIFO is emptied or enabled, the transmitter
hold register is empty. When it is disabled, it is also emptied and
in addition the previous contents of the transmitter hold register
are discarded. In either case, the THRE bit in LSR must be set and
THRI raised.
When the receive FIFO is emptied or enabled, the data ready and break
bits must be cleared in LSR. Likewise when the receive FIFO is disabled.
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/char/serial.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/char/serial.c b/hw/char/serial.c
index 9adb126..76054a5 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -377,12 +377,15 @@ static void serial_ioport_write(void *opaque, hwaddr
addr, uint64_t val,
/* FIFO clear */
if (val & UART_FCR_RFR) {
+ s->lsr &= ~(UART_LSR_DR | UART_LSR_BI);
timer_del(s->fifo_timeout_timer);
s->timeout_ipending = 0;
fifo8_reset(&s->recv_fifo);
}
if (val & UART_FCR_XFR) {
+ s->lsr |= UART_LSR_THRE;
+ s->thr_ipending = 1;
fifo8_reset(&s->xmit_fifo);
}
--
1.8.3.1
- [Qemu-devel] [PULL 32/47] i386: do not cross the pages boundaries in replay mode, (continued)
- [Qemu-devel] [PULL 32/47] i386: do not cross the pages boundaries in replay mode, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 34/47] target-i386: add VME to all CPUs, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 33/47] pc: add 2.3 machine types, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 35/47] target-i386: add f16c and rdrand to Haswell and Broadwell, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 36/47] target-i386: add Ivy Bridge CPU model, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 38/47] linuxboot: fix loading old kernels, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 37/47] kvm/apic: fix 2.2->2.1 migration, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 39/47] serial: reset thri_pending on IER writes with THRI=0, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 40/47] serial: clean up THRE/TEMT handling, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 42/47] serial: only resample THR interrupt on rising edge of IER.THRI, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 41/47] serial: update LSR on enabling/disabling FIFOs,
Paolo Bonzini <=
- [Qemu-devel] [PULL 43/47] sdhci: Set a default frequency clock, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 44/47] sdhci: Remove class "virtual" methods, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 45/47] sdhci: Add "sysbus" to sdhci QOM types and methods, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 46/47] sdhci: Define SDHCI PCI ids, Paolo Bonzini, 2014/12/15
- [Qemu-devel] [PULL 47/47] sdhci: Support SDHCI devices on PCI, Paolo Bonzini, 2014/12/15
- Re: [Qemu-devel] [PULL 00/47] Patches for KVM, x86, SCSI, migration fixes (2014-12-15), Peter Maydell, 2014/12/16