Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ spin = "0.9"
axerrno = "0.1.0"
memory_addr = "0.4"

axvmconfig = { git = "https://github.com/arceos-hypervisor/axvmconfig.git", default-features = false }
axaddrspace = { git = "https://github.com/arceos-hypervisor/axaddrspace.git" }
axdevice_base = { git = "https://github.com/arceos-hypervisor/axdevice_crates.git" }
axvmconfig = { version = "0.1", default-features = false }
axaddrspace = "0.1"
axdevice_base = "0.1"
range-alloc = { git = "https://github.com/arceos-hypervisor/range-alloc.git" }

[target.'cfg(target_arch = "aarch64")'.dependencies]
Expand Down
20 changes: 9 additions & 11 deletions src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ use axaddrspace::{
GuestPhysAddr, GuestPhysAddrRange,
device::{AccessWidth, DeviceAddrRange, Port, PortRange, SysRegAddr, SysRegAddrRange},
};
use axdevice_base::{
BaseDeviceOps, BaseMmioDeviceOps, BasePortDeviceOps, BaseSysRegDeviceOps, EmuDeviceType,
};
use axdevice_base::{BaseDeviceOps, BaseMmioDeviceOps, BasePortDeviceOps, BaseSysRegDeviceOps};
use axerrno::{AxResult, ax_err};
use axvmconfig::EmulatedDeviceConfig;
use axvmconfig::{EmulatedDeviceConfig, EmulatedDeviceType};
use memory_addr::{PhysAddr, is_aligned_4k};

use crate::AxVmDeviceConfig;
Expand Down Expand Up @@ -127,7 +125,7 @@ impl AxVmDevices {
fn init(this: &mut Self, emu_configs: &Vec<EmulatedDeviceConfig>) {
for config in emu_configs {
match config.emu_type {
EmuDeviceType::InterruptController => {
EmulatedDeviceType::InterruptController => {
#[cfg(target_arch = "aarch64")]
{
this.add_mmio_dev(Arc::new(Vgic::new()));
Expand All @@ -140,15 +138,15 @@ impl AxVmDevices {
);
}
}
EmuDeviceType::GPPTRedistributor => {
EmulatedDeviceType::GPPTRedistributor => {
#[cfg(target_arch = "aarch64")]
{
const GPPT_GICR_ARG_ERR_MSG: &'static str =
"expect 3 args for gppt redistributor (cpu_num, stride, pcpu_id)";

let cpu_num = config
.cfg_list
.get(0)
.first()
.copied()
.expect(GPPT_GICR_ARG_ERR_MSG);
let stride = config
Expand Down Expand Up @@ -185,7 +183,7 @@ impl AxVmDevices {
);
}
}
EmuDeviceType::GPPTDistributor => {
EmulatedDeviceType::GPPTDistributor => {
#[cfg(target_arch = "aarch64")]
{
this.add_mmio_dev(Arc::new(arm_vgic::v3::vgicd::VGicD::new(
Expand All @@ -206,12 +204,12 @@ impl AxVmDevices {
);
}
}
EmuDeviceType::GPPTITS => {
EmulatedDeviceType::GPPTITS => {
#[cfg(target_arch = "aarch64")]
{
let host_gits_base = config
.cfg_list
.get(0)
.first()
.copied()
.map(PhysAddr::from_usize)
.expect("expect 1 arg for gppt its (host_gits_base)");
Expand All @@ -236,7 +234,7 @@ impl AxVmDevices {
);
}
}
EmuDeviceType::IVCChannel => {
EmulatedDeviceType::IVCChannel => {
if this.ivc_channel.is_none() {
// Initialize the IVC channel range allocator
this.ivc_channel = Some(Mutex::new(RangeAllocator::new(Range {
Expand Down