summaryrefslogtreecommitdiff
path: root/core/host/task.c
diff options
context:
space:
mode:
authorYuval Peress <peress@chromium.org>2020-11-02 12:11:11 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-08 19:31:12 +0000
commitc47740eca17a2fe652b7bb13f5b2949687884e79 (patch)
treee8efbfdac3fc0f01520e0997560f0095297d4b79 /core/host/task.c
parent25ae7edffcceb662d5d2ebe92d19bf6f191d8bd5 (diff)
downloadchrome-ec-c47740eca17a2fe652b7bb13f5b2949687884e79.tar.gz
Zephyr: add more compliant implementation for irq_(un)lock
This change replaces the stubbed irq_(un)lock static functions defined in task.h with new functions that behave more like the Zephyr implementation of irq_(un)lock functions. This should make the migration from interrupt_(dis|en)able to Zephyr more seamless. BRANCH=none BUG=b:172060699 TEST=Added unit tests, make runtests -j, and built for various boards: eve, volteer, arcada_ish, atlas, hatch, kohaku, nocturne, samus, and scarlet Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Ia7ad2b8d7d411a11699353bf5d3cc36a261fad14 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2511720
Diffstat (limited to 'core/host/task.c')
-rw-r--r--core/host/task.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/host/task.c b/core/host/task.c
index 6b3ff31a81..d6227384e1 100644
--- a/core/host/task.c
+++ b/core/host/task.c
@@ -124,14 +124,14 @@ int in_interrupt_context(void)
return !!in_interrupt;
}
-void interrupt_disable(void)
+test_mockable void interrupt_disable(void)
{
pthread_mutex_lock(&interrupt_lock);
interrupt_disabled = 1;
pthread_mutex_unlock(&interrupt_lock);
}
-void interrupt_enable(void)
+test_mockable void interrupt_enable(void)
{
pthread_mutex_lock(&interrupt_lock);
interrupt_disabled = 0;