diff options
author | Vic (Chun-Ju) Yang <victoryang@chromium.org> | 2014-01-06 15:11:20 +0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-01-06 12:40:51 +0000 |
commit | a0cb64374a629dbaf0415b0abbbb7882c46fe80b (patch) | |
tree | dcda285fecdafbec045f021a789eb62ec1d3acc4 /core | |
parent | cdcaf6ed8a1d18bdedb72fb665263c0dbff0ac8e (diff) | |
download | chrome-ec-a0cb64374a629dbaf0415b0abbbb7882c46fe80b.tar.gz |
Process emulator UART events in interrupt context
Currently emulator UART input/output are processed in various context,
including UART thread, individual tasks, and tests. By moving the
processing to interrupt context, the way it works resemble real chips
more. Also, this provides a cleaner cut between emulated UART device and
UART processing code.
BUG=chrome-os-partner:23804
TEST=make buildall
BRANCH=None
Change-Id: I58127e66f4058a68d37be9029e9ddbbd798381c6
Signed-off-by: Vic (Chun-Ju) Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/181590
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/host/task.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/host/task.c b/core/host/task.c index 23d16bd802..bb4b073997 100644 --- a/core/host/task.c +++ b/core/host/task.c @@ -13,6 +13,7 @@ #include "atomic.h" #include "common.h" +#include "console.h" #include "task.h" #include "task_id.h" #include "test_util.h" @@ -35,6 +36,7 @@ static struct emu_task_t tasks[TASK_ID_COUNT]; static pthread_cond_t scheduler_cond; static pthread_mutex_t run_lock; static task_id_t running_task_id; +static int task_started; static sem_t interrupt_sem; static pthread_mutex_t interrupt_lock; @@ -280,11 +282,18 @@ static int fast_forward(void) } } +int task_start_called(void) +{ + return task_started; +} + void task_scheduler(void) { int i; timestamp_t now; + task_started = 1; + while (1) { now = get_time(); i = TASK_ID_COUNT - 1; |