mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 00:43:24 +00:00
Polish the doc and rename variables in ostd::mm
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
f332797084
commit
983a6af3cc
@ -5,7 +5,7 @@ use bitvec::array::BitArray;
|
||||
use int_to_c_enum::TryFromInt;
|
||||
use ostd::{
|
||||
mm::{
|
||||
DmaDirection, DmaStream, DmaStreamSlice, DynUSegment, FrameAllocOptions, Infallible, VmIo,
|
||||
DmaDirection, DmaStream, DmaStreamSlice, FrameAllocOptions, Infallible, USegment, VmIo,
|
||||
VmReader, VmWriter,
|
||||
},
|
||||
sync::{SpinLock, WaitQueue},
|
||||
@ -442,8 +442,8 @@ impl<'a> BioSegment {
|
||||
}
|
||||
}
|
||||
|
||||
/// Constructs a new `BioSegment` with a given `DynUSegment` and the bio direction.
|
||||
pub fn new_from_segment(segment: DynUSegment, direction: BioDirection) -> Self {
|
||||
/// Constructs a new `BioSegment` with a given `USegment` and the bio direction.
|
||||
pub fn new_from_segment(segment: USegment, direction: BioDirection) -> Self {
|
||||
let len = segment.size();
|
||||
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) -> &DynUSegment {
|
||||
pub fn inner_segment(&self) -> &USegment {
|
||||
self.inner.dma_slice.stream().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 DynUFrame to place the descriptors and available rings, one DynUFrame to place used rings
|
||||
// Currently, we use one UFrame to place the descriptors and available rings, one UFrame 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