diff --git a/Cargo.toml b/Cargo.toml index 2ecb687..6d4d509 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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] diff --git a/src/device.rs b/src/device.rs index 2f6beda..035acce 100644 --- a/src/device.rs +++ b/src/device.rs @@ -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; @@ -127,7 +125,7 @@ impl AxVmDevices { fn init(this: &mut Self, emu_configs: &Vec) { 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())); @@ -140,7 +138,7 @@ impl AxVmDevices { ); } } - EmuDeviceType::GPPTRedistributor => { + EmulatedDeviceType::GPPTRedistributor => { #[cfg(target_arch = "aarch64")] { const GPPT_GICR_ARG_ERR_MSG: &'static str = @@ -148,7 +146,7 @@ impl AxVmDevices { let cpu_num = config .cfg_list - .get(0) + .first() .copied() .expect(GPPT_GICR_ARG_ERR_MSG); let stride = config @@ -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( @@ -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)"); @@ -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 {