summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic (Chun-Ju) Yang <victoryang@chromium.org>2014-01-07 12:22:10 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-01-09 05:30:42 +0000
commit28de8c96b92815139d8589a5c2cf145c4a5785ee (patch)
tree514e75bac1e37bac62ada26e7df5b3b565466b1f
parentfee92f1202e3bb100db298c735dade5c464df9ce (diff)
downloadchrome-ec-28de8c96b92815139d8589a5c2cf145c4a5785ee.tar.gz
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 <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/181722 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--chip/host/uart.c5
1 files changed, 1 insertions, 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;