From 3e738661108fb2a8e3474c6336c2a5c2668f82b6 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sat, 21 Jan 2017 14:18:37 -0500 Subject: Add CPU mode asserts to kernel on blocking functions. This scourge finds it's way back in far too often. Right now, only defined for ARM. Have fun! Change-Id: Ib21be09ebf71dec10dc652a7a664779251f49644 --- firmware/kernel/semaphore.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'firmware/kernel/semaphore.c') diff --git a/firmware/kernel/semaphore.c b/firmware/kernel/semaphore.c index 5e9e46798f..6b58fa3d8a 100644 --- a/firmware/kernel/semaphore.c +++ b/firmware/kernel/semaphore.c @@ -57,6 +57,8 @@ int semaphore_wait(struct semaphore *s, int timeout) } else if(timeout != 0) { + ASSERT_CPU_MODE(CPU_MODE_THREAD_CONTEXT, oldlevel); + /* too many waits - block until count is upped... */ struct thread_entry *current = __running_self_entry(); -- cgit v1.2.3