Home
last modified time | relevance | path

Searched refs:slice (Results 1 – 9 of 9) sorted by relevance

/DragonOS-0.1.8/kernel/src/mm/allocator/
Dkernel_allocator.rs38 let slice = unsafe { in alloc_in_buddy() localVariable
39 core::slice::from_raw_parts_mut( in alloc_in_buddy()
44 return Ok(NonNull::from(slice)); in alloc_in_buddy()
/DragonOS-0.1.8/kernel/src/process/
Dexec.rs269 fn push_slice<T: Copy>(&self, ustack: &mut UserStack, slice: &[T]) -> Result<(), SystemError> { in push_slice()
271 sp -= slice.len() * core::mem::size_of::<T>(); in push_slice()
274 unsafe { core::slice::from_raw_parts_mut(sp.data() as *mut T, slice.len()) } in push_slice()
275 .copy_from_slice(slice); in push_slice()
/DragonOS-0.1.8/kernel/src/filesystem/vfs/
Dsyscall.rs674 let iovs: &[IoVec] = core::slice::from_raw_parts(iov, iovcnt); in from_user()
688 slices.push(core::slice::from_raw_parts_mut(iov.iov_base, iov.iov_len)); in from_user()
699 for slice in self.0.iter() { in gather()
700 buf.extend_from_slice(slice); in gather()
708 for slice in self.0.iter_mut() { in scatter()
709 let len = core::cmp::min(slice.len(), data.len()); in scatter()
714 slice[..len].copy_from_slice(&data[..len]); in scatter()
727 let total_len: usize = self.0.iter().map(|slice| slice.len()).sum(); in new_buf()
Dfile.rs279 ::core::slice::from_raw_parts_mut::<'static, u8>(ptr, name_bytes.len()); in readdir()
/DragonOS-0.1.8/kernel/src/syscall/
Dmod.rs443 core::slice::from_raw_parts_mut::<'static, u8>(buf_vaddr as *mut u8, len) in handle()
462 core::slice::from_raw_parts::<'static, u8>(buf_vaddr as *const u8, len) in handle()
555 core::slice::from_raw_parts_mut::<'static, u8>(buf_vaddr as *mut u8, len) in handle()
663 let pipefd = unsafe { core::slice::from_raw_parts_mut(pipefd, 2) }; in handle()
739 let data: &[u8] = unsafe { core::slice::from_raw_parts(optval, optlen) }; in handle()
811 let data: &[u8] = unsafe { core::slice::from_raw_parts(buf, len) }; in handle()
848 let buf = unsafe { core::slice::from_raw_parts_mut(buf, len) }; in handle()
Duser_access.rs46 let src: &[u8] = core::slice::from_raw_parts(src.data() as *const u8, dst.len()); in copy_from_user()
/DragonOS-0.1.8/kernel/src/arch/x86_64/mm/
Dmod.rs479 let slice = unsafe { in test_buddy() localVariable
480 core::slice::from_raw_parts_mut( in test_buddy()
485 for i in 0..slice.len() { in test_buddy()
486 slice[i] = ((i + unsafe { rdtsc() } as usize) % 256) as u8; in test_buddy()
/DragonOS-0.1.8/kernel/src/driver/multiboot2/
Dmultiboot2.h241 unsigned int slice; member
/DragonOS-0.1.8/kernel/src/net/
Dsyscall.rs561 let buf = core::slice::from_raw_parts_mut(addr as *mut u8, to_write); in write_to_user()
562 buf.copy_from_slice(core::slice::from_raw_parts( in write_to_user()