Skip to content

Commit 1e7577d

Browse files
committed
refactor: update platform features and remove unused configurations
1 parent 1dd46ae commit 1e7577d

File tree

8 files changed

+13
-111
lines changed

8 files changed

+13
-111
lines changed

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ axstd = {git = "https://github.com/arceos-hypervisor/arceos.git", tag = "hv-0.4.
3838
"irq",
3939
"multitask",
4040
"smp", # "page-alloc-64g",
41-
"myplat",
42-
"driver-dyn",
4341
]}
4442

4543
axalloc = {git = "https://github.com/arceos-hypervisor/arceos.git", tag = "hv-0.4.1"}

configs/board/orangepi-5-plus.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
cargo_args = []
22
features = [
3-
# "ept-level-4",
4-
"axstd/myplat",
5-
"axstd/bus-mmio",
6-
"driver/sdmmc",
7-
"driver/rk3588-clk",
8-
"fs",
3+
# "ept-level-4",
4+
"dyn-plat",
5+
"axstd/bus-mmio",
6+
"driver/sdmmc",
7+
"driver/rk3588-clk",
8+
"fs",
99
]
1010
log = "Info"
1111
target = "aarch64-unknown-none-softfloat"
1212
to_bin = true
13-
vm_configs = []
13+
vm_configs = []

configs/board/phytiumpi.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cargo_args = []
22
features = [
33
# "ept-level-4",
4-
"axstd/myplat",
4+
"dyn-plat",
55
"axstd/bus-mmio",
66
]
77
log = "Info"

configs/board/qemu-aarch64.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cargo_args = []
22
features = [
33
"ept-level-4",
4-
"axstd/myplat",
54
"axstd/bus-mmio",
5+
"dyn-plat",
66
]
77
log = "Info"
88
target = "aarch64-unknown-none-softfloat"

configs/board/roc-rk3568-pc.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cargo_args = []
22
features = [
33
# "ept-level-4",
4-
"axstd/myplat",
4+
"dyn-plat",
55
"axstd/bus-mmio",
66
]
77
log = "Info"

kernel/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ name = "axvisor"
77
[features]
88
ept-level-4 = ["axaddrspace/4-level-ept"]
99
fs = ["axstd/fs", "axruntime/fs"]
10+
dyn-plat = ["axstd/myplat", "axstd/driver-dyn", "axruntime/driver-dyn"]
1011

1112
[dependencies]
1213
bitflags.workspace = true
@@ -27,14 +28,12 @@ axstd = {workspace = true, features = [
2728
"irq",
2829
"multitask",
2930
"smp",
30-
"myplat",
31-
"driver-dyn",
3231
]}
3332

3433
# System dependent modules provided by ArceOS-Hypervisor.
3534
axaddrspace.workspace = true
3635
axhvc.workspace = true
37-
axruntime = {workspace = true, features = ["alloc", "irq", "paging", "smp", "driver-dyn", "multitask"]}
36+
axruntime = {workspace = true, features = ["alloc", "irq", "paging", "smp", "multitask"]}
3837
axvcpu.workspace = true
3938
axvm.workspace = true
4039

kernel/build.rs

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use std::{
2626
env,
2727
ffi::OsString,
2828
fs,
29-
io::{self, Write},
29+
io::Write,
3030
path::{Path, PathBuf},
3131
};
3232

@@ -239,10 +239,6 @@ fn generate_guest_img_loading_functions(
239239

240240
fn main() -> anyhow::Result<()> {
241241
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
242-
let mut smp = None;
243-
if let Ok(s) = std::env::var("AXVISOR_SMP") {
244-
smp = Some(s.parse::<usize>().unwrap_or(1));
245-
}
246242

247243
// let platform = env::var("AX_PLATFORM").unwrap_or("".to_string());
248244

@@ -256,10 +252,6 @@ fn main() -> anyhow::Result<()> {
256252

257253
println!("cargo:rustc-cfg=platform=\"{platform}\"");
258254

259-
// if platform != "dummy" {
260-
// gen_linker_script(&arch, platform.as_str(), smp.unwrap_or(1)).unwrap();
261-
// }
262-
263255
let config_files = get_configs();
264256
let mut output_file = open_output_file();
265257

@@ -298,28 +290,3 @@ fn main() -> anyhow::Result<()> {
298290
}
299291
Ok(())
300292
}
301-
302-
fn gen_linker_script(arch: &str, _platform: &str, smp: usize) -> io::Result<()> {
303-
let fname = "link.x";
304-
let output_arch = if arch == "x86_64" {
305-
"i386:x86-64"
306-
} else if arch.contains("riscv") {
307-
"riscv" // OUTPUT_ARCH of both riscv32/riscv64 is "riscv"
308-
} else {
309-
arch
310-
};
311-
let ld_content = std::fs::read_to_string("../scripts/lds/linker.lds.S")?;
312-
let ld_content = ld_content.replace("%ARCH%", output_arch);
313-
let ld_content = ld_content.replace("%KERNEL_BASE%", &format!("{:#x}", 0xffff800000200000usize));
314-
let ld_content = ld_content.replace("%SMP%", &format!("{smp}",));
315-
316-
let out_dir = std::env::var("OUT_DIR").unwrap();
317-
println!("cargo:rerun-if-changed=../scripts/lds/linker.lds.S");
318-
println!("cargo:rustc-link-search={out_dir}");
319-
320-
let out_path = Path::new(&out_dir).join(fname);
321-
322-
println!("writing linker script to {}", out_path.display());
323-
// std::fs::write(out_path, ld_content)?;
324-
Ok(())
325-
}

platform/x86-qemu-q35/axconfig.toml

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)