/DragonOS-0.1.8/kernel/src/libs/ |
D | wait_queue.rs | 45 let mut guard: SpinLockGuard<InnerWaitQueue> = self.0.lock(); in sleep() localVariable 47 guard.wait_list.push_back(current_pcb()); in sleep() 48 drop(guard); in sleep() 58 let mut guard: SpinLockGuard<InnerWaitQueue> = self.0.lock(); in sleep_with_func() localVariable 60 guard.wait_list.push_back(current_pcb()); in sleep_with_func() 62 drop(guard); in sleep_with_func() 83 let mut guard: SpinLockGuard<InnerWaitQueue> = self.0.lock(); in sleep_without_schedule() localVariable 85 guard.wait_list.push_back(current_pcb()); in sleep_without_schedule() 86 drop(guard); in sleep_without_schedule() 90 let mut guard: SpinLockGuard<InnerWaitQueue> = self.0.lock(); in sleep_uninterruptible() localVariable [all …]
|
D | rwlock.rs | 154 Some(guard) => return guard, in read() 213 Some(guard) => return guard, in write() 251 Some(guard) => return guard, in upgradeable_read()
|
/DragonOS-0.1.8/docs/kernel/locking/ |
D | rwlock.md | 16 …wLock的数据结构进行访问和修改. 每个要访问共享数据的会获得一个守卫(guard), 只读进程获得READER(读者守卫),需要修改共享变量的进程获得WRITER(写者守卫),作为RwLock… 132 let guard = LOCK.read(); 133 let value = *guard; 143 let guard = LOCK.read(); 144 let value = *guard; 154 let mut guard = LOCK.write(); 155 *guard += 100; 159 "Writers: the value is {guard} 161 guard = *guard 163 let read_guard=guard.downgrade(); [all …]
|
/DragonOS-0.1.8/kernel/src/mm/ |
D | c_adapter.rs | 96 let mut guard = C_ALLOCATION_MAP.lock(); in do_kmalloc() localVariable 97 if unlikely(guard.contains_key(&vaddr)) { in do_kmalloc() 98 drop(guard); in do_kmalloc() 108 guard.insert(vaddr, (vaddr, len, cap)); in do_kmalloc() 118 let mut guard = C_ALLOCATION_MAP.lock(); in kfree() localVariable 119 let p = guard.remove(&vaddr); in kfree() 120 drop(guard); in kfree()
|
D | ucontext.rs | 609 let guard = v.lock(); in contains() localVariable 610 if guard.region.contains(vaddr) { in contains() 828 let mut guard = self.lock(); in remap() localVariable 829 assert!(guard.mapped); in remap() 830 for page in guard.region.pages() { in remap() 840 guard.flags = flags; in remap() 847 let mut guard = self.lock(); in unmap() localVariable 848 assert!(guard.mapped); in unmap() 849 for page in guard.region.pages() { in unmap() 865 guard.mapped = false; in unmap() [all …]
|
D | kernel_mapper.rs | 130 let guard = unsafe { CurrentIrqArch::save_and_disable_irq() }; in drop() localVariable 135 drop(guard); in drop()
|
/DragonOS-0.1.8/kernel/src/net/ |
D | net_core.rs | 120 let guard: RwLockReadGuard<BTreeMap<usize, Arc<dyn NetDriver>>> = NET_DRIVERS.read(); in poll_ifaces() localVariable 121 if guard.len() == 0 { in poll_ifaces() 126 for (_, iface) in guard.iter() { in poll_ifaces() 140 let guard: RwLockReadGuard<BTreeMap<usize, Arc<dyn NetDriver>>> = NET_DRIVERS.read(); in poll_ifaces_try_lock() localVariable 141 if guard.len() == 0 { in poll_ifaces_try_lock() 154 for (_, iface) in guard.iter() { in poll_ifaces_try_lock()
|
/DragonOS-0.1.8/kernel/src/arch/x86_64/ |
D | fpu.rs | 83 let guard = unsafe { CurrentIrqArch::save_and_disable_irq() }; in fp_state_save() localVariable 115 drop(guard); in fp_state_save() 121 let guard = unsafe { CurrentIrqArch::save_and_disable_irq() }; in fp_state_restore() localVariable 145 drop(guard); in fp_state_restore()
|
/DragonOS-0.1.8/kernel/src/filesystem/fat/ |
D | fs.rs | 1362 let mut guard: SpinLockGuard<FATInode> = self.0.lock(); in read_at() localVariable 1363 match &guard.inode_type { in read_at() 1366 &guard.fs.upgrade().unwrap(), in read_at() 1370 guard.update_metadata(); in read_at() 1390 let mut guard: SpinLockGuard<FATInode> = self.0.lock(); in write_at() localVariable 1391 let fs: &Arc<FATFileSystem> = &guard.fs.upgrade().unwrap(); in write_at() 1393 match &mut guard.inode_type { in write_at() 1396 guard.update_metadata(); in write_at() 1429 let mut guard: SpinLockGuard<FATInode> = self.0.lock(); in create() localVariable 1430 let fs: &Arc<FATFileSystem> = &guard.fs.upgrade().unwrap(); in create() [all …]
|
/DragonOS-0.1.8/kernel/src/driver/keyboard/ |
D | ps2_keyboard.rs | 100 let guard = self.0.read(); in read_at() localVariable 101 let func = guard.f_ops.read.unwrap(); in read_at() 131 let guard = self.0.write(); in open() localVariable 132 let func = guard.f_ops.open.unwrap(); in open() 145 let guard = self.0.write(); in close() localVariable 146 let func = guard.f_ops.close.unwrap(); in close()
|
/DragonOS-0.1.8/kernel/src/arch/x86_64/interrupt/ |
D | mod.rs | 53 let guard = IrqFlagsGuard::new(flags); in save_and_disable_irq() localVariable 55 return guard; in save_and_disable_irq()
|
/DragonOS-0.1.8/kernel/src/filesystem/sysfs/ |
D | mod.rs | 287 mut guard: SpinLockGuard<SysFSInode>, in do_create_with_data() 293 if guard.metadata.file_type != FileType::Dir { in do_create_with_data() 298 if guard.children.contains_key(_name) { in do_create_with_data() 304 parent: guard.self_ref.clone(), in do_create_with_data() 323 fs: guard.fs.clone(), in do_create_with_data() 330 guard.children.insert(String::from(_name), result.clone()); in do_create_with_data() 340 let guard: SpinLockGuard<SysFSInode> = self.0.lock(); in add_dir() localVariable 342 if guard.children.contains_key(name) { in add_dir() 346 match self.do_create_with_data(guard, name, FileType::Dir, 0o755 as u32, 0) { in add_dir()
|
/DragonOS-0.1.8/kernel/src/filesystem/devfs/ |
D | mod.rs | 249 let guard: SpinLockGuard<DevFSInode> = self.0.lock(); in add_dir() localVariable 251 if guard.children.contains_key(name) { in add_dir() 255 match self.do_create_with_data(guard, name, FileType::Dir, 0o755 as u32, 0) { in add_dir() 290 mut guard: SpinLockGuard<DevFSInode>, in do_create_with_data() 296 if guard.metadata.file_type != FileType::Dir { in do_create_with_data() 301 if guard.children.contains_key(_name) { in do_create_with_data() 307 parent: guard.self_ref.clone(), in do_create_with_data() 326 fs: guard.fs.clone(), in do_create_with_data() 333 guard.children.insert(String::from(_name), result.clone()); in do_create_with_data() 363 let guard: SpinLockGuard<DevFSInode> = self.0.lock(); in create_with_data() localVariable [all …]
|
/DragonOS-0.1.8/kernel/src/driver/tty/ |
D | tty_device.rs | 300 let guard = TTY_DEVICES.upgradeable_read(); in tty_init() localVariable 303 if guard.contains_key("tty0") { in tty_init() 307 let mut guard = guard.upgrade(); in tty_init() localVariable 309 guard.insert("tty0".to_string(), tty.clone()); in tty_init() 311 drop(guard); in tty_init()
|
/DragonOS-0.1.8/kernel/src/ipc/ |
D | pipe.rs | 66 let mut guard = result.0.lock(); in new() localVariable 67 guard.self_ref = Arc::downgrade(&result); in new() 69 drop(guard); //这一步其实不需要,只要离开作用域,guard生命周期结束,自会解锁 in new()
|
/DragonOS-0.1.8/kernel/src/exception/ |
D | softirq.rs | 228 let guard = unsafe { CurrentIrqArch::save_and_disable_irq() }; in raise_softirq() localVariable 235 drop(guard); in raise_softirq()
|
/DragonOS-0.1.8/kernel/src/driver/net/ |
D | virtio_net.rs | 283 let mut guard = self.iface.lock(); in poll() localVariable 284 let poll_res = guard.poll(timestamp, self.driver.force_get_mut(), sockets); in poll()
|
/DragonOS-0.1.8/kernel/src/filesystem/procfs/ |
D | mod.rs | 348 let guard: SpinLockGuard<ProcFSInode> = self.0.lock(); in close() localVariable 350 if let FileType::Dir = guard.metadata.file_type { in close()
|