mirror of
https://github.com/ipxe/ipxe
synced 2026-01-23 12:38:58 +03:00
[riscv] Add fences around early UART writes
Add a fence between the write to the UART transmit register and the subsequent read from the transmit status register, to ensure that the status correctly reflects the occurrence of the write. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -204,6 +204,7 @@ early_uart_reg_base_64_done_\@:
|
||||
.macro print_char_uart_8250
|
||||
early_uart_reg_base a7
|
||||
sb a0, EARLY_UART_8250_TX(a7)
|
||||
fence
|
||||
early_uart_8250_wait_\@:
|
||||
lbu a1, EARLY_UART_8250_LSR(a7)
|
||||
andi a1, a1, EARLY_UART_8250_LSR_THRE
|
||||
@@ -236,6 +237,7 @@ early_uart_8250_wait_\@:
|
||||
.macro print_char_uart_sifive
|
||||
early_uart_reg_base a7
|
||||
sw a0, EARLY_UART_SIFIVE_TXFIFO(a7)
|
||||
fence
|
||||
early_uart_sifive_wait_\@:
|
||||
lw a1, EARLY_UART_SIFIVE_TXFIFO(a7)
|
||||
bltz a1, early_uart_sifive_wait_\@
|
||||
|
||||
Reference in New Issue
Block a user