From 28de8c96b92815139d8589a5c2cf145c4a5785ee Mon Sep 17 00:00:00 2001 From: "Vic (Chun-Ju) Yang" Date: Tue, 7 Jan 2014 12:22:10 +0800 Subject: Remove old TODO comment in emulator UART module Now that we handle all UART input from interrupt context, we shouldn't need to guard input buffer with mutex lock. Removing the stale TODO comment and adding an assertion to ensure this argument is correct. BUG=chrome-os-partner:23804 TEST=make buildall BRANCH=None Change-Id: If61eed4329a782b80fe8b16667bddaae8464620d Signed-off-by: Vic (Chun-Ju) Yang Reviewed-on: https://chromium-review.googlesource.com/181722 Reviewed-by: Vincent Palatin Reviewed-by: Randall Spangler --- chip/host/uart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/chip/host/uart.c b/chip/host/uart.c index b39232833b..3721ea9c78 100644 --- a/chip/host/uart.c +++ b/chip/host/uart.c @@ -24,10 +24,6 @@ static int init_done; static pthread_t input_thread; #define INPUT_BUFFER_SIZE 16 -/* - * TODO(crosbug.com/p/23804): Guard these data with mutex lock when we have - * interrupt support. - */ static int char_available; static char cached_char_buf[INPUT_BUFFER_SIZE]; static struct queue cached_char = { @@ -130,6 +126,7 @@ void uart_write_char(char c) int uart_read_char(void) { char ret; + ASSERT(in_interrupt_context()); queue_remove_unit(&cached_char, &ret); --char_available; return ret; -- cgit v1.2.1