Refactor the read/write operations to userspace

This commit is contained in:
Chen Chengjun
2024-06-28 09:39:51 +08:00
committed by Tate, Hongliang Tian
parent 09b6153d29
commit af908c29cf
7 changed files with 234 additions and 47 deletions

View File

@ -752,6 +752,10 @@ impl<R1, R2> VmarMapOptions<R1, R2> {
if self.align % PAGE_SIZE != 0 || !self.align.is_power_of_two() {
return_errno_with_message!(Errno::EINVAL, "invalid align");
}
debug_assert!(self.size % self.align == 0);
if self.size % self.align != 0 {
return_errno_with_message!(Errno::EINVAL, "invalid mapping size");
}
debug_assert!(self.vmo_offset % self.align == 0);
if self.vmo_offset % self.align != 0 {
return_errno_with_message!(Errno::EINVAL, "invalid vmo offset");