From c47740eca17a2fe652b7bb13f5b2949687884e79 Mon Sep 17 00:00:00 2001 From: Yuval Peress Date: Mon, 2 Nov 2020 12:11:11 -0700 Subject: 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 Change-Id: Ia7ad2b8d7d411a11699353bf5d3cc36a261fad14 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2511720 --- core/host/task.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core') 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; -- cgit v1.2.1