/DragonOS-0.1.8/kernel/src/libs/ |
D | lockref.c | 15 … struct lockref new = old; \ 17 … if (likely(arch_try_cmpxchg(&__lock_ref->lock_count, &old.lock_count, new.lock_count))) \ 43 CMPXCHG_LOOP(lock_ref, ++new.count;, return;); in lockref_inc() 65 ++new.count; in lockref_inc_not_zero() 98 --new.count; in lockref_dec() 100 { return new.count; }) in lockref_dec() 132 --new.count; in lockref_dec_return() 134 { return new.count; }) in lockref_dec_return() 156 --new.count; in lockref_dec_not_zero() 188 --new.count; in lockref_dec_or_lock_not_zero() [all …]
|
D | lockref.rs | 38 pub fn new() -> LockRef { in new() method 59 let mut new = LockRef::INIT; in cmpxchg_loop() localVariable 61 *(&mut new as *mut LockRef as *mut usize as *mut u64) = in cmpxchg_loop() 63 new.lock.set_value(false); in cmpxchg_loop() 69 new.count += 1; in cmpxchg_loop() 76 new.count += 1; in cmpxchg_loop() 83 new.count += 1; in cmpxchg_loop() 90 new.count -= 1; in cmpxchg_loop() 96 new.count -= 1; in cmpxchg_loop() 104 &mut new as *mut LockRef as *mut usize as *mut u64, in cmpxchg_loop() [all …]
|
D | int_like.rs | 56 pub const fn new(x: $new_type_name) -> Self { 58 container: $backing_atomic_type::new(x.into()), 63 Self::new($new_type_name::from(0)) 85 new: $new_type_name, 91 .compare_exchange(current.into(), new.into(), success, failure) 101 new: $new_type_name, 107 new.into(),
|
D | notifier.rs | 22 pub fn new() -> Self { in new() method 102 pub fn new() -> Self { in new() method 103 Self(SpinLock::new(NotifierChain::<T>::new())) in new() 140 pub fn new() -> Self { in new() method 141 Self(RwLock::new(NotifierChain::<T>::new())) in new() 177 pub fn new() -> Self { in new() method 178 Self(NotifierChain::<T>::new()) in new()
|
/DragonOS-0.1.8/kernel/src/arch/x86_64/include/asm/ |
D | cmpxchg.h | 35 : [new] "q"(__new) \ 46 : [new] "q"(__new) \ 57 : [new] "q"(__new) \ 68 : [new] "q"(__new) \ 80 #define arch_try_cmpxchg(ptr, old_ptr, new) \ argument 81 __raw_try_cmpxchg((ptr), (old_ptr), (new), sizeof(*ptr))
|
/DragonOS-0.1.8/kernel/src/driver/virtio/ |
D | virtio_impl.rs | 25 let page_num = PageFrameCount::new( in dma_alloc() 45 NonNull::new(MMArch::phys_2_virt(paddr).unwrap().data() as _).unwrap(), in dma_alloc() 57 let page_count = PageFrameCount::new( in dma_dealloc() 62 let vaddr = VirtAddr::new(vaddr.as_ptr() as *mut u8 as usize); in dma_dealloc() 71 deallocate_page_frames(PhysPageFrame::new(PhysAddr::new(paddr)), page_count); in dma_dealloc() 79 NonNull::new((0) as _).unwrap() in mmio_phys_to_virt() 88 let vaddr = VirtAddr::new(buffer.as_ptr() as *mut u8 as usize); in share()
|
/DragonOS-0.1.8/kernel/src/mm/ |
D | c_adapter.rs | 24 …OCATION_MAP: SpinLock<HashMap<VirtAddr, (VirtAddr, usize, usize)>> = SpinLock::new(HashMap::new()); 30 let vaddr = VirtAddr::new(vaddr); in rs_pseudo_map_phys() 31 let paddr = PhysAddr::new(paddr); in rs_pseudo_map_phys() 32 let count = PageFrameCount::new(page_align_up(size) / MMArch::PAGE_SIZE); in rs_pseudo_map_phys() 39 let mut vaddr = VirtAddr::new(vaddr); in rs_map_phys() 40 let mut paddr = PhysAddr::new(paddr); in rs_map_phys() 41 let count = PageFrameCount::new(page_align_up(size) / MMArch::PAGE_SIZE); in rs_map_phys() 44 let mut page_flags: PageFlags<MMArch> = PageFlags::new().set_execute(true).set_write(true); in rs_map_phys() 93 let vaddr = VirtAddr::new(ptr as usize); in do_kmalloc() 117 let vaddr = VirtAddr::new(vaddr); in kfree()
|
D | ucontext.rs | 57 pub fn new(create_stack: bool) -> Result<Arc<Self>, SystemError> { in new() method 58 let inner = InnerAddressSpace::new(create_stack)?; in new() 60 inner: RwLock::new(inner), in new() 62 return Ok(Arc::new(result)); in new() 121 pub fn new(create_stack: bool) -> Result<Self, SystemError> { in new() method 124 mappings: UserMappings::new(), in new() 126 elf_brk_start: VirtAddr::new(0), in new() 127 elf_brk: VirtAddr::new(0), in new() 151 let new_addr_space = AddressSpace::new(false)?; in try_clone() 167 let tmp_flags: PageFlags<MMArch> = PageFlags::new().set_write(true); in try_clone() [all …]
|
/DragonOS-0.1.8/kernel/src/driver/base/platform/ |
D | mod.rs | 32 pub fn new(id_vec: Vec<&'static str>) -> CompatibleTable { in new() method 59 pub fn new() -> LockedPlatformBusDriver { in new() method 60 LockedPlatformBusDriver(SpinLock::new(PlatformBusDriver::new())) in new() 69 CompatibleTable::new(vec!["platform"]) in get_compatible_table() 220 pub fn new() -> Self { in new() method 222 drivers: BTreeMap::new(), in new() 223 devices: BTreeMap::new(), in new() 238 IdTable::new("PlatformBusDriver", 0) in id_table() 274 pub fn new() -> LockedPlatform { in new() method 275 LockedPlatform(SpinLock::new(Platform::new())) in new() [all …]
|
/DragonOS-0.1.8/kernel/src/driver/video/ |
D | mod.rs | 32 pub fn new() -> VideoRefreshFramebuffer { in new() method 34 running: AtomicBool::new(false), in new() 56 let handler = Arc::new(VideoRefreshFramebuffer::new()); in register_softirq_video()
|
/DragonOS-0.1.8/docs/community/ChangeLog/V0.1.x/ |
D | V0.1.4.md | 34 - Spinlock: new: 新增具有守卫的自旋锁SpinLock,支持编译期对锁的使用进行检查。 (#148) 36 - Mutex: new: Rust版本的Mutex (#157) 37 - doc: new: Rust代码风格文档 (#161) 38 - WaitQueue: new: Rust版本的WaitQueue (#162) 40 - block io: new: Block IO 调度器. 当具有多核时,io调度器在核心1上运行。 (#158) 42 - smp: new: 增加kick_cpu功能,支持让某个特定核心立即运行调度器 (#158) 43 - smp: new: 增加进程在核心间迁移的功能 (#158) 44 - scheduler: new: 增加实时进程调度器(支持FIFO、RR策略) (#139) 47 - process: new: pcb中增加migrate_to字段 (#158) 157 * new: rust版本的waitqueue [all …]
|
D | V0.1.1.md | 191 new:在fork时拷贝signal和sighand (#91) 195 * new: 实现copy_sighand 198 * new: 拷贝signal 209 * new: 初步实现signal的数据结构 211 * new:signal相关数据结构 215 * new: rust下的kdebug kinfo kwarn kBUG kerror宏 219 * new: signal的发送(暂时只支持父子进程共享信号及处理函数) 228 new: pcb相关api文档 236 new: rust下的kdebug kinfo kwarn kBUG kerror宏 (#86) 238 * new: rust下的kdebug kinfo kwarn kBUG kerror宏 [all …]
|
D | V0.1.3.md | 30 - syscall: new: 增加getpid系统调用 (#120) 33 - doc: new: 新增signal的文档 (#126) 34 - Spinlock: new: 新增rust写的RawSpinlock (#127) 37 - scheduler: new: 使用Rust重构CFS调度器 (#131) 41 - lockref: new: 新增rust版本的lockref (#135) 42 - cpu: new: new:Rust封装cpu_relax(),通过pause指令,让cpu休息一会儿,降低空转功耗. (#135) 49 - libc: new: 增加了raise、kill、abort (#120) 50 - libc: new: 新增arch文件夹,在下面新增crt0 crti crtn文件 (#134) 51 - libc: new: 新增`fflush()`, `fprintf()`, `stdin`, `stdout`, `stderr`, `ferror()`, `fopen()`, `fclose… 52 - libc: new: 简单添加了`fopen()`对mode参数的处理。请注意,它没有完全遵循posix,也与Linux的不一致,将来使用Rust的时候完善它。 (#141) [all …]
|
/DragonOS-0.1.8/kernel/src/driver/net/ |
D | virtio_net.rs | 85 pub fn new(mut driver: VirtioNICDriver<T>) -> Arc<Self> { in new() method 87 let mut iface_config = smoltcp::iface::Config::new(); in new() 96 let iface = smoltcp::iface::Interface::new(iface_config, &mut driver); in new() 98 let driver: VirtioNICDriverWrapper<T> = VirtioNICDriverWrapper(UnsafeCell::new(driver)); in new() 99 let result = Arc::new(VirtioInterface { in new() 102 iface: SpinLock::new(iface), in new() 111 pub fn new(driver_net: VirtIONet<HalImpl, T, 2>) -> Self { in new() method 112 let mut iface_config = smoltcp::iface::Config::new(); in new() 122 let inner: Arc<SpinLock<VirtIONet<HalImpl, T, 2>>> = Arc::new(SpinLock::new(driver_net)); in new() 134 pub fn new( in new() method [all …]
|
/DragonOS-0.1.8/kernel/src/driver/base/device/ |
D | driver.rs | 7 pub static ref DRIVER_MANAGER: Arc<LockedDriverManager> = Arc::new(LockedDriverManager::new()); 59 fn new() -> LockedDriverManager { in new() method 60 LockedDriverManager(SpinLock::new(DriverManager::new())) in new() 116 fn new() -> DriverManager { in new() method 118 drivers: BTreeMap::new(), in new()
|
/DragonOS-0.1.8/kernel/src/sched/ |
D | rt.rs | 29 RT_SCHEDULER_PTR = Some(Box::new(SchedulerRT::new())); in sched_rt_init() 45 pub fn new() -> RTQueue { in new() method 47 queue: LinkedList::new(), in new() 107 pub fn new() -> SchedulerRT { in new() method 117 result.cpu_queue.push(Vec::new()); in new() 120 result.cpu_queue[cpu_id as usize].push(Box::leak(Box::new(RTQueue::new()))); in new() 127 .push(Box::leak(Box::new(LinkedList::new()))); in new()
|
/DragonOS-0.1.8/kernel/src/time/ |
D | timer.rs | 29 static TIMER_JIFFIES: AtomicU64 = AtomicU64::new(0); 32 pub static ref TIMER_LIST: SpinLock<LinkedList<Arc<Timer>>> = SpinLock::new(LinkedList::new()); 47 pub fn new(pcb: &'static mut process_control_block) -> Box<WakeUpHelper> { in new() method 48 return Box::new(WakeUpHelper { pcb }); in new() 72 pub fn new(timer_func: Box<dyn TimerFunction>, expire_jiffies: u64) -> Arc<Self> { in new() method 73 let result: Arc<Timer> = Arc::new(Timer(SpinLock::new(InnerTimer { in new() 144 pub fn new() -> Self { in new() method 146 running: AtomicBool::new(false), in new() 214 let do_timer_softirq = Arc::new(DoTimerSoftirq::new()); in timer_init() 250 let timer = Timer::new(WakeUpHelper::new(current_pcb()), timeout as u64); in schedule_timeout()
|
D | jiffies.rs | 14 pub static ref DEFAULT_CLOCK: Arc<ClocksourceJiffies> = ClocksourceJiffies::new(); 64 pub fn new() -> Arc<Self> { in new() method 68 mask: ClocksourceMask::new(0xffffffff), in new() 72 flags: ClocksourceFlags::new(0), in new() 75 let jieffies = Arc::new(ClocksourceJiffies(SpinLock::new(InnerJiffies { in new()
|
/DragonOS-0.1.8/kernel/src/filesystem/fat/ |
D | fs.rs | 83 pub fn new(fs_info: FATFsInfo) -> Self { in new() method 84 return Self(SpinLock::new(fs_info)); in new() 137 let entry_inode: Arc<LockedFATInode> = LockedFATInode::new( in find() 161 pub fn new( in new() method 172 let inode: Arc<LockedFATInode> = Arc::new(LockedFATInode(SpinLock::new(FATInode { in new() 175 children: BTreeMap::new(), in new() 252 pub fn new(partition: Arc<Partition>) -> Result<Arc<FATFileSystem>, SystemError> { in new() method 253 let bpb = BiosParameterBlock::new(partition.clone())?; in new() 260 FATFsInfo::new( in new() 291 let root_inode: Arc<LockedFATInode> = Arc::new(LockedFATInode(SpinLock::new(FATInode { in new() [all …]
|
/DragonOS-0.1.8/kernel/src/mm/allocator/ |
D | page_frame.rs | 20 pub fn new(paddr: PhysAddr) -> Self { in new() method 28 return PhysAddr::new(self.number * MMArch::PAGE_SIZE); in phys_address() 43 return PhysPageFrameIter::new(start, end); in iter_range() 56 pub fn new(start: PhysPageFrame, end: PhysPageFrame) -> Self { in new() method 84 pub fn new(vaddr: VirtAddr) -> Self { in new() method 92 return VirtAddr::new(self.number * MMArch::PAGE_SIZE); in virt_address() 130 pub fn new(start: VirtPageFrame, end: VirtPageFrame) -> Self { in new() method 158 pub const fn new(count: usize) -> Self { in new() method 267 pub fn new(used: PageFrameCount, total: PageFrameCount) -> Self { in new() method 293 return self.allocate(PageFrameCount::new(1)).map(|(addr, _)| addr); in allocate_one() [all …]
|
/DragonOS-0.1.8/kernel/src/arch/x86_64/mm/ |
D | mod.rs | 42 base: PhysAddr::new(0), 47 static mut INITIAL_CR3_VALUE: PhysAddr = PhysAddr::new(0); 53 static INNER_ALLOCATOR: SpinLock<Option<BuddyAllocator<MMArch>>> = SpinLock::new(None); 80 static XD_RESERVED: AtomicBool = AtomicBool::new(false); 121 const USER_END_VADDR: VirtAddr = VirtAddr::new(0x0000_7eff_ffff_ffff); 122 const USER_BRK_START: VirtAddr = VirtAddr::new(0x700000000000); 123 const USER_STACK_START: VirtAddr = VirtAddr::new(0x6ffff0a00000); 177 return PhysAddr::new(paddr); in table() 224 return Ok(crate::mm::ucontext::UserMapper::new(new_umapper)); in setup_new_usermapper() 253 PHYS_MEMORY_AREAS[areas_count].base = PhysAddr::new(mb2_mem_info[i].addr as usize); in init_memory_area_from_multiboot2() [all …]
|
/DragonOS-0.1.8/kernel/src/driver/base/map/ |
D | mod.rs | 15 pub fn new(data: Arc<dyn KObject>) -> Self { in new() method 26 Self(SpinLock::new(KObjMap::default())) in default() 36 Self(vec![BTreeMap::new(); KOBJMAP_HASH_SIZE]) in default() 56 Probe::new(data.clone()), in kobj_map() 70 let rm_dev_t = &DeviceNumber::new(Into::<usize>::into(dev_t) + i); in kobj_unmap()
|
/DragonOS-0.1.8/kernel/src/net/ |
D | socket.rs | 27 … pub static ref SOCKET_SET: SpinLock<SocketSet<'static >> = SpinLock::new(SocketSet::new(vec![])); 30 pub static ref PORT_MANAGER: PortManager = PortManager::new(); 43 pub fn new() -> Self { in new() method 45 tcp_port_table: SpinLock::new(HashMap::new()), in new() 46 udp_port_table: SpinLock::new(HashMap::new()), in new() 136 pub fn new(handle: SocketHandle) -> Arc<Self> { in new() method 137 return Arc::new(Self(handle)); in new() 200 fn new( in new() method 245 pub fn new(protocol: Protocol, options: SocketOptions) -> Self { in new() method 246 let tx_buffer = raw::PacketBuffer::new( in new() [all …]
|
/DragonOS-0.1.8/docs/kernel/sched/ |
D | kernel_timer.md | 9 …imer>`组成。全局中使用元素类型为`Arc<Timer>`的队列`TIMER_LIST`存储系统创建的定时器。创建定时器时,应调用`Timer::new(timer_func,expire_j… 32 pub fn new(timer_func: Box<dyn TimerFunction>, expire_jiffies: u64) -> Arc<Self> 145 pub fn new(para: i32) -> Box<TimerExample> { 146 return Box::new(TimerExample { 163 let timer_example: Box<TimerExample> = TimerExample::new(1); 165 let timer: Arc<Timer> = Timer::new(timer_example, 1);
|
/DragonOS-0.1.8/kernel/src/syscall/ |
D | user_access.rs | 74 return Ok(String::new()); in check_and_clone_cstr() 78 let mut buffer = Vec::new(); in check_and_clone_cstr() 87 copy_from_user(&mut c, VirtAddr::new(addr as usize))?; in check_and_clone_cstr() 113 Ok(Vec::new()) in check_and_clone_cstr_array() 116 let mut buffer = Vec::new(); in check_and_clone_cstr_array() 124 copy_from_user(&mut dst, VirtAddr::new(addr as usize))?; in check_and_clone_cstr_array()
|