/DragonOS/kernel/src/libs/lib_ui/ |
H A D | textui_no_alloc.rs | 3 sync::atomic::{AtomicI32, Ordering}, 27 TRUE_LINE_NUM.store((height / TEXTUI_CHAR_HEIGHT) as i32, Ordering::SeqCst); in textui_init_no_alloc() 29 CHAR_PER_LINE.store((width / TEXTUI_CHAR_WIDTH) as i32, Ordering::SeqCst); in textui_init_no_alloc() 34 NO_ALLOC_OPERATIONS_INDEX.store(0, Ordering::SeqCst); in next_line() 35 NO_ALLOC_OPERATIONS_LINE.fetch_add(1, Ordering::SeqCst); in next_line() 36 if NO_ALLOC_OPERATIONS_LINE.load(Ordering::SeqCst) >= TRUE_LINE_NUM.load(Ordering::SeqCst) { in next_line() 37 NO_ALLOC_OPERATIONS_LINE.store(0, Ordering::SeqCst); in next_line() 66 let mut space_to_print = 8 - NO_ALLOC_OPERATIONS_INDEX.load(Ordering::SeqCst) % 8; in no_init_textui_putchar_window() 69 LineId::new(NO_ALLOC_OPERATIONS_LINE.load(Ordering::SeqCst)), in no_init_textui_putchar_window() 70 LineIndex::new(NO_ALLOC_OPERATIONS_INDEX.load(Ordering::SeqCst)), in no_init_textui_putchar_window() [all …]
|
/DragonOS/kernel/src/libs/ |
H A D | once.rs | 3 sync::atomic::Ordering, 38 Ordering::SeqCst, in call_once() 39 Ordering::SeqCst, in call_once() 47 self.inner.store(OnceState::Complete, Ordering::SeqCst); in call_once() 108 Ordering::SeqCst, in call_once_force() 109 Ordering::SeqCst, in call_once_force() 114 f(&self.inner.load(Ordering::SeqCst)); in call_once_force() 117 self.inner.store(OnceState::Complete, Ordering::SeqCst); in call_once_force() 123 self.inner.load(Ordering::SeqCst) == OnceState::Complete in is_completed() 129 self.inner.load(Ordering::SeqCst) in state()
|
H A D | rwlock.rs | 7 sync::atomic::{AtomicU32, Ordering}, 105 let value = self.lock.fetch_add(READER, Ordering::Acquire); in current_reader() 109 self.lock.fetch_sub(READER, Ordering::Release); in current_reader() 142 self.lock.fetch_sub(READER, Ordering::Release); in inner_try_read() 194 let state = self.lock.load(Ordering::Relaxed); in reader_count() 202 return (self.lock.load(Ordering::Relaxed) & WRITER) / WRITER; in writer_count() 241 .compare_exchange(0, WRITER, Ordering::Acquire, Ordering::Relaxed) in inner_try_write() 313 if self.lock.fetch_or(UPGRADED, Ordering::Acquire) & (WRITER | UPGRADED) == 0 { in inner_try_upgradeable_read() 356 debug_assert!(self.lock.load(Ordering::Relaxed) & !WRITER > 0); in force_read_decrement() 357 self.lock.fetch_sub(READER, Ordering::Release); in force_read_decrement() [all …]
|
H A D | semaphore.rs | 1 use core::sync::atomic::{AtomicI32, Ordering}; 38 if self.counter.fetch_sub(1, Ordering::Release) <= 0 { in down() 39 self.counter.fetch_add(1, Ordering::Relaxed); in down() 50 self.counter.fetch_add(1, Ordering::Release); in up()
|
H A D | int_like.rs | 77 pub fn load(&self, order: ::core::sync::atomic::Ordering) -> $new_type_name { 81 pub fn store(&self, val: $new_type_name, order: ::core::sync::atomic::Ordering) { 88 order: ::core::sync::atomic::Ordering, 97 success: ::core::sync::atomic::Ordering, 98 failure: ::core::sync::atomic::Ordering, 113 success: ::core::sync::atomic::Ordering, 114 failure: ::core::sync::atomic::Ordering, 130 order: ::core::sync::atomic::Ordering,
|
H A D | spinlock.rs | 7 use core::sync::atomic::{AtomicBool, Ordering}; 123 .compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) in inner_try_lock() 163 self.lock.store(false, Ordering::SeqCst); in force_unlock() 167 self.lock.store(false, Ordering::SeqCst); in unlock() 172 self.lock.load(Ordering::SeqCst) in is_locked()
|
/DragonOS/kernel/src/sched/ |
H A D | cputime.rs | 1 use core::sync::atomic::{compiler_fence, AtomicUsize, Ordering}; 12 compiler_fence(Ordering::SeqCst); in irq_time_read() 18 let seq = irqtime.sync.load(Ordering::SeqCst); in irq_time_read() 21 if seq == irqtime.sync.load(Ordering::SeqCst) { in irq_time_read() 25 compiler_fence(Ordering::SeqCst); in irq_time_read() 40 self.sync.fetch_add(1, Ordering::SeqCst); in account_delta() 54 compiler_fence(Ordering::SeqCst); in irqtime_start() 56 compiler_fence(Ordering::SeqCst); in irqtime_start() 60 compiler_fence(Ordering::SeqCst); in irqtime_account_irq() 63 compiler_fence(Ordering::SeqCst); in irqtime_account_irq() [all …]
|
/DragonOS/kernel/src/mm/ |
H A D | kernel_mapper.rs | 19 sync::atomic::{compiler_fence, AtomicUsize, Ordering}, 44 Ordering::Acquire, in lock_cpu() 45 Ordering::Relaxed, in lock_cpu() 55 let prev_count = KERNEL_MAPPER_LOCK_COUNT.fetch_add(1, Ordering::Relaxed); in lock_cpu() 56 compiler_fence(Ordering::Acquire); in lock_cpu() 126 compiler_fence(Ordering::SeqCst); in map_phys_with_size() 135 let prev_count = KERNEL_MAPPER_LOCK_COUNT.fetch_sub(1, Ordering::Relaxed); in drop() 137 KERNEL_MAPPER_LOCK_OWNER.store(KERNEL_MAPPER_NO_PROCESSOR, Ordering::Release); in drop() 140 compiler_fence(Ordering::Release); in drop()
|
H A D | init.rs | 1 use core::{fmt::Write, sync::atomic::Ordering}; 42 Ordering::SeqCst, in mm_init() 43 Ordering::SeqCst, in mm_init() 71 Ordering::SeqCst, in mm_init() 72 Ordering::SeqCst, in mm_init() 81 MM_INIT.load(Ordering::SeqCst) in mm_init_status()
|
H A D | percpu.rs | 36 if cpu_num.load(core::sync::atomic::Ordering::SeqCst) != 0 { in init() 42 CPU_NUM_ATOMIC.store(cpus, core::sync::atomic::Ordering::SeqCst); in init() 69 let cpu_num = CPU_NUM_ATOMIC.load(core::sync::atomic::Ordering::SeqCst); in new()
|
/DragonOS/kernel/src/debug/klog/ |
H A D | mm.rs | 3 use core::sync::atomic::{compiler_fence, Ordering}; 65 compiler_fence(Ordering::SeqCst); in log() 67 compiler_fence(Ordering::SeqCst); in log() 71 compiler_fence(Ordering::SeqCst); in log() 73 compiler_fence(Ordering::SeqCst); in log() 76 compiler_fence(Ordering::SeqCst); in log()
|
/DragonOS/kernel/src/exception/ |
H A D | softirq.rs | 6 sync::atomic::{compiler_fence, fence, AtomicI16, Ordering}, 163 compiler_fence(Ordering::SeqCst); in register_softirq() 180 compiler_fence(Ordering::SeqCst); in unregister_softirq() 182 compiler_fence(Ordering::SeqCst); in unregister_softirq() 187 if self.cpu_running_count().get().load(Ordering::SeqCst) >= Self::MAX_RUNNING_PER_CPU { in do_softirq() 199 compiler_fence(Ordering::SeqCst); in do_softirq() 202 compiler_fence(Ordering::SeqCst); in do_softirq() 234 compiler_fence(Ordering::SeqCst); in do_softirq() 236 compiler_fence(Ordering::SeqCst); in do_softirq() 255 compiler_fence(Ordering::SeqCst); in raise_softirq() [all …]
|
/DragonOS/kernel/src/time/ |
H A D | timer.rs | 4 sync::atomic::{compiler_fence, AtomicBool, AtomicU64, Ordering}, 48 let result = TIMER_JIFFIES.load(Ordering::SeqCst) + self.data(); in timer_jiffies() 153 compiler_fence(Ordering::SeqCst); in activate() 234 .compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed); in set_run() 239 self.running.store(false, Ordering::Release); in clear_run() 263 if front_jiffies >= TIMER_JIFFIES.load(Ordering::SeqCst) { in run() 288 return TIMER_JIFFIES.load(Ordering::SeqCst) + expire_ms * 1000000 / NSEC_PER_JIFFY as u64; in next_n_ms_timer_jiffies() 292 return TIMER_JIFFIES.load(Ordering::SeqCst) + expire_us * 1000 / NSEC_PER_JIFFY as u64; in next_n_us_timer_jiffies() 317 timeout += TIMER_JIFFIES.load(Ordering::SeqCst) as i64; in schedule_timeout() 328 let time_remaining: i64 = timeout - TIMER_JIFFIES.load(Ordering::SeqCst) as i64; in schedule_timeout() [all …]
|
/DragonOS/kernel/src/arch/x86_64/smp/ |
H A D | mod.rs | 3 sync::atomic::{compiler_fence, fence, AtomicBool, Ordering}, 60 compiler_fence(core::sync::atomic::Ordering::SeqCst); in smp_ap_start() 122 if !self.initialized.load(Ordering::SeqCst) { in set_cpu_count() 129 if !self.initialized.load(Ordering::SeqCst) { in set_phys_id() 137 self.initialized.store(true, Ordering::SeqCst); in mark_initialized() 218 fence(Ordering::SeqCst); in start_cpu() 220 fence(Ordering::SeqCst); in start_cpu() 223 fence(Ordering::SeqCst); in start_cpu() 226 fence(Ordering::SeqCst); in start_cpu() 238 fence(Ordering::SeqCst); in copy_smp_start_code() [all …]
|
/DragonOS/kernel/src/arch/x86_64/kvm/vmx/ |
H A D | ept.rs | 9 use core::sync::atomic::{compiler_fence, AtomicUsize, Ordering}; 51 Ordering::Acquire, in lock_cpu() 52 Ordering::Relaxed, in lock_cpu() 62 let prev_count = EPT_MAPPER_LOCK_COUNT.fetch_add(1, Ordering::Relaxed); in lock_cpu() 63 compiler_fence(Ordering::Acquire); in lock_cpu()
|
/DragonOS/kernel/src/arch/x86_64/driver/apic/ |
H A D | mod.rs | 1 use core::sync::atomic::Ordering; 453 return LOCAL_APIC_ENABLE_TYPE.load(Ordering::SeqCst) == LocalApicEnableType::X2Apic; in x2apic_enabled() 494 LOCAL_APIC_ENABLE_TYPE.store(LocalApicEnableType::X2Apic, Ordering::SeqCst); in init_current_cpu() 500 LOCAL_APIC_ENABLE_TYPE.store(LocalApicEnableType::XApic, Ordering::SeqCst); in init_current_cpu() 525 if LOCAL_APIC_ENABLE_TYPE.load(Ordering::SeqCst) == LocalApicEnableType::X2Apic { in send_eoi() 533 if LOCAL_APIC_ENABLE_TYPE.load(Ordering::SeqCst) == LocalApicEnableType::X2Apic { in version() 545 if LOCAL_APIC_ENABLE_TYPE.load(Ordering::SeqCst) == LocalApicEnableType::X2Apic { in support_eoi_broadcast_suppression() 557 if LOCAL_APIC_ENABLE_TYPE.load(Ordering::SeqCst) == LocalApicEnableType::X2Apic { in max_lvt_entry() 569 if LOCAL_APIC_ENABLE_TYPE.load(Ordering::SeqCst) == LocalApicEnableType::X2Apic { in id() 581 if LOCAL_APIC_ENABLE_TYPE.load(Ordering::SeqCst) == LocalApicEnableType::X2Apic { in set_lvt() [all …]
|
/DragonOS/kernel/src/arch/riscv64/process/ |
H A D | mod.rs | 6 sync::atomic::{compiler_fence, Ordering}, 69 compiler_fence(Ordering::SeqCst); in arch_switch_to_user() 75 compiler_fence(Ordering::SeqCst); in arch_switch_to_user() 176 compiler_fence(Ordering::SeqCst); in switch_process() 180 compiler_fence(Ordering::SeqCst); in switch_process() 194 compiler_fence(Ordering::SeqCst); in switch_process() 443 compiler_fence(Ordering::SeqCst); in do_save() 497 compiler_fence(Ordering::SeqCst); in do_save() 501 compiler_fence(Ordering::SeqCst); in do_restore() 505 compiler_fence(Ordering::SeqCst); in do_restore() [all …]
|
/DragonOS/kernel/src/driver/clocksource/ |
H A D | acpi_pm.rs | 17 use core::sync::atomic::{AtomicU32, Ordering}; 29 return unsafe { CurrentPortIOArch::in32(PMTMR_IO_PORT.load(Ordering::SeqCst) as u16) } in read_pmtmr() 219 PMTMR_IO_PORT.store(pmtmr_addr as u32, Ordering::SeqCst); in find_acpi_pm_clock() 223 PMTMR_IO_PORT.load(Ordering::SeqCst) in find_acpi_pm_clock() 240 if PMTMR_IO_PORT.load(Ordering::SeqCst) == 0 { in init_acpi_pm_clocksource() 271 PMTMR_IO_PORT.store(0, Ordering::SeqCst); in init_acpi_pm_clocksource() 278 PMTMR_IO_PORT.store(0, Ordering::SeqCst); in init_acpi_pm_clocksource() 286 PMTMR_IO_PORT.store(0, Ordering::SeqCst); in init_acpi_pm_clocksource()
|
/DragonOS/kernel/src/process/ |
H A D | kthread.rs | 3 sync::atomic::{compiler_fence, AtomicBool, Ordering}, 180 match self.created.load(Ordering::SeqCst) { in poll_result() 189 let to_delete = self.has_unsafe_arc_instance.swap(false, Ordering::SeqCst); in poll_result() 212 .store(KernelThreadCreateStatus::Created, Ordering::SeqCst); in set_create_ok() 219 .compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) in generate_unsafe_arc_ptr() 231 .compare_exchange(true, false, Ordering::SeqCst, Ordering::SeqCst) in parse_unsafe_arc_ptr() 253 self.to_mark_sleep.store(to_mark_sleep, Ordering::SeqCst); in set_to_mark_sleep() 258 self.to_mark_sleep.load(Ordering::SeqCst) in to_mark_sleep() 346 compiler_fence(Ordering::SeqCst); in create() 474 .store(KernelThreadCreateStatus::ErrorOccured, Ordering::SeqCst); in kthread_daemon()
|
/DragonOS/kernel/src/ipc/ |
H A D | signal.rs | 70 compiler_fence(core::sync::atomic::Ordering::SeqCst); in send_signal_info() 85 compiler_fence(core::sync::atomic::Ordering::SeqCst); in send_signal_info() 89 compiler_fence(core::sync::atomic::Ordering::SeqCst); in send_signal_info() 124 compiler_fence(core::sync::atomic::Ordering::SeqCst); in send_signal() 162 compiler_fence(core::sync::atomic::Ordering::SeqCst); in send_signal() 175 compiler_fence(core::sync::atomic::Ordering::SeqCst); in complete_signal() 208 compiler_fence(core::sync::atomic::Ordering::SeqCst); in complete_signal() 364 compiler_fence(core::sync::atomic::Ordering::SeqCst); in flush_signal_handlers() 375 compiler_fence(core::sync::atomic::Ordering::SeqCst); in flush_signal_handlers() 377 compiler_fence(core::sync::atomic::Ordering::SeqCst); in flush_signal_handlers()
|
/DragonOS/kernel/src/driver/acpi/ |
H A D | pmtmr.rs | 14 use core::sync::atomic::Ordering; in acpi_pm_read_early() 15 let port = PMTMR_IO_PORT.load(Ordering::SeqCst); in acpi_pm_read_early()
|
/DragonOS/kernel/src/arch/x86_64/interrupt/ |
H A D | mod.rs | 10 sync::atomic::{compiler_fence, Ordering}, 68 compiler_fence(Ordering::SeqCst); in save_and_disable_irq() 72 compiler_fence(Ordering::SeqCst); in save_and_disable_irq() 77 compiler_fence(Ordering::SeqCst); in restore_irq() 79 compiler_fence(Ordering::SeqCst); in restore_irq()
|
/DragonOS/kernel/src/arch/riscv64/mm/ |
H A D | init.rs | 1 use core::sync::atomic::{compiler_fence, AtomicBool, Ordering}; 146 compiler_fence(Ordering::SeqCst); in riscv_mm_init() 152 compiler_fence(Ordering::SeqCst); in riscv_mm_init() 154 compiler_fence(Ordering::SeqCst); in riscv_mm_init() 166 .compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) in set_inner_allocator()
|
/DragonOS/kernel/crates/rust-slabmalloc/src/ |
H A D | pages.rs | 6 sync::atomic::{AtomicU64, Ordering}, 66 let bitval = b.load(Ordering::Relaxed); in first_fit() 98 (self[base_idx].load(Ordering::Relaxed) & (1 << bit_idx)) > 0 in is_allocated() 106 self[base_idx].fetch_or(1 << bit_idx, Ordering::Relaxed); in set_bit() 114 self[base_idx].fetch_and(!(1 << bit_idx), Ordering::Relaxed); in clear_bit() 128 .filter(|&x| x.load(Ordering::Relaxed) != u64::MAX) in is_full() 146 return (free_mask & bitmap.load(Ordering::Relaxed)) == 0; in all_free() 149 if bitmap.load(Ordering::Relaxed) == 0 { in all_free() 266 let bitval = b.load(Ordering::Relaxed); in free_obj_count()
|
/DragonOS/kernel/src/arch/x86_64/mm/ |
H A D | mod.rs | 37 use core::sync::atomic::{compiler_fence, AtomicBool, Ordering}; 180 compiler_fence(Ordering::SeqCst); in invalidate_page() 182 compiler_fence(Ordering::SeqCst); in invalidate_page() 187 compiler_fence(Ordering::SeqCst); in invalidate_all() 190 compiler_fence(Ordering::SeqCst); in invalidate_all() 197 compiler_fence(Ordering::SeqCst); in table() 199 compiler_fence(Ordering::SeqCst); in table() 212 compiler_fence(Ordering::SeqCst); in set_table() 214 compiler_fence(Ordering::SeqCst); in set_table() 429 XD_RESERVED.store(true, Ordering::Relaxed); in init_xd_rsvd() [all …]
|