diff options
author | Richard Braun <rbraun@sceen.net> | 2017-09-06 20:42:42 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-09-06 20:42:42 +0200 |
commit | 4a9e56baddebd6b0f2c145d6cdb4425680c8a185 (patch) | |
tree | 63e7156634da1944d8eb10ddefb08d8968644319 /kern/thread.h | |
parent | 76161a62dd157ec9c7692098356a439b408ced60 (diff) |
Use new thread_check_intr_context function consistently
Diffstat (limited to 'kern/thread.h')
-rw-r--r-- | kern/thread.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/kern/thread.h b/kern/thread.h index 2d28aa8..164eed7 100644 --- a/kern/thread.h +++ b/kern/thread.h @@ -642,6 +642,14 @@ thread_interrupted(void) return (thread_self()->intr != 0); } +static inline bool +thread_check_intr_context(void) +{ + return thread_interrupted() + && !cpu_intr_enabled() + && !thread_preempt_enabled(); +} + static inline void thread_intr_enter(void) { @@ -673,15 +681,6 @@ thread_intr_leave(void) } } -/* TODO Use in interrupt handlers instead of manual interrupt/preemption checks */ -static inline void -thread_assert_interrupted(void) -{ - assert(thread_interrupted()); - assert(!cpu_intr_enabled()); - assert(!thread_preempt_enabled()); -} - /* * Lockless synchronization read-side critical section nesting counter * control functions. |