forked from Imagelibrary/rtems
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:
@@ -34,11 +34,12 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <dev/serial/zynq-uart.h>
|
|
||||||
#include <dev/serial/zynq-uart-regs.h>
|
#include <dev/serial/zynq-uart-regs.h>
|
||||||
|
|
||||||
#include <bspopts.h>
|
#include <bspopts.h>
|
||||||
|
|
||||||
|
#include <rtems/dev/io.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make weak and let the user override.
|
* 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)
|
void zynq_uart_write_char_polled(volatile zynq_uart *regs, char c)
|
||||||
{
|
{
|
||||||
while ((regs->channel_sts & ZYNQ_UART_CHANNEL_STS_TNFUL) != 0) {
|
while ((regs->channel_sts & ZYNQ_UART_CHANNEL_STS_TNFUL) != 0) {
|
||||||
/* Wait */
|
_IO_Relax();
|
||||||
}
|
}
|
||||||
|
|
||||||
regs->tx_rx_fifo = ZYNQ_UART_TX_RX_FIFO_FIFO(c);
|
regs->tx_rx_fifo = ZYNQ_UART_TX_RX_FIFO_FIFO(c);
|
||||||
|
|||||||
Reference in New Issue
Block a user