/DragonOS/kernel/crates/intertrait/src/cast/ |
H A D | cast_box.rs | 1 use alloc::boxed::Box; 33 fn cast<T: ?Sized + 'static>(self: Box<Self>) -> Result<Box<T>, Box<Self>>; in cast() 38 fn cast<T: ?Sized + 'static>(self: Box<Self>) -> Result<Box<T>, Box<Self>> { in cast()
|
/DragonOS/kernel/crates/intertrait/src/ |
H A D | lib.rs | 70 use alloc::boxed::Box; 85 pub type BoxedCaster = Box<dyn Any + Send + Sync>; 188 pub cast_box: fn(from: Box<dyn Any>) -> Box<T>, 203 cast_box: fn(from: Box<dyn Any>) -> Box<T>, in new() 218 cast_box: fn(from: Box<dyn Any>) -> Box<T>, in new_sync() 274 fn box_any(self: Box<Self>) -> Box<dyn Any>; in box_any() 306 fn box_any(self: Box<Self>) -> Box<dyn Any> { in box_any() 324 fn box_any(self: Box<Self>) -> Box<dyn Any> { in box_any() 348 fn box_any(self: Box<Self>) -> Box<dyn Any> { in box_any() 388 let caster = Box::new(Caster::<dyn Debug> { in create_test_caster() [all …]
|
/DragonOS/kernel/src/driver/block/cache/ |
H A D | cache_block.rs | 1 use alloc::{boxed::Box, vec::Vec}; 21 data: Box<[u8]>, 27 pub fn new(data: Box<[u8]>, flag: CacheBlockFlag, lba_id: BlockId) -> Self { in new()
|
/DragonOS/kernel/src/process/ |
H A D | timer.rs | 8 use alloc::{boxed::Box, sync::Arc}; 36 pub fn new(timer_func: Box<dyn TimerFunction>, second: u64) -> Self { in new() 113 pub fn new(pid: Pid) -> Box<AlarmTimerFunc> { in new() 114 return Box::new(AlarmTimerFunc { pid }); in new()
|
H A D | kthread.rs | 7 boxed::Box, 97 UsizeClosure((Box<dyn Fn(usize) -> i32 + Send + Sync>, usize)), 99 EmptyClosure((Box<dyn Fn() -> i32 + Send + Sync>, ())), 129 closure: SpinLock<Option<Box<KernelThreadClosure>>>, 154 closure: SpinLock::new(Some(Box::new(func))), in new() 200 pub fn take_closure(&self) -> Option<Box<KernelThreadClosure>> { in take_closure() 272 KernelThreadClosure::EmptyClosure((Box::new(initial_kernel_thread), ())), in init_stage1() 310 let closure = KernelThreadClosure::EmptyClosure((Box::new(Self::kthread_daemon), ())); in init_stage2() 498 let closure: Box<KernelThreadClosure> = info.take_closure().unwrap(); in kernel_thread_bootstrap_stage2()
|
/DragonOS/docs/kernel/sched/ |
H A D | kernel_timer.md | 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);
|
/DragonOS/kernel/src/driver/disk/ahci/ |
H A D | mod.rs | 21 use alloc::{boxed::Box, collections::LinkedList, vec::Vec}; 40 list: &'a mut RwLockWriteGuard<'_, LinkedList<Box<dyn PciDeviceStructure>>>, in ahci_device_search() 41 ) -> Result<Vec<&'a mut Box<dyn PciDeviceStructure>>, SystemError> { in ahci_device_search() 61 Box::leak(Box::new([0u8; (1 << 20) as usize])) as *mut u8 as usize; in ahci_init()
|
/DragonOS/kernel/src/net/socket/ |
H A D | mod.rs | 4 boxed::Box, 68 ) -> Result<Box<dyn Socket>, SystemError> { in new_socket() 69 let socket: Box<dyn Socket> = match address_family { in new_socket() 71 PosixSocketType::Stream => Box::new(StreamSocket::new(SocketOptions::default())), in new_socket() 72 PosixSocketType::SeqPacket => Box::new(SeqpacketSocket::new(SocketOptions::default())), in new_socket() 78 PosixSocketType::Stream => Box::new(TcpSocket::new(SocketOptions::default())), in new_socket() 79 PosixSocketType::Datagram => Box::new(UdpSocket::new(SocketOptions::default())), in new_socket() 80 PosixSocketType::Raw => Box::new(RawSocket::new(protocol, SocketOptions::default())), in new_socket() 162 fn accept(&mut self) -> Result<(Box<dyn Socket>, Endpoint), SystemError> { in accept() 216 fn box_clone(&self) -> Box<dyn Socket>; in box_clone() [all …]
|
H A D | unix.rs | 1 use alloc::{boxed::Box, sync::Arc, vec::Vec}; 113 fn box_clone(&self) -> Box<dyn Socket> { in box_clone() 114 Box::new(self.clone()) in box_clone() 228 fn box_clone(&self) -> Box<dyn Socket> { in box_clone() 229 Box::new(self.clone()) in box_clone()
|
H A D | inet.rs | 1 use alloc::{boxed::Box, sync::Arc, vec::Vec}; 222 fn box_clone(&self) -> Box<dyn Socket> { in box_clone() 223 Box::new(self.clone()) in box_clone() 444 fn box_clone(&self) -> Box<dyn Socket> { in box_clone() 445 return Box::new(self.clone()); in box_clone() 881 fn accept(&mut self) -> Result<(Box<dyn Socket>, Endpoint), SystemError> { in accept() 923 let sock_ret = Box::new(TcpSocket { in accept() 995 fn box_clone(&self) -> Box<dyn Socket> { in box_clone() 996 Box::new(self.clone()) in box_clone()
|
/DragonOS/kernel/src/driver/video/ |
H A D | mod.rs | 15 use alloc::{boxed::Box, sync::Arc}; 35 refresh_target: RwLock<Option<Arc<SpinLock<Box<[u8]>>>>>, 138 pub fn refresh_target(&self) -> RwLockReadGuard<'_, Option<Arc<SpinLock<Box<[u8]>>>>> { in refresh_target() 220 fn new() -> Box<VideoRefreshExecutor> { in new() 221 return Box::new(VideoRefreshExecutor); in new() 244 let mut refresh_target: Option<RwLockReadGuard<'_, Option<Arc<SpinLock<Box<[u8]>>>>>> = in run()
|
/DragonOS/tools/debugging/logmonitor/src/backend/monitor/ |
H A D | mod.rs | 11 object: Box<T>, 26 let object = Box::new(x); in new()
|
H A D | logset.rs | 16 backend: Box<dyn LogSetBackend<K, V>>, 24 pub fn new(name: String, backend: Option<Box<dyn LogSetBackend<K, V>>>) -> Self { in new() 32 backend: backend.unwrap_or_else(|| Box::new(DefaultBackend::new())), in new()
|
/DragonOS/kernel/src/mm/allocator/ |
H A D | slab.rs | 3 use alloc::boxed::Box; 34 let leaked_page = Box::leak(boxed_page); in allocate()
|
/DragonOS/kernel/src/time/ |
H A D | sleep.rs | 3 use alloc::{boxed::Box, sync::Arc}; 45 let handler: Box<WakeUpHelper> = WakeUpHelper::new(ProcessManager::current_pcb()); in nanosleep()
|
H A D | timer.rs | 9 boxed::Box, 94 pub fn new(pcb: Arc<ProcessControlBlock>) -> Box<WakeUpHelper> { in new() 95 return Box::new(WakeUpHelper { pcb }); in new() 119 pub fn new(timer_func: Box<dyn TimerFunction>, expire_jiffies: u64) -> Arc<Self> { in new() 212 pub timer_func: Option<Box<dyn TimerFunction>>,
|
/DragonOS/kernel/src/exception/ |
H A D | softirq.rs | 9 use alloc::{boxed::Box, sync::Arc, vec::Vec}; 28 static mut __CPU_PENDING: Option<Box<[VecStatus; PerCpu::MAX_CPU_NUM as usize]>> = None; 40 __SORTIRQ_VECTORS = Box::leak(Box::new(Softirq::new())); in softirq_init() 41 __CPU_PENDING = Some(Box::new( in softirq_init()
|
/DragonOS/kernel/src/arch/x86_64/kvm/vmx/ |
H A D | vcpu.rs | 18 use alloc::boxed::Box; 49 pub vmxon_region: Box<VmxonRegion>, 55 pub vmcs_region: Box<VMCSRegion>, 57 pub msr_bitmap: Box<MSRBitmap>, 90 let vmxon_region: Box<VmxonRegion> = unsafe { in alloc() 91 Box::try_new_zeroed_in(Global) in alloc() 95 let vmcs_region: Box<VMCSRegion> = unsafe { in alloc() 96 Box::try_new_zeroed_in(Global) in alloc() 100 let msr_bitmap: Box<MSRBitmap> = unsafe { in alloc() 101 Box::try_new_zeroed_in(Global) in alloc()
|
/DragonOS/kernel/crates/intertrait/macros/src/ |
H A D | gen_caster.rs | 44 (::std::any::TypeId::of::<#ty>(), Box::new(#new_caster)) in generate_caster() 50 (::core::any::TypeId::of::<#ty>(), alloc::boxed::Box::new(#new_caster)) in generate_caster()
|
/DragonOS/kernel/src/driver/pci/ |
H A D | pci.rs | 21 use alloc::{boxed::Box, collections::LinkedList}; 71 list: RwLock<LinkedList<Box<dyn PciDeviceStructure>>>, 83 pub fn read(&self) -> RwLockReadGuard<LinkedList<Box<dyn PciDeviceStructure>>> { in read() 88 pub fn write(&self) -> RwLockWriteGuard<LinkedList<Box<dyn PciDeviceStructure>>> { in write() 98 pub fn add(&self, device: Box<dyn PciDeviceStructure>) { in add() 117 list: &'a mut RwLockWriteGuard<'_, LinkedList<Box<dyn PciDeviceStructure>>>, in get_pci_device_structures_mut_by_vendor_id() 119 ) -> Vec<&'a mut Box<(dyn PciDeviceStructure)>> { in get_pci_device_structures_mut_by_vendor_id() 144 list: &'a mut RwLockWriteGuard<'_, LinkedList<Box<dyn PciDeviceStructure>>>, in get_pci_device_structure_mut() 147 ) -> Vec<&'a mut Box<(dyn PciDeviceStructure)>> { in get_pci_device_structure_mut() 173 list: &'a mut RwLockReadGuard<'_, LinkedList<Box<dyn PciDeviceStructure>>>, in get_pci_device_structure() [all …]
|
/DragonOS/docs/kernel/memory_management/ |
H A D | allocate-memory.md | 8 内存分配函数,或者是创建一个`Box`对象等等,都是安全的。
|
/DragonOS/kernel/src/driver/virtio/ |
H A D | virtio.rs | 19 use alloc::{boxed::Box, collections::LinkedList}; 91 list: &'a mut RwLockWriteGuard<'_, LinkedList<Box<dyn PciDeviceStructure>>>, in virtio_device_search()
|
/DragonOS/build-scripts/kernel_build/src/bindgen/ |
H A D | mod.rs | 36 .parse_callbacks(Box::new(bindgen::CargoCallbacks)); in generate_bindings()
|
/DragonOS/tools/debugging/logmonitor/src/ |
H A D | logging.rs | 16 builder = builder.with_backend(Box::new(TUILoggingBackend::new(channel.0))); in init()
|
H A D | tui.rs | 40 panic::set_hook(Box::new(move |panic| { in init()
|