Lines Matching refs:src
38 pub unsafe fn copy_to_user(dest: VirtAddr, src: &[u8]) -> Result<usize, SystemError> { in copy_to_user()
39 verify_area(dest, src.len()).map_err(|_| SystemError::EFAULT)?; in copy_to_user()
43 p.copy_from_nonoverlapping(src.as_ptr(), src.len()); in copy_to_user()
44 return Ok(src.len()); in copy_to_user()
48 pub unsafe fn copy_from_user(dst: &mut [u8], src: VirtAddr) -> Result<usize, SystemError> { in copy_from_user()
49 verify_area(src, dst.len()).map_err(|_| SystemError::EFAULT)?; in copy_from_user()
51 let src: &[u8] = core::slice::from_raw_parts(src.data() as *const u8, dst.len()); in copy_from_user() localVariable
53 dst.copy_from_slice(src); in copy_from_user()
241 fn convert_with_offset<T>(&self, src: &[u8], offset: usize) -> Result<&[T], SystemError> { in convert_with_offset()
242 if offset >= src.len() { in convert_with_offset()
245 let byte_buffer: &[u8] = &src[offset..]; in convert_with_offset()
259 fn convert_one_with_offset<T>(&self, src: &[u8], offset: usize) -> Result<&T, SystemError> { in convert_one_with_offset()
260 if offset + core::mem::size_of::<T>() > src.len() { in convert_one_with_offset()
263 let byte_buffer: &[u8] = &src[offset..offset + core::mem::size_of::<T>()]; in convert_one_with_offset()
300 src: &[T], in copy_to_user()
304 dst.copy_from_slice(src); in copy_to_user()
305 return Ok(src.len()); in copy_to_user()
316 src: &T, in copy_one_to_user()
320 dst.clone_from(src); in copy_one_to_user()
328 fn convert_with_offset<T>(src: &mut [u8], offset: usize) -> Result<&mut [T], SystemError> { in convert_with_offset()
329 if offset >= src.len() { in convert_with_offset()
332 let byte_buffer: &mut [u8] = &mut src[offset..]; in convert_with_offset()
346 fn convert_one_with_offset<T>(src: &mut [u8], offset: usize) -> Result<&mut T, SystemError> { in convert_one_with_offset()
347 if offset + core::mem::size_of::<T>() > src.len() { in convert_one_with_offset()
350 let byte_buffer: &mut [u8] = &mut src[offset..offset + core::mem::size_of::<T>()]; in convert_one_with_offset()