dev/serial: Use _IO_Relax()

This reduces the system bus load while waiting for a state change.  In
addition, it simplifies testing by using a wrapped _IO_Relax().
This commit is contained in:
Sebastian Huber
2024-08-30 09:29:00 +02:00
parent 7be49773c0
commit a078b091c1

View File

@@ -34,11 +34,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <dev/serial/zynq-uart.h>
#include <dev/serial/zynq-uart-regs.h>
#include <bspopts.h>
#include <rtems/dev/io.h>
/*
* Make weak and let the user override.
*/
@@ -165,7 +166,7 @@ int zynq_uart_read_char_polled(volatile zynq_uart *regs)
void zynq_uart_write_char_polled(volatile zynq_uart *regs, char c)
{
while ((regs->channel_sts & ZYNQ_UART_CHANNEL_STS_TNFUL) != 0) {
/* Wait */
_IO_Relax();
}
regs->tx_rx_fifo = ZYNQ_UART_TX_RX_FIFO_FIFO(c);