Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102803168
D31025.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
736 B
Referenced Files
None
Subscribers
None
D31025.diff
View Options
diff --git a/sys/riscv/sifive/sifive_uart.c b/sys/riscv/sifive/sifive_uart.c
--- a/sys/riscv/sifive/sifive_uart.c
+++ b/sys/riscv/sifive/sifive_uart.c
@@ -137,9 +137,15 @@
static int
sfuart_rxready(struct uart_bas *bas)
{
-
- return ((uart_getreg(bas, SFUART_RXDATA) &
- SFUART_RXDATA_EMPTY) == 0);
+ /*
+ * Unfortunately the FIFO empty flag is in the FIFO data register so
+ * reading it would dequeue the character. Instead, rely on the fact
+ * we've configured the watermark to be 0 and that interrupts are off
+ * when using the low-level console function, and read the interrupt
+ * pending state instead.
+ */
+ return ((uart_getreg(bas, SFUART_IRQ_PENDING) &
+ SFUART_IRQ_PENDING_RXQM) != 0);
}
static int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 9:29 AM (21 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14695381
Default Alt Text
D31025.diff (736 B)
Attached To
Mode
D31025: sifive_uart: Fix input character dropping in ddb and at a mountroot prompt
Attached
Detach File
Event Timeline
Log In to Comment