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
49 changes: 30 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 20 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ members = [
]

[workspace.package]
version = "0.2.2-hv.4"
version = "0.2.2-hv.5"
edition = "2024"
authors = ["Yuekai Jia <equation618@gmail.com>"]
license = "GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0"
Expand All @@ -44,28 +44,28 @@ keywords = ["arceos", "kernel"]
categories = ["os", "no-std"]

[workspace.dependencies]
axstd = { version = "=0.2.2-hv.4", path = "ulib/axstd" }
axlibc = { version = "=0.2.2-hv.4", path = "ulib/axlibc" }
axstd = { version = "=0.2.2-hv.5", path = "ulib/axstd" }
axlibc = { version = "=0.2.2-hv.5", path = "ulib/axlibc" }

arceos_api = { version = "=0.2.2-hv.4", path = "api/arceos_api" }
arceos_posix_api = { version = "=0.2.2-hv.4", path = "api/arceos_posix_api" }
axfeat = { version = "=0.2.2-hv.4", path = "api/axfeat" }
arceos_api = { version = "=0.2.2-hv.5", path = "api/arceos_api" }
arceos_posix_api = { version = "=0.2.2-hv.5", path = "api/arceos_posix_api" }
axfeat = { version = "=0.2.2-hv.5", path = "api/axfeat" }

axalloc = { version = "=0.2.2-hv.4", path = "modules/axalloc" }
axconfig = { version = "=0.2.2-hv.4", path = "modules/axconfig" }
axdisplay = { version = "=0.2.2-hv.4", path = "modules/axdisplay" }
axdma = { version = "=0.2.2-hv.4", path = "modules/axdma" }
axdriver = { version = "=0.2.2-hv.4", path = "modules/axdriver" }
axfs = { version = "=0.2.2-hv.4", path = "modules/axfs" }
axhal = { version = "=0.2.2-hv.4", path = "modules/axhal" }
axinput = { version = "=0.2.2-hv.4", path = "modules/axinput" }
axipi = { version = "=0.2.2-hv.4", path = "modules/axipi" }
axalloc = { version = "=0.2.2-hv.5", path = "modules/axalloc" }
axconfig = { version = "=0.2.2-hv.5", path = "modules/axconfig" }
axdisplay = { version = "=0.2.2-hv.5", path = "modules/axdisplay" }
axdma = { version = "=0.2.2-hv.5", path = "modules/axdma" }
axdriver = { version = "=0.2.2-hv.5", path = "modules/axdriver" }
axfs = { version = "=0.2.2-hv.5", path = "modules/axfs" }
axhal = { version = "=0.2.2-hv.5", path = "modules/axhal" }
axinput = { version = "=0.2.2-hv.5", path = "modules/axinput" }
axipi = { version = "=0.2.2-hv.5", path = "modules/axipi" }
axlog = { version = "=0.2.2-preview.1", path = "modules/axlog" }
axmm = { version = "=0.2.2-hv.4", path = "modules/axmm" }
axnet = { version = "=0.2.2-hv.4", path = "modules/axnet" }
axruntime = { version = "=0.2.2-hv.4", path = "modules/axruntime" }
axsync = { version = "=0.2.2-hv.4", path = "modules/axsync" }
axtask = { version = "=0.2.2-hv.4", path = "modules/axtask" }
axmm = { version = "=0.2.2-hv.5", path = "modules/axmm" }
axnet = { version = "=0.2.2-hv.5", path = "modules/axnet" }
axruntime = { version = "=0.2.2-hv.5", path = "modules/axruntime" }
axsync = { version = "=0.2.2-hv.5", path = "modules/axsync" }
axtask = { version = "=0.2.2-hv.5", path = "modules/axtask" }

axallocator = { version = "0.1.3-preview.1", features = [
"axerrno",
Expand Down
12 changes: 6 additions & 6 deletions modules/axfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ version.workspace = true
default = []
monolitic = []
fat = ["dep:fatfs"]
# ext4 = ["dep:lwext4_rust"]
# std = ["lwext4_rust?/std"]
ext4 = ["dep:lwext4_rust"]
std = ["lwext4_rust?/std"]
times = []
use-ramdisk = [] # TODO: init ramdisk

Expand Down Expand Up @@ -54,10 +54,10 @@ features = [
"unicode",
]

# [dependencies.lwext4_rust]
# version = "0.3.1-preview.1"
# default-features = false
# optional = true
[dependencies.lwext4_rust]
version = "0.3.1-preview.1"
default-features = false
optional = true

[dependencies.fatfs]
version = "0.4.1-preview.2"
Expand Down
13 changes: 6 additions & 7 deletions modules/axruntime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ default = []
alloc = ["axalloc"]
hv = ["axalloc/hv"]
dma = ["paging"]
driver-dyn = ["driver-dyn-base", "driver-dyn-aarch64", "driver-dyn-x86_64", "axconfig/driver-dyn"]
driver-dyn-base = ["axdriver/dyn", "paging"]
driver-dyn = ["axdriver/dyn", "paging"]
ipi = ["dep:axipi"]
irq = ["axhal/irq", "axtask?/irq", "percpu"]
paging = ["axhal/paging", "axmm"]
smp = ["axhal/smp", "axtask?/smp"]
tls = ["axhal/tls", "axtask?/tls"]

# Platform-specific driver-dyn features
driver-dyn-aarch64 = ["dep:axplat-dyn", "dep:somehal"]
driver-dyn-x86_64 = ["dep:axplat-x86-qemu-q35"]
# Platform-specific features (optional, enable separately if needed)
plat-hv-aarch64 = ["dep:axplat-dyn", "dep:somehal", "axconfig/driver-dyn"]
plat-hv-x86_64 = ["dep:axplat-x86-qemu-q35", "axconfig/driver-dyn"]

display = ["axdriver", "axdisplay"]
fs = ["axdriver", "axfs"]
Expand Down Expand Up @@ -64,8 +63,8 @@ chrono = {version = "0.4.38", default-features = false}
indoc = "2"

[target.'cfg(target_arch = "x86_64")'.dependencies]
axplat-x86-qemu-q35 = {version ="0.1.0-preview.1", default-features = false, features = ["reboot-on-system-off"], optional = true}
axplat-x86-qemu-q35 = { version ="0.1.0-preview.1", default-features = false, features = ["reboot-on-system-off", "smp", "irq"], optional = true }

[target.'cfg(target_arch = "aarch64")'.dependencies]
axplat-dyn = { version = "0.4", features = ["irq", "smp", "hv"], optional = true }
somehal = { version = "0.4", optional = true }
somehal = { version = "0.4", optional = true }
3 changes: 2 additions & 1 deletion modules/axruntime/src/lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use core::panic::PanicInfo;

#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
error!("{info}");
ax_println!("{}", info);
// ax_println!("{}", axbacktrace::Backtrace::capture());
axhal::power::system_off()
}
24 changes: 12 additions & 12 deletions modules/axruntime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
#[macro_use]
extern crate axlog;

#[cfg(all(target_arch = "x86_64", feature = "driver-dyn"))]
#[cfg(all(target_arch = "x86_64", feature = "plat-hv-x86_64"))]
extern crate axplat_x86_qemu_q35;

#[cfg(all(target_arch = "aarch64", feature = "driver-dyn"))]
#[cfg(all(target_arch = "aarch64", feature = "plat-hv-aarch64"))]
extern crate axplat_dyn;

#[cfg(all(target_arch = "aarch64", feature = "driver-dyn"))]
#[cfg(all(target_arch = "aarch64", feature = "plat-hv-aarch64"))]
extern crate somehal;

#[cfg(all(target_os = "none", not(test)))]
Expand Down Expand Up @@ -111,13 +111,13 @@ use core::sync::atomic::{AtomicUsize, Ordering};

static INITED_CPUS: AtomicUsize = AtomicUsize::new(0);

#[cfg(feature = "driver-dyn")]
#[cfg(any(feature = "plat-hv-x86_64", feature = "plat-hv-aarch64"))]
fn is_init_ok() -> bool {
let cpu_num = cpu_count();
INITED_CPUS.load(Ordering::Acquire) == cpu_num
}

#[cfg(not(feature = "driver-dyn"))]
#[cfg(not(any(feature = "plat-hv-x86_64", feature = "plat-hv-aarch64")))]
fn is_init_ok() -> bool {
let cpu_num = axconfig::plat::CPU_NUM;
INITED_CPUS.load(Ordering::Acquire) == cpu_num
Expand All @@ -140,10 +140,10 @@ pub fn rust_main(cpu_id: usize, arg: usize) -> ! {
axhal::init_early(cpu_id, arg);

ax_println!("{}", LOGO);
#[cfg(feature = "driver-dyn")]
ax_println!("smp = {}", cpu_count());
#[cfg(any(feature = "plat-hv-x86_64", feature = "plat-hv-aarch64"))]
ax_println!("smp = {}\n", cpu_count());

#[cfg(not(feature = "driver-dyn"))]
#[cfg(not(any(feature = "plat-hv-x86_64", feature = "plat-hv-aarch64")))]
ax_println!(
indoc::indoc! {"
arch = {}
Expand Down Expand Up @@ -365,7 +365,7 @@ fn init_tls() {
core::mem::forget(main_tls);
}

#[cfg(feature = "driver-dyn")]
#[cfg(any(feature = "plat-hv-x86_64", feature = "plat-hv-aarch64"))]
fn smp() -> Option<usize> {
let mut smp = None;
let s = option_env!("AXVISOR_SMP");
Expand All @@ -378,14 +378,14 @@ fn smp() -> Option<usize> {
}

/// Returns the number of CPUs available on the system
#[cfg(feature = "driver-dyn")]
#[cfg(any(feature = "plat-hv-x86_64", feature = "plat-hv-aarch64"))]
pub fn cpu_count() -> usize {
let mut cpu_count;

cfg_if::cfg_if! {
if #[cfg(all(target_arch = "x86_64", target_os = "none"))] {
if #[cfg(all(target_arch = "x86_64", feature = "plat-hv-x86_64"))] {
cpu_count = axplat_x86_qemu_q35::cpu_count()
} else if #[cfg(target_arch = "aarch64")] {
} else if #[cfg(all(target_arch = "aarch64", feature = "plat-hv-aarch64"))] {
cpu_count = somehal::mem::cpu_id_list().count()
} else {
cpu_count = 1;
Expand Down
Loading
Loading