From f96f176c303a73973d7cf5ddf1abf86f534a6e39 Mon Sep 17 00:00:00 2001 From: Dawid Niedzwiecki Date: Fri, 6 Nov 2020 09:20:56 +0100 Subject: task_set_event: remove the wait argument There is an option in the task_set_event function which force the calling task to wait for an event. However, the option is never used thus remove it. This also will help in the Zephyr migration process. BUG=b:172360521 BRANCH=none TEST=make buildall Signed-off-by: Dawid Niedzwiecki Change-Id: Ic152fd3d6862d487bcc0024c48d136556c0b81bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521599 Reviewed-by: Jett Rink Reviewed-by: Tom Hughes Reviewed-by: Jack Rosenthal Commit-Queue: Jack Rosenthal --- core/riscv-rv32i/task.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'core/riscv-rv32i') diff --git a/core/riscv-rv32i/task.c b/core/riscv-rv32i/task.c index e39e854a3e..eef46efce7 100644 --- a/core/riscv-rv32i/task.c +++ b/core/riscv-rv32i/task.c @@ -410,7 +410,19 @@ static uint32_t __ram_code __wait_evt(int timeout_us, task_id_t resched) return evt; } -uint32_t __ram_code task_set_event(task_id_t tskid, uint32_t event, int wait) +/* TODO: Remove the remove_me function. + * At the moment "make BOARD=it8xxx2_evb" returns an error + * "relocation truncated to fit" without it. + */ +uint32_t __ram_code remove_me(task_id_t tskid) +{ + task_ *receiver = __task_id_to_ptr(tskid); + + ASSERT(receiver); + return 0; +} + +uint32_t __ram_code task_set_event(task_id_t tskid, uint32_t event) { task_ *receiver = __task_id_to_ptr(tskid); @@ -426,10 +438,7 @@ uint32_t __ram_code task_set_event(task_id_t tskid, uint32_t event, int wait) if (start_called) need_resched = 1; } else { - if (wait) - return __wait_evt(-1, tskid); - else - __schedule(0, tskid, 0); + __schedule(0, tskid, 0); } return 0; @@ -594,7 +603,7 @@ void __ram_code mutex_unlock(struct mutex *mtx) waiters &= ~BIT(id); /* Somebody is waiting on the mutex */ - task_set_event(id, TASK_EVENT_MUTEX, 0); + task_set_event(id, TASK_EVENT_MUTEX); } /* Ensure no event is remaining from mutex wake-up */ -- cgit v1.2.1