diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-02-19 00:58:00 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-02-19 00:58:00 +0100 |
commit | 8a49b0fd609ca347dbc8400af139c2b5e188f159 (patch) | |
tree | 6c149153698898d026332accad91b9e97827b625 /kern | |
parent | 83bb0f42038f12beb9f2a31a8ef3f7ff75938681 (diff) | |
download | gnumach-8a49b0fd609ca347dbc8400af139c2b5e188f159.tar.gz gnumach-8a49b0fd609ca347dbc8400af139c2b5e188f159.tar.bz2 gnumach-8a49b0fd609ca347dbc8400af139c2b5e188f159.zip |
Introduce and use assert_splsched()
Diffstat (limited to 'kern')
-rw-r--r-- | kern/sched.h | 4 | ||||
-rw-r--r-- | kern/sched_prim.c | 4 | ||||
-rw-r--r-- | kern/thread.h | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/kern/sched.h b/kern/sched.h index 35747f19..d7e74d3a 100644 --- a/kern/sched.h +++ b/kern/sched.h @@ -77,11 +77,11 @@ typedef struct run_queue *run_queue_t; /* Shall be taken at splsched only */ #ifdef MACH_LDEBUG #define runq_lock(rq) do { \ - assert(splsched() == SPL7); \ + assert_splsched(); \ simple_lock_nocheck(&(rq)->lock); \ } while (0) #define runq_unlock(rq) do { \ - assert(splsched() == SPL7); \ + assert_splsched(); \ simple_unlock_nocheck(&(rq)->lock); \ } while (0) #else diff --git a/kern/sched_prim.c b/kern/sched_prim.c index 28792194..24f342fb 100644 --- a/kern/sched_prim.c +++ b/kern/sched_prim.c @@ -134,11 +134,11 @@ queue_head_t wait_queue[NUMQUEUES]; #ifdef MACH_LDEBUG #define waitq_lock(wl) do { \ - assert(splsched() == SPL7); \ + assert_splsched(); \ simple_lock_nocheck(wl); \ } while (0) #define waitq_unlock(wl) do { \ - assert(splsched() == SPL7); \ + assert_splsched(); \ simple_unlock_nocheck(wl); \ } while (0) #else diff --git a/kern/thread.h b/kern/thread.h index 21b25030..81d32924 100644 --- a/kern/thread.h +++ b/kern/thread.h @@ -399,11 +399,11 @@ extern void thread_unfreeze( /* Shall be taken at splsched only */ #ifdef MACH_LDEBUG #define thread_lock(th) do { \ - assert(splsched() == SPL7); \ + assert_splsched(); \ simple_lock_nocheck(&(th)->lock); \ } while (0) #define thread_unlock(th) do { \ - assert(splsched() == SPL7); \ + assert_splsched(); \ simple_unlock_nocheck(&(th)->lock); \ } while (0) #else |