Home
last modified time | relevance | path

Searched refs:old (Results 1 – 6 of 6) sorted by relevance

/DragonOS-0.1.3/kernel/src/libs/
Dlockref.c10 … struct lockref old; \
11 … BUILD_BUG_ON(sizeof(old) != sizeof(uint64_t)); \
12old.lock_count = READ_ONCE(__lock_ref->lock_count); \
13 … while (likely(!spin_is_locked(&old.lock))) \
15 … struct lockref new = old; \
17 … if (likely(arch_try_cmpxchg(&__lock_ref->lock_count, &old.lock_count, new.lock_count))) \
61 if (old.count <= 0) return false; in lockref_inc_not_zero()
90 if (old.count <= 0) break; in lockref_dec()
121 if (old.count <= 0) return -1; in lockref_dec_return()
142 if (old.count <= 1) return false; in lockref_dec_not_zero()
[all …]
Dlockref.rs58 let mut old: LockRef = LockRef::INIT; in cmpxchg_loop() localVariable
59 old.count = unsafe { read_volatile(&self.count) }; in cmpxchg_loop()
61 if !old.lock.is_locked() { in cmpxchg_loop()
65 read_volatile(&mut old as *mut LockRef as *mut usize as *mut u64); in cmpxchg_loop()
76 if old.count <= 0 { in cmpxchg_loop()
83 if old.count < 0 { in cmpxchg_loop()
90 if old.count <= 0 { in cmpxchg_loop()
96 if old.count <= 1 { in cmpxchg_loop()
106 &mut old as *mut LockRef as *mut usize as *mut u64, in cmpxchg_loop()
/DragonOS-0.1.3/kernel/src/arch/x86_64/include/asm/
Dcmpxchg.h34 [old] "+a"(__old) \
45 [old] "+a"(__old) \
56 [old] "+a"(__old) \
67 [old] "+a"(__old) \
/DragonOS-0.1.3/kernel/src/common/
Dlist.h76 static inline void list_replace(struct List *old, struct List *new) in list_replace() argument
78 if (old->prev != NULL) in list_replace()
79 old->prev->next = new; in list_replace()
80 new->prev = old->prev; in list_replace()
81 if (old->next != NULL) in list_replace()
82 old->next->prev = new; in list_replace()
83 new->next = old->next; in list_replace()
85 old->prev = NULL; in list_replace()
86 old->next = NULL; in list_replace()
/DragonOS-0.1.3/docs/kernel/locking/
Dlockref.md55 …没有别的线程持有锁,然后改变引用计数,同时通过`lock cmpxchg`指令验证在更改发生时,没有其他线程持有锁,并且当前的目标lockref的值与old变量中存储的一致,从而将新值存储到目标l…
145 &emsp;&emsp;该函数与`lockref_dec_or_lock_not_zero()`的区别在于,当`cmpxchg()`时发现`old.count≤1`时,该函数会直接返回`Err(-1…
161 &emsp;&emsp;该函数与`lockref_dec_not_zero()`的区别在于,当cmpxchg()时发现`old.count≤1`时,该函数会尝试加锁来进行操作,而`lockref_d…
/DragonOS-0.1.3/docs/kernel/core_api/
Dkernel_api.md111 ### `void list_replace(struct List *old, struct List *new)`
115 &emsp;&emsp;将链表中的old结点替换成new结点
119 **old**