mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-13 23:36:48 +00:00
Change IoMem directory
This commit is contained in:
parent
5f5be25e4a
commit
1f03955f51
@ -16,7 +16,7 @@ use component::{init_component, ComponentInitError};
|
|||||||
use font8x8::UnicodeFonts;
|
use font8x8::UnicodeFonts;
|
||||||
use ostd::{
|
use ostd::{
|
||||||
boot::{boot_info, memory_region::MemoryRegionType},
|
boot::{boot_info, memory_region::MemoryRegionType},
|
||||||
io_mem::IoMem,
|
io::IoMem,
|
||||||
mm::{VmIo, PAGE_SIZE},
|
mm::{VmIo, PAGE_SIZE},
|
||||||
sync::SpinLock,
|
sync::SpinLock,
|
||||||
};
|
};
|
||||||
|
@ -16,7 +16,7 @@ use aster_util::{field_ptr, safe_ptr::SafePtr};
|
|||||||
use bitflags::bitflags;
|
use bitflags::bitflags;
|
||||||
use log::{debug, info};
|
use log::{debug, info};
|
||||||
use ostd::{
|
use ostd::{
|
||||||
io_mem::IoMem,
|
io::IoMem,
|
||||||
mm::{DmaDirection, DmaStream, FrameAllocOptions, HasDaddr, VmIo, PAGE_SIZE},
|
mm::{DmaDirection, DmaStream, FrameAllocOptions, HasDaddr, VmIo, PAGE_SIZE},
|
||||||
offset_of,
|
offset_of,
|
||||||
sync::{LocalIrqDisabled, RwLock, SpinLock},
|
sync::{LocalIrqDisabled, RwLock, SpinLock},
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
pub mod device;
|
pub mod device;
|
||||||
use aster_util::safe_ptr::SafePtr;
|
use aster_util::safe_ptr::SafePtr;
|
||||||
use ostd::{io_mem::IoMem, Pod};
|
use ostd::{io::IoMem, Pod};
|
||||||
|
|
||||||
use crate::transport::VirtioTransport;
|
use crate::transport::VirtioTransport;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
use aster_util::safe_ptr::SafePtr;
|
use aster_util::safe_ptr::SafePtr;
|
||||||
use bitflags::bitflags;
|
use bitflags::bitflags;
|
||||||
use ostd::{io_mem::IoMem, mm::PodOnce, Pod};
|
use ostd::{io::IoMem, mm::PodOnce, Pod};
|
||||||
|
|
||||||
use crate::transport::VirtioTransport;
|
use crate::transport::VirtioTransport;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ use ostd::{
|
|||||||
},
|
},
|
||||||
pci::cfg_space::Bar,
|
pci::cfg_space::Bar,
|
||||||
},
|
},
|
||||||
io_mem::IoMem,
|
io::IoMem,
|
||||||
mm::{DmaCoherent, PAGE_SIZE},
|
mm::{DmaCoherent, PAGE_SIZE},
|
||||||
offset_of,
|
offset_of,
|
||||||
sync::RwLock,
|
sync::RwLock,
|
||||||
|
@ -6,7 +6,7 @@ use core::fmt::Debug;
|
|||||||
use aster_rights::{ReadOp, TRightSet, WriteOp};
|
use aster_rights::{ReadOp, TRightSet, WriteOp};
|
||||||
use aster_util::safe_ptr::SafePtr;
|
use aster_util::safe_ptr::SafePtr;
|
||||||
use ostd::{
|
use ostd::{
|
||||||
io_mem::IoMem,
|
io::IoMem,
|
||||||
sync::RwLock,
|
sync::RwLock,
|
||||||
trap::{IrqCallbackFunction, IrqLine, TrapFrame},
|
trap::{IrqCallbackFunction, IrqLine, TrapFrame},
|
||||||
};
|
};
|
||||||
|
@ -7,7 +7,7 @@ use aster_util::safe_ptr::SafePtr;
|
|||||||
use ostd::{
|
use ostd::{
|
||||||
arch::device::io_port::{PortRead, PortWrite},
|
arch::device::io_port::{PortRead, PortWrite},
|
||||||
bus::pci::cfg_space::Bar,
|
bus::pci::cfg_space::Bar,
|
||||||
io_mem::IoMem,
|
io::IoMem,
|
||||||
mm::{DmaCoherent, PodOnce},
|
mm::{DmaCoherent, PodOnce},
|
||||||
trap::IrqCallbackFunction,
|
trap::IrqCallbackFunction,
|
||||||
Pod,
|
Pod,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: MPL-2.0
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
use aster_util::safe_ptr::SafePtr;
|
use aster_util::safe_ptr::SafePtr;
|
||||||
use ostd::{io_mem::IoMem, Pod};
|
use ostd::{io::IoMem, Pod};
|
||||||
|
|
||||||
use super::capability::VirtioPciCapabilityData;
|
use super::capability::VirtioPciCapabilityData;
|
||||||
use crate::transport::pci::capability::VirtioPciCpabilityType;
|
use crate::transport::pci::capability::VirtioPciCpabilityType;
|
||||||
|
@ -13,7 +13,7 @@ use ostd::{
|
|||||||
},
|
},
|
||||||
BusProbeError,
|
BusProbeError,
|
||||||
},
|
},
|
||||||
io_mem::IoMem,
|
io::IoMem,
|
||||||
mm::DmaCoherent,
|
mm::DmaCoherent,
|
||||||
offset_of,
|
offset_of,
|
||||||
trap::IrqCallbackFunction,
|
trap::IrqCallbackFunction,
|
||||||
|
@ -10,7 +10,7 @@ use ostd::{
|
|||||||
pci::{capability::CapabilityData, cfg_space::Bar, common_device::PciCommonDevice},
|
pci::{capability::CapabilityData, cfg_space::Bar, common_device::PciCommonDevice},
|
||||||
BusProbeError,
|
BusProbeError,
|
||||||
},
|
},
|
||||||
io_mem::IoMem,
|
io::IoMem,
|
||||||
mm::{DmaCoherent, HasDaddr, PAGE_SIZE},
|
mm::{DmaCoherent, HasDaddr, PAGE_SIZE},
|
||||||
trap::IrqCallbackFunction,
|
trap::IrqCallbackFunction,
|
||||||
};
|
};
|
||||||
|
@ -6,7 +6,7 @@ use core::sync::atomic::{AtomicU64, Ordering};
|
|||||||
|
|
||||||
use spin::Once;
|
use spin::Once;
|
||||||
|
|
||||||
use crate::{arch::boot::DEVICE_TREE, io_mem::IoMem};
|
use crate::{arch::boot::DEVICE_TREE, io::IoMem};
|
||||||
|
|
||||||
/// The timer frequency (Hz). Here we choose 1000Hz since 1000Hz is easier for unit conversion and
|
/// The timer frequency (Hz). Here we choose 1000Hz since 1000Hz is easier for unit conversion and
|
||||||
/// convenient for timer. What's more, the frequency cannot be set too high or too low, 1000Hz is
|
/// convenient for timer. What's more, the frequency cannot be set too high or too low, 1000Hz is
|
||||||
|
@ -7,7 +7,7 @@ use log::info;
|
|||||||
|
|
||||||
use super::VIRTIO_MMIO_MAGIC;
|
use super::VIRTIO_MMIO_MAGIC;
|
||||||
use crate::{
|
use crate::{
|
||||||
io_mem::IoMem,
|
io::IoMem,
|
||||||
mm::{
|
mm::{
|
||||||
paddr_to_vaddr,
|
paddr_to_vaddr,
|
||||||
page_prop::{CachePolicy, PageFlags},
|
page_prop::{CachePolicy, PageFlags},
|
||||||
|
@ -7,7 +7,7 @@ use log::info;
|
|||||||
|
|
||||||
use super::VIRTIO_MMIO_MAGIC;
|
use super::VIRTIO_MMIO_MAGIC;
|
||||||
use crate::{
|
use crate::{
|
||||||
io_mem::IoMem,
|
device::io_mem::IoMem,
|
||||||
mm::{paddr_to_vaddr, Paddr, VmIo},
|
mm::{paddr_to_vaddr, Paddr, VmIo},
|
||||||
trap::IrqLine,
|
trap::IrqLine,
|
||||||
};
|
};
|
||||||
|
@ -12,7 +12,7 @@ use bitflags::bitflags;
|
|||||||
use super::PciDeviceLocation;
|
use super::PciDeviceLocation;
|
||||||
use crate::{
|
use crate::{
|
||||||
arch::device::io_port::{PortRead, PortWrite},
|
arch::device::io_port::{PortRead, PortWrite},
|
||||||
io_mem::IoMem,
|
io::IoMem,
|
||||||
mm::{
|
mm::{
|
||||||
page_prop::{CachePolicy, PageFlags},
|
page_prop::{CachePolicy, PageFlags},
|
||||||
PodOnce, VmIoOnce,
|
PodOnce, VmIoOnce,
|
||||||
|
12
ostd/src/io/mod.rs
Normal file
12
ostd/src/io/mod.rs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// SPDX-License-Identifier: MPL-2.0
|
||||||
|
|
||||||
|
//! Device I/O access and corresponding allocator.
|
||||||
|
//!
|
||||||
|
//! This module allows device drivers to access the device I/O they need
|
||||||
|
//! through _allocators_. There are two types of device I/O:
|
||||||
|
//! - `IoMem` for memory I/O (MMIO).
|
||||||
|
//! - `IoPort` for port I/O (PIO).
|
||||||
|
|
||||||
|
mod io_mem;
|
||||||
|
|
||||||
|
pub use self::io_mem::IoMem;
|
@ -31,8 +31,8 @@ pub mod bus;
|
|||||||
pub mod collections;
|
pub mod collections;
|
||||||
pub mod console;
|
pub mod console;
|
||||||
pub mod cpu;
|
pub mod cpu;
|
||||||
|
pub mod io;
|
||||||
mod error;
|
mod error;
|
||||||
pub mod io_mem;
|
|
||||||
pub mod logger;
|
pub mod logger;
|
||||||
pub mod mm;
|
pub mod mm;
|
||||||
pub mod panic;
|
pub mod panic;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user