Merge "Removes extra nesting around LOCK blocks"

GitOrigin-RevId: ced5b4310539398d3425b43fe0b66e35ad5d73b2
This commit is contained in:
Matt Harvey 2021-10-06 01:05:52 +00:00 committed by Sam Leffler
parent 31946b70ed
commit 61fbe78415

View File

@ -180,7 +180,6 @@ int read_read(size_t limit) {
char *const cursor_limit = cursor_begin + limit;
LOCK(rx_mutex);
{
while (circular_buffer_empty(&rx_buf)) {
UNLOCK(rx_mutex);
seL4_Assert(rx_semaphore_wait() == 0);
@ -193,7 +192,6 @@ int read_read(size_t limit) {
}
++cursor;
}
}
UNLOCK(rx_mutex);
int num_read = cursor - cursor_begin;
@ -216,7 +214,6 @@ int write_write(size_t available) {
while (cursor < cursor_limit) {
LOCK(tx_mutex);
{
if (circular_buffer_remaining(&tx_buf) == 0) {
break;
}
@ -226,7 +223,6 @@ int write_write(size_t available) {
break;
}
}
}
UNLOCK(tx_mutex);
}
@ -300,7 +296,6 @@ void tx_empty_handle(void) {
fill_tx_fifo();
LOCK(tx_mutex);
{
if (circular_buffer_empty(&tx_buf)) {
// Clears INTR_STATE for tx_empty. (INTR_STATE is write-1-to-clear.) We
// only do this if tx_buf is empty, since the TX FIFO might have become
@ -309,6 +304,5 @@ void tx_empty_handle(void) {
REG(INTR_STATE) = BIT(UART_INTR_STATE_TX_EMPTY);
}
seL4_Assert(tx_empty_acknowledge() == 0);
}
UNLOCK(tx_mutex);
}