/DragonOS/kernel/src/virt/kvm/ |
H A D | mod.rs | 24 pub fn push_vm(id: usize) -> Result<(), ()> { in push_vm() 26 if vm_list.iter().any(|x| x.id == id) { in push_vm() 27 debug!("push_vm: vm {} already exists", id); in push_vm() 30 vm_list.push(Vm::new(id).unwrap()); in push_vm() 35 pub fn remove_vm(id: usize) -> Vm { in remove_vm() 37 match vm_list.iter().position(|x| x.id == id) { in remove_vm() 39 panic!("VM[{}] not exist in VM LIST", id); in remove_vm() 45 pub fn update_vm(id: usize, new_vm: Vm) { in update_vm() 46 remove_vm(id); in update_vm() 51 pub fn vm(id: usize) -> Option<Vm> { in vm() [all …]
|
H A D | vm.rs | 20 pub id: usize, field 33 pub fn new(id: usize) -> Result<Self, SystemError> { in new() 37 id, in new() 53 let id: u16 = mem.slot as u16; // slot id in set_user_memory_region() localVariable 55 debug!("id={}, as_id={}", id, as_id); in set_user_memory_region() 70 if as_id >= (KVM_ADDRESS_SPACE_NUM as u32) || id >= KVM_MEM_SLOTS_NUM as u16 { in set_user_memory_region() 76 let slot = &self.memslots[as_id as usize].memslots[id as usize]; in set_user_memory_region() 91 id, // 虚机内存区间id in set_user_memory_region() 134 if memslot.id == id || memslot.id as u32 >= KVM_USER_MEM_SLOTS { in set_user_memory_region() 159 memslots[id as usize] = new_slot; in set_user_memory_region()
|
H A D | vcpu.rs | 9 fn id(&self) -> u32; in id() method
|
/DragonOS/kernel/src/driver/scsi/ |
H A D | mod.rs | 62 fn format_name(id: usize) -> BlockDevName { in format_name() 63 let x = (b'a' + id as u8) as char; in format_name() 64 BlockDevName::new(format!("sd{}", x), id) in format_name() 68 pub fn free_id(&self, id: usize) { in free_id() 69 if id >= Self::MAX_DEVICES { in free_id() 72 self.inner().id_bmp.set(id, false); in free_id() 73 self.inner().devname[id] = None; in free_id()
|
/DragonOS/kernel/src/driver/pci/ |
H A D | dev_id.rs | 57 pub fn general_match(&self, id: PciDeviceID) -> bool { in general_match() 58 if (self.vendor == id.vendor() || self.vendor == PCI_ANY_ID) in general_match() 59 && (self.device_id == id.device_id() || self.device_id == PCI_ANY_ID) in general_match() 60 && (self.subvendor == id.subvendor() || self.subvendor == PCI_ANY_ID) in general_match() 61 && (self.subdevice == id.subdevice() || self.subdevice == PCI_ANY_ID) in general_match() 62 && self.class_check(&id) in general_match() 69 pub fn class_check(&self, id: &Self) -> bool { in class_check() 70 return (self.class ^ id.class()) & self.class_mask == 0; in class_check()
|
H A D | driver.rs | 27 fn probe(&self, device: &Arc<dyn PciDevice>, id: &PciDeviceID) -> Result<(), SystemError>; in probe() 41 fn add_dynid(&mut self, id: PciDeviceID) -> Result<(), SystemError>; in add_dynid()
|
/DragonOS/kernel/src/ipc/ |
H A D | shm.rs | 157 let id = self.id_allocator.alloc().expect("No more id to allocate."); in add() localVariable 158 let shm_id = ShmId::new(id); in add() 178 id: shm_id, in add() 200 pub fn get_mut(&mut self, id: &ShmId) -> Option<&mut KernelShm> { in get_mut() 201 self.id2shm.get_mut(id) in get_mut() 208 pub fn free_id(&mut self, id: &ShmId) { in free_id() 209 self.id2shm.remove(id); in free_id() 210 self.id_allocator.free(id.0); in free_id() 249 id: ShmId, in shm_stat() 254 let kernel_shm = self.id2shm.get(&id).ok_or(SystemError::EINVAL)?; in shm_stat() [all …]
|
H A D | syscall.rs | 274 let id = shm_manager_guard.contains_key(&key); in shmget() localVariable 275 if let Some(id) = id { in shmget() 282 return Ok(id.data()); in shmget() 308 pub fn shmat(id: ShmId, vaddr: VirtAddr, shmflg: ShmFlags) -> Result<usize, SystemError> { in shmat() 313 let kernel_shm = shm_manager_guard.get_mut(&id).ok_or(SystemError::EINVAL)?; in shmat() 479 id: ShmId, in shmctl() 493 shm_manager_guard.shm_stat(id, cmd, user_buf, from_user) in shmctl() 496 ShmCtlCmd::IpcSet => shm_manager_guard.ipc_set(id, user_buf, from_user), in shmctl() 498 ShmCtlCmd::IpcRmid => shm_manager_guard.ipc_rmid(id), in shmctl() 500 ShmCtlCmd::ShmLock => shm_manager_guard.shm_lock(id), in shmctl() [all …]
|
/DragonOS/kernel/crates/ida/src/ |
H A D | lib.rs | 117 pub fn exists(&self, id: usize) -> bool { in exists() 118 if id < self.min_id || id >= self.max_id { in exists() 121 self.xarray.load(id as u64).is_some() in exists() 133 pub fn free(&mut self, id: usize) { in free() 134 if id < self.min_id || id >= self.max_id { in free() 137 if self.xarray.remove(id as u64).is_some() { in free()
|
/DragonOS/kernel/crates/klog_types/src/ |
H A D | lib.rs | 15 pub id: u64, field 41 id: u64, in new() 48 id, in new() 62 id: 0, in zeroed() 95 if self.id == 0 { in is_valid() 111 return self.id.cmp(&other.id); in cmp()
|
/DragonOS/kernel/src/driver/video/fbdev/base/ |
H A D | fbmem.rs | 145 let id = self.generate_fb_id().expect("no more fb id"); in register_fb() localVariable 146 fb.set_fb_id(id); in register_fb() 147 let fb_device = FbDevice::new(Arc::downgrade(&fb) as Weak<dyn FrameBuffer>, id); in register_fb() 169 inner.registered_fbs[id.data() as usize] = Some(fb.clone() as Arc<dyn FrameBuffer>); in register_fb() 172 return Ok(id); in register_fb() 185 pub fn find_fb_by_id(&self, id: FbId) -> Result<Option<Arc<dyn FrameBuffer>>, SystemError> { in find_fb_by_id() 186 if unlikely(!id.is_valid()) { in find_fb_by_id() 191 return Ok(inner.registered_fbs[id.data() as usize].clone()); in find_fb_by_id() 218 fn new(fb: Weak<dyn FrameBuffer>, id: FbId) -> Arc<Self> { in new() 224 fb_id: id, in new()
|
/DragonOS/user/apps/user-manage/ |
H A D | README.md | 15 -g 组id 50 usermod -a -G<组 1,组 2,...> -c<备注> -d<登入目录> -G<组名> -l<名称> -s<登入终端> -u<用户 id> username 89 -g\<gid\> 指定组 id
|
/DragonOS/kernel/src/driver/base/platform/ |
H A D | platform_device.rs | 61 fn set_pdev_id(&self, id: i32); in set_pdev_id() 91 let id = pdev.pdev_id().0; in device_add() localVariable 92 match id { in device_add() 97 let id = PLATFORM_DEVID_IDA in device_add() localVariable 101 pdev.set_pdev_id(id as i32); in device_add() 106 pdev.set_name(format!("{}.{}", pdev.pdev_name(), id)); in device_add()
|
/DragonOS/kernel/src/driver/pci/test/ |
H A D | pt_driver.rs | 47 fn add_dynid(&mut self, id: PciDeviceID) -> Result<(), system_error::SystemError> { in add_dynid() 48 let id = Arc::new(id); in add_dynid() localVariable 49 self.locked_dynid_list.write().push(id); in add_dynid()
|
/DragonOS/kernel/src/debug/klog/ |
H A D | mm.rs | 54 let id = __MM_DEBUG_LOG_IDA.lock_irqsave().alloc().unwrap(); in log() localVariable 56 id as u64, in log()
|
/DragonOS/kernel/src/cgroup/ |
H A D | mem_cgroup.rs | 5 id: u32, field
|
/DragonOS/kernel/src/net/ |
H A D | mod.rs | 99 Protocol::Unknown(id) => write!(f, "0x{id:02x}"), in fmt() 142 Protocol::Unknown(id) => id, in from()
|
/DragonOS/docs/kernel/libs/ |
H A D | index.rst | 13 id-allocation
|
/DragonOS/kernel/src/filesystem/ |
H A D | eventfd.rs | 42 id: u32, field 46 pub fn new(count: u64, flags: EventFdFlags, id: u32) -> Self { in new() 47 EventFd { count, flags, id } in new() 264 let id = EVENTFD_ID_ALLOCATOR in sys_eventfd() localVariable 268 let eventfd = EventFd::new(init_val as u64, flags, id); in sys_eventfd()
|
/DragonOS/kernel/src/arch/x86_64/kvm/ |
H A D | mod.rs | 58 pub fn kvm_arch_vcpu_create(id: u32) -> Result<Arc<Mutex<VmxVcpu>>, SystemError> { in kvm_arch_vcpu_create() 60 let vcpu = VmxVcpu::new(id, vm(0).unwrap()).unwrap(); in kvm_arch_vcpu_create()
|
/DragonOS/kernel/src/arch/x86_64/kvm/vmx/ |
H A D | ept.rs | 56 Err(id) if id == cpuid => break, in lock_cpu()
|
/DragonOS/tools/ |
H A D | umount_virt_disk.sh | 2 uid=`id -u`
|
/DragonOS/kernel/src/driver/virtio/ |
H A D | sysfs.rs | 139 for id in &ids { in match_device() 140 if id.device != virtio_device.device_type_id() && id.vendor != VIRTIO_DEV_ANY_ID { in match_device() 143 if id.vendor == VIRTIO_DEV_ANY_ID || id.vendor == virtio_device.vendor() { in match_device()
|
/DragonOS/kernel/src/driver/block/ |
H A D | virtio_blk.rs | 135 fn format_name(id: usize) -> BlockDevName { in format_name() 136 let x = (b'a' + id as u8) as char; in format_name() 137 BlockDevName::new(format!("vd{}", x), id) in format_name() 141 pub fn free_id(&self, id: usize) { in free_id() 142 if id >= Self::MAX_DEVICES { in free_id() 145 self.inner().id_bmp.set(id, false); in free_id() 146 self.inner().devname[id] = None; in free_id() 553 fn add_virtio_id(&self, id: VirtioDeviceId) { in add_virtio_id() 554 self.inner().virtio_driver_common.id_table.push_back(id); in add_virtio_id()
|
/DragonOS/kernel/src/driver/base/device/ |
H A D | mod.rs | 319 id: Option<DeviceNumber>, field 328 pub fn new(basename: String, id: Option<DeviceNumber>) -> IdTable { in new() 329 return IdTable { basename, id }; in new() 336 if self.id.is_none() { in name() 339 let id = self.id.unwrap(); in name() localVariable 340 return format!("{}:{}", id.major().data(), id.minor()); in name() 345 return self.id.unwrap_or_default(); in device_number() 997 pub fn id(&self) -> Option<&str> { in id() method 1014 return self.id() == other.id(); in eq() 1020 self.id().hash(state); in hash()
|