Refactor the source structure in aster_frame::mm

This commit is contained in:
Zhang Junyang
2024-06-02 11:00:34 +00:00
committed by Tate, Hongliang Tian
parent e8595b95fe
commit 7095b37e7e
38 changed files with 177 additions and 129 deletions

View File

@ -10,7 +10,7 @@ use core::{
use aster_frame::{
io_mem::IoMem,
mm::{DmaCoherent, VmAllocOptions},
mm::{DmaCoherent, FrameAllocOptions},
offset_of,
};
use aster_rights::{Dup, TRightSet, TRights, Write};
@ -82,7 +82,7 @@ impl VirtQueue {
let desc_size = size_of::<Descriptor>() * size as usize;
let (seg1, seg2) = {
let continue_segment = VmAllocOptions::new(2).alloc_contiguous().unwrap();
let continue_segment = FrameAllocOptions::new(2).alloc_contiguous().unwrap();
let seg1 = continue_segment.range(0..1);
let seg2 = continue_segment.range(1..2);
(seg1, seg2)
@ -101,17 +101,17 @@ impl VirtQueue {
}
(
SafePtr::new(
DmaCoherent::map(VmAllocOptions::new(1).alloc_contiguous().unwrap(), true)
DmaCoherent::map(FrameAllocOptions::new(1).alloc_contiguous().unwrap(), true)
.unwrap(),
0,
),
SafePtr::new(
DmaCoherent::map(VmAllocOptions::new(1).alloc_contiguous().unwrap(), true)
DmaCoherent::map(FrameAllocOptions::new(1).alloc_contiguous().unwrap(), true)
.unwrap(),
0,
),
SafePtr::new(
DmaCoherent::map(VmAllocOptions::new(1).alloc_contiguous().unwrap(), true)
DmaCoherent::map(FrameAllocOptions::new(1).alloc_contiguous().unwrap(), true)
.unwrap(),
0,
),