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/mutex.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'firmware/kernel/mutex.c') diff --git a/firmware/kernel/mutex.c b/firmware/kernel/mutex.c index cb9e6816b8..b1ae3e9e54 100644 --- a/firmware/kernel/mutex.c +++ b/firmware/kernel/mutex.c @@ -39,6 +39,8 @@ void mutex_init(struct mutex *m) /* Gain ownership of a mutex object or block until it becomes free */ void mutex_lock(struct mutex *m) { + ASSERT_CPU_MODE(CPU_MODE_THREAD_CONTEXT); + struct thread_entry *current = __running_self_entry(); if(current == m->blocker.thread) -- cgit v1.2.3