diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2017-01-21 14:18:37 -0500 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2017-01-21 14:25:52 -0500 |
commit | 3e738661108fb2a8e3474c6336c2a5c2668f82b6 (patch) | |
tree | c3c7bc51c4329ab6652fd2550a241a56bbafda1f /firmware/kernel/mrsw_lock.c | |
parent | da464572318a34f4791ccb419acbf0a470b810e6 (diff) | |
download | rockbox-3e738661108fb2a8e3474c6336c2a5c2668f82b6.tar.gz rockbox-3e738661108fb2a8e3474c6336c2a5c2668f82b6.zip |
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
Diffstat (limited to 'firmware/kernel/mrsw_lock.c')
-rw-r--r-- | firmware/kernel/mrsw_lock.c | 4 |
1 files changed, 4 insertions, 0 deletions
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) | |||
159 | * access recursively. The current writer is ignored and gets access. */ | 159 | * access recursively. The current writer is ignored and gets access. */ |
160 | void mrsw_read_acquire(struct mrsw_lock *mrsw) | 160 | void mrsw_read_acquire(struct mrsw_lock *mrsw) |
161 | { | 161 | { |
162 | ASSERT_CPU_MODE(CPU_MODE_THREAD_CONTEXT); | ||
163 | |||
162 | struct thread_entry *current = __running_self_entry(); | 164 | struct thread_entry *current = __running_self_entry(); |
163 | 165 | ||
164 | if (current == mrsw->splay.blocker.thread IF_PRIO( && mrsw->count < 0 )) | 166 | if (current == mrsw->splay.blocker.thread IF_PRIO( && mrsw->count < 0 )) |
@@ -268,6 +270,8 @@ void mrsw_read_release(struct mrsw_lock *mrsw) | |||
268 | * safely call recursively. */ | 270 | * safely call recursively. */ |
269 | void mrsw_write_acquire(struct mrsw_lock *mrsw) | 271 | void mrsw_write_acquire(struct mrsw_lock *mrsw) |
270 | { | 272 | { |
273 | ASSERT_CPU_MODE(CPU_MODE_THREAD_CONTEXT); | ||
274 | |||
271 | struct thread_entry *current = __running_self_entry(); | 275 | struct thread_entry *current = __running_self_entry(); |
272 | 276 | ||
273 | if (current == mrsw->splay.blocker.thread) | 277 | if (current == mrsw->splay.blocker.thread) |