/DragonOS/kernel/crates/bitmap/tests/ |
H A D | static-bitmap.rs | 17 assert_eq!(bitmap.first_false_index(), Some(0)); in test_empty_bitmap_32() 19 assert_eq!(bitmap.last_false_index(), Some(31)); in test_empty_bitmap_32() 21 assert_eq!(bitmap.next_false_index(0), Some(1)); in test_empty_bitmap_32() 29 assert_eq!(bitmap.first_index(), Some(0)); in test_empty_bitmap_32() 31 assert_eq!(bitmap.last_index(), Some(31)); in test_empty_bitmap_32() 33 assert_eq!(bitmap.next_index(0), Some(1)); in test_empty_bitmap_32() 47 assert_eq!(bitmap.first_false_index(), Some(0)); in test_empty_bitmap_64() 49 assert_eq!(bitmap.last_false_index(), Some(63)); in test_empty_bitmap_64() 51 assert_eq!(bitmap.next_false_index(0), Some(1)); in test_empty_bitmap_64() 59 assert_eq!(bitmap.first_index(), Some(0)); in test_empty_bitmap_64() [all …]
|
H A D | alloc-bitmap.rs | 17 assert_eq!(bitmap.first_false_index(), Some(0)); in test_empty_bitmap_32() 19 assert_eq!(bitmap.last_false_index(), Some(31)); in test_empty_bitmap_32() 21 assert_eq!(bitmap.next_false_index(0), Some(1)); in test_empty_bitmap_32() 29 assert_eq!(bitmap.first_index(), Some(0)); in test_empty_bitmap_32() 31 assert_eq!(bitmap.last_index(), Some(31)); in test_empty_bitmap_32() 33 assert_eq!(bitmap.next_index(0), Some(1)); in test_empty_bitmap_32() 47 assert_eq!(bitmap.first_false_index(), Some(0)); in test_empty_bitmap_64() 49 assert_eq!(bitmap.last_false_index(), Some(63)); in test_empty_bitmap_64() 51 assert_eq!(bitmap.next_false_index(0), Some(1)); in test_empty_bitmap_64() 59 assert_eq!(bitmap.first_index(), Some(0)); in test_empty_bitmap_64() [all …]
|
/DragonOS/kernel/crates/rbpf/tests/ |
H A D | ubpf_vm.rs | 38 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_add() 67 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_alu64_arith() 100 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_alu64_bit() 129 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_alu_arith() 160 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_alu_bit() 174 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_arsh32_high_shift() 188 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_arsh() 204 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_arsh64() 219 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_arsh_reg() 233 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_vm_arsh_imm_overflow() [all …]
|
H A D | ubpf_jit_x86_64.rs | 39 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_jit_add() 71 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_jit_alu64_arith() 107 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_jit_alu64_bit() 139 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_jit_alu_arith() 173 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_jit_alu_bit() 190 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_jit_arsh32_high_shift() 207 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_jit_arsh() 226 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_jit_arsh64() 244 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_jit_arsh_reg() 261 let mut vm = rbpf::EbpfVmRaw::new(Some(&prog)).unwrap(); in test_jit_be16() [all …]
|
H A D | ubpf_verifier.rs | 30 let vm = rbpf::EbpfVmNoData::new(Some(prog)).unwrap(); in test_verifier_err_endian_size() 42 let vm = rbpf::EbpfVmNoData::new(Some(prog)).unwrap(); in test_verifier_err_incomplete_lddw() 55 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_verifier_err_infinite_loop() 68 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_verifier_err_invalid_reg_dst() 81 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_verifier_err_invalid_reg_src() 95 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_verifier_err_jmp_lddw() 108 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_verifier_err_jmp_out() 120 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_verifier_err_no_exit() 133 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_verifier_err_no_exit_backward_jump() 151 let vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_verifier_err_too_many_instructions() [all …]
|
H A D | cranelift.rs | 18 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); 28 let mut vm = rbpf::EbpfVmRaw::new(Some(&prog)).unwrap(); 273 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_cranelift_call() 294 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_cranelift_err_call_unreg() 312 let mut vm = rbpf::EbpfVmRaw::new(Some(&prog)).unwrap(); in test_cranelift_call_memfrob() 480 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_cranelift_err_stack_out_of_bound() 1777 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_cranelift_stack2() 1853 let mut vm = rbpf::EbpfVmNoData::new(Some(&prog)).unwrap(); in test_cranelift_string_stack() 2045 let mut vm = rbpf::EbpfVmRaw::new(Some(prog)).unwrap(); in test_cranelift_tcp_port80_match() 2062 let mut vm = rbpf::EbpfVmRaw::new(Some(prog)).unwrap(); in test_cranelift_tcp_port80_nomatch() [all …]
|
H A D | misc.rs | 149 let mut vm = rbpf::EbpfVmFixedMbuff::new(Some(prog), 0x40, 0x50).unwrap(); in test_vm_block_port() 215 let mut vm = rbpf::EbpfVmFixedMbuff::new(Some(prog), 0x40, 0x50).unwrap(); in test_jit_block_port() 246 let vm = rbpf::EbpfVmMbuff::new(Some(prog)).unwrap(); in test_vm_mbuff() 280 let vm = rbpf::EbpfVmMbuff::new(Some(program.into_bytes())).unwrap(); in test_vm_mbuff_with_rust_api() 305 let mut vm = rbpf::EbpfVmMbuff::new(Some(prog)).unwrap(); in test_jit_mbuff() 322 let mut vm = rbpf::EbpfVmRaw::new(Some(prog)).unwrap(); in test_vm_jit_ldabsb() 342 let mut vm = rbpf::EbpfVmRaw::new(Some(prog)).unwrap(); in test_vm_jit_ldabsh() 362 let mut vm = rbpf::EbpfVmRaw::new(Some(prog)).unwrap(); in test_vm_jit_ldabsw() 382 let mut vm = rbpf::EbpfVmRaw::new(Some(prog)).unwrap(); in test_vm_jit_ldabsdw() 402 let vm = rbpf::EbpfVmRaw::new(Some(prog)).unwrap(); in test_vm_err_ldabsb_oob() [all …]
|
/DragonOS/kernel/src/driver/base/device/ |
H A D | init.rs | 24 DEVICES_KSET_INSTANCE = Some(devices_kset); in devices_init() 26 DEVICE_MANAGER = Some(DeviceManager::new()); in devices_init() 35 virtual_kset.set_parent(Some(Arc::downgrade(&parent))); in devices_init() 38 .register(Some(devices_kset)) in devices_init() 48 DEV_KSET_INSTANCE = Some(dev_kset); in devices_init() 58 dev_block_kset.set_parent(Some(Arc::downgrade(&parent))); in devices_init() 61 .register(Some(dev_kset)) in devices_init() 73 dev_char_kset.set_parent(Some(Arc::downgrade(&parent))); in devices_init() 76 .register(Some(dev_kset)) in devices_init()
|
H A D | mod.rs | 111 DEV_BLOCK_KSET_INSTANCE = Some(kset); in set_sys_dev_block_kset() 115 DEV_CHAR_KSET_INSTANCE = Some(kset); in set_sys_dev_char_kset() 124 DEVICES_VIRTUAL_KSET_INSTANCE = Some(kset); in set_sys_devices_virtual_kset() 442 Some(&DeviceSysFSOps) in sysfs_ops() 500 if let Some(ref dev) = deivce_parent { in add_device() 508 if let Some(ref kobj) = kobject_parent { in add_device() 511 if let Some(kobject_parent) = kobject_parent { in add_device() 518 device.set_parent(Some(Arc::downgrade(&kobject_parent))); in add_device() 541 if let Some(bus) = device.bus().and_then(|bus| bus.upgrade()) { in add_device() 544 Some(&device), in add_device() [all …]
|
/DragonOS/kernel/crates/ida/src/ |
H A D | lib.rs | 64 Some(Self { in new() 89 if let Some(try1) = self.do_find_first_free_index(self.current_id, self.max_id) { in alloc() 93 return Some(try1); in alloc() 97 if let Some(try2) = in alloc() 103 return Some(try2); in alloc() 182 assert_eq!(ida.alloc(), Some(0)); in test_id_allocator() 183 assert_eq!(ida.alloc(), Some(1)); in test_id_allocator() 184 assert_eq!(ida.alloc(), Some(2)); in test_id_allocator() 185 assert_eq!(ida.alloc(), Some(3)); in test_id_allocator() 186 assert_eq!(ida.alloc(), Some(4)); in test_id_allocator() [all …]
|
/DragonOS/kernel/crates/bitmap/src/ |
H A D | bitmap_core.rs | 29 Some(bit) in get() 43 Some(bit) in set() 64 if let Some(b) = bit { in first_index() 65 return Some(i * T::bit_size() + b); in first_index() 75 if let Some(bit) = <T as BitOps>::first_false_index(element) { in first_false_index() 86 if let Some(bit) = <T as BitOps>::last_index(element) { in last_index() 112 if let Some(bit) = <T as BitOps>::last_false_index(&last_element) { in last_false_index() 117 if let Some(bit) = <T as BitOps>::last_false_index(element) { in last_false_index() 135 if let Some(bit) = <T as BitOps>::next_index(element, bit_index) { in next_index() 140 if let Some(bit) = <T as BitOps>::first_index(element) { in next_index() [all …]
|
/DragonOS/user/apps/user-manage/src/check/ |
H A D | check.rs | 85 username: Some(info.username.clone()), in check() 86 uid: Some(info.uid.clone()), in check() 169 if exit_status.code() != Some(0) { in check_group_gid() 201 username: Some(info.username.clone()), in check() 207 if let Some(_) = cmd.options.get(&CmdOption::Remove) { in check() 208 info.home = Some(Self::home(&info.username)); in check() 255 if let Some(shell) = &info.new_shell { in check() 260 if let Some(new_home) = &info.new_home { in check() 267 username: Some(info.username.clone()), in check() 316 info.groups = Some(arg.split(",").map(|s| s.to_string()).collect()); in parse_options() [all …]
|
/DragonOS/kernel/src/filesystem/overlayfs/ |
H A D | mod.rs | 162 Some(upper_inode), in make_overlayfs() 176 mnt: Arc::new(OvlInode::new(dir.clone(), None, Some(lower_inode))), in make_overlayfs() 212 Some(&self.redirect) in ovl_lower_redirect() 221 if let Some(ref upper_inode) = *upper_inode { in create_whiteout() 230 *upper_inode = Some(new_inode); in create_whiteout() 244 if let Some(ref upper_inode) = *upper_inode { in has_whiteout() 246 if let Some(ovl_inode) = inode.as_any_ref().downcast_ref::<OvlInode>() { in has_whiteout() 263 if let Some(ref upper_inode) = *self.upper_inode.lock() { in read_at() 267 if let Some(lower_inode) = &self.lower_inode { in read_at() 284 if let Some(ref upper_inode) = *self.upper_inode.lock() { in write_at() [all …]
|
/DragonOS/kernel/crates/rust-slabmalloc/src/ |
H A D | zone.rs | 80 0..=8 => Some(8), in get_max_size() 81 9..=16 => Some(16), in get_max_size() 82 17..=32 => Some(32), in get_max_size() 83 33..=64 => Some(64), in get_max_size() 84 65..=128 => Some(128), in get_max_size() 85 129..=256 => Some(256), in get_max_size() 86 257..=512 => Some(512), in get_max_size() 87 513..=1024 => Some(1024), in get_max_size() 88 1025..=2048 => Some(2048), in get_max_size()
|
/DragonOS/tools/debugging/logmonitor/src/ |
H A D | app.rs | 57 self.backend_log_receiver = Some(receiver); in set_backend_log_receiver() 73 if let Some(logs) = logs_to_push { in handle_logs_on_tick() 86 if let Some(res) = self.counter.checked_add(1) { in increment_counter() 92 if let Some(res) = self.counter.checked_sub(1) { in decrement_counter() 167 Some(self.distribution.sample(&mut self.rng)) in next() 187 Some(i) => { in next() 196 self.state.select(Some(i)); in next() 201 Some(i) => { in previous() 210 self.state.select(Some(i)); in previous()
|
/DragonOS/kernel/src/process/ |
H A D | exit.rs | 96 if let Some(mut wstatus_buf) = wstatus_buf { in kernel_wait4() 97 let wstatus = if let Some(ret_info) = &kwo.ret_info { in kernel_wait4() 114 kwo.no_task_error = Some(SystemError::ECHILD); in do_wait() 117 if let Some(err) = &kwo.no_task_error { in do_wait() 145 if let Some(r) = r { in do_wait() 191 if let Some(info) = &mut kwo.ret_info { in do_waitpid() 201 return Some(Ok(0)); in do_waitpid() 212 return Some(Ok(0)); in do_waitpid() 218 if let Some(infop) = &mut kwo.ret_info { in do_waitpid() 226 return Some(Ok(child_pcb.pid().data())); in do_waitpid() [all …]
|
/DragonOS/kernel/src/init/ |
H A D | cmdline.rs | 75 Some(KernelCmdlineEarlyKV { in build_early_kv() 89 KCmdlineParamType::Arg => Some(KernelCmdlineParameter::Arg(KernelCmdlineArg { in build() 96 KCmdlineParamType::KV => Some(KernelCmdlineParameter::KV(KernelCmdlineKV { in build() 127 KernelCmdlineParameter::Arg(v) => Some(v.value()), in value_bool() 264 Some(v) => v, in early_init() 268 if let Some(param) = self.find_param(node, option, KCmdlineParamType::EarlyKV) { in early_init() 273 if let Some(value) = value { in early_init() 325 Some(v) => v, in init() 332 inner.init_path = Some(CString::new(value.unwrap()).unwrap()); in init() 341 if let Some(param) = self.find_param(node, option, KCmdlineParamType::KV) { in init() [all …]
|
/DragonOS/kernel/src/exception/ |
H A D | irqdomain.rs | 39 IRQ_DOMAIN_MANAGER = Some(Arc::new(IrqDomainManager::new())); in irq_domain_manager_init() 104 Some(name), in create_and_add() 114 return Some(domain); in create_and_add() 141 self.inner.write_irqsave().default_domain = Some(domain); in set_default_domain() 201 irq_data_guard.set_domain(Some(domain.clone())); in domain_associate() 255 r = self.do_activate_irq(Some(irq_data.clone()), reserve); in activate_irq() 273 if let Some(irq_data) = irq_data { in do_activate_irq() 275 if let Some(domain) = irq_data.domain() { in do_activate_irq() 278 if let Some(parent_data) = parent_data.clone() { in do_activate_irq() 279 r = self.do_activate_irq(Some(parent_data), reserve); in do_activate_irq() [all …]
|
/DragonOS/kernel/src/filesystem/sysfs/ |
H A D | file.rs | 61 if let Some(attribute) = self.attribute { in callback_read() 74 } else if let Some(bin_attribute) = self.bin_attribute.as_ref() { in callback_read() 84 if let Some(attribute) = self.attribute { in callback_write() 88 } else if let Some(bin_attribute) = self.bin_attribute.as_ref() { in callback_write() 123 if let Some(KernInodePrivateData::SysFS(SysFSKernPrivateData::Dir(dt))) = x.as_ref() { in add_file_with_mode() 154 let sys_priv = SysFSKernPrivateData::File(SysKernFilePriv::new(&kobj, Some(attr), None)); in add_file_with_mode() 158 Some(4096), in add_file_with_mode() 159 Some(KernInodePrivateData::SysFS(sys_priv)), in add_file_with_mode() 160 Some(kern_callback), in add_file_with_mode() 184 if let Some(parent) = parent { in remove_file() [all …]
|
H A D | dir.rs | 62 .unwrap_or_else(|| Some(self.root_inode.clone())) in create_dir() 70 Some(KernInodePrivateData::SysFS(sysfs_dir_priv)), in create_dir() 74 kobj.set_inode(Some(dir.clone())); in create_dir() 96 if let Some(parent) = p.parent() { in kernfs_path() 122 if let Some(inode) = kobj_inode { in remove_dir()
|
/DragonOS/kernel/src/driver/base/ |
H A D | kobject.rs | 198 if let Some(kset) = join_kset { in add_kobj() 202 kobj.set_parent(Some(Arc::downgrade(&(kset as Arc<dyn KObject>)))); in add_kobj() 210 if let Some(kset) = kobj.kset() { in add_kobj() 221 kobj.update_kobj_state(Some(KObjectState::IN_SYSFS), None); in add_kobj() 230 if let Some(ktype) = kobj.kobj_type() { in create_dir() 232 if let Some(groups) = groups { in create_dir() 247 if let Some(ktype) = ktype { in remove_kobj() 248 if let Some(groups) = ktype.attribute_groups() { in remove_kobj() 256 kobj.update_kobj_state(None, Some(KObjectState::IN_SYSFS)); in remove_kobj() 258 if let Some(kset) = kset { in remove_kobj() [all …]
|
H A D | class.rs | 30 CLASS_KSET_INSTANCE = Some(class_kset); in classes_init() 89 return Some(dev.clone()); in find_device() 130 subsys.set_kobj_type(Some(&ClassKObjbectType)); in class_register() 131 subsystem.set_class(Some(Arc::downgrade(class))); in class_register() 133 subsys.register(Some(sys_class_kset()))?; in class_register() 155 Some(&ClassSysFSOps) in sysfs_ops()
|
/DragonOS/kernel/crates/rbpf/src/ |
H A D | lib.rs | 143 if let Some(prog) = prog { in new() 179 self.prog = Some(prog); in set_program() 214 if let Some(prog) = self.prog { in set_verifier() 324 Some(prog) => prog, in jit_compile() 330 self.jit = Some(jit::JitMemory::new(prog, &self.helpers, true, false)?); in jit_compile() 404 Some(jit) => Ok(jit.get_prog()( in execute_program_jit() 443 Some(prog) => prog, in cranelift_compile() 453 self.cranelift_prog = Some(program); in cranelift_compile() 516 Some(prog) => { in execute_program_cranelift() 842 Some(prog) => prog, in jit_compile() [all …]
|
/DragonOS/kernel/src/libs/ |
H A D | rwlock.rs | 145 return Some(RwLockReadGuard { in inner_try_read() 159 Some(guard) => return guard, in read() 170 Some(mut guard) => { in read_irqsave() 171 guard.irq_guard = Some(irq_guard); in read_irqsave() 182 if let Some(mut guard) = self.try_read() { in try_read_irqsave() 183 guard.irq_guard = Some(irq_guard); in try_read_irqsave() 184 return Some(guard); in try_read_irqsave() 226 g.irq_guard = Some(irq_guard); in try_write_irqsave() 245 return Some(RwLockWriteGuard { in inner_try_write() 261 Some(guard) => return guard, in write() [all …]
|
/DragonOS/kernel/src/arch/x86_64/driver/apic/ |
H A D | mod.rs | 167 return Some(result); in new() 278 return Some(TriggerMode::Level); in trigger_mode() 280 return Some(TriggerMode::Edge); in trigger_mode() 340 return Some(LocalApicTimerMode::Oneshot); in timer_mode() 343 return Some(LocalApicTimerMode::Periodic); in timer_mode() 346 return Some(LocalApicTimerMode::Deadline); in timer_mode() 457 if let Some(xapic) = current_xapic_instance().borrow_mut().as_mut() { in write_xapic_register() 508 *cur = Some(xapic_instance); in init_current_cpu() 513 if let Some(xapic) = cur.as_mut() { in init_current_cpu() 527 } else if let Some(xapic) = current_xapic_instance().borrow().as_ref() { in send_eoi() [all …]
|