diff options
author | Peter Crosthwaite <peter.crosthwaite@xilinx.com> | 2013-06-03 15:13:27 +1000 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2013-06-11 23:45:44 +0400 |
commit | 8e8638fa87ff045f5dadec7342301bf10de776ff (patch) | |
tree | c02babfaffd0aa27782ad301625c6e35a6514bd3 /include/hw | |
parent | 7f4f0a227fe0b24c35d0898f9ae7d5909fb51137 (diff) | |
download | qemu-8e8638fa87ff045f5dadec7342301bf10de776ff.zip |
char/serial: Use generic Fifo8
Use the generic Fifo8 helper provided by QEMU, rather than re-implement
privately.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/char/serial.h | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h index bca79f17b5..9ab81f6321 100644 --- a/include/hw/char/serial.h +++ b/include/hw/char/serial.h @@ -28,17 +28,10 @@ #include "hw/hw.h" #include "sysemu/sysemu.h" #include "exec/memory.h" +#include "qemu/fifo8.h" #define UART_FIFO_LENGTH 16 /* 16550A Fifo Length */ -typedef struct SerialFIFO { - uint8_t data[UART_FIFO_LENGTH]; - uint8_t count; - uint8_t itl; /* Interrupt Trigger Level */ - uint8_t tail; - uint8_t head; -} SerialFIFO; - struct SerialState { uint16_t divider; uint8_t rbr; /* receive register */ @@ -67,8 +60,10 @@ struct SerialState { /* Time when the last byte was successfully sent out of the tsr */ uint64_t last_xmit_ts; - SerialFIFO recv_fifo; - SerialFIFO xmit_fifo; + Fifo8 recv_fifo; + Fifo8 xmit_fifo; + /* Interrupt trigger level for recv_fifo */ + uint8_t recv_fifo_itl; struct QEMUTimer *fifo_timeout_timer; int timeout_ipending; /* timeout interrupt pending state */ |