diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-02-23 14:04:33 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-02-23 14:04:33 +0100 |
commit | 68e9c64926264a0bb926372b16f0dbf9c0d35224 (patch) | |
tree | 896facbbb9c722eb712b68acaf3733056dcf429d /kern | |
parent | b10edca40b871ca7e9ac0e09a5cf0ae8feac3311 (diff) | |
download | gnumach-68e9c64926264a0bb926372b16f0dbf9c0d35224.tar.gz gnumach-68e9c64926264a0bb926372b16f0dbf9c0d35224.tar.bz2 gnumach-68e9c64926264a0bb926372b16f0dbf9c0d35224.zip |
kern: move pset_idle_lock/unlock to header
so that kern/machine.c can use it
Diffstat (limited to 'kern')
-rw-r--r-- | kern/machine.c | 6 | ||||
-rw-r--r-- | kern/processor.h | 14 | ||||
-rw-r--r-- | kern/sched_prim.c | 10 |
3 files changed, 16 insertions, 14 deletions
diff --git a/kern/machine.c b/kern/machine.c index a350fad4..1322b549 100644 --- a/kern/machine.c +++ b/kern/machine.c @@ -176,8 +176,7 @@ processor_request_action( * get at processor state. */ pset = processor->processor_set; - assert_splsched(); - simple_lock_nocheck(&pset->idle_lock); + pset_idle_lock(); /* * If the processor is dispatching, let it finish - it will set its @@ -229,8 +228,7 @@ processor_request_action( panic("processor_request_action: bad state"); } simple_unlock(&action_lock); - assert_splsched(); - simple_unlock_nocheck(&pset->idle_lock); + pset_idle_unlock(); thread_wakeup((event_t)&action_queue); } diff --git a/kern/processor.h b/kern/processor.h index a562f80a..c90d0529 100644 --- a/kern/processor.h +++ b/kern/processor.h @@ -89,6 +89,20 @@ extern struct processor_set default_pset; extern struct processor_set *slave_pset; #endif +#ifdef MACH_LDEBUG +#define pset_idle_lock() do { \ + assert_splsched(); \ + simple_lock_nocheck(&pset->idle_lock); \ +} while (0) +#define pset_idle_unlock() do { \ + assert_splsched(); \ + simple_unlock_nocheck(&pset->idle_lock); \ +} while (0) +#else +#define pset_idle_lock() simple_lock_nocheck(&pset->idle_lock) +#define pset_idle_unlock() simple_unlock_nocheck(&pset->idle_lock) +#endif + struct processor { struct run_queue runq; /* local runq for this processor */ /* XXX want to do this round robin eventually */ diff --git a/kern/sched_prim.c b/kern/sched_prim.c index f7a20729..47e578e6 100644 --- a/kern/sched_prim.c +++ b/kern/sched_prim.c @@ -141,19 +141,9 @@ queue_head_t wait_queue[NUMQUEUES]; assert_splsched(); \ simple_unlock_nocheck(wl); \ } while (0) -#define pset_idle_lock() do { \ - assert_splsched(); \ - simple_lock_nocheck(&pset->idle_lock); \ -} while (0) -#define pset_idle_unlock() do { \ - assert_splsched(); \ - simple_unlock_nocheck(&pset->idle_lock); \ -} while (0) #else #define waitq_lock(wl) simple_lock_nocheck(wl) #define waitq_unlock(wl) simple_unlock_nocheck(wl) -#define pset_idle_lock() simple_lock_nocheck(&pset->idle_lock) -#define pset_idle_unlock() simple_unlock_nocheck(&pset->idle_lock) #endif |