Browse Source
Merge pull request #2048 from hdinc/patch-1
ns16550.cc : fix handling clear rx/tx FIFO requests.
pull/2049/head
Andrew Waterman
9 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
4 deletions
-
riscv/ns16550.cc
|
|
@ -93,8 +93,8 @@ void ns16550_t::update_interrupt(void) |
|
|
uint8_t interrupts = 0; |
|
|
uint8_t interrupts = 0; |
|
|
|
|
|
|
|
|
/* Handle clear rx */ |
|
|
/* Handle clear rx */ |
|
|
if (lcr & UART_FCR_CLEAR_RCVR) { |
|
|
if (fcr & UART_FCR_CLEAR_RCVR) { |
|
|
lcr &= ~UART_FCR_CLEAR_RCVR; |
|
|
fcr &= ~UART_FCR_CLEAR_RCVR; |
|
|
while (!rx_queue.empty()) { |
|
|
while (!rx_queue.empty()) { |
|
|
rx_queue.pop(); |
|
|
rx_queue.pop(); |
|
|
} |
|
|
} |
|
|
@ -102,8 +102,8 @@ void ns16550_t::update_interrupt(void) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* Handle clear tx */ |
|
|
/* Handle clear tx */ |
|
|
if (lcr & UART_FCR_CLEAR_XMIT) { |
|
|
if (fcr & UART_FCR_CLEAR_XMIT) { |
|
|
lcr &= ~UART_FCR_CLEAR_XMIT; |
|
|
fcr &= ~UART_FCR_CLEAR_XMIT; |
|
|
lsr |= UART_LSR_TEMT | UART_LSR_THRE; |
|
|
lsr |= UART_LSR_TEMT | UART_LSR_THRE; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|