diff options
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 2d28aa82..164eed79 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. |