Rename various concepts related to memory management

This commit is contained in:
Zhang Junyang
2024-05-26 17:53:44 +00:00
committed by Tate, Hongliang Tian
parent 03a39c94ca
commit 14e1b1a9fc
97 changed files with 331 additions and 353 deletions

View File

@ -9,9 +9,9 @@ use aster_block::{
};
use aster_frame::{
io_mem::IoMem,
mm::{DmaDirection, DmaStream, DmaStreamSlice, VmAllocOptions, VmIo},
sync::SpinLock,
trap::TrapFrame,
vm::{DmaDirection, DmaStream, DmaStreamSlice, VmAllocOptions, VmIo},
};
use aster_util::safe_ptr::SafePtr;
use id_alloc::IdAlloc;

View File

@ -6,9 +6,9 @@ use core::hint::spin_loop;
use aster_console::{AnyConsoleDevice, ConsoleCallback};
use aster_frame::{
io_mem::IoMem,
mm::{DmaDirection, DmaStream, DmaStreamSlice, VmAllocOptions, VmReader},
sync::{RwLock, SpinLock},
trap::TrapFrame,
vm::{DmaDirection, DmaStream, DmaStreamSlice, VmAllocOptions, VmReader},
};
use aster_util::safe_ptr::SafePtr;
use log::debug;

View File

@ -10,10 +10,10 @@ use core::{fmt::Debug, iter, mem};
use aster_frame::{
io_mem::IoMem,
mm::{DmaDirection, DmaStream, HasDaddr, VmAllocOptions, VmIo, PAGE_SIZE},
offset_of,
sync::{RwLock, SpinLock},
trap::TrapFrame,
vm::{DmaDirection, DmaStream, HasDaddr, VmAllocOptions, VmIo, PAGE_SIZE},
};
use aster_input::{
key::{Key, KeyStatus},

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
use aster_frame::vm::{DmaCoherent, DmaStream, DmaStreamSlice, HasDaddr};
use aster_frame::mm::{DmaCoherent, DmaStream, DmaStreamSlice, HasDaddr};
use aster_network::{DmaSegment, RxBuffer, TxBuffer};
/// A DMA-capable buffer.

View File

@ -10,8 +10,8 @@ use core::{
use aster_frame::{
io_mem::IoMem,
mm::{DmaCoherent, VmAllocOptions},
offset_of,
vm::{DmaCoherent, VmAllocOptions},
};
use aster_rights::{Dup, TRightSet, TRights, Write};
use aster_util::{field_ptr, safe_ptr::SafePtr};
@ -74,7 +74,7 @@ impl VirtQueue {
let (descriptor_ptr, avail_ring_ptr, used_ring_ptr) = if transport.is_legacy_version() {
// FIXME: How about pci legacy?
// Currently, we use one VmFrame to place the descriptors and avaliable rings, one VmFrame to place used rings
// Currently, we use one Frame to place the descriptors and avaliable rings, one Frame 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);

View File

@ -9,10 +9,10 @@ use aster_frame::{
device::{MmioCommonDevice, VirtioMmioVersion},
},
io_mem::IoMem,
mm::{DmaCoherent, PAGE_SIZE},
offset_of,
sync::RwLock,
trap::IrqCallbackFunction,
vm::{DmaCoherent, PAGE_SIZE},
};
use aster_rights::{ReadOp, WriteOp};
use aster_util::{field_ptr, safe_ptr::SafePtr};

View File

@ -3,7 +3,7 @@
use alloc::boxed::Box;
use core::fmt::Debug;
use aster_frame::{io_mem::IoMem, trap::IrqCallbackFunction, vm::DmaCoherent};
use aster_frame::{io_mem::IoMem, mm::DmaCoherent, trap::IrqCallbackFunction};
use aster_util::safe_ptr::SafePtr;
use self::{mmio::virtio_mmio_init, pci::virtio_pci_init};

View File

@ -11,9 +11,9 @@ use aster_frame::{
BusProbeError,
},
io_mem::IoMem,
mm::DmaCoherent,
offset_of,
trap::IrqCallbackFunction,
vm::DmaCoherent,
};
use aster_util::{field_ptr, safe_ptr::SafePtr};
use log::{info, warn};