Home
last modified time | relevance | path

Searched refs:atomic (Results 1 – 25 of 93) sorted by relevance

1234

/DragonOS/kernel/src/libs/
H A Dint_like.rs77 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,
140 use ::core::sync::atomic::AtomicUsize; in test()
H A Dsemaphore.rs1 use core::sync::atomic::{AtomicI32, Ordering};
H A Donce.rs3 sync::atomic::Ordering,
H A Dlazy_init.rs23 use core::sync::atomic::{AtomicBool, Ordering};
/DragonOS/kernel/src/common/
H A Datomic.h16 #define atomic_read(atomic) ((atomic)->value) // 读取原子变量 argument
17 #define atomic_set(atomic, val) (((atomic)->value) = (val)) // 设置原子变量的初始值 argument
/DragonOS/kernel/src/mm/
H A Dpercpu.rs1 use core::sync::atomic::AtomicU32;
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()
H A Dinit.rs1 use core::{fmt::Write, sync::atomic::Ordering};
/DragonOS/kernel/src/ipc/
H A Dsignal.rs1 use core::sync::atomic::compiler_fence;
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()
[all …]
/DragonOS/kernel/src/smp/cpu/
H A Dmod.rs1 use core::sync::atomic::AtomicU32;
123 .fetch_add(1, core::sync::atomic::Ordering::SeqCst); in set_possible_cpu()
126 .fetch_sub(1, core::sync::atomic::Ordering::SeqCst); in set_possible_cpu()
138 self.possible_cnt.load(core::sync::atomic::Ordering::SeqCst) in possible_cpus_count()
142 self.present_cnt.load(core::sync::atomic::Ordering::SeqCst) in present_cpus_count()
153 .fetch_add(1, core::sync::atomic::Ordering::SeqCst); in set_present_cpu()
156 .fetch_sub(1, core::sync::atomic::Ordering::SeqCst); in set_present_cpu()
/DragonOS/kernel/src/process/
H A Dtimer.rs9 use core::sync::atomic::compiler_fence;
135 compiler_fence(core::sync::atomic::Ordering::SeqCst); in run()
140 compiler_fence(core::sync::atomic::Ordering::SeqCst); in run()
/DragonOS/kernel/src/namespaces/
H A Ducount.rs3 use core::{hash::Hash, sync::atomic::AtomicU32};
77 .fetch_add(1, core::sync::atomic::Ordering::SeqCst); in alloc_ucounts()
107 let num = iter.ucount[uc_type].fetch_add(1, core::sync::atomic::Ordering::SeqCst); in inc_ucounts()
112 add_iter.ucount[uc_type].fetch_sub(1, core::sync::atomic::Ordering::SeqCst); in inc_ucounts()
140 let num = iter.ucount[uc_type].fetch_sub(1, core::sync::atomic::Ordering::SeqCst); in dec_ucount()
H A Dmnt_namespace.rs2 use core::sync::atomic::AtomicU64;
3 use core::sync::atomic::Ordering;
175 seq.fetch_add(1, core::sync::atomic::Ordering::SeqCst); in create_mnt_namespace()
/DragonOS/docs/kernel/core_api/
H A Dindex.rst12 atomic
H A Datomic.md5   DragonOS实现了原子变量,类型为atomic_t. 原子变量是基于具体体系结构的原子操作指令实现的。具体实现在`kernel/common/atomic.h`中。
/DragonOS/kernel/src/driver/disk/ahci/
H A Dmod.rs20 use core::sync::atomic::compiler_fence;
118 compiler_fence(core::sync::atomic::Ordering::SeqCst); in ahci_init()
132 compiler_fence(core::sync::atomic::Ordering::SeqCst); in ahci_init()
H A Dhba.rs4 use core::sync::atomic::compiler_fence;
200 compiler_fence(core::sync::atomic::Ordering::SeqCst); in init()
215 compiler_fence(core::sync::atomic::Ordering::SeqCst); in init()
237 compiler_fence(core::sync::atomic::Ordering::SeqCst); in init()
/DragonOS/kernel/src/driver/acpi/
H A Dpmtmr.rs14 use core::sync::atomic::Ordering; in acpi_pm_read_early()
/DragonOS/kernel/src/net/
H A Dmod.rs3 sync::atomic::AtomicUsize,
27 return IFACE_ID.fetch_add(1, core::sync::atomic::Ordering::SeqCst); in generate_iface_id()
/DragonOS/kernel/src/virt/kvm/
H A Dhost_mem.rs164 atomic: bool, in __gfn_to_pfn()
171 let pfn = hva_to_pfn(addr, atomic, writable)?; in __gfn_to_pfn()
/DragonOS/kernel/src/debug/klog/
H A Dmm.rs3 use core::sync::atomic::{compiler_fence, Ordering};
/DragonOS/kernel/src/mm/allocator/
H A Dslab.rs1 use core::{alloc::Layout, ptr::NonNull, sync::atomic::AtomicBool};
/DragonOS/kernel/src/arch/x86_64/kvm/vmx/
H A Dept.rs9 use core::sync::atomic::{compiler_fence, AtomicUsize, Ordering};
/DragonOS/kernel/src/arch/x86_64/smp/
H A Dmod.rs3 sync::atomic::{compiler_fence, fence, AtomicBool, Ordering},
60 compiler_fence(core::sync::atomic::Ordering::SeqCst); in smp_ap_start()
/DragonOS/kernel/src/filesystem/vfs/
H A Dfile.rs1 use core::sync::atomic::{AtomicUsize, Ordering};
250 self.offset.load(core::sync::atomic::Ordering::SeqCst), in read()
266 self.offset.load(core::sync::atomic::Ordering::SeqCst), in write()
325 .fetch_add(len, core::sync::atomic::Ordering::SeqCst); in do_read()
367 .fetch_add(len, core::sync::atomic::Ordering::SeqCst); in do_write()
/DragonOS/kernel/src/arch/x86_64/driver/apic/
H A Dx2apic.rs1 use core::sync::atomic::{fence, Ordering};

1234