diff options
author | Richard Braun <rbraun@sceen.net> | 2017-03-19 13:32:54 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-03-19 13:32:54 +0100 |
commit | 5fd6d6e12599ae5d17f3f7d4f4c3012bb56f8fab (patch) | |
tree | 3b2a36566edd4afc7c1dbe3a1707f886277b6dc1 /kern/thread.h | |
parent | 7d670538290125c1d100bbcf43700343f9c11332 (diff) |
kern/thread: new thread_assert_interrupted function
Diffstat (limited to 'kern/thread.h')
-rw-r--r-- | kern/thread.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kern/thread.h b/kern/thread.h index 486d6fae..c7f68f14 100644 --- a/kern/thread.h +++ b/kern/thread.h @@ -43,6 +43,7 @@ #include <kern/spinlock_types.h> #include <kern/turnstile_types.h> #include <machine/atomic.h> +#include <machine/cpu.h> #include <machine/tcb.h> /* @@ -642,6 +643,14 @@ thread_intr_leave(void) } } +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. |