Skip to content

Commit

Permalink
[refactor] introduce axvmconfig (#6)
Browse files Browse the repository at this point in the history
* [refactor] introduce axvmconfig
* [feat] fix toolchain version as 2024-05-02
  • Loading branch information
hky1999 authored Dec 23, 2024
1 parent 51bf078 commit 520b694
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ edition = "2021"
[dependencies]
log = "0.4"
cfg-if = "1.0"
serde = { version = "1.0.204", default-features = false, features = ["derive", "alloc"] }

# System independent crates provided by ArceOS.
axerrno = "0.1.0"
memory_addr = "0.3"
axaddrspace = { git = "https://github.com/arceos-hypervisor/axaddrspace.git" }
axdevice_base = { git = "https://github.com/arceos-hypervisor/axdevice_crates.git"}

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" }
5 changes: 5 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[toolchain]
profile = "minimal"
channel = "nightly-2024-05-02"
components = ["rust-src", "llvm-tools", "rustfmt", "clippy"]
targets = ["x86_64-unknown-none", "riscv64gc-unknown-none-elf", "aarch64-unknown-none", "aarch64-unknown-none-softfloat"]
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloc::vec::Vec;
use axdevice_base::EmulatedDeviceConfig;
use axvmconfig::EmulatedDeviceConfig;

/// The vector of DeviceConfig
pub struct AxVmDeviceConfig {
Expand Down
6 changes: 3 additions & 3 deletions src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use alloc::sync::Arc;
use alloc::vec::Vec;

use axaddrspace::GuestPhysAddr;
use axdevice_base::EmulatedDeviceConfig;
use axdevice_base::{BaseDeviceOps, EmuDeviceType};
use axdevice_base::BaseDeviceOps;
use axerrno::AxResult;
use axvmconfig::EmulatedDeviceConfig;

/// represent A vm own devices
pub struct AxVmDevices {
Expand All @@ -28,7 +28,7 @@ impl AxVmDevices {
}

/// According the emu_configs to init every specific device
fn init(this: &mut Self, emu_configs: &Vec<EmulatedDeviceConfig>) {
fn init(_this: &mut Self, _emu_configs: &Vec<EmulatedDeviceConfig>) {
/*
for config in emu_configs {
let dev = match EmuDeviceType::from_usize(config.emu_type) {
Expand Down

0 comments on commit 520b694

Please sign in to comment.