qemu/include/hw/char
Evgeny Iakovlev 9d88935cb1 hw/char/pl011: refactor FIFO depth handling code
PL011 can be in either of 2 modes depending guest config: FIFO and
single register. The last mode could be viewed as a 1-element-deep FIFO.

Current code open-codes a bunch of depth-dependent logic. Refactor FIFO
depth handling code to isolate calculating current FIFO depth.

One functional (albeit guest-invisible) side-effect of this change is
that previously we would always increment s->read_pos in UARTDR read
handler even if FIFO was disabled, now we are limiting read_pos to not
exceed FIFO depth (read_pos itself is reset to 0 if user disables FIFO).

Signed-off-by: Evgeny Iakovlev <eiakovlev@linux.microsoft.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20230123162304.26254-2-eiakovlev@linux.microsoft.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2023-02-03 12:59:21 +00:00
..
avr_usart.h hw: Remove superfluous includes of hw/hw.h 2021-05-02 17:24:50 +02:00
bcm2835_aux.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
cadence_uart.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
cmsdk-apb-uart.h include: Include headers where needed 2023-01-08 01:54:22 -05:00
digic-uart.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
escc.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
goldfish_tty.h include: Include headers where needed 2023-01-08 01:54:22 -05:00
ibex_uart.h hw/char/ibex_uart: Make the register layout private 2021-06-24 05:00:12 -07:00
imx_serial.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
mchp_pfsoc_mmuart.h hw/char/mchp_pfsoc_mmuart: QOM'ify PolarFire MMUART 2021-10-07 08:41:33 +10:00
nrf51_uart.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
parallel.h Include exec/memory.h slightly less 2019-08-16 13:31:52 +02:00
pl011.h hw/char/pl011: refactor FIFO depth handling code 2023-02-03 12:59:21 +00:00
renesas_sci.h Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
riscv_htif.h hw/riscv: spike: Decouple create_fdt() dependency to ELF loading 2023-01-20 10:14:13 +10:00
serial.h hw/char/serial: Make 'wakeup' property boolean 2020-09-30 19:09:20 +02:00
shakti_uart.h hw/char: Add Shakti UART emulation 2021-05-11 20:02:05 +10:00
sifive_uart.h hw/char: QOMify sifive_uart 2021-06-24 05:00:12 -07:00
stm32f2xx_usart.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
xilinx_uartlite.h include: Include headers where needed 2023-01-08 01:54:22 -05:00