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/mrsw_lock.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'firmware/kernel/mrsw_lock.c') diff --git a/firmware/kernel/mrsw_lock.c b/firmware/kernel/mrsw_lock.c index b683f63d5f..6120666d05 100644 --- a/firmware/kernel/mrsw_lock.c +++ b/firmware/kernel/mrsw_lock.c @@ -159,6 +159,8 @@ void mrsw_init(struct mrsw_lock *mrsw) * access recursively. The current writer is ignored and gets access. */ void mrsw_read_acquire(struct mrsw_lock *mrsw) { + ASSERT_CPU_MODE(CPU_MODE_THREAD_CONTEXT); + struct thread_entry *current = __running_self_entry(); if (current == mrsw->splay.blocker.thread IF_PRIO( && mrsw->count < 0 )) @@ -268,6 +270,8 @@ void mrsw_read_release(struct mrsw_lock *mrsw) * safely call recursively. */ void mrsw_write_acquire(struct mrsw_lock *mrsw) { + ASSERT_CPU_MODE(CPU_MODE_THREAD_CONTEXT); + struct thread_entry *current = __running_self_entry(); if (current == mrsw->splay.blocker.thread) -- cgit v1.2.3