mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 08:53:29 +00:00
Renaming concepts around pages and frames
This commit renames `Frame` -> `UntypedFrame` and `Page` -> `Frame`. So do other concepts in the following list: - `Segment` -> `UntypedSegment`, - `ContPages` -> `Segment`, - `DynPage` -> `AnyFrame`, - `PageMeta` -> `FrameMeta`, - `FrameMeta` -> `UntypedMeta`. This commit also re-organized the source in the `mm/page` and `mm/frame` module to accommodate the changes.
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
10f1856306
commit
c9a37ccab1
@ -5,8 +5,8 @@ use bitvec::array::BitArray;
|
||||
use int_to_c_enum::TryFromInt;
|
||||
use ostd::{
|
||||
mm::{
|
||||
DmaDirection, DmaStream, DmaStreamSlice, FrameAllocOptions, Infallible, Segment, VmIo,
|
||||
VmReader, VmWriter,
|
||||
DmaDirection, DmaStream, DmaStreamSlice, FrameAllocOptions, Infallible, UntypedSegment,
|
||||
VmIo, VmReader, VmWriter,
|
||||
},
|
||||
sync::{SpinLock, WaitQueue},
|
||||
Error,
|
||||
@ -442,8 +442,8 @@ impl<'a> BioSegment {
|
||||
}
|
||||
}
|
||||
|
||||
/// Constructs a new `BioSegment` with a given `Segment` and the bio direction.
|
||||
pub fn new_from_segment(segment: Segment, direction: BioDirection) -> Self {
|
||||
/// Constructs a new `BioSegment` with a given `UntypedSegment` and the bio direction.
|
||||
pub fn new_from_segment(segment: UntypedSegment, direction: BioDirection) -> Self {
|
||||
let len = segment.nbytes();
|
||||
let dma_stream = DmaStream::map(segment, direction.into(), false).unwrap();
|
||||
Self {
|
||||
@ -481,7 +481,7 @@ impl<'a> BioSegment {
|
||||
|
||||
/// Returns the inner VM segment.
|
||||
#[cfg(ktest)]
|
||||
pub fn inner_segment(&self) -> &Segment {
|
||||
pub fn inner_segment(&self) -> &UntypedSegment {
|
||||
self.inner.dma_slice.stream().vm_segment()
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ impl VirtQueue {
|
||||
}
|
||||
|
||||
let (descriptor_ptr, avail_ring_ptr, used_ring_ptr) = if transport.is_legacy_version() {
|
||||
// Currently, we use one Frame to place the descriptors and available rings, one Frame to place used rings
|
||||
// Currently, we use one UntypedFrame to place the descriptors and available rings, one UntypedFrame to place used rings
|
||||
// because the virtio-mmio legacy required the address to be continuous. The max queue size is 128.
|
||||
if size > 128 {
|
||||
return Err(QueueError::InvalidArgs);
|
||||
|
Reference in New Issue
Block a user