Home
last modified time | relevance | path

Searched refs:IdAllocator (Results 1 – 14 of 14) sorted by relevance

/DragonOS/kernel/crates/ida/src/
H A Dlib.rs50 pub struct IdAllocator { struct
58 impl IdAllocator { impl
153 impl core::fmt::Debug for IdAllocator { implementation
170 assert_eq!(IdAllocator::new(10, 10).is_none(), true); in test_new_fail()
171 assert_eq!(IdAllocator::new(11, 10).is_none(), true); in test_new_fail()
175 assert_eq!(IdAllocator::new(9, 10).is_some(), true); in test_new_success()
176 assert_eq!(IdAllocator::new(0, 10).is_some(), true); in test_new_success()
181 let mut ida = IdAllocator::new(0, 10).unwrap(); in test_id_allocator()
/DragonOS/kernel/src/net/socket/
H A Dhandle.rs1 use ida::IdAllocator;
17 static KERNEL_HANDLE_IDA: SpinLock<IdAllocator> =
18 SpinLock::new(IdAllocator::new(0, usize::MAX).unwrap());
/DragonOS/kernel/src/namespaces/
H A Dpid_namespace.rs19 use ida::IdAllocator;
27 static PID_IDA: ida::IdAllocator = ida::IdAllocator::new(1, usize::MAX).unwrap();
31 id_alloctor: RwLock<IdAllocator>,
216 id_alloctor: RwLock::new(IdAllocator::new(1, PID_MAX).unwrap()), in new()
250 id_alloctor: RwLock::new(IdAllocator::new(1, PID_MAX).unwrap()), in create_pid_namespace()
/DragonOS/kernel/src/debug/klog/
H A Dmm.rs19 static __MM_DEBUG_LOG_IDA: SpinLock<ida::IdAllocator> =
20 SpinLock::new(ida::IdAllocator::new(1, usize::MAX).unwrap());
/DragonOS/docs/kernel/libs/
H A Did-allocation.md9 内核提供了一个名为`IdAllocator`的ID分配器,位于`kernel/crates/ida`中。
/DragonOS/kernel/src/filesystem/devpts/
H A Dmod.rs9 use ida::IdAllocator;
44 pts_ida: SpinLock<IdAllocator>,
53 pts_ida: SpinLock::new(IdAllocator::new(0, NR_UNIX98_PTY_MAX as usize).unwrap()), in new()
/DragonOS/kernel/src/filesystem/
H A Deventfd.rs16 use ida::IdAllocator;
19 static EVENTFD_ID_ALLOCATOR: SpinLock<IdAllocator> =
20 SpinLock::new(IdAllocator::new(0, u32::MAX as usize).unwrap());
/DragonOS/kernel/src/driver/base/platform/
H A Dplatform_device.rs5 use ida::IdAllocator;
30 static PLATFORM_DEVID_IDA: SpinLock<IdAllocator> =
31 SpinLock::new(IdAllocator::new(0, i32::MAX as usize).unwrap());
/DragonOS/kernel/src/driver/virtio/
H A Dsysfs.rs5 use ida::IdAllocator;
259 ida: SpinLock<IdAllocator>,
269 ida: SpinLock::new(IdAllocator::new(0, usize::MAX).unwrap()), in new()
/DragonOS/kernel/src/driver/rtc/
H A Dsysfs.rs5 use ida::IdAllocator;
37 static RTC_GENERAL_DEVICE_IDA: SpinLock<IdAllocator> =
38 SpinLock::new(IdAllocator::new(0, usize::MAX).unwrap());
/DragonOS/kernel/src/driver/tty/virtual_terminal/
H A Dmod.rs8 use ida::IdAllocator;
139 ida: IdAllocator,
151 let ida = IdAllocator::new(0, MAX_NR_CONSOLES as usize).unwrap(); in new()
/DragonOS/kernel/src/ipc/
H A Dshm.rs20 use ida::IdAllocator;
118 id_allocator: IdAllocator,
128 id_allocator: IdAllocator::new(0, usize::MAX - 1).unwrap(), in new()
/DragonOS/kernel/src/driver/tty/
H A Dtty_driver.rs9 use ida::IdAllocator;
138 ida: SpinLock<IdAllocator>,
176 ida: SpinLock::new(IdAllocator::new(0, count as usize).unwrap()), in new()
/DragonOS/kernel/src/mm/
H A Ducontext.rs17 use ida::IdAllocator;
57 static LOCKEDVMA_ID_ALLOCATOR: SpinLock<IdAllocator> =
58 SpinLock::new(IdAllocator::new(0, usize::MAX).unwrap());