diff options
-rw-r--r-- | kern/llsync.c | 8 | ||||
-rw-r--r-- | kern/llsync_i.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/kern/llsync.c b/kern/llsync.c index 5b4966b0..7204c438 100644 --- a/kern/llsync.c +++ b/kern/llsync.c @@ -207,10 +207,10 @@ llsync_register_cpu(unsigned int cpu) if (llsync_nr_registered_cpus == 1) llsync_process_global_checkpoint(cpu); - spinlock_unlock_intr_restore(&llsync_lock, flags); - assert(!llsync_cpus[cpu].registered); llsync_cpus[cpu].registered = 1; + + spinlock_unlock_intr_restore(&llsync_lock, flags); } static void @@ -235,11 +235,11 @@ llsync_unregister_cpu(unsigned int cpu) { unsigned long flags; + spinlock_lock_intr_save(&llsync_lock, &flags); + assert(llsync_cpus[cpu].registered); llsync_cpus[cpu].registered = 0; - spinlock_lock_intr_save(&llsync_lock, &flags); - assert(bitmap_test(llsync_registered_cpus, cpu)); bitmap_clear(llsync_registered_cpus, cpu); llsync_nr_registered_cpus--; diff --git a/kern/llsync_i.h b/kern/llsync_i.h index 034e368b..c0ba1a39 100644 --- a/kern/llsync_i.h +++ b/kern/llsync_i.h @@ -22,6 +22,8 @@ /* * Per-processor data. + * + * Interrupts must be disabled on access. */ struct llsync_cpu { int registered; |