From ecf590e3544d286b868f1269b9e040805f7072da Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 10:55:42 +0800 Subject: [PATCH 01/23] =?UTF-8?q?Fix:=20Circular=20dependencies=20=3D=3D?= =?UTF-8?q?=3D=20The=20fundamental=20problem=20Circular=20dependencies:=20?= =?UTF-8?q?axdriver=20=E2=86=92=20axdma=20=E2=86=92=20axmm=20=E2=86=92=20a?= =?UTF-8?q?xfs=20=E2=86=92=20axdriver=20Fix=20Policy=20Break=20the=20two?= =?UTF-8?q?=20edges=20in=20the=20loop=20(axdma=20=E2=86=92=20axmm=20and=20?= =?UTF-8?q?axdriver=20=E2=86=92=20axmm)=20by=20decoupling=20them=20with=20?= =?UTF-8?q?crate=5Finterface,=20and=20change=20axmm=20=E2=86=92=20axfs=20t?= =?UTF-8?q?o=20optional.=20Change=20log=20(13=20files)=201.=20Decouple=20a?= =?UTF-8?q?xdma=20=E2=86=92=20axmm=20using=20crate=5Finterface=20modules/a?= =?UTF-8?q?xdma/Cargo.toml=20=E2=80=94=20Remove=20the=20axmm=20dependency?= =?UTF-8?q?=20and=20add=20crate=5Finterface=20modules/axdma/src/lib.rs=20?= =?UTF-8?q?=E2=80=94=20Defines=20the=20DmaProtectIf=20trait=20(crate=5Fint?= =?UTF-8?q?erface:=20def=5Finterface)=20modules/axdma/src/dma.rs=20?= =?UTF-8?q?=E2=80=94=20Replace=20axmm::kernel=5Faspace()=20with=20call=5Fi?= =?UTF-8?q?nterface!=20(DmaProtectIf:=20protect=5Fmemory(...))=20lock()=20?= =?UTF-8?q?protect(...).=202.=20Decouple=20axdriver=20=E2=86=92=20axmm=20u?= =?UTF-8?q?sing=20crate=5Finterface=20modules/axdriver/Cargo.toml=20?= =?UTF-8?q?=E2=80=94=20Remove=20axmm=20from=20dyn=20features=20and=20depen?= =?UTF-8?q?dencies=20modules/axdriver/src/dyn=5Fdrivers/klib.rs=20?= =?UTF-8?q?=E2=80=94=20Defines=20the=20IoMapIf=20trait,=20replacing=20axmm?= =?UTF-8?q?::iomap(...)=20with=20call=5Finterface!=20(IoMapIf:=20iomap(...?= =?UTF-8?q?))=203.=20Change=20axmm=20=E2=86=92=20axfs=20to=20optional=20mo?= =?UTF-8?q?dules/axmm/Cargo.toml=20=E2=80=94=20Added=20fs=20feature,=20cha?= =?UTF-8?q?nging=20axfs/axfs-ng-vfs=20to=20optional=20modules/axmm/src/bac?= =?UTF-8?q?kend/mod.rs=20=E2=80=94=20Protects=20the=20cow=20and=20file=20m?= =?UTF-8?q?odules=20and=20enum=20variants=20with=20#[cfg=20(feature=20=3D?= =?UTF-8?q?=20fs)]=204.=20Implement=20the=20interface=20in=20axruntime=20m?= =?UTF-8?q?odules/axruntime/Cargo.toml=20=E2=80=94=20Added=20DMA=20feature?= =?UTF-8?q?=20(axdma=20enabled),=20driver-dyn=20supports=20paging,=20fs=20?= =?UTF-8?q?supports=20axmm=3F/fs=20modules/axruntime/src/lib.rs=20?= =?UTF-8?q?=E2=80=94=20Implements=20DmaProtectIf=20(axmm:kernel=5Faspace)?= =?UTF-8?q?=20and=20IoMapIf=20(axmm:iomap)=205.=20Feature=20Transmission?= =?UTF-8?q?=20api/axfeat/Cargo.toml=20=E2=80=94=20DMA=20feature=20added=20?= =?UTF-8?q?to=20axruntime/dma=20api/arceos=5Fapi/Cargo.toml=20=E2=80=94=20?= =?UTF-8?q?fs=20feature=20added=20to=20axmm=3F=20/fs=206.=20Fixed=20const?= =?UTF-8?q?=20compatibility=20issues=20in=20the=20new=20Rust=20toolchain?= =?UTF-8?q?=20ulib/axstd/Cargo.toml=20=E2=80=94=20Add=20spin=20dependencie?= =?UTF-8?q?s=20ulib/axstd/src/io/stdio.rs=20=E2=80=94=20Uses=20spin::Lazy?= =?UTF-8?q?=20to=20statically=20initialize=20BufReader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 661 ++++++++++++++++------- api/arceos_api/Cargo.toml | 2 +- api/axfeat/Cargo.toml | 2 +- modules/axdma/Cargo.toml | 2 +- modules/axdma/src/dma.rs | 14 +- modules/axdma/src/lib.rs | 17 +- modules/axdriver/Cargo.toml | 2 - modules/axdriver/src/dyn_drivers/klib.rs | 16 +- modules/axmm/Cargo.toml | 5 +- modules/axmm/src/backend/mod.rs | 4 + modules/axruntime/Cargo.toml | 6 +- modules/axruntime/src/lib.rs | 31 ++ ulib/axstd/Cargo.toml | 1 + ulib/axstd/src/io/stdio.rs | 4 +- 14 files changed, 534 insertions(+), 233 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7be437fa83..61054dc2ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,6 +63,12 @@ dependencies = [ "slab_allocator", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -162,10 +168,7 @@ dependencies = [ name = "arceos-shell" version = "0.1.0" dependencies = [ - "axfs_ramfs", - "axfs_vfs", "axstd", - "crate_interface", ] [[package]] @@ -177,7 +180,7 @@ dependencies = [ "axdisplay", "axdma", "axdriver", - "axerrno 0.1.2", + "axerrno 0.2.2", "axfeat", "axfs", "axhal", @@ -197,7 +200,7 @@ version = "0.2.0" dependencies = [ "axalloc", "axconfig", - "axerrno 0.1.2", + "axerrno 0.2.2", "axfeat", "axfs", "axhal", @@ -207,7 +210,7 @@ dependencies = [ "axruntime", "axsync", "axtask", - "bindgen 0.72.1", + "bindgen", "flatten_objects", "lazy_static", "scope-local", @@ -216,9 +219,9 @@ dependencies = [ [[package]] name = "arm-gic-driver" -version = "0.15.8" +version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f251a1a74133f802b55eaf5e340107b0024457aa9b2ac3c72074501bfa8509a5" +checksum = "6dac353a1d007bb25a96f1b8af6d694927901f4ff6c5d54a6252a784f3032bf0" dependencies = [ "aarch64-cpu 10.0.0", "bitflags 2.10.0", @@ -247,12 +250,30 @@ dependencies = [ "chrono", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "as-any" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0f477b951e452a0b6b4a10b53ccd569042d1d01729b519e02074a9c0958a063" +[[package]] +name = "async-channel" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-trait" version = "0.1.89" @@ -261,7 +282,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -285,7 +306,7 @@ version = "0.2.0" dependencies = [ "allocator", "axbacktrace", - "axerrno 0.1.2", + "axerrno 0.2.2", "cfg-if", "kspin", "log", @@ -317,9 +338,9 @@ dependencies = [ [[package]] name = "axconfig-gen" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf14099a96dbb925e39a44c4f25555f1e24516194452a84a943aa7eda62383d" +checksum = "e8021a26bbd0b7e0760e28ded5dba2082fda8224c7cfd457ab370ff851626452" dependencies = [ "clap", "toml_edit", @@ -327,14 +348,14 @@ dependencies = [ [[package]] name = "axconfig-macros" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86a6711b80fbd1dc4c1d8e2fb77a5de6fc8e2eb2b96bbd0420ca8af370eb74c" +checksum = "4b2decc5437a10ddb659f0fbd819b9308362ea1d11455ddb5a1c47ea3973920d" dependencies = [ "axconfig-gen", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -351,7 +372,7 @@ dependencies = [ "loongArch64", "memory_addr", "page_table_entry", - "page_table_multiarch", + "page_table_multiarch 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", "percpu", "riscv", "static_assertions", @@ -377,9 +398,9 @@ dependencies = [ "allocator", "axalloc", "axconfig", - "axerrno 0.1.2", + "axerrno 0.2.2", "axhal", - "axmm", + "crate_interface", "kspin", "log", "memory_addr", @@ -401,10 +422,9 @@ dependencies = [ "axdriver_pci", "axdriver_virtio", "axdriver_vsock", - "axerrno 0.1.2", + "axerrno 0.2.2", "axhal", "axklib", - "axmm", "cfg-if", "crate_interface", "dma-api", @@ -420,24 +440,24 @@ dependencies = [ [[package]] name = "axdriver_base" version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=dev-v01#cada10715c1f4c08b63d5d60345d2bedbc39bcd8" +source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" [[package]] name = "axdriver_block" version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=dev-v01#cada10715c1f4c08b63d5d60345d2bedbc39bcd8" +source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" dependencies = [ "axdriver_base", "bcm2835-sdhci", "log", - "simple-sdmmc", "simple-ahci", + "simple-sdmmc", ] [[package]] name = "axdriver_display" version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=dev-v01#cada10715c1f4c08b63d5d60345d2bedbc39bcd8" +source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" dependencies = [ "axdriver_base", ] @@ -445,7 +465,7 @@ dependencies = [ [[package]] name = "axdriver_input" version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=dev-v01#cada10715c1f4c08b63d5d60345d2bedbc39bcd8" +source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" dependencies = [ "axdriver_base", "strum", @@ -454,7 +474,7 @@ dependencies = [ [[package]] name = "axdriver_net" version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=dev-v01#cada10715c1f4c08b63d5d60345d2bedbc39bcd8" +source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" dependencies = [ "axdriver_base", "fxmac_rs", @@ -466,7 +486,7 @@ dependencies = [ [[package]] name = "axdriver_pci" version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=dev-v01#cada10715c1f4c08b63d5d60345d2bedbc39bcd8" +source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" dependencies = [ "virtio-drivers", ] @@ -474,7 +494,7 @@ dependencies = [ [[package]] name = "axdriver_virtio" version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=dev-v01#cada10715c1f4c08b63d5d60345d2bedbc39bcd8" +source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" dependencies = [ "axdriver_base", "axdriver_block", @@ -489,7 +509,7 @@ dependencies = [ [[package]] name = "axdriver_vsock" version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=dev-v01#cada10715c1f4c08b63d5d60345d2bedbc39bcd8" +source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" dependencies = [ "axdriver_base", "log", @@ -539,56 +559,44 @@ dependencies = [ name = "axfs" version = "0.2.0" dependencies = [ + "axalloc", "axdriver", - "axdriver_block", - "axerrno 0.1.2", - "axfs_devfs", - "axfs_ramfs", - "axfs_vfs", + "axerrno 0.2.2", + "axfs-ng-vfs", + "axhal", "axio", + "axpoll", "axsync", - "axtask", - "cap_access", + "bitflags 2.10.0", "cfg-if", - "crate_interface", + "chrono", + "env_logger", "fatfs", - "lazyinit", + "intrusive-collections", + "kspin", "log", + "lru", "lwext4_rust", "scope-local", + "slab", + "spin 0.10.0", ] [[package]] -name = "axfs_devfs" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b87ae981272ca8d5d8f106a4452c63f4b5ac36e17ee8f848ee1b250538b9f8" -dependencies = [ - "axfs_vfs", - "log", - "spin 0.9.8", -] - -[[package]] -name = "axfs_ramfs" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f50c26614485d837a3fc09a92f24a226caddc25a30df7e6aaf4bd19b304c399" -dependencies = [ - "axfs_vfs", - "log", - "spin 0.9.8", -] - -[[package]] -name = "axfs_vfs" -version = "0.1.2" +name = "axfs-ng-vfs" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcba2006898d7879d456a9c34b9c9460cb536f5bf69d1d5d7d0e0f19f073368d" +checksum = "bf0d501c182116576111dc04ba89f48fea639b7080e0455393be5dbc41cfacef" dependencies = [ - "axerrno 0.1.2", + "axerrno 0.2.2", + "axpoll", "bitflags 2.10.0", + "cfg-if", + "hashbrown 0.15.5", + "inherit-methods-macro", "log", + "smallvec", + "spin 0.10.0", ] [[package]] @@ -611,7 +619,7 @@ dependencies = [ "linkme", "log", "memory_addr", - "page_table_multiarch", + "page_table_multiarch 0.5.7 (git+https://github.com/arceos-org/page_table_multiarch.git?tag=dev-v05)", "percpu", ] @@ -627,11 +635,14 @@ dependencies = [ [[package]] name = "axio" -version = "0.2.0" +version = "0.3.0-pre.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e797ff4cfd17460c7b8742222a2cadd72a2f4966f0057d36b5925fabf534f7" +checksum = "f6ce41624ae4e7ef942ebe3ac3aa3ce5d64340e8f23fb29bbd0007e9765544b4" dependencies = [ - "axerrno 0.1.2", + "autocfg", + "axerrno 0.2.2", + "heapless 0.9.2", + "memchr", ] [[package]] @@ -649,7 +660,7 @@ dependencies = [ [[package]] name = "axklib" version = "0.2.0" -source = "git+https://github.com/arceos-hypervisor/axklib.git#7c0fc0588f978f7d75bb94f4e07477776ed37887" +source = "git+https://github.com/arceos-hypervisor/axklib.git#0cb1045714015acff11b7c6f531ee81be0e02924" dependencies = [ "axerrno 0.1.2", "memory_addr", @@ -661,10 +672,10 @@ name = "axlibc" version = "0.2.0" dependencies = [ "arceos_posix_api", - "axerrno 0.1.2", + "axerrno 0.2.2", "axfeat", "axio", - "bindgen 0.72.1", + "bindgen", ] [[package]] @@ -685,29 +696,46 @@ version = "0.2.0" dependencies = [ "axalloc", "axconfig", - "axerrno 0.1.2", + "axerrno 0.2.2", + "axfs", + "axfs-ng-vfs", "axhal", + "axsync", + "axtask", + "enum_dispatch", "kspin", "lazyinit", "log", "memory_addr", "memory_set", - "page_table_multiarch", + "page_table_multiarch 0.5.7 (git+https://github.com/arceos-org/page_table_multiarch.git?tag=dev-v05)", ] [[package]] name = "axnet" version = "0.2.0" dependencies = [ + "async-channel", + "async-trait", + "axconfig", "axdriver", - "axerrno 0.1.2", + "axerrno 0.2.2", + "axfs", + "axfs-ng-vfs", "axhal", "axio", + "axpoll", "axsync", "axtask", + "bitflags 2.10.0", "cfg-if", + "enum_dispatch", + "event-listener", + "hashbrown 0.16.1", + "lazy_static", "lazyinit", "log", + "ringbuf", "smoltcp 0.12.0", "spin 0.10.0", ] @@ -825,7 +853,7 @@ source = "git+https://github.com/arceos-org/axplat_crates.git?tag=dev-v03#0df071 dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -889,6 +917,7 @@ dependencies = [ "axbacktrace", "axconfig", "axdisplay", + "axdma", "axdriver", "axfs", "axhal", @@ -908,9 +937,9 @@ dependencies = [ [[package]] name = "axsched" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44de469da35f912194e4104cc2f51bff63d6c184b65b6ebf8e90e2cd162b7f3c" +checksum = "cad6b7b0b8d9ad1d52a834d8b7721114413da8cf3430af928b1c8651f911287a" dependencies = [ "linked_list_r4l", ] @@ -920,11 +949,12 @@ name = "axstd" version = "0.2.0" dependencies = [ "arceos_api", - "axerrno 0.1.2", + "axerrno 0.2.2", "axfeat", "axio", "kspin", "lock_api", + "spin 0.10.0", ] [[package]] @@ -944,7 +974,7 @@ name = "axtask" version = "0.2.0" dependencies = [ "axconfig", - "axerrno 0.1.2", + "axerrno 0.2.2", "axhal", "axpoll", "axsched", @@ -971,7 +1001,7 @@ checksum = "e585a01076fee271c5aabcf36212acb349fb3e638561d842fffa8ca013f4fdd8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -991,26 +1021,6 @@ dependencies = [ "volatile 0.2.7", ] -[[package]] -name = "bindgen" -version = "0.71.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" -dependencies = [ - "bitflags 2.10.0", - "cexpr", - "clang-sys", - "itertools", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.111", -] - [[package]] name = "bindgen" version = "0.72.1" @@ -1028,7 +1038,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1051,7 +1061,7 @@ checksum = "d3ca019570363e800b05ad4fd890734f28ac7b72f563ad8a35079efb793616f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1089,9 +1099,9 @@ checksum = "a7913f22349ffcfc6ca0ca9a656ec26cfbba538ed49c31a273dff2c5d1ea83d9" [[package]] name = "bumpalo" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "byteorder" @@ -1099,20 +1109,11 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "cap_access" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9b24894fa5f73bbf9c72196e7f495a1f81d6218a548280a09ada4a937157692" -dependencies = [ - "bitflags 2.10.0", -] - [[package]] name = "cc" -version = "1.2.47" +version = "1.2.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd405d82c84ff7f35739f175f67d8b9fb7687a0e84ccdc78bd3568839827cf07" +checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29" dependencies = [ "find-msvc-tools", "shlex", @@ -1135,9 +1136,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chrono" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" +checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" dependencies = [ "iana-time-zone", "js-sys", @@ -1159,9 +1160,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.53" +version = "4.5.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" +checksum = "6899ea499e3fb9305a65d5ebf6e3d2248c5fab291f300ad0a704fbe142eae31a" dependencies = [ "clap_builder", "clap_derive", @@ -1169,33 +1170,33 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.53" +version = "4.5.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" +checksum = "7b12c8b680195a62a8364d16b8447b01b6c2c8f9aaf68bee653be34d4245e238" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.11.1", ] [[package]] name = "clap_derive" -version = "4.5.49" +version = "4.5.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" +checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "clap_lex" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" +checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" [[package]] name = "colorchoice" @@ -1277,7 +1278,7 @@ checksum = "70272a03a2cef15589bac05d3d15c023752f5f8f2da8be977d983a9d9e6250fb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1309,7 +1310,42 @@ checksum = "9a49d5cd78b1c748184d41407b14a58af8403c13328ff2b9f49b0a418c24e3ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", +] + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", ] [[package]] @@ -1341,7 +1377,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1395,7 +1431,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1406,7 +1442,30 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", +] + +[[package]] +name = "env_filter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "jiff", + "log", ] [[package]] @@ -1425,6 +1484,16 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + [[package]] name = "extern-trait" version = "0.2.0" @@ -1433,7 +1502,7 @@ checksum = "ba8f5038f5845165d06fe1453fe4130ad546d3314818bbda57e208e7b0cffe08" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1445,7 +1514,7 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fatfs" version = "0.4.0" -source = "git+https://github.com/rafalh/rust-fatfs?rev=4eccb50#4eccb50d011146fbed20e133d33b22f3c27292e7" +source = "git+https://github.com/Starry-OS/rust-fatfs.git?rev=2685439#2685439e679cc832a67fd21340258b7c018c0f33" dependencies = [ "bitflags 2.10.0", "log", @@ -1459,9 +1528,9 @@ checksum = "1f95f0bda5ff920492f6573294d8e3a99b75ee2e5ef93ab313fc6d517fa46785" [[package]] name = "find-msvc-tools" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" [[package]] name = "flatten_objects" @@ -1472,6 +1541,24 @@ dependencies = [ "bitmaps", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "futures" version = "0.3.31" @@ -1516,7 +1603,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1594,11 +1681,27 @@ dependencies = [ "byteorder", ] +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.1.5", +] + [[package]] name = "hashbrown" version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.2.0", +] [[package]] name = "heapless" @@ -1641,9 +1744,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "iana-time-zone" -version = "0.1.64" +version = "0.1.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1663,14 +1766,20 @@ dependencies = [ "cc", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "indexmap" -version = "2.12.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.16.1", ] [[package]] @@ -1682,12 +1791,33 @@ dependencies = [ "rustversion", ] +[[package]] +name = "inherit-methods-macro" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831739f8836b05db933f3a84783a5af48bd605915dcd10c7435bc74e7947a030" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "int_ratio" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6045ea39e8d2862506c0dff6c65d068da362335df698bb1634033492740d2170" +[[package]] +name = "intrusive-collections" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "189d0897e4cbe8c75efedf3502c18c887b05046e59d28404d4d8e46cbc4d1e86" +dependencies = [ + "memoffset", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.2" @@ -1715,11 +1845,35 @@ dependencies = [ "volatile 0.3.0", ] +[[package]] +name = "jiff" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89a5b5e10d5a9ad6e5d1f4bd58225f655d6fe9767575a5e8ac5a6fe64e04495" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", +] + +[[package]] +name = "jiff-static" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff7a39c8862fc1369215ccf0a8f12dd4598c7f6484704359f0351bd617034dbf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + [[package]] name = "js-sys" -version = "0.3.83" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" dependencies = [ "once_cell", "wasm-bindgen", @@ -1727,9 +1881,9 @@ dependencies = [ [[package]] name = "kernel_guard" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307e6be468f3d6b6d895e191f63c11602e4e76575ecca68325d8c8dbebe2870e" +checksum = "d10c55bedf6789bc3748e0d8756ee639df1ae25144fd3525ed311044bd9a739f" dependencies = [ "cfg-if", "crate_interface", @@ -1791,9 +1945,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.177" +version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" [[package]] name = "libloading" @@ -1807,9 +1961,9 @@ dependencies = [ [[package]] name = "linked_list_r4l" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c6e48d7df84e6414be8e53976ead35ba4d47a4ba561eaad5d1e2b1447b4c0a" +checksum = "1730c4ce817dc3edb092739ca5c109fe551018e5ea5a8361a8ddaa13d79ac8ed" [[package]] name = "linkme" @@ -1828,7 +1982,7 @@ checksum = "e5cec0ec4228b4853bb129c84dbf093a27e6c7a20526da046defc334a1b017f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -1848,9 +2002,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.28" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "loongArch64" @@ -1862,12 +2016,21 @@ dependencies = [ "bitflags 2.10.0", ] +[[package]] +name = "lru" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1dc47f592c06f33f8e3aea9591776ec7c9f9e4124778ff8a3c3b87159f7e593" +dependencies = [ + "hashbrown 0.16.1", +] + [[package]] name = "lwext4_rust" version = "0.2.0" -source = "git+https://github.com/Josen-B/lwext4_rust.git?rev=99b3e5c#99b3e5c7262718db2002411fe55ea0362a23fdfc" +source = "git+https://github.com/Starry-OS/lwext4_rust.git?rev=033fa2c#033fa2cc848c7495651b00af6695dc07de06d596" dependencies = [ - "bindgen 0.71.1", + "bindgen", "log", ] @@ -1883,6 +2046,15 @@ version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + [[package]] name = "memory_addr" version = "0.4.1" @@ -1963,6 +2135,20 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa11a21844255e14aa6688ef0eafb058d7be19338633024fb59417f1bfb07f8" dependencies = [ + "log", + "memory_addr", + "page_table_entry", + "riscv", + "x86", +] + +[[package]] +name = "page_table_multiarch" +version = "0.5.7" +source = "git+https://github.com/arceos-org/page_table_multiarch.git?tag=dev-v05#4594a765e361bca2a8b6ef6773a37ae6d8539840" +dependencies = [ + "arrayvec", + "axerrno 0.1.2", "bitmaps", "log", "memory_addr", @@ -1979,9 +2165,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pci_types" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4325c6aa3cca3373503b1527e75756f9fbfe5fd76be4b4c8a143ee47430b8e0" +checksum = "f0c2a105c657261a938ff68ee231c199a3d80eef33976004829de761ef5b1a9b" dependencies = [ "bit_field", "bitflags 2.10.0", @@ -2004,9 +2190,9 @@ dependencies = [ [[package]] name = "percpu" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01e56c0c558952222967b592899f98765b48590e7bd7403bfd7075f73afc6ed6" +checksum = "54ca06381bdd16a5397e23cf61d347b539c765e2c20b2ecc5cb36df88695c1f7" dependencies = [ "cfg-if", "kernel_guard", @@ -2017,13 +2203,14 @@ dependencies = [ [[package]] name = "percpu_macros" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9f4cc54a2e471ff72f1499461ba381ad4eae9cbd60d29c258545b995e406e0" +checksum = "a933d46113c0171aee86623311a9367f2ec3a86dab0a96aba1d5bc627473617e" dependencies = [ + "cfg-if", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2038,6 +2225,21 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + +[[package]] +name = "portable-atomic-util" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a9db96d7fa8782dd8c15ce32ffe8680bbd1e978a43bf51a34d39483540495f5" +dependencies = [ + "portable-atomic", +] + [[package]] name = "prettyplease" version = "0.2.37" @@ -2045,7 +2247,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2067,23 +2269,23 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "proc-macro2" -version = "1.0.103" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.42" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" dependencies = [ "proc-macro2", ] @@ -2189,14 +2391,14 @@ checksum = "eab3105c9af32e901a2adc7d920b39ff8b6ee0f6f0b7dfdeaf18f306ec12606f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "regex" -version = "1.12.2" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" dependencies = [ "aho-corasick", "memchr", @@ -2206,9 +2408,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" dependencies = [ "aho-corasick", "memchr", @@ -2217,9 +2419,19 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" +checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" + +[[package]] +name = "ringbuf" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe47b720588c8702e34b5979cb3271a8b1842c7cb6f57408efa70c779363488c" +dependencies = [ + "crossbeam-utils", + "portable-atomic-util", +] [[package]] name = "riscv" @@ -2242,7 +2454,7 @@ checksum = "e8c4aa1ea1af6dcc83a61be12e8189f9b293c3ba5a487778a4cd89fb060fdbbc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2280,9 +2492,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" +checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" [[package]] name = "rustc-hash" @@ -2322,12 +2534,12 @@ checksum = "e6e36312fb5ddc10d08ecdc65187402baba4ac34585cb9d1b78522ae2358d890" [[package]] name = "scope-local" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "231e441739fbe668e91acf8440a0b1ac83c73faec7a6d984190ee25354c2ec9a" +checksum = "4a7d5ed5013e6436fcd78f2bcd3892a6286ef9ce6c9b61504d4c4a08d6a40eab" dependencies = [ "percpu", - "spin 0.9.8", + "spin 0.10.0", ] [[package]] @@ -2342,6 +2554,26 @@ version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + [[package]] name = "shlex" version = "1.3.0" @@ -2349,26 +2581,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "simple-sdmmc" +name = "simple-ahci" version = "0.1.0" -source = "git+https://github.com/Starry-OS/simple-sdmmc.git?rev=9e6420c#9e6420c3bcaa67d4c3a6ecd2b24a2e7ee9118f9b" +source = "git+https://github.com/Starry-OS/simple-ahci.git?rev=36d0979#36d0979fedb17c7846b78d1a63f944da31f96186" dependencies = [ "bitfield-struct", "log", + "thiserror", "volatile 0.6.1", ] [[package]] -name = "simple-ahci" +name = "simple-sdmmc" version = "0.1.0" -source = "git+https://github.com/Starry-OS/simple-ahci.git?rev=36d0979#36d0979fedb17c7846b78d1a63f944da31f96186" +source = "git+https://github.com/Starry-OS/simple-sdmmc.git?rev=9e6420c#9e6420c3bcaa67d4c3a6ecd2b24a2e7ee9118f9b" dependencies = [ "bitfield-struct", "log", - "thiserror", "volatile 0.6.1", ] +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "slab_allocator" @@ -2401,7 +2638,7 @@ dependencies = [ [[package]] name = "smoltcp" version = "0.12.0" -source = "git+https://github.com/rcore-os/smoltcp.git?rev=21a2f82#21a2f82b062ec88442eb624d7fcec1feeb886496" +source = "git+https://github.com/Starry-OS/smoltcp.git?rev=7401a54#7401a54b041924a78971b077cd62140b26d441dc" dependencies = [ "bitflags 1.3.2", "byteorder", @@ -2451,6 +2688,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strsim" version = "0.11.1" @@ -2475,7 +2718,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2504,9 +2747,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.111" +version = "2.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" dependencies = [ "proc-macro2", "quote", @@ -2515,22 +2758,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2585,7 +2828,7 @@ dependencies = [ "lenient_semver", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2670,14 +2913,14 @@ checksum = "65c67ce935f3b4329e473ecaff7bab444fcdc3d1d19f8bae61fabfa90b84f93e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] name = "wasm-bindgen" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" dependencies = [ "cfg-if", "once_cell", @@ -2688,9 +2931,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2698,22 +2941,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.106" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" dependencies = [ "unicode-ident", ] @@ -2739,7 +2982,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2750,7 +2993,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] [[package]] @@ -2860,5 +3103,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.111", + "syn 2.0.114", ] diff --git a/api/arceos_api/Cargo.toml b/api/arceos_api/Cargo.toml index b9be846b53..04b6c9963f 100644 --- a/api/arceos_api/Cargo.toml +++ b/api/arceos_api/Cargo.toml @@ -18,7 +18,7 @@ alloc = ["dep:axalloc", "axfeat/alloc"] paging = ["dep:axmm", "axfeat/paging"] dma = ["dep:axdma", "axfeat/dma"] multitask = ["axtask/multitask", "axsync/multitask", "axfeat/multitask"] -fs = ["dep:axfs", "dep:axdriver", "axfeat/fs"] +fs = ["dep:axfs", "dep:axdriver", "axfeat/fs", "axmm?/fs"] net = ["dep:axnet", "dep:axdriver", "axfeat/net"] display = ["dep:axdisplay", "dep:axdriver", "axfeat/display"] diff --git a/api/axfeat/Cargo.toml b/api/axfeat/Cargo.toml index 875d302d0a..db59358e8a 100644 --- a/api/axfeat/Cargo.toml +++ b/api/axfeat/Cargo.toml @@ -39,7 +39,7 @@ page-alloc-64g = ["axalloc/page-alloc-64g"] # up to 64G memory page-alloc-4g = ["axalloc/page-alloc-4g"] # up to 4G memory capacity paging = ["alloc", "axhal/paging", "axruntime/paging"] tls = ["alloc", "axhal/tls", "axruntime/tls", "axtask?/tls"] -dma = ["alloc", "paging"] +dma = ["alloc", "paging", "axruntime/dma"] # Multi-threading and scheduler multitask = [ diff --git a/modules/axdma/Cargo.toml b/modules/axdma/Cargo.toml index 0c24cf6348..4a9259792c 100644 --- a/modules/axdma/Cargo.toml +++ b/modules/axdma/Cargo.toml @@ -16,7 +16,7 @@ axalloc.workspace = true axconfig.workspace = true axerrno.workspace = true axhal = { workspace = true, features = ["paging"] } -axmm.workspace = true +crate_interface.workspace = true kspin.workspace = true log.workspace = true memory_addr.workspace = true diff --git a/modules/axdma/src/dma.rs b/modules/axdma/src/dma.rs index 39a63f92b7..ca11138c7e 100644 --- a/modules/axdma/src/dma.rs +++ b/modules/axdma/src/dma.rs @@ -3,6 +3,7 @@ use core::{alloc::Layout, ptr::NonNull}; use allocator::{AllocError, AllocResult, BaseAllocator, ByteAllocator}; use axalloc::{DefaultByteAllocator, UsageKind, global_allocator}; use axhal::{mem::virt_to_phys, paging::MappingFlags}; +use crate_interface::call_interface; use kspin::SpinNoIrq; use log::{debug, error}; use memory_addr::{PAGE_SIZE_4K, VirtAddr, va}; @@ -95,14 +96,11 @@ impl DmaAllocator { num_pages: usize, flags: MappingFlags, ) -> AllocResult<()> { - let expand_size = num_pages * PAGE_SIZE_4K; - axmm::kernel_aspace() - .lock() - .protect(vaddr, expand_size, flags) - .map_err(|e| { - error!("change table flag fail: {e:?}"); - AllocError::NoMemory - }) + let size = num_pages * PAGE_SIZE_4K; + call_interface!(DmaProtectIf::protect_memory(vaddr, size, flags)).map_err(|e| { + error!("change table flag fail: {e:?}"); + AllocError::NoMemory + }) } /// Gives back the allocated region to the byte allocator. diff --git a/modules/axdma/src/lib.rs b/modules/axdma/src/lib.rs index 1803c6869b..5b4c002d0a 100644 --- a/modules/axdma/src/lib.rs +++ b/modules/axdma/src/lib.rs @@ -9,10 +9,25 @@ mod dma; use core::{alloc::Layout, ptr::NonNull}; use allocator::AllocResult; -use memory_addr::PhysAddr; +use axhal::paging::MappingFlags; +use memory_addr::{PhysAddr, VirtAddr}; use self::dma::ALLOCATOR; +/// Extern interfaces that must be implemented in other crates to provide +/// memory protection for DMA regions. +#[crate_interface::def_interface] +pub trait DmaProtectIf { + /// Updates the page table flags for the given virtual memory region. + /// + /// This is used to set memory regions as uncached for DMA coherence. + fn protect_memory( + vaddr: VirtAddr, + size: usize, + flags: MappingFlags, + ) -> Result<(), axerrno::AxError>; +} + /// Converts a physical address to a bus address. /// /// It assumes that there is a linear mapping with the offset diff --git a/modules/axdriver/Cargo.toml b/modules/axdriver/Cargo.toml index 27a8c02bc1..df3ac66d6e 100644 --- a/modules/axdriver/Cargo.toml +++ b/modules/axdriver/Cargo.toml @@ -45,7 +45,6 @@ dyn = [ "dep:axerrno", "dep:axhal", "dep:axklib", - "dep:axmm", "dep:dma-api", "dep:memory_addr", "dep:rdif-block", @@ -71,7 +70,6 @@ axdriver_vsock = { workspace = true, optional = true } axerrno = { workspace = true, optional = true } axhal = { workspace = true, optional = true } axklib = { workspace = true, optional = true } -axmm = { workspace = true, optional = true } cfg-if.workspace = true crate_interface.workspace = true dma-api = { version = "0.5", features = ["alloc"], optional = true } diff --git a/modules/axdriver/src/dyn_drivers/klib.rs b/modules/axdriver/src/dyn_drivers/klib.rs index df2aeb7f33..fa00f869db 100644 --- a/modules/axdriver/src/dyn_drivers/klib.rs +++ b/modules/axdriver/src/dyn_drivers/klib.rs @@ -13,17 +13,23 @@ use core::time::Duration; use axklib::{AxResult, IrqHandler, Klib, PhysAddr, VirtAddr, impl_trait}; +use crate_interface::call_interface; + +/// Extern interface for IO memory mapping, implemented in axruntime. +#[crate_interface::def_interface] +pub trait IoMapIf { + /// Map a physical memory region for IO access. + fn iomap(paddr: PhysAddr, size: usize) -> AxResult; +} struct KlibImpl; impl_trait! { impl Klib for KlibImpl { - /// Map a physical region by delegating to the memory manager (`axmm`). - /// - /// This function forwards the request to `axmm::iomap` and returns the - /// resulting virtual address wrapped in an `AxResult`. + /// Map a physical region by delegating to the memory manager via + /// the `IoMapIf` interface. fn mem_iomap(addr: PhysAddr, size: usize) -> AxResult { - axmm::iomap(addr, size) + call_interface!(IoMapIf::iomap(addr, size)) } /// Busy-wait for the given duration by calling into `axhal`. diff --git a/modules/axmm/Cargo.toml b/modules/axmm/Cargo.toml index 760d7f7d6c..0a8b1bbf85 100644 --- a/modules/axmm/Cargo.toml +++ b/modules/axmm/Cargo.toml @@ -11,14 +11,15 @@ documentation = "https://arceos-org.github.io/arceos/axmm/index.html" [features] default = [] +fs = ["dep:axfs", "dep:axfs-ng-vfs"] copy = ["page_table_multiarch/copy-from"] [dependencies] axalloc = { workspace = true } axconfig = { workspace = true } axerrno = { workspace = true } -axfs = { workspace = true } -axfs-ng-vfs = { workspace = true } +axfs = { workspace = true, optional = true } +axfs-ng-vfs = { workspace = true, optional = true } axhal = { workspace = true, features = ["paging"] } axsync = { workspace = true } axtask = { workspace = true } diff --git a/modules/axmm/src/backend/mod.rs b/modules/axmm/src/backend/mod.rs index 0bc1760564..be3b0581f9 100644 --- a/modules/axmm/src/backend/mod.rs +++ b/modules/axmm/src/backend/mod.rs @@ -12,7 +12,9 @@ use enum_dispatch::enum_dispatch; use memory_addr::{DynPageIter, PAGE_SIZE_4K, PhysAddr, VirtAddr, VirtAddrRange}; use memory_set::MappingBackend; +#[cfg(feature = "fs")] pub mod cow; +#[cfg(feature = "fs")] pub mod file; pub mod linear; pub mod shared; @@ -107,8 +109,10 @@ pub trait BackendOps { #[enum_dispatch(BackendOps)] pub enum Backend { Linear(linear::LinearBackend), + #[cfg(feature = "fs")] Cow(cow::CowBackend), Shared(shared::SharedBackend), + #[cfg(feature = "fs")] File(file::FileBackend), } diff --git a/modules/axruntime/Cargo.toml b/modules/axruntime/Cargo.toml index 01e409463f..b0efcb6ebf 100644 --- a/modules/axruntime/Cargo.toml +++ b/modules/axruntime/Cargo.toml @@ -17,22 +17,24 @@ irq = ["axhal/irq", "axtask?/irq", "dep:percpu"] tls = ["axhal/tls", "axtask?/tls"] alloc = ["dep:axalloc"] paging = ["axhal/paging", "dep:axmm"] +dma = ["paging", "dep:axdma"] ipi = ["dep:axipi"] multitask = ["axtask/multitask"] -fs = ["dep:axdriver", "dep:axfs"] +fs = ["dep:axdriver", "dep:axfs", "axmm?/fs"] net = ["dep:axdriver", "dep:axnet"] display = ["dep:axdriver", "dep:axdisplay"] input = ["dep:axdriver", "dep:axinput"] vsock = ["net", "dep:axdriver"] rtc = [] -driver-dyn = ["axdriver/dyn"] +driver-dyn = ["axdriver/dyn", "paging"] [dependencies] axalloc = { workspace = true, optional = true } axbacktrace.workspace = true axconfig.workspace = true axdisplay = { workspace = true, optional = true } +axdma = { workspace = true, optional = true } axdriver = { workspace = true, optional = true } axinput = { workspace = true, optional = true } axfs = { workspace = true, optional = true } diff --git a/modules/axruntime/src/lib.rs b/modules/axruntime/src/lib.rs index 4bccbaa64d..eae02a9fe7 100644 --- a/modules/axruntime/src/lib.rs +++ b/modules/axruntime/src/lib.rs @@ -84,6 +84,37 @@ impl axlog::LogIf for LogIfImpl { } } +#[cfg(feature = "dma")] +struct DmaProtectIfImpl; + +#[cfg(feature = "dma")] +#[crate_interface::impl_interface] +impl axdma::DmaProtectIf for DmaProtectIfImpl { + fn protect_memory( + vaddr: memory_addr::VirtAddr, + size: usize, + flags: axhal::paging::MappingFlags, + ) -> Result<(), axerrno::AxError> { + axmm::kernel_aspace() + .lock() + .protect(vaddr, size, flags) + } +} + +#[cfg(feature = "driver-dyn")] +struct IoMapIfImpl; + +#[cfg(feature = "driver-dyn")] +#[crate_interface::impl_interface] +impl axdriver::dyn_drivers::klib::IoMapIf for IoMapIfImpl { + fn iomap( + paddr: memory_addr::PhysAddr, + size: usize, + ) -> Result { + axmm::iomap(paddr, size) + } +} + use core::sync::atomic::{AtomicUsize, Ordering}; static INITED_CPUS: AtomicUsize = AtomicUsize::new(0); diff --git a/ulib/axstd/Cargo.toml b/ulib/axstd/Cargo.toml index 6ab9e122e1..52978a028c 100644 --- a/ulib/axstd/Cargo.toml +++ b/ulib/axstd/Cargo.toml @@ -96,3 +96,4 @@ axfeat.workspace = true axio.workspace = true kspin.workspace = true lock_api.workspace = true +spin.workspace = true diff --git a/ulib/axstd/src/io/stdio.rs b/ulib/axstd/src/io/stdio.rs index bb7e1144c1..4ee02d3465 100644 --- a/ulib/axstd/src/io/stdio.rs +++ b/ulib/axstd/src/io/stdio.rs @@ -150,7 +150,9 @@ impl Write for StdoutLock<'_> { /// Constructs a new handle to the standard input of the current process. pub fn stdin() -> Stdin { - static INSTANCE: Mutex> = Mutex::new(BufReader::new(StdinRaw)); + use spin::Lazy; + static INSTANCE: Lazy>> = + Lazy::new(|| Mutex::new(BufReader::new(StdinRaw))); Stdin { inner: &INSTANCE } } From 08330925f152a1898d3fff437ebf350de5cb4f2d Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 11:37:08 +0800 Subject: [PATCH 02/23] Chore: for cargo publish -p axconfig ======== 1. modules/axconfig/src/lib.rs Fallback path: Change from ../../configs/dummy.toml to dummy.toml. The original path points to Configs/dummy.toml outside the crate directory, which does not exist after packaging. Move it directly to the crate directory. 2. modules/axconfig/dummy.toml (new) Copy the config file from config/dummy.toml to the axconfig crate directory, ensuring the packaged crate includes the fallback configuration file. 3. modules/axconfig/Cargo.toml Add README.md. Add the following files: [src/**/*, build.rs, dummy.toml, Cargo.toml, README.md], ensuring dummy.toml is included in the.crate file. 4. modules/axconfig/README.md (new) The README documentation required by crates.io. The cargo build-p axconfig command in workspace can also pass without affecting the existing development workflow. --- Cargo.toml | 4 +-- modules/PUBLISH_ORDER.md | 49 +++++++++++++++++++++++++++++ modules/axconfig/Cargo.toml | 2 ++ modules/axconfig/README.md | 16 ++++++++++ modules/axconfig/dummy.toml | 61 +++++++++++++++++++++++++++++++++++++ modules/axconfig/src/lib.rs | 2 +- 6 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 modules/PUBLISH_ORDER.md create mode 100644 modules/axconfig/README.md create mode 100644 modules/axconfig/dummy.toml diff --git a/Cargo.toml b/Cargo.toml index 8dbac6bdb0..fb7738d2ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,9 +33,9 @@ members = [ ] [workspace.package] -version = "0.2.0" +version = "0.2.1-preview.1" edition = "2024" -authors = ["Yuekai Jia "] +authors = ["Yuekai Jia ", "Yu Chen "] license = "GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0" homepage = "https://github.com/arceos-org/arceos" documentation = "https://arceos-org.github.io/arceos" diff --git a/modules/PUBLISH_ORDER.md b/modules/PUBLISH_ORDER.md new file mode 100644 index 0000000000..84b68f74dc --- /dev/null +++ b/modules/PUBLISH_ORDER.md @@ -0,0 +1,49 @@ +# arceos/modules 發布至 crates.io 順序 + +依「被依賴者先發布」的拓撲順序,各 crate 僅列出**對同屬 `modules/` 的其它 crate** 的依賴。 + +## 依賴關係摘要 + +| Crate | 依賴的 modules | +|-------|----------------| +| axconfig | — | +| axlog | — | +| axalloc | — | +| axhal | axconfig | +| axtask | axhal | +| axsync | axtask | +| axipi | axconfig, axhal | +| axdma | axalloc, axconfig, axhal | +| axdriver | axalloc?, axconfig?, axdma?, axhal?(均 optional) | +| axdisplay | axdriver, axsync | +| axinput | axdriver, axsync | +| axfs | axalloc, axdriver, axhal, axsync | +| axmm | axalloc, axconfig, axhal, axsync, axtask;axfs?(optional) | +| axnet | axconfig, axdriver, axhal, axsync, axtask, axfs | +| axruntime | axconfig, axhal, axlog;其餘多為 optional | + +## 建議發布順序 + +按下列順序執行 `cargo publish -p `(在 arceos 倉庫根目錄): + +1. **axconfig** — 無 module 依賴 +2. **axlog** — 無 module 依賴 +3. **axalloc** — 無 module 依賴 +4. **axhal** — 依賴 axconfig +5. **axtask** — 依賴 axhal +6. **axsync** — 依賴 axtask +7. **axipi** — 依賴 axconfig, axhal +8. **axdma** — 依賴 axalloc, axconfig, axhal +9. **axdriver** — 依賴 axalloc, axconfig, axdma, axhal(皆 optional) +10. **axdisplay** — 依賴 axdriver, axsync +11. **axinput** — 依賴 axdriver, axsync +12. **axfs** — 依賴 axalloc, axdriver, axhal, axsync +13. **axmm** — 依賴 axalloc, axconfig, axhal, axsync, axtask(axfs optional) +14. **axnet** — 依賴 axconfig, axdriver, axhal, axsync, axtask, axfs +15. **axruntime** — 依賴其餘 modules(多為 optional) + +## 注意 + +- 上述僅考慮 **modules 內** 的依賴;各 crate 還依賴 workspace 中的 **外部** 依賴(如 `allocator`、`axdriver_*`、`axplat`、`axcpu` 等 git/crates.io)。發布前須確保這些依賴已存在於 crates.io 或改為可發布的 version 依賴。 +- 含 **git 依賴** 的 crate 無法直接發布,需先改為 crates.io 版本或移除該依賴。 +- 每發布一個 crate 後,再對依賴它的 crate 執行 `cargo publish --dry-run` 以確認可通過。 diff --git a/modules/axconfig/Cargo.toml b/modules/axconfig/Cargo.toml index db192e2a9c..68a02fb667 100644 --- a/modules/axconfig/Cargo.toml +++ b/modules/axconfig/Cargo.toml @@ -8,6 +8,8 @@ license.workspace = true homepage.workspace = true repository = "https://github.com/arceos-org/arceos/tree/main/modules/axconfig" documentation = "https://arceos-org.github.io/arceos/axconfig/index.html" +readme = "README.md" +include = ["src/**/*", "build.rs", "dummy.toml", "Cargo.toml", "README.md"] [dependencies] axconfig-macros = "0.2" diff --git a/modules/axconfig/README.md b/modules/axconfig/README.md new file mode 100644 index 0000000000..a205577019 --- /dev/null +++ b/modules/axconfig/README.md @@ -0,0 +1,16 @@ +# axconfig + +Platform-specific constants and parameters for [ArceOS](https://github.com/arceos-org/arceos). + +Uses [`axconfig-macros`](https://docs.rs/axconfig-macros) to generate compile-time configuration from a TOML file. Set the `AX_CONFIG_PATH` environment variable to point to a custom config; otherwise a built-in `dummy.toml` is used as fallback. + +## Usage + +```toml +[dependencies] +axconfig = "0.2" +``` + +## License + +GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0 diff --git a/modules/axconfig/dummy.toml b/modules/axconfig/dummy.toml new file mode 100644 index 0000000000..2e47eb4c92 --- /dev/null +++ b/modules/axconfig/dummy.toml @@ -0,0 +1,61 @@ +# Architecture identifier. +arch = "unknown" # str +# Platform identifier. +platform = "dummy" # str +# Platform package. +package = "dummy" # str +# Stack size of each task. +task-stack-size = 0x40000 # uint +# Number of timer ticks per second (Hz). A timer tick may contain several timer +# interrupts. +ticks-per-sec = 100 # uint + +# +# Platform configs +# +[plat] +# Platform family. +# Number of CPUs +cpu-num = 1 # uint +# Base address of the whole physical memory. +phys-memory-base = 0 # uint +# Size of the whole physical memory. +phys-memory-size = 0 # uint +# End address of the whole physical memory. +phys-memory-end = 0 # uint +# Base physical address of the kernel image. +kernel-base-paddr = 0 # uint +# Base virtual address of the kernel image. +kernel-base-vaddr = 0 # uint +# Linear mapping offset, for quick conversions between physical and virtual +# addresses. +phys-virt-offset = 0 # uint +# Offset of bus address and phys address. some boards, the bus address is +# different from the physical address. +phys-bus-offset = 0 # uint +# Kernel address space base. +kernel-aspace-base = 0 # uint +# Kernel address space size. +kernel-aspace-size = 0 # uint + +# +# Device specifications +# +[devices] +# MMIO ranges with format (`base_paddr`, `size`). +mmio-ranges = [] # [(uint, uint)] +# VirtIO MMIO ranges with format (`base_paddr`, `size`). +virtio-mmio-ranges = [] # [(uint, uint)] +# Base physical address of the PCIe ECAM space. +pci-ecam-base = 0 # uint +# End PCI bus number. +pci-bus-end = 0 # uint +# PCI device memory ranges. +pci-ranges = [] # [(uint, uint)] +# Timer interrupt num. +timer-irq = 0 # uint +# IPI interrupt num +ipi-irq = 0 # uint + +# SDMMC controller physical address. +sdmmc-paddr = 0 # uint diff --git a/modules/axconfig/src/lib.rs b/modules/axconfig/src/lib.rs index 09eb5b56bb..1b6fe3c263 100644 --- a/modules/axconfig/src/lib.rs +++ b/modules/axconfig/src/lib.rs @@ -10,5 +10,5 @@ axconfig_macros::include_configs!( path_env = "AX_CONFIG_PATH", - fallback = "../../configs/dummy.toml" + fallback = "dummy.toml" ); From 2d8c170bbcafec5f4e99d5ab4ad6675ae1b9a901 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 11:54:55 +0800 Subject: [PATCH 03/23] Chore: for cargo publish -p axalloc =========== cargo publish-p axalloc--dry-run has passed, and cargo build-p axalloc in the workspace can be compiled normally. 1. modules/axalloc/Cargo.toml Dependency: allocator = {workspace = true, features = [bitmap]} changed to axallocator = {version = 0.1.3-preview.1,default-features = false,features = [bitmap]} (modified to align with crates.io's ax allocator to meet release requirements). Features: All allocator/... will be renamed to ax allocator/... (e.g., ax allocator/page-alloc-256m, ax allocator/tlsf, etc.). readme: Added readme = README.md. 2. modules/axalloc/src/lib.rs use allocator: {...} changed to use axallocator: {...}. allocator:: SlabByte Allocator / BuddyByte Allocator / TlsfByte Allocator changed to ax allocator::... The allocator in the file annotation: TlsfByte Allocator has been renamed to axallocator: TlsfByte Allocator. 3. modules/axalloc/src/page.rs axallocator: The AllocError cannot be automatically converted to AxError. Modify the two alloc_pages (...) to Map error (|_| AxError: NoMemory)?, and use axerrno: {AxError, AxResult}. 4. modules/axalloc/README.md (new file) A brief description, feature list, and license for crates.io. Note: axalloc now depends on the ax allocator 0.1.3-preview.1 from crates.io. If this version has not been released, you must release the allocator (ax allocator) before releasing axalloc. --- Cargo.lock | 76 +++++++++++++++++++++---------------- modules/axalloc/Cargo.toml | 15 ++++---- modules/axalloc/README.md | 17 +++++++++ modules/axalloc/src/lib.rs | 10 ++--- modules/axalloc/src/page.rs | 10 +++-- 5 files changed, 80 insertions(+), 48 deletions(-) create mode 100644 modules/axalloc/README.md diff --git a/Cargo.lock b/Cargo.lock index 61054dc2ff..59caa9c869 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -56,11 +56,7 @@ version = "0.1.2" source = "git+https://github.com/arceos-org/allocator.git?tag=v0.1.2#922e72a7e4dfb7ffc4b67d242d38f8361ebd13ac" dependencies = [ "axerrno 0.1.2", - "bitmap-allocator", - "buddy_system_allocator", "cfg-if", - "rlsf", - "slab_allocator", ] [[package]] @@ -173,7 +169,7 @@ dependencies = [ [[package]] name = "arceos_api" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "axalloc", "axconfig", @@ -196,7 +192,7 @@ dependencies = [ [[package]] name = "arceos_posix_api" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "axalloc", "axconfig", @@ -300,11 +296,20 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +[[package]] +name = "ax_slab_allocator" +version = "0.3.2-preview.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925fe9ce2492005f319efe39af520a1d53976aa6f473bd3ecdee2edd8382dbd3" +dependencies = [ + "buddy_system_allocator", +] + [[package]] name = "axalloc" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ - "allocator", + "axallocator", "axbacktrace", "axerrno 0.2.2", "cfg-if", @@ -315,6 +320,19 @@ dependencies = [ "strum", ] +[[package]] +name = "axallocator" +version = "0.1.3-preview.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1af235e0e403b05aef675f5273ded7f54e79d78ffb358a7b46e950434c4e1fd8" +dependencies = [ + "ax_slab_allocator", + "bitmap-allocator", + "buddy_system_allocator", + "cfg-if", + "rlsf", +] + [[package]] name = "axbacktrace" version = "0.1.1" @@ -331,7 +349,7 @@ dependencies = [ [[package]] name = "axconfig" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "axconfig-macros", ] @@ -383,7 +401,7 @@ dependencies = [ [[package]] name = "axdisplay" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "axdriver", "axsync", @@ -393,7 +411,7 @@ dependencies = [ [[package]] name = "axdma" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "allocator", "axalloc", @@ -408,7 +426,7 @@ dependencies = [ [[package]] name = "axdriver" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "arm-gic-driver", "axalloc", @@ -537,7 +555,7 @@ dependencies = [ [[package]] name = "axfeat" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "axalloc", "axbacktrace", @@ -557,7 +575,7 @@ dependencies = [ [[package]] name = "axfs" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "axalloc", "axdriver", @@ -601,7 +619,7 @@ dependencies = [ [[package]] name = "axhal" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "axalloc", "axconfig", @@ -625,7 +643,7 @@ dependencies = [ [[package]] name = "axinput" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "axdriver", "axsync", @@ -647,7 +665,7 @@ dependencies = [ [[package]] name = "axipi" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "axconfig", "axhal", @@ -669,7 +687,7 @@ dependencies = [ [[package]] name = "axlibc" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "arceos_posix_api", "axerrno 0.2.2", @@ -680,7 +698,7 @@ dependencies = [ [[package]] name = "axlog" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "axlog", "cfg-if", @@ -692,7 +710,7 @@ dependencies = [ [[package]] name = "axmm" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "axalloc", "axconfig", @@ -713,7 +731,7 @@ dependencies = [ [[package]] name = "axnet" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "async-channel", "async-trait", @@ -911,7 +929,7 @@ dependencies = [ [[package]] name = "axruntime" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "axalloc", "axbacktrace", @@ -946,7 +964,7 @@ dependencies = [ [[package]] name = "axstd" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "arceos_api", "axerrno 0.2.2", @@ -959,7 +977,7 @@ dependencies = [ [[package]] name = "axsync" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "axsync", "axtask", @@ -971,7 +989,7 @@ dependencies = [ [[package]] name = "axtask" -version = "0.2.0" +version = "0.2.1-preview.1" dependencies = [ "axconfig", "axerrno 0.2.2", @@ -2607,14 +2625,6 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" -[[package]] -name = "slab_allocator" -version = "0.3.1" -source = "git+https://github.com/arceos-org/slab_allocator.git?tag=v0.3.1#3c13499d664ccd36f66786985b753340aea57f5a" -dependencies = [ - "buddy_system_allocator", -] - [[package]] name = "smallvec" version = "1.15.1" diff --git a/modules/axalloc/Cargo.toml b/modules/axalloc/Cargo.toml index 3610d55e99..e638cfc4ad 100644 --- a/modules/axalloc/Cargo.toml +++ b/modules/axalloc/Cargo.toml @@ -8,21 +8,22 @@ license.workspace = true homepage.workspace = true repository = "https://github.com/arceos-org/arceos/tree/main/modules/axalloc" documentation = "https://arceos-org.github.io/arceos/axalloc/index.html" +readme = "README.md" [features] -default = ["tlsf", "allocator/page-alloc-256m"] -tlsf = ["allocator/tlsf"] -slab = ["allocator/slab"] -buddy = ["allocator/buddy"] +default = ["tlsf", "axallocator/page-alloc-256m"] +tlsf = ["axallocator/tlsf"] +slab = ["axallocator/slab"] +buddy = ["axallocator/buddy"] page-alloc-64g = [ - "allocator/page-alloc-64g", + "axallocator/page-alloc-64g", ] # Support up to 64G memory capacity -page-alloc-4g = ["allocator/page-alloc-4g"] # Support up to 4G memory capacity +page-alloc-4g = ["axallocator/page-alloc-4g"] # Support up to 4G memory capacity level-1 = [] tracking = ["dep:percpu", "dep:axbacktrace"] [dependencies] -allocator = { workspace = true, features = ["bitmap"] } +axallocator = { version = "0.1.3-preview.1", default-features = false, features = ["bitmap"] } axbacktrace = { workspace = true, optional = true } axerrno.workspace = true cfg-if.workspace = true diff --git a/modules/axalloc/README.md b/modules/axalloc/README.md new file mode 100644 index 0000000000..98c4b0d47d --- /dev/null +++ b/modules/axalloc/README.md @@ -0,0 +1,17 @@ +# axalloc + +ArceOS global memory allocator. Provides [`GlobalAllocator`] implementing [`core::alloc::GlobalAlloc`] for use with `#[global_allocator]`. + +Uses the [axallocator](https://docs.rs/axallocator) crate for the underlying byte and page allocators (TLSF, slab, buddy, bitmap). + +## Features + +- `tlsf` (default) – TLSF byte allocator +- `slab` – slab byte allocator +- `buddy` – buddy byte allocator +- `page-alloc-256m` (default), `page-alloc-4g`, `page-alloc-64g` – page allocator capacity +- `tracking` – allocation tracking (requires `percpu`, `axbacktrace`) + +## License + +GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0 diff --git a/modules/axalloc/src/lib.rs b/modules/axalloc/src/lib.rs index 794bd272bf..b212d1cffb 100644 --- a/modules/axalloc/src/lib.rs +++ b/modules/axalloc/src/lib.rs @@ -18,7 +18,7 @@ use core::{ }; #[allow(unused_imports)] -use allocator::{AllocResult, BaseAllocator, BitmapPageAllocator, ByteAllocator, PageAllocator}; +use axallocator::{AllocResult, BaseAllocator, BitmapPageAllocator, ByteAllocator, PageAllocator}; use kspin::SpinNoIrq; use strum::{IntoStaticStr, VariantArray}; @@ -36,13 +36,13 @@ pub use tracking::*; cfg_if::cfg_if! { if #[cfg(feature = "slab")] { /// The default byte allocator. - pub type DefaultByteAllocator = allocator::SlabByteAllocator; + pub type DefaultByteAllocator = axallocator::SlabByteAllocator; } else if #[cfg(feature = "buddy")] { /// The default byte allocator. - pub type DefaultByteAllocator = allocator::BuddyByteAllocator; + pub type DefaultByteAllocator = axallocator::BuddyByteAllocator; } else if #[cfg(feature = "tlsf")] { /// The default byte allocator. - pub type DefaultByteAllocator = allocator::TlsfByteAllocator; + pub type DefaultByteAllocator = axallocator::TlsfByteAllocator; } } @@ -106,7 +106,7 @@ impl fmt::Debug for Usages { /// Currently, [`TlsfByteAllocator`] is used as the byte allocator, while /// [`BitmapPageAllocator`] is used as the page allocator. /// -/// [`TlsfByteAllocator`]: allocator::TlsfByteAllocator +/// [`TlsfByteAllocator`]: axallocator::TlsfByteAllocator pub struct GlobalAllocator { balloc: SpinNoIrq, #[cfg(not(feature = "level-1"))] diff --git a/modules/axalloc/src/page.rs b/modules/axalloc/src/page.rs index 152fff5832..73926c73b0 100644 --- a/modules/axalloc/src/page.rs +++ b/modules/axalloc/src/page.rs @@ -1,4 +1,4 @@ -use axerrno::AxResult; +use axerrno::{AxError, AxResult}; use memory_addr::{PhysAddr, VirtAddr}; use crate::{PAGE_SIZE, UsageKind, global_allocator}; @@ -15,7 +15,9 @@ pub struct GlobalPage { impl GlobalPage { /// Allocate one 4K-sized page. pub fn alloc() -> AxResult { - let vaddr = global_allocator().alloc_pages(1, PAGE_SIZE, UsageKind::Global)?; + let vaddr = global_allocator() + .alloc_pages(1, PAGE_SIZE, UsageKind::Global) + .map_err(|_| AxError::NoMemory)?; Ok(Self { start_vaddr: vaddr.into(), num_pages: 1, @@ -31,7 +33,9 @@ impl GlobalPage { /// Allocate contiguous 4K-sized pages. pub fn alloc_contiguous(num_pages: usize, align_pow2: usize) -> AxResult { - let vaddr = global_allocator().alloc_pages(num_pages, align_pow2, UsageKind::Global)?; + let vaddr = global_allocator() + .alloc_pages(num_pages, align_pow2, UsageKind::Global) + .map_err(|_| AxError::NoMemory)?; Ok(Self { start_vaddr: vaddr.into(), num_pages, From c35267c013478d61bb8e000f0932a8660bc35aaa Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 12:23:01 +0800 Subject: [PATCH 04/23] Chore: for cargo publish -p axhal ========== Root cause: The API between the axplat version (0.3.0) on crates.io and the git dev-v03 branch differs. - crates.io 0.3.0 does not have the percpu module - The MemIf in crate.io 0.3.0 does not support the kernel_aspace method - The PowerIf method in crates.io 0.3.0 requires the cpu_num method Modified three files (located in /home/chyyuu/thecodes/publisharceos/arceos/modules/axhal/src/): - percpu.rs Enables pub use axplat::percpu::*; conditional gate control via #[cfg (any (feature = defplat, feature = myplat))]. These features are disabled during dry-run, preventing compilation of non-existent modules. During build, defplat is enabled, and the git version of axplat used through patch includes the percpu module. - mem.rs Isolate the re-export of kernel_aspace from the main import, similarly controlled by #[cfg (any (feature = defplat, feature = myplat))]. - dummy.rs Removes kernel_aspace (a feature absent in 0.3.0) from impl MemIf for DummyMem, and adds cpu_num() -> usize (a feature required in 0.3.0) to impl PowerIf for DummyPower. dummy.rs is compiled only on non-embedded targets (e.g., x86_64 host for dry-run) and does not affect make builds. Verification result: cargo publish -p axhal --dry-run --allow-dirty # Successfully completed make A=examples/helloworld ARCH=riscv64 LOG=info run # Successfully executed and output Hello, world! --- Cargo.lock | 19 +++---------------- Cargo.toml | 13 +++++++++++++ modules/axhal/Cargo.toml | 21 +++++++++++---------- modules/axhal/README.md | 9 +++++++++ modules/axhal/src/dummy.rs | 8 ++++---- modules/axhal/src/mem.rs | 8 ++++++-- modules/axhal/src/percpu.rs | 4 ++++ 7 files changed, 50 insertions(+), 32 deletions(-) create mode 100644 modules/axhal/README.md diff --git a/Cargo.lock b/Cargo.lock index 59caa9c869..4fe6122ab1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -390,7 +390,7 @@ dependencies = [ "loongArch64", "memory_addr", "page_table_entry", - "page_table_multiarch 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", + "page_table_multiarch", "percpu", "riscv", "static_assertions", @@ -637,7 +637,7 @@ dependencies = [ "linkme", "log", "memory_addr", - "page_table_multiarch 0.5.7 (git+https://github.com/arceos-org/page_table_multiarch.git?tag=dev-v05)", + "page_table_multiarch", "percpu", ] @@ -726,7 +726,7 @@ dependencies = [ "log", "memory_addr", "memory_set", - "page_table_multiarch 0.5.7 (git+https://github.com/arceos-org/page_table_multiarch.git?tag=dev-v05)", + "page_table_multiarch", ] [[package]] @@ -2147,19 +2147,6 @@ dependencies = [ "x86_64", ] -[[package]] -name = "page_table_multiarch" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa11a21844255e14aa6688ef0eafb058d7be19338633024fb59417f1bfb07f8" -dependencies = [ - "log", - "memory_addr", - "page_table_entry", - "riscv", - "x86", -] - [[package]] name = "page_table_multiarch" version = "0.5.7" diff --git a/Cargo.toml b/Cargo.toml index fb7738d2ed..b0be505bb3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -112,3 +112,16 @@ page_table_multiarch = { git = "https://github.com/arceos-org/page_table_multiar percpu = "0.2" scope-local = "0.1" spin = "0.10" + +# Local build: use path/git so make run works when axhal (and deps) use version for publish +[patch.crates-io] +axalloc = { path = "modules/axalloc" } +axconfig = { path = "modules/axconfig" } +axhal = { path = "modules/axhal" } +axcpu = { git = "https://github.com/arceos-org/axcpu.git", tag = "dev-v03" } +axplat = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } +axplat-x86-pc = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } +axplat-aarch64-qemu-virt = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } +axplat-riscv64-qemu-virt = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } +axplat-loongarch64-qemu-virt = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } +page_table_multiarch = { git = "https://github.com/arceos-org/page_table_multiarch.git", tag = "dev-v05" } diff --git a/modules/axhal/Cargo.toml b/modules/axhal/Cargo.toml index b91c018c80..c7b25d5f7f 100644 --- a/modules/axhal/Cargo.toml +++ b/modules/axhal/Cargo.toml @@ -8,6 +8,7 @@ license.workspace = true homepage.workspace = true repository = "https://github.com/arceos-org/arceos/tree/main/modules/axhal" documentation = "https://arceos-org.github.io/arceos/axhal/index.html" +readme = "README.md" [features] smp = [ @@ -55,10 +56,10 @@ default = [] ipi = ["irq"] [dependencies] -axalloc = { workspace = true, optional = true } -axconfig.workspace = true -axcpu = { git = "https://github.com/arceos-org/axcpu.git", tag = "dev-v03" } -axplat.workspace = true +axalloc = { version = "0.2.1-preview.1", optional = true } +axconfig = { version = "0.2.1-preview.1" } +axcpu = { version = "0.3.0-alpha.0" } +axplat = { version = "0.3" } cfg-if.workspace = true heapless = "0.9" kernel_guard.workspace = true @@ -66,21 +67,21 @@ lazyinit.workspace = true linkme = { version = "0.3.33", optional = true } log.workspace = true memory_addr.workspace = true -page_table_multiarch = { workspace = true, optional = true } +page_table_multiarch = { version = "0.5", optional = true, features = ["axerrno"] } percpu.workspace = true fdt-parser = "0.4" [target.'cfg(target_arch = "x86_64")'.dependencies] -axplat-x86-pc = { workspace = true, optional = true } +axplat-x86-pc = { version = "0.3", optional = true } [target.'cfg(target_arch = "aarch64")'.dependencies] -axplat-aarch64-qemu-virt = { workspace = true, optional = true } +axplat-aarch64-qemu-virt = { version = "0.3", optional = true } [target.'cfg(target_arch = "riscv64")'.dependencies] -axplat-riscv64-qemu-virt = { workspace = true, optional = true } +axplat-riscv64-qemu-virt = { version = "0.3", optional = true } [target.'cfg(target_arch = "loongarch64")'.dependencies] -axplat-loongarch64-qemu-virt = { workspace = true, optional = true } +axplat-loongarch64-qemu-virt = { version = "0.3", optional = true } [build-dependencies] -axconfig.workspace = true +axconfig = { version = "0.2.1-preview.1" } diff --git a/modules/axhal/README.md b/modules/axhal/README.md new file mode 100644 index 0000000000..1819231765 --- /dev/null +++ b/modules/axhal/README.md @@ -0,0 +1,9 @@ +# axhal + +ArceOS hardware abstraction layer: unified APIs for platform-specific operations (CPU, platform, paging, IRQ, etc.). + +Depends on axconfig, axplat, and axcpu for platform and architecture support. + +## License + +GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0 diff --git a/modules/axhal/src/dummy.rs b/modules/axhal/src/dummy.rs index d692895936..3f502ae3de 100644 --- a/modules/axhal/src/dummy.rs +++ b/modules/axhal/src/dummy.rs @@ -69,10 +69,6 @@ impl MemIf for DummyMem { fn virt_to_phys(_vaddr: memory_addr::VirtAddr) -> memory_addr::PhysAddr { pa!(0) } - - fn kernel_aspace() -> (memory_addr::VirtAddr, usize) { - (va!(0), 0) - } } #[impl_plat_interface] @@ -110,6 +106,10 @@ impl PowerIf for DummyPower { fn system_off() -> ! { unimplemented!() } + + fn cpu_num() -> usize { + 1 + } } #[cfg(feature = "irq")] diff --git a/modules/axhal/src/mem.rs b/modules/axhal/src/mem.rs index a1e9612d21..dcb8f73a6e 100644 --- a/modules/axhal/src/mem.rs +++ b/modules/axhal/src/mem.rs @@ -7,9 +7,13 @@ use axplat::mem::{check_sorted_ranges_overlap, ranges_difference}; pub use axplat::mem::{MemRegionFlags, PhysMemRegion}; pub use axplat::mem::{ - kernel_aspace, mmio_ranges, phys_ram_ranges, phys_to_virt, reserved_phys_ram_ranges, - total_ram_size, virt_to_phys, + mmio_ranges, phys_ram_ranges, phys_to_virt, reserved_phys_ram_ranges, total_ram_size, + virt_to_phys, }; +// `kernel_aspace` is only available in newer (unpublished) versions of axplat; +// the crates.io 0.3.0 release does not have it. +#[cfg(any(feature = "defplat", feature = "myplat"))] +pub use axplat::mem::kernel_aspace; pub use memory_addr::{PAGE_SIZE_4K, PhysAddr, PhysAddrRange, VirtAddr, VirtAddrRange, pa, va}; use crate::addr_of_sym; diff --git a/modules/axhal/src/percpu.rs b/modules/axhal/src/percpu.rs index 7891c5ea22..f350bf39b4 100644 --- a/modules/axhal/src/percpu.rs +++ b/modules/axhal/src/percpu.rs @@ -1,5 +1,9 @@ //! CPU-local data structures. +// Re-export platform percpu items only when a real platform is selected. +// The `percpu` module in `axplat` is only available in newer (unpublished) versions; +// the crates.io 0.3.0 release does not have it. +#[cfg(any(feature = "defplat", feature = "myplat"))] pub use axplat::percpu::*; #[percpu::def_percpu] From 29aeb42c01114bb966a1fcf743afa5e425cf6baa Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 12:35:42 +0800 Subject: [PATCH 05/23] Chore: for cargo publish -p axtask ========== MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified 1 file and added 1 file (both located in /home/chyyuu/thecodes/publisharceos/arceos/modules/axtask/): 1. Modify Cargo.toml - Add readme = README.md - Change axconfig = {workspace = true, optional = true} to axconfig = {version = 0.2.1-preview.1, optional = true} (axconfig is already on crates.io) - Replace with (axhal is available on crates.io) - In the dev-dependencies, axhal is also updated to version dependency {version = 0.2.1-preview.1, features = [fp-simd]} - In dev-dependencies, axtask's auto-reference is changed to {path = ., features = [test, multitask]} Other workspace dependencies (e.g., axerrno, cfg-if, log, axpoll) are already versioned in the workspace definition. Setting workspace = true correctly interprets these as versioned dependencies, eliminating the need for modification. 2. Added README.md A README file was created to describe the functions and features of the axtask module. Verification results: - cargo publish-p axtask--dry-run--allow-dirty — Successfully completed (downloaded axhal 0.2.1-preview.1 from crates.io and compiled it) - make A=examples/helloworld ARCH=riscv64 LOG=info run — Successfully executed and output Hello, world! (workspace's [patch.crates-io] automatically redirects axconfig and axhal to the local path) --- modules/axtask/Cargo.toml | 9 +++++---- modules/axtask/README.md | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 modules/axtask/README.md diff --git a/modules/axtask/Cargo.toml b/modules/axtask/Cargo.toml index 84767b44d9..93519cab4a 100644 --- a/modules/axtask/Cargo.toml +++ b/modules/axtask/Cargo.toml @@ -8,6 +8,7 @@ license.workspace = true homepage.workspace = true repository = "https://github.com/arceos-org/arceos/tree/main/modules/axtask" documentation = "https://arceos-org.github.io/arceos/axtask/index.html" +readme = "README.md" [features] default = [] @@ -39,9 +40,9 @@ sched-cfs = ["multitask", "preempt"] test = ["percpu?/sp-naive"] [dependencies] -axconfig = { workspace = true, optional = true } +axconfig = { version = "0.2.1-preview.1", optional = true } axerrno.workspace = true -axhal.workspace = true +axhal = { version = "0.2.1-preview.1" } axpoll = { workspace = true, optional = true } axsched = { version = "0.3", optional = true } cfg-if.workspace = true @@ -61,5 +62,5 @@ memory_addr = { workspace = true, optional = true } percpu = { workspace = true, optional = true } [dev-dependencies] -axhal = { workspace = true, features = ["fp-simd"] } -axtask = { workspace = true, features = ["test", "multitask"] } +axhal = { version = "0.2.1-preview.1", features = ["fp-simd"] } +axtask = { path = ".", features = ["test", "multitask"] } diff --git a/modules/axtask/README.md b/modules/axtask/README.md new file mode 100644 index 0000000000..1f82af0782 --- /dev/null +++ b/modules/axtask/README.md @@ -0,0 +1,25 @@ +# axtask + +[![Crates.io](https://img.shields.io/crates/v/axtask)](https://crates.io/crates/axtask) +[![Docs.rs](https://docs.rs/axtask/badge.svg)](https://docs.rs/axtask) + +[ArceOS](https://github.com/arceos-org/arceos) task management module. + +This module provides primitives for task management, including task creation, +scheduling, sleeping, termination, etc. The scheduler algorithm is configurable +by cargo features. + +## Features + +- `multitask`: Enable multi-task support with complex scheduling and more task-related APIs. +- `irq`: Enable timer-based APIs such as `sleep`, `sleep_until`, and `WaitQueue::wait_timeout`. +- `preempt`: Enable preemptive scheduling. +- `sched-fifo`: Use the FIFO cooperative scheduler (enables `multitask`). +- `sched-rr`: Use the Round-robin preemptive scheduler (enables `multitask` and `preempt`). +- `sched-cfs`: Use the Completely Fair Scheduler (enables `multitask` and `preempt`). +- `tls`: Enable kernel space thread-local storage support. +- `smp`: Enable SMP (symmetric multiprocessing) support. + +## License + +This project is licensed under GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0. From 3b245734c45d9a26631627ff1893c5ee89e6ff72 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 12:47:12 +0800 Subject: [PATCH 06/23] Chore: for cargo publish -p axsync ========== 1. Modify /home/chyyuu/thecodes/publisharceos/arceos/modules/axsync/Cargo.toml Add README.md. Replace axtask/workspace = true with axtask = {version = 0.2.1-preview.1} (parsed from crates.io after release). dev-dependencies: axsync is updated to {path = ., features = [multitask]} and axtask to {version = 0.2.1-preview.1, features = [test]}. 2. Added /home/chyyuu/thecodes/publisharceos/arceos/modules/axsync/README.md The module description, provided synchronization primitives, and feature descriptions have been written. 3. Modify /home/chyyuu/thecodes/publisharceos/arceos/Cargo.toml Add to [patch.crates-io]: axtask = { path = modules/axtask } axsync = { path = modules/axsync } This approach utilizes the local axtask/axsync during workspace setup, eliminating the need for crates.io axtask in make run. Verification results make A=examples/helloworld ARCH=riscv64 LOG=info run: Passed, successfully outputs Hello, world! cargo publish-p axsync--dry-run: Passed. --- Cargo.toml | 2 ++ modules/axsync/Cargo.toml | 7 ++++--- modules/axsync/README.md | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 modules/axsync/README.md diff --git a/Cargo.toml b/Cargo.toml index b0be505bb3..0c31f214af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,6 +118,8 @@ spin = "0.10" axalloc = { path = "modules/axalloc" } axconfig = { path = "modules/axconfig" } axhal = { path = "modules/axhal" } +axtask = { path = "modules/axtask" } +axsync = { path = "modules/axsync" } axcpu = { git = "https://github.com/arceos-org/axcpu.git", tag = "dev-v03" } axplat = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } axplat-x86-pc = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } diff --git a/modules/axsync/Cargo.toml b/modules/axsync/Cargo.toml index 3c7d231eb7..c5a6895df9 100644 --- a/modules/axsync/Cargo.toml +++ b/modules/axsync/Cargo.toml @@ -8,19 +8,20 @@ license.workspace = true homepage.workspace = true repository = "https://github.com/arceos-org/arceos/tree/main/modules/axsync" documentation = "https://arceos-org.github.io/arceos/axsync/index.html" +readme = "README.md" [features] multitask = ["axtask/multitask"] default = [] [dependencies] -axtask.workspace = true +axtask = { version = "0.2.1-preview.1" } event-listener.workspace = true kspin.workspace = true lock_api.workspace = true [dev-dependencies] -axsync = { workspace = true, features = ["multitask"] } -axtask = { workspace = true, features = ["test"] } +axsync = { path = ".", features = ["multitask"] } +axtask = { version = "0.2.1-preview.1", features = ["test"] } # FIXME: `rand` crate can not be used since https://github.com/google/zerocopy/pull/2574 fastrand = "2.3" diff --git a/modules/axsync/README.md b/modules/axsync/README.md new file mode 100644 index 0000000000..d253e795af --- /dev/null +++ b/modules/axsync/README.md @@ -0,0 +1,19 @@ +# axsync + +[![Crates.io](https://img.shields.io/crates/v/axsync)](https://crates.io/crates/axsync) +[![Docs.rs](https://docs.rs/axsync/badge.svg)](https://docs.rs/axsync) + +[ArceOS](https://github.com/arceos-org/arceos) synchronization primitives. + +## Primitives + +- **Mutex**: A mutual exclusion primitive. With the `multitask` feature, it uses task-aware locking; otherwise it is an alias of `kspin::SpinNoIrq`. +- **spin**: Re-export of the [kspin](https://crates.io/crates/kspin) crate (spinlocks). + +## Features + +- `multitask`: Enable multi-threaded support. When enabled, `Mutex` uses blocking that cooperates with the task scheduler; when disabled, `Mutex` is a spinlock. + +## License + +This project is licensed under GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0. From 63bd98701c707504cd1a8490162de056226567af Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 13:16:17 +0800 Subject: [PATCH 07/23] =?UTF-8?q?Chore:=20update=20axhal=20publish=20for?= =?UTF-8?q?=20axipi=20=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20axipi?= =?UTF-8?q?=20relies=20on=20axhal=20and=20enables=20the=20IPI=20feature=20?= =?UTF-8?q?(=E2=86=92irq).=20The=20released=20axhal=200.2.1-preview.1=20is?= =?UTF-8?q?=20API=20incompatible=20with=20axplat=200.3.0=20on=20crates.io?= =?UTF-8?q?=20when=20irq=20is=20enabled=20(irq=5Fnum,=20handle(),=20return?= =?UTF-8?q?=20type,=20ConsoleIf::irq=5Fnum,=20etc.).=20It=20is=20necessary?= =?UTF-8?q?=20to=20fix=20axhal=20and=20release=20a=20new=20version.=20Modi?= =?UTF-8?q?fied=20file=201.=20modules/axhal/Cargo.toml=20=E2=80=94=20Upgra?= =?UTF-8?q?de=20to=20version=200.2.2-preview.1=20(independent=20of=20works?= =?UTF-8?q?pace=20version),=20remove=20the=20redundant=20axplat-0=5F3=20fe?= =?UTF-8?q?ature,=20and=20restore=20default=20to=20[]=202.=20modules/axhal?= =?UTF-8?q?/src/dummy.rs=20=E2=80=94=20Compatible=20with=20axplat=200.3.0?= =?UTF-8?q?=20API:=20ConsoleIf:=20Remove=20irq=5Fnum=20(not=20available=20?= =?UTF-8?q?in=20version=200.3.0)=20MemIf:=20Remove=20kernel=5Faspace=20(no?= =?UTF-8?q?t=20available=20in=200.3.0)=20TimeIf:=20set=5Foneshot=5Ftimer?= =?UTF-8?q?=20restore=20#[cfg=20(feature=20=3D=20"irq")]=20PowerIf:=20Add?= =?UTF-8?q?=20cpu=5Fnum()=20(required=20in=200.3.0)=20IrqIf:=20handle:=20r?= =?UTF-8?q?eturn=20()=20(0.3.0=20signature)=203.=20modules/axhal/src/time.?= =?UTF-8?q?rs=20=E2=80=94=20set=5Foneshot=5Ftimer=20directly=20re-exported?= =?UTF-8?q?=20from=20axplat=20via=20#[cfg=20(feature=20=3D=20"irq")];=20ir?= =?UTF-8?q?q=5Fnum=20controlled=20by=20defplat/myplat=20(this=20API=20was?= =?UTF-8?q?=20not=20available=20in=20version=200.3.0).=204.=20modules/axha?= =?UTF-8?q?l/src/lib.rs=20=E2=80=94=20The=20console=20module=20uses=20defp?= =?UTF-8?q?lat/myplat=20to=20control=20irq=5Fnum,=20providing=20a=20stub?= =?UTF-8?q?=20when=20no=20platform=20is=20detected.=205.=20modules/axhal/s?= =?UTF-8?q?rc/irq.rs=20=E2=80=94=20handle()=20function=20(defplat/myplat?= =?UTF-8?q?=20gate=20control,=20with=20git=20version=20returning=20Option=20and=200.3.0=20version=20returning=20().=206.=20modules?= =?UTF-8?q?/axhal/src/percpu.rs=20=E2=80=94=20axplat::percpu::*=20gateway?= =?UTF-8?q?=20control=20+=20this=5Fcpu=5Fid()=20stub.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test Results cargo publish-p axhal--dry-run # passed --- modules/axhal/Cargo.toml | 2 +- modules/axhal/src/dummy.rs | 14 +------------- modules/axhal/src/irq.rs | 10 ++++++++++ modules/axhal/src/lib.rs | 6 +++++- modules/axhal/src/percpu.rs | 8 ++++++++ modules/axhal/src/time.rs | 10 +++++++++- 6 files changed, 34 insertions(+), 16 deletions(-) diff --git a/modules/axhal/Cargo.toml b/modules/axhal/Cargo.toml index c7b25d5f7f..91652aa655 100644 --- a/modules/axhal/Cargo.toml +++ b/modules/axhal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axhal" -version.workspace = true +version = "0.2.2-preview.1" edition.workspace = true authors = ["Yuekai Jia "] description = "ArceOS hardware abstraction layer, provides unified APIs for platform-specific operations" diff --git a/modules/axhal/src/dummy.rs b/modules/axhal/src/dummy.rs index 3f502ae3de..dcfeb30d2b 100644 --- a/modules/axhal/src/dummy.rs +++ b/modules/axhal/src/dummy.rs @@ -41,11 +41,6 @@ impl ConsoleIf for DummyConsole { fn read_bytes(_bytes: &mut [u8]) -> usize { unimplemented!() } - - #[cfg(feature = "irq")] - fn irq_num() -> Option { - None - } } #[impl_plat_interface] @@ -89,11 +84,6 @@ impl TimeIf for DummyTime { 0 } - #[cfg(feature = "irq")] - fn irq_num() -> usize { - 0 - } - #[cfg(feature = "irq")] fn set_oneshot_timer(_deadline_ns: u64) {} } @@ -125,9 +115,7 @@ impl IrqIf for DummyIrq { None } - fn handle(_irq: usize) -> Option { - None - } + fn handle(_irq: usize) {} fn send_ipi(_irq: usize, _target: IpiTarget) {} } diff --git a/modules/axhal/src/irq.rs b/modules/axhal/src/irq.rs index 9f5ee6fc77..72667025d2 100644 --- a/modules/axhal/src/irq.rs +++ b/modules/axhal/src/irq.rs @@ -39,6 +39,7 @@ pub fn register_irq_hook(hook: fn(usize)) -> bool { pub fn irq_handler(vector: usize) -> bool { let guard = kernel_guard::NoPreempt::new(); + #[cfg(any(feature = "defplat", feature = "myplat"))] if let Some(irq) = handle(vector) { let hook = IRQ_HOOK.load(Ordering::SeqCst); if hook != 0 { @@ -46,6 +47,15 @@ pub fn irq_handler(vector: usize) -> bool { hook(irq); } } + #[cfg(not(any(feature = "defplat", feature = "myplat")))] + { + handle(vector); + let hook = IRQ_HOOK.load(Ordering::SeqCst); + if hook != 0 { + let hook = unsafe { core::mem::transmute::(hook) }; + hook(vector); + } + } drop(guard); // rescheduling may occur when preemption is re-enabled. true diff --git a/modules/axhal/src/lib.rs b/modules/axhal/src/lib.rs index 433eb72cec..bcc45d05af 100644 --- a/modules/axhal/src/lib.rs +++ b/modules/axhal/src/lib.rs @@ -72,8 +72,12 @@ pub mod paging; /// Console input and output. pub mod console { - #[cfg(feature = "irq")] + #[cfg(all(feature = "irq", any(feature = "defplat", feature = "myplat")))] pub use axplat::console::irq_num; + #[cfg(all(feature = "irq", not(any(feature = "defplat", feature = "myplat"))))] + pub fn irq_num() -> Option { + None + } pub use axplat::console::{read_bytes, write_bytes}; } diff --git a/modules/axhal/src/percpu.rs b/modules/axhal/src/percpu.rs index f350bf39b4..1be84e1a77 100644 --- a/modules/axhal/src/percpu.rs +++ b/modules/axhal/src/percpu.rs @@ -6,6 +6,14 @@ #[cfg(any(feature = "defplat", feature = "myplat"))] pub use axplat::percpu::*; +/// Stub for single-CPU / dummy platform when not using defplat/myplat (e.g. for crates that +/// depend on axhal without a real platform, such as when building axipi for publish verification). +#[cfg(not(any(feature = "defplat", feature = "myplat")))] +#[inline] +pub fn this_cpu_id() -> usize { + 0 +} + #[percpu::def_percpu] static CURRENT_TASK_PTR: usize = 0; diff --git a/modules/axhal/src/time.rs b/modules/axhal/src/time.rs index 4f1891f0d3..aae80f3b34 100644 --- a/modules/axhal/src/time.rs +++ b/modules/axhal/src/time.rs @@ -6,4 +6,12 @@ pub use axplat::time::{ monotonic_time_nanos, nanos_to_ticks, ticks_to_nanos, wall_time, wall_time_nanos, }; #[cfg(feature = "irq")] -pub use axplat::time::{irq_num, set_oneshot_timer}; +pub use axplat::time::set_oneshot_timer; + +// `irq_num` exists only in the git (unpublished) version of axplat, not in 0.3.0. +#[cfg(all(feature = "irq", any(feature = "defplat", feature = "myplat")))] +pub use axplat::time::irq_num; +#[cfg(all(feature = "irq", not(any(feature = "defplat", feature = "myplat"))))] +pub fn irq_num() -> usize { + 0 +} From 8a6106aaa354d1dc3f2b85607712874551138d70 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 13:20:29 +0800 Subject: [PATCH 08/23] Chore: upate axtask's Cargo.toml to axhal 0.2.2-preview1 --- modules/axtask/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/axtask/Cargo.toml b/modules/axtask/Cargo.toml index 93519cab4a..028340290e 100644 --- a/modules/axtask/Cargo.toml +++ b/modules/axtask/Cargo.toml @@ -42,7 +42,7 @@ test = ["percpu?/sp-naive"] [dependencies] axconfig = { version = "0.2.1-preview.1", optional = true } axerrno.workspace = true -axhal = { version = "0.2.1-preview.1" } +axhal = { version = "0.2.2-preview.1" } axpoll = { workspace = true, optional = true } axsched = { version = "0.3", optional = true } cfg-if.workspace = true @@ -62,5 +62,5 @@ memory_addr = { workspace = true, optional = true } percpu = { workspace = true, optional = true } [dev-dependencies] -axhal = { version = "0.2.1-preview.1", features = ["fp-simd"] } +axhal = { version = "0.2.2-preview.1", features = ["fp-simd"] } axtask = { path = ".", features = ["test", "multitask"] } From 168f3080b67297f7e4e029c86544e8566462bfa4 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 13:23:58 +0800 Subject: [PATCH 09/23] Chore: axtask v0.2.2-preview.1 --- modules/axtask/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/axtask/Cargo.toml b/modules/axtask/Cargo.toml index 028340290e..08a10dbedb 100644 --- a/modules/axtask/Cargo.toml +++ b/modules/axtask/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axtask" -version.workspace = true +version = "0.2.2-preview.1" edition.workspace = true authors = ["Yuekai Jia "] description = "ArceOS task management module" From e31ee8410e78fd9a8f83c9c1bed8efd00f10e059 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 13:27:02 +0800 Subject: [PATCH 10/23] Chore: cargo publish axipi --- Cargo.lock | 83 ++++++++++++++++++++++++++++++---------- Cargo.toml | 1 + modules/axipi/Cargo.toml | 7 ++-- modules/axipi/README.md | 12 ++++++ 4 files changed, 80 insertions(+), 23 deletions(-) create mode 100644 modules/axipi/README.md diff --git a/Cargo.lock b/Cargo.lock index 4fe6122ab1..0e40b9e7db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,7 +179,7 @@ dependencies = [ "axerrno 0.2.2", "axfeat", "axfs", - "axhal", + "axhal 0.2.2-preview.1", "axio", "axipi", "axlog", @@ -187,7 +187,7 @@ dependencies = [ "axnet", "axruntime", "axsync", - "axtask", + "axtask 0.2.2-preview.1", ] [[package]] @@ -199,13 +199,13 @@ dependencies = [ "axerrno 0.2.2", "axfeat", "axfs", - "axhal", + "axhal 0.2.2-preview.1", "axio", "axlog", "axnet", "axruntime", "axsync", - "axtask", + "axtask 0.2.2-preview.1", "bindgen", "flatten_objects", "lazy_static", @@ -417,7 +417,7 @@ dependencies = [ "axalloc", "axconfig", "axerrno 0.2.2", - "axhal", + "axhal 0.2.2-preview.1", "crate_interface", "kspin", "log", @@ -441,7 +441,7 @@ dependencies = [ "axdriver_virtio", "axdriver_vsock", "axerrno 0.2.2", - "axhal", + "axhal 0.2.2-preview.1", "axklib", "cfg-if", "crate_interface", @@ -562,14 +562,14 @@ dependencies = [ "axdisplay", "axdriver", "axfs", - "axhal", + "axhal 0.2.2-preview.1", "axinput", "axipi", "axlog", "axnet", "axruntime", "axsync", - "axtask", + "axtask 0.2.2-preview.1", "kspin", ] @@ -581,7 +581,7 @@ dependencies = [ "axdriver", "axerrno 0.2.2", "axfs-ng-vfs", - "axhal", + "axhal 0.2.2-preview.1", "axio", "axpoll", "axsync", @@ -620,6 +620,25 @@ dependencies = [ [[package]] name = "axhal" version = "0.2.1-preview.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c40e732d65e96154e1887a9e5532768e3b3d528d6ac8c160a42800399bc5bee8" +dependencies = [ + "axconfig", + "axcpu", + "axplat", + "cfg-if", + "fdt-parser", + "heapless 0.9.2", + "kernel_guard", + "lazyinit", + "log", + "memory_addr", + "percpu", +] + +[[package]] +name = "axhal" +version = "0.2.2-preview.1" dependencies = [ "axalloc", "axconfig", @@ -665,10 +684,10 @@ dependencies = [ [[package]] name = "axipi" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "axconfig", - "axhal", + "axhal 0.2.2-preview.1", "kspin", "lazyinit", "log", @@ -717,9 +736,9 @@ dependencies = [ "axerrno 0.2.2", "axfs", "axfs-ng-vfs", - "axhal", + "axhal 0.2.2-preview.1", "axsync", - "axtask", + "axtask 0.2.2-preview.1", "enum_dispatch", "kspin", "lazyinit", @@ -740,11 +759,11 @@ dependencies = [ "axerrno 0.2.2", "axfs", "axfs-ng-vfs", - "axhal", + "axhal 0.2.2-preview.1", "axio", "axpoll", "axsync", - "axtask", + "axtask 0.2.2-preview.1", "bitflags 2.10.0", "cfg-if", "enum_dispatch", @@ -938,14 +957,14 @@ dependencies = [ "axdma", "axdriver", "axfs", - "axhal", + "axhal 0.2.2-preview.1", "axinput", "axipi", "axlog", "axmm", "axnet", "axplat", - "axtask", + "axtask 0.2.2-preview.1", "chrono", "crate_interface", "ctor_bare", @@ -980,7 +999,7 @@ name = "axsync" version = "0.2.1-preview.1" dependencies = [ "axsync", - "axtask", + "axtask 0.2.1-preview.1", "event-listener", "fastrand", "kspin", @@ -990,13 +1009,37 @@ dependencies = [ [[package]] name = "axtask" version = "0.2.1-preview.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aff38bb532d5c1354057ed28f5445a74d9e4d4ad12a7681d0e9e3cc9063e9fb5" +dependencies = [ + "axconfig", + "axerrno 0.2.2", + "axhal 0.2.1-preview.1", + "axpoll", + "axsched", + "cfg-if", + "cpumask", + "crate_interface", + "event-listener", + "futures-util", + "kernel_guard", + "kspin", + "lazyinit", + "log", + "memory_addr", + "percpu", +] + +[[package]] +name = "axtask" +version = "0.2.2-preview.1" dependencies = [ "axconfig", "axerrno 0.2.2", - "axhal", + "axhal 0.2.2-preview.1", "axpoll", "axsched", - "axtask", + "axtask 0.2.2-preview.1", "cfg-if", "cpumask", "crate_interface", diff --git a/Cargo.toml b/Cargo.toml index 0c31f214af..44adcaed07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -120,6 +120,7 @@ axconfig = { path = "modules/axconfig" } axhal = { path = "modules/axhal" } axtask = { path = "modules/axtask" } axsync = { path = "modules/axsync" } +axipi = { path = "modules/axipi" } axcpu = { git = "https://github.com/arceos-org/axcpu.git", tag = "dev-v03" } axplat = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } axplat-x86-pc = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } diff --git a/modules/axipi/Cargo.toml b/modules/axipi/Cargo.toml index 54e0ba12ea..74bc0ea58f 100644 --- a/modules/axipi/Cargo.toml +++ b/modules/axipi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axipi" -version.workspace = true +version = "0.2.2-preview.1" edition.workspace = true authors = ["Keyang Hu "] description = "ArceOS IPI management module" @@ -8,13 +8,14 @@ license.workspace = true homepage.workspace = true repository = "https://github.com/arceos-org/arceos/tree/main/modules/axipi" documentation = "https://arceos-org.github.io/arceos/axipi/index.html" +readme = "README.md" [features] default = [] [dependencies] -axconfig.workspace = true -axhal = { workspace = true, features = ["ipi"] } +axconfig = { version = "0.2.1-preview.1" } +axhal = { version = "0.2.2-preview.1", features = ["ipi"] } kspin.workspace = true lazyinit.workspace = true log.workspace = true diff --git a/modules/axipi/README.md b/modules/axipi/README.md new file mode 100644 index 0000000000..65027feb1d --- /dev/null +++ b/modules/axipi/README.md @@ -0,0 +1,12 @@ +# axipi + +[![Crates.io](https://img.shields.io/crates/v/axipi)](https://crates.io/crates/axipi) +[![Docs.rs](https://docs.rs/axipi/badge.svg)](https://docs.rs/axipi) + +[ArceOS](https://github.com/arceos-org/arceos) Inter-Processor Interrupt (IPI) management module. + +Provides primitives to run callbacks on a specific CPU or on all other CPUs via IPI, and to handle IPI events (e.g. in the kernel's IPI handler). + +## License + +This project is licensed under GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0. From a00ad84d3af91a7058f76be625eb2ad3c438d477 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 14:30:14 +0800 Subject: [PATCH 11/23] =?UTF-8?q?Chore:=20for=20cargo=20publish=20-p=20axd?= =?UTF-8?q?ma=20=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20Modified=20files=20(all?= =?UTF-8?q?=20in=20/home/chyyuu/thecodes/publisharceos/arceos)=201.=20modu?= =?UTF-8?q?les/axdma/Cargo.toml=20=E2=80=94=20Prepare=20for=20release=20Ad?= =?UTF-8?q?d=20description=20(required=20for=20crates.io)=20allocator=20(G?= =?UTF-8?q?it=20dependency)=20=E2=86=92=20ax=20allocator=20=3D=20"0.1.3-pr?= =?UTF-8?q?eview.1"=20(crates.io)=20axalloc,=20axconfig,=20and=20axhal=20h?= =?UTF-8?q?ave=20been=20updated=20from=20workspace=20=3D=20true=20(path-de?= =?UTF-8?q?pendent)=20to=20explicit=20crates.io=20version=20numbers=20Add?= =?UTF-8?q?=20page=5Ftable=5Fmultiarch=20=3D=20"0.5"=20(direct=20dependenc?= =?UTF-8?q?y,=20used=20for=20MappingFlags)=20Disable=20axhal's=20paging=20?= =?UTF-8?q?feature=20to=20prevent=20compilation=20issues=20on=20crates.io?= =?UTF-8?q?=202.=20modules/axdma/src/lib.rs=20=E2=80=94=20Update=20import?= =?UTF-8?q?=20use=20allocator::AllocResult=20=E2=86=92=20use=20axallocator?= =?UTF-8?q?::AllocResult=20use=20axhal::paging::MappingFlags=20=E2=86=92?= =?UTF-8?q?=20use=20page=5Ftable=5Fmultiarch::MappingFlags=203.=20modules/?= =?UTF-8?q?axdma/src/dma.rs=20=E2=80=94=20Update=20imports=20and=20fix=20m?= =?UTF-8?q?acro=20paths=20use=20allocator::{...}=20=E2=86=92=20use=20axall?= =?UTF-8?q?ocator::{...}=20use=20axhal::=20{mem::=20virt=5Fto=5Fphys,=20pa?= =?UTF-8?q?ging::=20MappingFlags}=20split=20into=20two=20lines=20call=5Fin?= =?UTF-8?q?terface!=20(DmaProtectIf:...)=20=E2=86=92=20call=5Finterface!?= =?UTF-8?q?=20(crate:=20DmaProtectIf:...)=20fixes=20cross-module=20paths?= =?UTF-8?q?=204.=20modules/axhal/Cargo.toml,=20modules/axtask/Cargo.toml,?= =?UTF-8?q?=20modules/axsync/Cargo.toml,=20modules/axipi/Cargo.toml=20?= =?UTF-8?q?=E2=80=94=20fixes=20pre-release=20version=20patch=20issues=20Up?= =?UTF-8?q?date=20the=20version=20reference=20from=20"0.2.1-preview.1"=20t?= =?UTF-8?q?o=20"0.2.2-preview.1"=20to=20ensure=20[patch.crates-io]=20match?= =?UTF-8?q?es=20the=20local=20version.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 129 +++++++++++------------------------- Cargo.toml | 2 +- modules/axalloc/Cargo.toml | 2 +- modules/axconfig/Cargo.toml | 2 +- modules/axdma/Cargo.toml | 10 +-- modules/axdma/src/dma.rs | 7 +- modules/axdma/src/lib.rs | 4 +- modules/axhal/Cargo.toml | 8 +-- modules/axipi/Cargo.toml | 2 +- modules/axlog/Cargo.toml | 2 +- modules/axsync/Cargo.toml | 4 +- modules/axtask/Cargo.toml | 2 +- 12 files changed, 63 insertions(+), 111 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e40b9e7db..af33283cbd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -50,15 +50,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "allocator" -version = "0.1.2" -source = "git+https://github.com/arceos-org/allocator.git?tag=v0.1.2#922e72a7e4dfb7ffc4b67d242d38f8361ebd13ac" -dependencies = [ - "axerrno 0.1.2", - "cfg-if", -] - [[package]] name = "allocator-api2" version = "0.2.21" @@ -169,7 +160,7 @@ dependencies = [ [[package]] name = "arceos_api" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "axalloc", "axconfig", @@ -179,7 +170,7 @@ dependencies = [ "axerrno 0.2.2", "axfeat", "axfs", - "axhal 0.2.2-preview.1", + "axhal", "axio", "axipi", "axlog", @@ -187,25 +178,25 @@ dependencies = [ "axnet", "axruntime", "axsync", - "axtask 0.2.2-preview.1", + "axtask", ] [[package]] name = "arceos_posix_api" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "axalloc", "axconfig", "axerrno 0.2.2", "axfeat", "axfs", - "axhal 0.2.2-preview.1", + "axhal", "axio", "axlog", "axnet", "axruntime", "axsync", - "axtask 0.2.2-preview.1", + "axtask", "bindgen", "flatten_objects", "lazy_static", @@ -307,7 +298,7 @@ dependencies = [ [[package]] name = "axalloc" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "axallocator", "axbacktrace", @@ -349,7 +340,7 @@ dependencies = [ [[package]] name = "axconfig" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "axconfig-macros", ] @@ -401,7 +392,7 @@ dependencies = [ [[package]] name = "axdisplay" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "axdriver", "axsync", @@ -411,22 +402,23 @@ dependencies = [ [[package]] name = "axdma" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ - "allocator", "axalloc", + "axallocator", "axconfig", "axerrno 0.2.2", - "axhal 0.2.2-preview.1", + "axhal", "crate_interface", "kspin", "log", "memory_addr", + "page_table_multiarch", ] [[package]] name = "axdriver" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "arm-gic-driver", "axalloc", @@ -441,7 +433,7 @@ dependencies = [ "axdriver_virtio", "axdriver_vsock", "axerrno 0.2.2", - "axhal 0.2.2-preview.1", + "axhal", "axklib", "cfg-if", "crate_interface", @@ -555,33 +547,33 @@ dependencies = [ [[package]] name = "axfeat" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "axalloc", "axbacktrace", "axdisplay", "axdriver", "axfs", - "axhal 0.2.2-preview.1", + "axhal", "axinput", "axipi", "axlog", "axnet", "axruntime", "axsync", - "axtask 0.2.2-preview.1", + "axtask", "kspin", ] [[package]] name = "axfs" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "axalloc", "axdriver", "axerrno 0.2.2", "axfs-ng-vfs", - "axhal 0.2.2-preview.1", + "axhal", "axio", "axpoll", "axsync", @@ -619,26 +611,7 @@ dependencies = [ [[package]] name = "axhal" -version = "0.2.1-preview.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c40e732d65e96154e1887a9e5532768e3b3d528d6ac8c160a42800399bc5bee8" -dependencies = [ - "axconfig", - "axcpu", - "axplat", - "cfg-if", - "fdt-parser", - "heapless 0.9.2", - "kernel_guard", - "lazyinit", - "log", - "memory_addr", - "percpu", -] - -[[package]] -name = "axhal" -version = "0.2.2-preview.1" +version = "0.2.2-preview.2" dependencies = [ "axalloc", "axconfig", @@ -662,7 +635,7 @@ dependencies = [ [[package]] name = "axinput" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "axdriver", "axsync", @@ -687,7 +660,7 @@ name = "axipi" version = "0.2.2-preview.1" dependencies = [ "axconfig", - "axhal 0.2.2-preview.1", + "axhal", "kspin", "lazyinit", "log", @@ -706,7 +679,7 @@ dependencies = [ [[package]] name = "axlibc" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "arceos_posix_api", "axerrno 0.2.2", @@ -717,7 +690,7 @@ dependencies = [ [[package]] name = "axlog" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "axlog", "cfg-if", @@ -729,16 +702,16 @@ dependencies = [ [[package]] name = "axmm" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "axalloc", "axconfig", "axerrno 0.2.2", "axfs", "axfs-ng-vfs", - "axhal 0.2.2-preview.1", + "axhal", "axsync", - "axtask 0.2.2-preview.1", + "axtask", "enum_dispatch", "kspin", "lazyinit", @@ -750,7 +723,7 @@ dependencies = [ [[package]] name = "axnet" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "async-channel", "async-trait", @@ -759,11 +732,11 @@ dependencies = [ "axerrno 0.2.2", "axfs", "axfs-ng-vfs", - "axhal 0.2.2-preview.1", + "axhal", "axio", "axpoll", "axsync", - "axtask 0.2.2-preview.1", + "axtask", "bitflags 2.10.0", "cfg-if", "enum_dispatch", @@ -948,7 +921,7 @@ dependencies = [ [[package]] name = "axruntime" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "axalloc", "axbacktrace", @@ -957,14 +930,14 @@ dependencies = [ "axdma", "axdriver", "axfs", - "axhal 0.2.2-preview.1", + "axhal", "axinput", "axipi", "axlog", "axmm", "axnet", "axplat", - "axtask 0.2.2-preview.1", + "axtask", "chrono", "crate_interface", "ctor_bare", @@ -983,7 +956,7 @@ dependencies = [ [[package]] name = "axstd" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "arceos_api", "axerrno 0.2.2", @@ -996,50 +969,26 @@ dependencies = [ [[package]] name = "axsync" -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" dependencies = [ "axsync", - "axtask 0.2.1-preview.1", + "axtask", "event-listener", "fastrand", "kspin", "lock_api", ] -[[package]] -name = "axtask" -version = "0.2.1-preview.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aff38bb532d5c1354057ed28f5445a74d9e4d4ad12a7681d0e9e3cc9063e9fb5" -dependencies = [ - "axconfig", - "axerrno 0.2.2", - "axhal 0.2.1-preview.1", - "axpoll", - "axsched", - "cfg-if", - "cpumask", - "crate_interface", - "event-listener", - "futures-util", - "kernel_guard", - "kspin", - "lazyinit", - "log", - "memory_addr", - "percpu", -] - [[package]] name = "axtask" version = "0.2.2-preview.1" dependencies = [ "axconfig", "axerrno 0.2.2", - "axhal 0.2.2-preview.1", + "axhal", "axpoll", "axsched", - "axtask 0.2.2-preview.1", + "axtask", "cfg-if", "cpumask", "crate_interface", diff --git a/Cargo.toml b/Cargo.toml index 44adcaed07..bf60b11353 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ members = [ ] [workspace.package] -version = "0.2.1-preview.1" +version = "0.2.2-preview.1" edition = "2024" authors = ["Yuekai Jia ", "Yu Chen "] license = "GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0" diff --git a/modules/axalloc/Cargo.toml b/modules/axalloc/Cargo.toml index e638cfc4ad..e6f0dcfa68 100644 --- a/modules/axalloc/Cargo.toml +++ b/modules/axalloc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axalloc" -version.workspace = true +version = "0.2.2-preview.1" edition.workspace = true authors = ["Yuekai Jia "] description = "ArceOS global memory allocator" diff --git a/modules/axconfig/Cargo.toml b/modules/axconfig/Cargo.toml index 68a02fb667..d8647befb4 100644 --- a/modules/axconfig/Cargo.toml +++ b/modules/axconfig/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axconfig" -version.workspace = true +version = "0.2.2-preview.1" edition.workspace = true authors = ["Yuekai Jia "] description = "Platform-specific constants and parameters for ArceOS" diff --git a/modules/axdma/Cargo.toml b/modules/axdma/Cargo.toml index 4a9259792c..b0250ce34a 100644 --- a/modules/axdma/Cargo.toml +++ b/modules/axdma/Cargo.toml @@ -3,6 +3,7 @@ name = "axdma" edition.workspace = true version.workspace = true authors = ["Zhour Rui "] +description = "ArceOS global DMA allocator" license.workspace = true homepage.workspace = true keywords.workspace = true @@ -11,11 +12,12 @@ repository = "https://github.com/arceos-org/arceos/tree/main/modules/axdma" documentation = "https://arceos-org.github.io/arceos/axdma/index.html" [dependencies] -allocator.workspace = true -axalloc.workspace = true -axconfig.workspace = true +axallocator = { version = "0.1.3-preview.1", default-features = false } +axalloc = { version = "0.2.2-preview.1" } +axconfig = { version = "0.2.2-preview.1" } axerrno.workspace = true -axhal = { workspace = true, features = ["paging"] } +axhal = { version = "0.2.2-preview.2" } +page_table_multiarch = { version = "0.5" } crate_interface.workspace = true kspin.workspace = true log.workspace = true diff --git a/modules/axdma/src/dma.rs b/modules/axdma/src/dma.rs index ca11138c7e..ef82414d47 100644 --- a/modules/axdma/src/dma.rs +++ b/modules/axdma/src/dma.rs @@ -1,8 +1,9 @@ use core::{alloc::Layout, ptr::NonNull}; -use allocator::{AllocError, AllocResult, BaseAllocator, ByteAllocator}; +use axallocator::{AllocError, AllocResult, BaseAllocator, ByteAllocator}; use axalloc::{DefaultByteAllocator, UsageKind, global_allocator}; -use axhal::{mem::virt_to_phys, paging::MappingFlags}; +use axhal::mem::virt_to_phys; +use page_table_multiarch::MappingFlags; use crate_interface::call_interface; use kspin::SpinNoIrq; use log::{debug, error}; @@ -97,7 +98,7 @@ impl DmaAllocator { flags: MappingFlags, ) -> AllocResult<()> { let size = num_pages * PAGE_SIZE_4K; - call_interface!(DmaProtectIf::protect_memory(vaddr, size, flags)).map_err(|e| { + call_interface!(crate::DmaProtectIf::protect_memory(vaddr, size, flags)).map_err(|e| { error!("change table flag fail: {e:?}"); AllocError::NoMemory }) diff --git a/modules/axdma/src/lib.rs b/modules/axdma/src/lib.rs index 5b4c002d0a..4097ac01ee 100644 --- a/modules/axdma/src/lib.rs +++ b/modules/axdma/src/lib.rs @@ -8,8 +8,8 @@ mod dma; use core::{alloc::Layout, ptr::NonNull}; -use allocator::AllocResult; -use axhal::paging::MappingFlags; +use axallocator::AllocResult; +use page_table_multiarch::MappingFlags; use memory_addr::{PhysAddr, VirtAddr}; use self::dma::ALLOCATOR; diff --git a/modules/axhal/Cargo.toml b/modules/axhal/Cargo.toml index 91652aa655..295a7fe815 100644 --- a/modules/axhal/Cargo.toml +++ b/modules/axhal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axhal" -version = "0.2.2-preview.1" +version = "0.2.2-preview.2" edition.workspace = true authors = ["Yuekai Jia "] description = "ArceOS hardware abstraction layer, provides unified APIs for platform-specific operations" @@ -56,8 +56,8 @@ default = [] ipi = ["irq"] [dependencies] -axalloc = { version = "0.2.1-preview.1", optional = true } -axconfig = { version = "0.2.1-preview.1" } +axalloc = { version = "0.2.2-preview.1", optional = true } +axconfig = { version = "0.2.2-preview.1" } axcpu = { version = "0.3.0-alpha.0" } axplat = { version = "0.3" } cfg-if.workspace = true @@ -84,4 +84,4 @@ axplat-riscv64-qemu-virt = { version = "0.3", optional = true } axplat-loongarch64-qemu-virt = { version = "0.3", optional = true } [build-dependencies] -axconfig = { version = "0.2.1-preview.1" } +axconfig = { version = "0.2.2-preview.1" } diff --git a/modules/axipi/Cargo.toml b/modules/axipi/Cargo.toml index 74bc0ea58f..8a6ba94a99 100644 --- a/modules/axipi/Cargo.toml +++ b/modules/axipi/Cargo.toml @@ -14,7 +14,7 @@ readme = "README.md" default = [] [dependencies] -axconfig = { version = "0.2.1-preview.1" } +axconfig = { version = "0.2.2-preview.1" } axhal = { version = "0.2.2-preview.1", features = ["ipi"] } kspin.workspace = true lazyinit.workspace = true diff --git a/modules/axlog/Cargo.toml b/modules/axlog/Cargo.toml index 3ce891caf4..5b6b1d0c5e 100644 --- a/modules/axlog/Cargo.toml +++ b/modules/axlog/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axlog" -version.workspace = true +version = "0.2.2-preview.1" edition.workspace = true authors = ["Yuekai Jia "] description = "Macros for multi-level formatted logging used by ArceOS" diff --git a/modules/axsync/Cargo.toml b/modules/axsync/Cargo.toml index c5a6895df9..979c442414 100644 --- a/modules/axsync/Cargo.toml +++ b/modules/axsync/Cargo.toml @@ -15,13 +15,13 @@ multitask = ["axtask/multitask"] default = [] [dependencies] -axtask = { version = "0.2.1-preview.1" } +axtask = { version = "0.2.2-preview.1" } event-listener.workspace = true kspin.workspace = true lock_api.workspace = true [dev-dependencies] axsync = { path = ".", features = ["multitask"] } -axtask = { version = "0.2.1-preview.1", features = ["test"] } +axtask = { version = "0.2.2-preview.1", features = ["test"] } # FIXME: `rand` crate can not be used since https://github.com/google/zerocopy/pull/2574 fastrand = "2.3" diff --git a/modules/axtask/Cargo.toml b/modules/axtask/Cargo.toml index 08a10dbedb..9cf9086322 100644 --- a/modules/axtask/Cargo.toml +++ b/modules/axtask/Cargo.toml @@ -40,7 +40,7 @@ sched-cfs = ["multitask", "preempt"] test = ["percpu?/sp-naive"] [dependencies] -axconfig = { version = "0.2.1-preview.1", optional = true } +axconfig = { version = "0.2.2-preview.1", optional = true } axerrno.workspace = true axhal = { version = "0.2.2-preview.1" } axpoll = { workspace = true, optional = true } From 022e4b501b21bdb5c48dddc4c5a35ef6cbf72cdd Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 18:46:56 +0800 Subject: [PATCH 12/23] Chore: cargo publish -p axdriver v0.2.2-preview.1 --- Cargo.lock | 121 ++++++++++++++---------------------- Cargo.toml | 17 ++--- modules/axdriver/Cargo.toml | 20 +++--- 3 files changed, 68 insertions(+), 90 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index af33283cbd..c2dccf4140 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -272,15 +272,6 @@ dependencies = [ "syn 2.0.114", ] -[[package]] -name = "atomic-polyfill" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" -dependencies = [ - "critical-section", -] - [[package]] name = "autocfg" version = "1.5.0" @@ -449,13 +440,15 @@ dependencies = [ [[package]] name = "axdriver_base" -version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" +version = "0.1.4-preview.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4614d9e505dae224e4e4cb934c8fa916d77ecfb7b770a8bf8eac78bdeec3dba" [[package]] name = "axdriver_block" -version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" +version = "0.1.4-preview.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cccf23999a9dff620ef87c08c571509d2e90cc9dc80f932381b0fd949f020f9" dependencies = [ "axdriver_base", "bcm2835-sdhci", @@ -466,16 +459,18 @@ dependencies = [ [[package]] name = "axdriver_display" -version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" +version = "0.1.4-preview.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcbd2fab37c37193bd21fcee061c96fe6a2850911a6a74a890018541e14ba92a" dependencies = [ "axdriver_base", ] [[package]] name = "axdriver_input" -version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" +version = "0.1.4-preview.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5703515bf1f113d272f1e6f6b7043976fbbee66553e21360e07cc7ba75866838" dependencies = [ "axdriver_base", "strum", @@ -483,8 +478,9 @@ dependencies = [ [[package]] name = "axdriver_net" -version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" +version = "0.1.4-preview.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dca0cded4fdabcf9176616b636d310a7179a89e31a6dd221d9ea7a6678ffaea4" dependencies = [ "axdriver_base", "fxmac_rs", @@ -495,16 +491,18 @@ dependencies = [ [[package]] name = "axdriver_pci" -version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" +version = "0.1.4-preview.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "129bd3a5ad486d989e9bdc211c86fd8d50720462ef46e2b0013d333338d50e98" dependencies = [ "virtio-drivers", ] [[package]] name = "axdriver_virtio" -version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" +version = "0.1.4-preview.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da6c36cc900745f3bab9de0dd8d5a2d5ac720a253937b3c5f3ab81bbb9c9e139" dependencies = [ "axdriver_base", "axdriver_block", @@ -518,8 +516,9 @@ dependencies = [ [[package]] name = "axdriver_vsock" -version = "0.1.2" -source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.2-dev.0#e92cfa5582f7df6dd9df52a052df0ab4b3264710" +version = "0.1.4-preview.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97c0344e1acedd21a1e2d4be29ed0827c4bcc205129b1332c17dbedd3db183c6" dependencies = [ "axdriver_base", "log", @@ -670,7 +669,8 @@ dependencies = [ [[package]] name = "axklib" version = "0.2.0" -source = "git+https://github.com/arceos-hypervisor/axklib.git#0cb1045714015acff11b7c6f531ee81be0e02924" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beb4b4d3c013138ee687343370f891941524a3d03a36ca8e80c0bd7e17f5e756" dependencies = [ "axerrno 0.1.2", "memory_addr", @@ -746,7 +746,7 @@ dependencies = [ "lazyinit", "log", "ringbuf", - "smoltcp 0.12.0", + "smoltcp 0.12.0 (git+https://github.com/Starry-OS/smoltcp.git?rev=7401a54)", "spin 0.10.0", ] @@ -1022,8 +1022,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bcm2835-sdhci" -version = "0.1.0" -source = "git+https://github.com/lhw2002426/bcm2835-sdhci.git?rev=e974f16#e974f168efa72b470a01f61bdef32240c66f54fc" +version = "0.1.1-preview.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c8a95c5a17e6a90cbb3a3461e9682286ba60d6ddf97d8ca43b17b0df5a21357" dependencies = [ "aarch64-cpu 9.4.0", "log", @@ -1644,8 +1645,9 @@ dependencies = [ [[package]] name = "fxmac_rs" -version = "0.2.0" -source = "git+https://github.com/elliott10/fxmac_rs.git?rev=0dbc3916#0dbc3916d5d5a0086916deda0c4c2dd8651c69ce" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cc278a5f88871e3800ca269ddf40f6504d29d702f3b47375954b5a64d0cfd4f" dependencies = [ "aarch64-cpu 10.0.0", "crate_interface", @@ -1673,15 +1675,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "702cb690200d6303c1e1992bc648f3f3bf9c1d6a27fcf50551c513d61f339c99" -[[package]] -name = "hash32" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" -dependencies = [ - "byteorder", -] - [[package]] name = "hash32" version = "0.3.1" @@ -1713,26 +1706,13 @@ dependencies = [ "foldhash 0.2.0", ] -[[package]] -name = "heapless" -version = "0.7.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" -dependencies = [ - "atomic-polyfill", - "hash32 0.2.1", - "rustc_version", - "spin 0.9.8", - "stable_deref_trait", -] - [[package]] name = "heapless" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ - "hash32 0.3.1", + "hash32", "stable_deref_trait", ] @@ -1742,7 +1722,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2af2455f757db2b292a9b1768c4b70186d443bcb3b316252d6b540aec1cd89ed" dependencies = [ - "hash32 0.3.1", + "hash32", "stable_deref_trait", ] @@ -1845,13 +1825,14 @@ dependencies = [ [[package]] name = "ixgbe-driver" -version = "0.1.0" -source = "git+https://github.com/KuangjuX/ixgbe-driver.git?rev=8e5eb74#8e5eb741299d7d95c373ec745e39a1473fe84563" +version = "0.1.1-preview.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6441478ad4511427afdc51fd359366aa749a324f5529094d0612a6ed1c11e114" dependencies = [ "bit_field", "core_detect", "log", - "smoltcp 0.10.0", + "smoltcp 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "volatile 0.3.0", ] @@ -2499,15 +2480,6 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - [[package]] name = "rustversion" version = "1.0.22" @@ -2579,8 +2551,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "simple-ahci" -version = "0.1.0" -source = "git+https://github.com/Starry-OS/simple-ahci.git?rev=36d0979#36d0979fedb17c7846b78d1a63f944da31f96186" +version = "0.1.1-preview.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e202ff0a10a30a13384768edcda5b00eeeafd7dda1784234662f43dba170e9b2" dependencies = [ "bitfield-struct", "log", @@ -2591,7 +2564,8 @@ dependencies = [ [[package]] name = "simple-sdmmc" version = "0.1.0" -source = "git+https://github.com/Starry-OS/simple-sdmmc.git?rev=9e6420c#9e6420c3bcaa67d4c3a6ecd2b24a2e7ee9118f9b" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "833bc981c24e613cf9b95bbd2c5ade1a222d23274343c29486a6f65c41fc3390" dependencies = [ "bitfield-struct", "log", @@ -2612,14 +2586,15 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "smoltcp" -version = "0.10.0" -source = "git+https://github.com/rcore-os/smoltcp.git?rev=2ade274#2ade2747abc4d779d0836154b0413d13ce16cd5b" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad095989c1533c1c266d9b1e8d70a1329dd3723c3edac6d03bbd67e7bf6f4bb" dependencies = [ "bitflags 1.3.2", "byteorder", "cfg-if", "defmt 0.3.100", - "heapless 0.7.17", + "heapless 0.8.0", "log", "managed", ] diff --git a/Cargo.toml b/Cargo.toml index bf60b11353..b9e546e0de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,14 +71,14 @@ allocator = { git = "https://github.com/arceos-org/allocator.git", tag = "v0.1.2 "axerrno", ] } axbacktrace = "0.1" -axdriver_base = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.2-dev.0" } -axdriver_block = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.2-dev.0" } -axdriver_display = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.2-dev.0" } -axdriver_input = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.2-dev.0" } -axdriver_net = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.2-dev.0" } -axdriver_pci = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.2-dev.0" } -axdriver_virtio = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.2-dev.0" } -axdriver_vsock = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.2-dev.0" } +axdriver_base = "0.1.4-preview.3" +axdriver_block = "0.1.4-preview.3" +axdriver_display = "0.1.4-preview.3" +axdriver_input = "0.1.4-preview.3" +axdriver_net = "0.1.4-preview.3" +axdriver_pci = "0.1.4-preview.3" +axdriver_virtio = "0.1.4-preview.3" +axdriver_vsock = "0.1.4-preview.3" axerrno = "0.2" axfs-ng-vfs = "0.1" axio = "0.3.0-pre.1" @@ -117,6 +117,7 @@ spin = "0.10" [patch.crates-io] axalloc = { path = "modules/axalloc" } axconfig = { path = "modules/axconfig" } +axdma = { path = "modules/axdma" } axhal = { path = "modules/axhal" } axtask = { path = "modules/axtask" } axsync = { path = "modules/axsync" } diff --git a/modules/axdriver/Cargo.toml b/modules/axdriver/Cargo.toml index df3ac66d6e..10bb014599 100644 --- a/modules/axdriver/Cargo.toml +++ b/modules/axdriver/Cargo.toml @@ -9,6 +9,8 @@ authors = [ description = "ArceOS device drivers" license.workspace = true homepage.workspace = true +keywords.workspace = true +categories.workspace = true repository = "https://github.com/arceos-org/arceos/tree/main/modules/axdriver" documentation = "https://arceos-org.github.io/arceos/axdriver/index.html" @@ -32,10 +34,10 @@ virtio-input = ["input", "virtio", "axdriver_virtio/input"] virtio-socket = ["vsock", "virtio", "axdriver_virtio/socket"] ramdisk = ["block", "axdriver_block/ramdisk"] bcm2835-sdhci = ["block", "axdriver_block/bcm2835-sdhci"] -sdmmc = ["block", "axdriver_block/sdmmc", "dep:axhal", "dep:axconfig"] -ahci = ["block", "axdriver_block/ahci", "dep:axhal", "dep:axconfig"] -ixgbe = ["net", "axdriver_net/ixgbe", "dep:axalloc", "dep:axhal", "dep:axdma"] -fxmac = ["net", "axdriver_net/fxmac", "dep:axalloc", "dep:axhal", "dep:axdma"] +sdmmc = ["block", "dep:axhal", "dep:axconfig", "axdriver_block/sdmmc"] +ahci = ["block", "dep:axhal", "dep:axconfig", "axdriver_block/ahci"] +ixgbe = ["net", "dep:axalloc", "dep:axhal", "dep:axdma", "axdriver_net/ixgbe"] +fxmac = ["net", "dep:axalloc", "dep:axhal", "dep:axdma", "axdriver_net/fxmac"] # more devices example: e1000 = ["net", "axdriver_net/e1000"] irq = [] @@ -56,9 +58,9 @@ dyn = [ default = ["bus-pci"] [dependencies] -axalloc = { workspace = true, optional = true } -axconfig = { workspace = true, optional = true } -axdma = { workspace = true, optional = true } +axalloc = { version = "0.2.2-preview.1", optional = true } +axconfig = { version = "0.2.2-preview.1", optional = true } +axdma = { version = "0.2.2-preview.1", optional = true } axdriver_base.workspace = true axdriver_block = { workspace = true, optional = true } axdriver_display = { workspace = true, optional = true } @@ -68,8 +70,8 @@ axdriver_pci = { workspace = true, optional = true } axdriver_virtio = { workspace = true, optional = true } axdriver_vsock = { workspace = true, optional = true } axerrno = { workspace = true, optional = true } -axhal = { workspace = true, optional = true } -axklib = { workspace = true, optional = true } +axhal = { version = "0.2.2-preview.2", optional = true } +axklib = { version = "0.2.0", optional = true } cfg-if.workspace = true crate_interface.workspace = true dma-api = { version = "0.5", features = ["alloc"], optional = true } From 1ac155dd977f955a1b52d9df3a528954490a393b Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 18:56:13 +0800 Subject: [PATCH 13/23] Chore: cargo publish axdisplay v0.2.2-preview.1 --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b9e546e0de..ab91676ccd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ axalloc = { path = "modules/axalloc" } axconfig = { path = "modules/axconfig" } axdisplay = { path = "modules/axdisplay" } axdma = { path = "modules/axdma" } -axdriver = { path = "modules/axdriver" } +axdriver = { version = "0.2.2-preview.1", path = "modules/axdriver" } axfs = { path = "modules/axfs" } axhal = { path = "modules/axhal" } axinput = { path = "modules/axinput" } @@ -64,7 +64,7 @@ axlog = { path = "modules/axlog" } axmm = { path = "modules/axmm" } axnet = { path = "modules/axnet" } axruntime = { path = "modules/axruntime" } -axsync = { path = "modules/axsync" } +axsync = { version = "0.2.2-preview.1", path = "modules/axsync" } axtask = { path = "modules/axtask" } allocator = { git = "https://github.com/arceos-org/allocator.git", tag = "v0.1.2", features = [ From c8a6306e7ed365d75108fe5c57c7e981c40d5068 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 18:59:16 +0800 Subject: [PATCH 14/23] Chore: cargo publish axinput v0.2.2-preview.1 --- modules/axinput/Cargo.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/axinput/Cargo.toml b/modules/axinput/Cargo.toml index 340c64c71b..6c5f36d74d 100644 --- a/modules/axinput/Cargo.toml +++ b/modules/axinput/Cargo.toml @@ -5,10 +5,11 @@ edition.workspace = true authors.workspace = true license.workspace = true homepage.workspace = true -documentation.workspace = true -repository.workspace = true +documentation = "https://arceos-org.github.io/arceos/axinput/index.html" +repository = "https://github.com/arceos-org/arceos/tree/main/modules/axinput" keywords.workspace = true categories.workspace = true +description = "ArceOS input subsystem module" [dependencies] axdriver = { workspace = true, features = ["input"] } From 6631e95554aa39e630eca35cfa83c9130abbc1d5 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 19:44:48 +0800 Subject: [PATCH 15/23] Chore: cargo publish axfs v0.2.2-preview.1 --- Cargo.lock | 26 ++++++++++++++------------ Cargo.toml | 4 ++-- modules/axfs/Cargo.toml | 7 +++---- modules/axfs/src/highlevel/file.rs | 3 ++- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c2dccf4140..b2866259d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -580,7 +580,6 @@ dependencies = [ "cfg-if", "chrono", "env_logger", - "fatfs", "intrusive-collections", "kspin", "log", @@ -589,6 +588,7 @@ dependencies = [ "scope-local", "slab", "spin 0.10.0", + "starry-fatfs", ] [[package]] @@ -1522,15 +1522,6 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" -[[package]] -name = "fatfs" -version = "0.4.0" -source = "git+https://github.com/Starry-OS/rust-fatfs.git?rev=2685439#2685439e679cc832a67fd21340258b7c018c0f33" -dependencies = [ - "bitflags 2.10.0", - "log", -] - [[package]] name = "fdt-parser" version = "0.4.18" @@ -2018,8 +2009,9 @@ dependencies = [ [[package]] name = "lwext4_rust" -version = "0.2.0" -source = "git+https://github.com/Starry-OS/lwext4_rust.git?rev=033fa2c#033fa2cc848c7495651b00af6695dc07de06d596" +version = "0.3.1-preview.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8514d8134c84bf2f8d3b1a957675fdd7f9b88c0331e9244f46d8bb904b2a60c" dependencies = [ "bindgen", "log", @@ -2646,6 +2638,16 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +[[package]] +name = "starry-fatfs" +version = "0.4.1-preview.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d994a3a25a5cc4a895b200bd00d8e757515f21f9c21647bd4e9a8e572a326f1" +dependencies = [ + "bitflags 2.10.0", + "log", +] + [[package]] name = "static_assertions" version = "1.1.0" diff --git a/Cargo.toml b/Cargo.toml index ab91676ccd..cea0113bec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,13 +51,13 @@ arceos_api = { path = "api/arceos_api" } arceos_posix_api = { path = "api/arceos_posix_api" } axfeat = { path = "api/axfeat" } -axalloc = { path = "modules/axalloc" } +axalloc = { version = "0.2.2-preview.1", path = "modules/axalloc" } axconfig = { path = "modules/axconfig" } axdisplay = { path = "modules/axdisplay" } axdma = { path = "modules/axdma" } axdriver = { version = "0.2.2-preview.1", path = "modules/axdriver" } axfs = { path = "modules/axfs" } -axhal = { path = "modules/axhal" } +axhal = { version = "0.2.2-preview.2", path = "modules/axhal" } axinput = { path = "modules/axinput" } axipi = { path = "modules/axipi" } axlog = { path = "modules/axlog" } diff --git a/modules/axfs/Cargo.toml b/modules/axfs/Cargo.toml index f6faa12093..245c997bce 100644 --- a/modules/axfs/Cargo.toml +++ b/modules/axfs/Cargo.toml @@ -36,14 +36,13 @@ slab = { version = "0.4.9", default-features = false } spin = { workspace = true } [dependencies.lwext4_rust] -git = "https://github.com/Starry-OS/lwext4_rust.git" -rev = "033fa2c" +version = "0.3.1-preview.1" default-features = false optional = true [dependencies.fatfs] -git = "https://github.com/Starry-OS/rust-fatfs.git" -rev = "2685439" +version = "0.4.1-preview.2" +package = "starry-fatfs" default-features = false optional = true features = ["alloc", "lfn", "log_level_trace", "unicode"] diff --git a/modules/axfs/src/highlevel/file.rs b/modules/axfs/src/highlevel/file.rs index 7cd360f9d5..bcf2fc88fa 100644 --- a/modules/axfs/src/highlevel/file.rs +++ b/modules/axfs/src/highlevel/file.rs @@ -314,7 +314,8 @@ impl PageCache { .alloc_pages(1, PAGE_SIZE, UsageKind::PageCache) .inspect_err(|err| { warn!("Failed to allocate page cache: {:?}", err); - })?; + }) + .map_err(|_| VfsError::NoMemory)?; Ok(Self { addr: addr.into(), dirty: false, From a9cf0f571ce7da38345b2cd37679a3ea4d524f7d Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 19:57:00 +0800 Subject: [PATCH 16/23] Chore: cargo publish axmm v0.2.2-preview.1 --- Cargo.toml | 8 ++++---- modules/axmm/src/backend/mod.rs | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cea0113bec..281eea26db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,11 +52,11 @@ arceos_posix_api = { path = "api/arceos_posix_api" } axfeat = { path = "api/axfeat" } axalloc = { version = "0.2.2-preview.1", path = "modules/axalloc" } -axconfig = { path = "modules/axconfig" } +axconfig = { version = "0.2.2-preview.1", path = "modules/axconfig" } axdisplay = { path = "modules/axdisplay" } axdma = { path = "modules/axdma" } axdriver = { version = "0.2.2-preview.1", path = "modules/axdriver" } -axfs = { path = "modules/axfs" } +axfs = { version = "0.2.2-preview.1", path = "modules/axfs" } axhal = { version = "0.2.2-preview.2", path = "modules/axhal" } axinput = { path = "modules/axinput" } axipi = { path = "modules/axipi" } @@ -65,7 +65,7 @@ axmm = { path = "modules/axmm" } axnet = { path = "modules/axnet" } axruntime = { path = "modules/axruntime" } axsync = { version = "0.2.2-preview.1", path = "modules/axsync" } -axtask = { path = "modules/axtask" } +axtask = { version = "0.2.2-preview.1", path = "modules/axtask" } allocator = { git = "https://github.com/arceos-org/allocator.git", tag = "v0.1.2", features = [ "axerrno", @@ -106,7 +106,7 @@ lazy_static = { version = "1.5", features = ["spin_no_std"] } lock_api = { version = "0.4", default-features = false } log = "0.4" memory_addr = "0.4" -page_table_multiarch = { git = "https://github.com/arceos-org/page_table_multiarch.git", tag = "dev-v05", features = [ +page_table_multiarch = { version = "0.5", features = [ "axerrno", ] } percpu = "0.2" diff --git a/modules/axmm/src/backend/mod.rs b/modules/axmm/src/backend/mod.rs index be3b0581f9..2d7ea23edd 100644 --- a/modules/axmm/src/backend/mod.rs +++ b/modules/axmm/src/backend/mod.rs @@ -32,7 +32,11 @@ fn alloc_frame(zeroed: bool, size: PageSize) -> AxResult { let page_size = size as usize; let num_pages = page_size / PAGE_SIZE_4K; let vaddr = - VirtAddr::from(global_allocator().alloc_pages(num_pages, page_size, UsageKind::VirtMem)?); + VirtAddr::from( + global_allocator() + .alloc_pages(num_pages, page_size, UsageKind::VirtMem) + .map_err(|_| AxError::NoMemory)?, + ); if zeroed { unsafe { core::ptr::write_bytes(vaddr.as_mut_ptr(), 0, page_size) }; } From 52bcc190322e74fcebc648f591c8a923fc8d4a62 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 20:22:30 +0800 Subject: [PATCH 17/23] Fix: stream.rs: The issue with the lock guard crossing the.await point in the Send method of accept(). First, clone the Receiver, release the lock, and then await. --- modules/axnet/src/unix/stream.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/axnet/src/unix/stream.rs b/modules/axnet/src/unix/stream.rs index 6f62959b58..3eb612ac32 100644 --- a/modules/axnet/src/unix/stream.rs +++ b/modules/axnet/src/unix/stream.rs @@ -198,9 +198,12 @@ impl TransportOps for StreamTransport { } async fn accept(&self) -> AxResult<(Transport, UnixSocketAddr)> { - let mut guard = self.conn_rx.lock(); - let Some((rx, _)) = guard.as_mut() else { - return Err(AxError::NotConnected); + let rx = { + let guard = self.conn_rx.lock(); + let Some((rx, _)) = guard.as_ref() else { + return Err(AxError::NotConnected); + }; + rx.clone() }; let ConnRequest { channel, From 573b2197d53b23a4e480b3dbddc5ed8824e41623 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 20:23:32 +0800 Subject: [PATCH 18/23] Chore: cargo publish axnet v0.2.2-preview.1 --- Cargo.lock | 35 ++++++++++++++++++----------------- Cargo.toml | 2 +- modules/axnet/Cargo.toml | 6 +++--- modules/axtask/Cargo.toml | 4 ++-- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b2866259d8..bd3720edd1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -746,8 +746,8 @@ dependencies = [ "lazyinit", "log", "ringbuf", - "smoltcp 0.12.0 (git+https://github.com/Starry-OS/smoltcp.git?rev=7401a54)", "spin 0.10.0", + "starry-smoltcp", ] [[package]] @@ -981,7 +981,7 @@ dependencies = [ [[package]] name = "axtask" -version = "0.2.2-preview.1" +version = "0.2.2-preview.3" dependencies = [ "axconfig", "axerrno 0.2.2", @@ -1823,7 +1823,7 @@ dependencies = [ "bit_field", "core_detect", "log", - "smoltcp 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smoltcp", "volatile 0.3.0", ] @@ -2591,20 +2591,6 @@ dependencies = [ "managed", ] -[[package]] -name = "smoltcp" -version = "0.12.0" -source = "git+https://github.com/Starry-OS/smoltcp.git?rev=7401a54#7401a54b041924a78971b077cd62140b26d441dc" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "cfg-if", - "defmt 0.3.100", - "heapless 0.8.0", - "log", - "managed", -] - [[package]] name = "spin" version = "0.9.8" @@ -2648,6 +2634,21 @@ dependencies = [ "log", ] +[[package]] +name = "starry-smoltcp" +version = "0.12.1-preview.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77517d20c697d9cc6fc579fa3e199c53e64c875d7e2898e17c41918e19e84e4b" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "cfg-if", + "defmt 0.3.100", + "heapless 0.8.0", + "log", + "managed", +] + [[package]] name = "static_assertions" version = "1.1.0" diff --git a/Cargo.toml b/Cargo.toml index 281eea26db..6c518eb519 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,7 +65,7 @@ axmm = { path = "modules/axmm" } axnet = { path = "modules/axnet" } axruntime = { path = "modules/axruntime" } axsync = { version = "0.2.2-preview.1", path = "modules/axsync" } -axtask = { version = "0.2.2-preview.1", path = "modules/axtask" } +axtask = { version = "0.2.2-preview.3", path = "modules/axtask" } allocator = { git = "https://github.com/arceos-org/allocator.git", tag = "v0.1.2", features = [ "axerrno", diff --git a/modules/axnet/Cargo.toml b/modules/axnet/Cargo.toml index 6a2aacdee3..6fcc6a0caf 100644 --- a/modules/axnet/Cargo.toml +++ b/modules/axnet/Cargo.toml @@ -20,7 +20,7 @@ axconfig = { workspace = true } axdriver = { workspace = true, features = ["net"] } axhal = { workspace = true } axsync = { workspace = true } -axtask = { workspace = true } +axtask = { workspace = true, features = ["multitask", "irq"] } axerrno = { workspace = true } axfs = { workspace = true } @@ -41,8 +41,8 @@ event-listener = { version = "5.4.0", default-features = false } async-trait = "0.1.88" [dependencies.smoltcp] -git = "https://github.com/Starry-OS/smoltcp.git" -rev = "7401a54" +version = "0.12.1-preview.1" +package = "starry-smoltcp" default-features = false features = [ "alloc", diff --git a/modules/axtask/Cargo.toml b/modules/axtask/Cargo.toml index 9cf9086322..341c94830c 100644 --- a/modules/axtask/Cargo.toml +++ b/modules/axtask/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axtask" -version = "0.2.2-preview.1" +version = "0.2.2-preview.3" edition.workspace = true authors = ["Yuekai Jia "] description = "ArceOS task management module" @@ -28,7 +28,7 @@ multitask = [ "dep:percpu", ] task-ext = ["dep:extern-trait"] -irq = [] +irq = ["axhal/irq"] tls = ["axhal/tls"] preempt = ["irq", "percpu?/preempt", "kernel_guard/preempt"] smp = ["kspin/smp"] From fde3965ea02124fcc7f5de68042af1e202e6495a Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 20:34:15 +0800 Subject: [PATCH 19/23] Chore: cargo publish axruntime v0.2.2-preview.1 --- Cargo.lock | 4 ++-- Cargo.toml | 18 +++++++++--------- modules/axhal/Cargo.toml | 2 +- modules/axhal/src/percpu.rs | 10 ++++++++++ modules/axipi/Cargo.toml | 2 +- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bd3720edd1..e589fccaee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -610,7 +610,7 @@ dependencies = [ [[package]] name = "axhal" -version = "0.2.2-preview.2" +version = "0.2.2-preview.3" dependencies = [ "axalloc", "axconfig", @@ -656,7 +656,7 @@ dependencies = [ [[package]] name = "axipi" -version = "0.2.2-preview.1" +version = "0.2.2-preview.2" dependencies = [ "axconfig", "axhal", diff --git a/Cargo.toml b/Cargo.toml index 6c518eb519..1f273597f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,16 +53,16 @@ axfeat = { path = "api/axfeat" } axalloc = { version = "0.2.2-preview.1", path = "modules/axalloc" } axconfig = { version = "0.2.2-preview.1", path = "modules/axconfig" } -axdisplay = { path = "modules/axdisplay" } -axdma = { path = "modules/axdma" } +axdisplay = { version = "0.2.2-preview.1", path = "modules/axdisplay" } +axdma = { version = "0.2.2-preview.1", path = "modules/axdma" } axdriver = { version = "0.2.2-preview.1", path = "modules/axdriver" } axfs = { version = "0.2.2-preview.1", path = "modules/axfs" } -axhal = { version = "0.2.2-preview.2", path = "modules/axhal" } -axinput = { path = "modules/axinput" } -axipi = { path = "modules/axipi" } -axlog = { path = "modules/axlog" } -axmm = { path = "modules/axmm" } -axnet = { path = "modules/axnet" } +axhal = { version = "0.2.2-preview.3", path = "modules/axhal" } +axinput = { version = "0.2.2-preview.1", path = "modules/axinput" } +axipi = { version = "0.2.2-preview.2", path = "modules/axipi" } +axlog = { version = "0.2.2-preview.1", path = "modules/axlog" } +axmm = { version = "0.2.2-preview.1", path = "modules/axmm" } +axnet = { version = "0.2.2-preview.1", path = "modules/axnet" } axruntime = { path = "modules/axruntime" } axsync = { version = "0.2.2-preview.1", path = "modules/axsync" } axtask = { version = "0.2.2-preview.3", path = "modules/axtask" } @@ -83,7 +83,7 @@ axerrno = "0.2" axfs-ng-vfs = "0.1" axio = "0.3.0-pre.1" axklib = { git = "https://github.com/arceos-hypervisor/axklib.git" } # FIXME: pin to a specific commit or tag -axplat = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } +axplat = "0.3" axplat-aarch64-bsta1000b = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } axplat-aarch64-phytium-pi = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } axplat-aarch64-qemu-virt = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } diff --git a/modules/axhal/Cargo.toml b/modules/axhal/Cargo.toml index 295a7fe815..f01bb7155a 100644 --- a/modules/axhal/Cargo.toml +++ b/modules/axhal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axhal" -version = "0.2.2-preview.2" +version = "0.2.2-preview.3" edition.workspace = true authors = ["Yuekai Jia "] description = "ArceOS hardware abstraction layer, provides unified APIs for platform-specific operations" diff --git a/modules/axhal/src/percpu.rs b/modules/axhal/src/percpu.rs index 1be84e1a77..7f77805d7a 100644 --- a/modules/axhal/src/percpu.rs +++ b/modules/axhal/src/percpu.rs @@ -14,6 +14,16 @@ pub fn this_cpu_id() -> usize { 0 } +/// Stub: initializes percpu for the primary CPU (no-op without a real platform). +#[cfg(not(any(feature = "defplat", feature = "myplat")))] +#[inline] +pub fn init_primary(_cpu_id: usize) {} + +/// Stub: initializes percpu for a secondary CPU (no-op without a real platform). +#[cfg(not(any(feature = "defplat", feature = "myplat")))] +#[inline] +pub fn init_secondary(_cpu_id: usize) {} + #[percpu::def_percpu] static CURRENT_TASK_PTR: usize = 0; diff --git a/modules/axipi/Cargo.toml b/modules/axipi/Cargo.toml index 8a6ba94a99..9873076ea4 100644 --- a/modules/axipi/Cargo.toml +++ b/modules/axipi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axipi" -version = "0.2.2-preview.1" +version = "0.2.2-preview.2" edition.workspace = true authors = ["Keyang Hu "] description = "ArceOS IPI management module" From f83789a90520544ef60f25a6b3638062bc7de966 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 21:11:39 +0800 Subject: [PATCH 20/23] Chore: cargo publish axfeat, arceos_api, axstd, arceos_posix_api, axlibc ========== In the [workspace_dependencies] section of arceos/Cargo.toml, add version = "0.2.2-preview.1" to arceos_api. Both dry-run and production releases passed without additional modifications. In the [workspace_dependencies] section of arceos/Cargo.toml, add version = "0.2.2-preview.1" to axstd. Both dry-run and release builds passed on the first attempt. The issue is that build.rs uses the relative path../../ulib/axlibc/include/ to reference external header files, which is not present in the cargo publish sandbox. The solution is: Skip generating build.rs when external header files are unavailable (use pre-generated files) Ensure that certgen.rs is included in the release package The build script does not allow modifying the source directory during publish verification. Modify it to write to OUT_DIR. arceos/Cargo.toml-for arceos_posix_api with version = "0.2.2-preview.1" arceos_posix_api/build.rs-Join condition check: If the external header file directory../../ulib/axlibc/include/ does not exist (e.g., in a cargo publish sandbox), skip regenerating ctypes_gen.rs and use the pre-generated version arceos_posix_api/.gitignore-Clear content to ensure ctypes_gen.rs is included in the release package arceos_posix_api/src/imp/stdio.rs-Fixed the BufReader::new issue in axio 0.3.0-pre.1 where it was no longer a const function, using spin::Once to delay initialization arceos/Cargo.toml-Add version = "0.2.2-preview.1" to axlibc axlibc/build.rs-Write libctypes_gen.rs to OUT_DIR instead of src/, avoiding the publish verification restriction on source directory modifications axlibc/lib.rs-Use include! (concat! (env! ("OUT_DIR"), "/libctypes_gen.rs")) to import the generated binding file from OUT_DIR --- Cargo.toml | 12 +- api/arceos_posix_api/.gitignore | 1 - api/arceos_posix_api/build.rs | 20 +- api/arceos_posix_api/src/ctypes_gen.rs | 826 +++++++++++++++++++++++++ api/arceos_posix_api/src/imp/stdio.rs | 6 +- examples/helloworld/Cargo.toml | 8 +- ulib/axlibc/build.rs | 4 +- ulib/axlibc/src/lib.rs | 6 +- 8 files changed, 866 insertions(+), 17 deletions(-) create mode 100644 api/arceos_posix_api/src/ctypes_gen.rs diff --git a/Cargo.toml b/Cargo.toml index 1f273597f8..11cd9a2d38 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,12 +44,12 @@ keywords = ["arceos", "kernel"] categories = ["os", "no-std"] [workspace.dependencies] -axstd = { path = "ulib/axstd" } -axlibc = { path = "ulib/axlibc" } +axstd = { version = "0.2.2-preview.1", path = "ulib/axstd" } +axlibc = { version = "0.2.2-preview.1", path = "ulib/axlibc" } -arceos_api = { path = "api/arceos_api" } -arceos_posix_api = { path = "api/arceos_posix_api" } -axfeat = { path = "api/axfeat" } +arceos_api = { version = "0.2.2-preview.1", path = "api/arceos_api" } +arceos_posix_api = { version = "0.2.2-preview.1", path = "api/arceos_posix_api" } +axfeat = { version = "0.2.2-preview.1", path = "api/axfeat" } axalloc = { version = "0.2.2-preview.1", path = "modules/axalloc" } axconfig = { version = "0.2.2-preview.1", path = "modules/axconfig" } @@ -63,7 +63,7 @@ axipi = { version = "0.2.2-preview.2", path = "modules/axipi" } axlog = { version = "0.2.2-preview.1", path = "modules/axlog" } axmm = { version = "0.2.2-preview.1", path = "modules/axmm" } axnet = { version = "0.2.2-preview.1", path = "modules/axnet" } -axruntime = { path = "modules/axruntime" } +axruntime = { version = "0.2.2-preview.1", path = "modules/axruntime" } axsync = { version = "0.2.2-preview.1", path = "modules/axsync" } axtask = { version = "0.2.2-preview.3", path = "modules/axtask" } diff --git a/api/arceos_posix_api/.gitignore b/api/arceos_posix_api/.gitignore index 5e6d7ebe4b..e69de29bb2 100644 --- a/api/arceos_posix_api/.gitignore +++ b/api/arceos_posix_api/.gitignore @@ -1 +0,0 @@ -ctypes_gen.rs diff --git a/api/arceos_posix_api/build.rs b/api/arceos_posix_api/build.rs index 5dbd0c309b..fe953c0003 100644 --- a/api/arceos_posix_api/build.rs +++ b/api/arceos_posix_api/build.rs @@ -109,6 +109,22 @@ typedef struct {{ .expect("Couldn't write bindings!"); } - gen_pthread_mutex("../../ulib/axlibc/include/ax_pthread_mutex.h").unwrap(); - gen_c_to_rust_bindings("ctypes.h", "src/ctypes_gen.rs"); + let axlibc_include = std::path::Path::new("../../ulib/axlibc/include"); + if axlibc_include.exists() { + gen_pthread_mutex( + axlibc_include + .join("ax_pthread_mutex.h") + .to_str() + .unwrap(), + ) + .unwrap(); + gen_c_to_rust_bindings("ctypes.h", "src/ctypes_gen.rs"); + } else { + // During `cargo publish` verification, the external headers are not + // available. Use the pre-generated ctypes_gen.rs shipped in the crate. + eprintln!( + "cargo:warning=axlibc include directory not found, \ + skipping ctypes_gen.rs regeneration" + ); + } } diff --git a/api/arceos_posix_api/src/ctypes_gen.rs b/api/arceos_posix_api/src/ctypes_gen.rs new file mode 100644 index 0000000000..497072103b --- /dev/null +++ b/api/arceos_posix_api/src/ctypes_gen.rs @@ -0,0 +1,826 @@ +/* automatically generated by rust-bindgen 0.72.1 */ + +pub const O_CREAT: u32 = 64; +pub const O_EXCL: u32 = 128; +pub const O_NOCTTY: u32 = 256; +pub const O_TRUNC: u32 = 512; +pub const O_APPEND: u32 = 1024; +pub const O_NONBLOCK: u32 = 2048; +pub const O_DSYNC: u32 = 4096; +pub const O_SYNC: u32 = 1052672; +pub const O_RSYNC: u32 = 1052672; +pub const O_DIRECTORY: u32 = 65536; +pub const O_NOFOLLOW: u32 = 131072; +pub const O_CLOEXEC: u32 = 524288; +pub const O_ASYNC: u32 = 8192; +pub const O_DIRECT: u32 = 16384; +pub const O_LARGEFILE: u32 = 32768; +pub const O_NOATIME: u32 = 262144; +pub const O_PATH: u32 = 2097152; +pub const O_TMPFILE: u32 = 4259840; +pub const O_NDELAY: u32 = 2048; +pub const O_SEARCH: u32 = 2097152; +pub const O_EXEC: u32 = 2097152; +pub const O_TTY_INIT: u32 = 0; +pub const O_ACCMODE: u32 = 2097155; +pub const O_RDONLY: u32 = 0; +pub const O_WRONLY: u32 = 1; +pub const O_RDWR: u32 = 2; +pub const F_DUPFD: u32 = 0; +pub const F_GETFD: u32 = 1; +pub const F_SETFD: u32 = 2; +pub const F_GETFL: u32 = 3; +pub const F_SETFL: u32 = 4; +pub const F_SETOWN: u32 = 8; +pub const F_GETOWN: u32 = 9; +pub const F_SETSIG: u32 = 10; +pub const F_GETSIG: u32 = 11; +pub const F_GETLK: u32 = 5; +pub const F_SETLK: u32 = 6; +pub const F_SETLKW: u32 = 7; +pub const FD_CLOEXEC: u32 = 1; +pub const F_DUPFD_CLOEXEC: u32 = 1030; +pub const F_RDLCK: u32 = 0; +pub const F_WRLCK: u32 = 1; +pub const F_UNLCK: u32 = 2; +pub const F_OK: u32 = 0; +pub const F_ULOCK: u32 = 0; +pub const F_LOCK: u32 = 1; +pub const F_TLOCK: u32 = 2; +pub const F_TEST: u32 = 3; +pub const SOCK_STREAM: u32 = 1; +pub const SOCK_DGRAM: u32 = 2; +pub const SOCK_RAW: u32 = 3; +pub const SOCK_RDM: u32 = 4; +pub const SOCK_SEQPACKET: u32 = 5; +pub const SOCK_DCCP: u32 = 6; +pub const SOCK_PACKET: u32 = 10; +pub const SOCK_CLOEXEC: u32 = 524288; +pub const SOCK_NONBLOCK: u32 = 2048; +pub const AF_UNSPEC: u32 = 0; +pub const AF_LOCAL: u32 = 1; +pub const AF_UNIX: u32 = 1; +pub const AF_FILE: u32 = 1; +pub const AF_INET: u32 = 2; +pub const AF_AX25: u32 = 3; +pub const AF_IPX: u32 = 4; +pub const AF_APPLETALK: u32 = 5; +pub const AF_NETROM: u32 = 6; +pub const AF_BRIDGE: u32 = 7; +pub const AF_ATMPVC: u32 = 8; +pub const AF_X25: u32 = 9; +pub const AF_INET6: u32 = 10; +pub const AF_ROSE: u32 = 11; +pub const AF_DECnet: u32 = 12; +pub const AF_NETBEUI: u32 = 13; +pub const AF_SECURITY: u32 = 14; +pub const AF_KEY: u32 = 15; +pub const AF_NETLINK: u32 = 16; +pub const AF_ROUTE: u32 = 16; +pub const AF_PACKET: u32 = 17; +pub const AF_ASH: u32 = 18; +pub const AF_ECONET: u32 = 19; +pub const AF_ATMSVC: u32 = 20; +pub const AF_RDS: u32 = 21; +pub const AF_SNA: u32 = 22; +pub const AF_IRDA: u32 = 23; +pub const AF_PPPOX: u32 = 24; +pub const AF_WANPIPE: u32 = 25; +pub const AF_LLC: u32 = 26; +pub const AF_IB: u32 = 27; +pub const AF_MPLS: u32 = 28; +pub const AF_CAN: u32 = 29; +pub const AF_TIPC: u32 = 30; +pub const AF_BLUETOOTH: u32 = 31; +pub const AF_IUCV: u32 = 32; +pub const AF_RXRPC: u32 = 33; +pub const AF_ISDN: u32 = 34; +pub const AF_PHONET: u32 = 35; +pub const AF_IEEE802154: u32 = 36; +pub const AF_CAIF: u32 = 37; +pub const AF_ALG: u32 = 38; +pub const AF_NFC: u32 = 39; +pub const AF_VSOCK: u32 = 40; +pub const AF_KCM: u32 = 41; +pub const AF_QIPCRTR: u32 = 42; +pub const AF_SMC: u32 = 43; +pub const AF_XDP: u32 = 44; +pub const AF_MAX: u32 = 45; +pub const IPPROTO_IP: u32 = 0; +pub const IPPROTO_HOPOPTS: u32 = 0; +pub const IPPROTO_ICMP: u32 = 1; +pub const IPPROTO_IGMP: u32 = 2; +pub const IPPROTO_IPIP: u32 = 4; +pub const IPPROTO_TCP: u32 = 6; +pub const IPPROTO_EGP: u32 = 8; +pub const IPPROTO_PUP: u32 = 12; +pub const IPPROTO_UDP: u32 = 17; +pub const IPPROTO_IDP: u32 = 22; +pub const IPPROTO_TP: u32 = 29; +pub const IPPROTO_DCCP: u32 = 33; +pub const IPPROTO_IPV6: u32 = 41; +pub const IPPROTO_ROUTING: u32 = 43; +pub const IPPROTO_FRAGMENT: u32 = 44; +pub const IPPROTO_RSVP: u32 = 46; +pub const IPPROTO_GRE: u32 = 47; +pub const IPPROTO_ESP: u32 = 50; +pub const IPPROTO_AH: u32 = 51; +pub const IPPROTO_ICMPV6: u32 = 58; +pub const IPPROTO_NONE: u32 = 59; +pub const IPPROTO_DSTOPTS: u32 = 60; +pub const IPPROTO_MTP: u32 = 92; +pub const IPPROTO_BEETPH: u32 = 94; +pub const IPPROTO_ENCAP: u32 = 98; +pub const IPPROTO_PIM: u32 = 103; +pub const IPPROTO_COMP: u32 = 108; +pub const IPPROTO_SCTP: u32 = 132; +pub const IPPROTO_MH: u32 = 135; +pub const IPPROTO_UDPLITE: u32 = 136; +pub const IPPROTO_MPLS: u32 = 137; +pub const IPPROTO_ETHERNET: u32 = 143; +pub const IPPROTO_RAW: u32 = 255; +pub const IPPROTO_MPTCP: u32 = 262; +pub const IPPROTO_MAX: u32 = 263; +pub const EAI_BADFLAGS: i32 = -1; +pub const EAI_NONAME: i32 = -2; +pub const EAI_AGAIN: i32 = -3; +pub const EAI_FAIL: i32 = -4; +pub const EAI_FAMILY: i32 = -6; +pub const EAI_SOCKTYPE: i32 = -7; +pub const EAI_SERVICE: i32 = -8; +pub const EAI_MEMORY: i32 = -10; +pub const EAI_SYSTEM: i32 = -11; +pub const EAI_OVERFLOW: i32 = -12; +pub const MAXADDRS: u32 = 48; +pub const CLOCK_REALTIME: u32 = 0; +pub const CLOCK_MONOTONIC: u32 = 1; +pub const EPOLL_CLOEXEC: u32 = 524288; +pub const EPOLL_NONBLOCK: u32 = 2048; +pub const EPOLLIN: u32 = 1; +pub const EPOLLPRI: u32 = 2; +pub const EPOLLOUT: u32 = 4; +pub const EPOLLRDNORM: u32 = 64; +pub const EPOLLNVAL: u32 = 32; +pub const EPOLLRDBAND: u32 = 128; +pub const EPOLLWRNORM: u32 = 256; +pub const EPOLLWRBAND: u32 = 512; +pub const EPOLLMSG: u32 = 1024; +pub const EPOLLERR: u32 = 8; +pub const EPOLLHUP: u32 = 16; +pub const EPOLLRDHUP: u32 = 8192; +pub const EPOLLEXCLUSIVE: u32 = 268435456; +pub const EPOLLWAKEUP: u32 = 536870912; +pub const EPOLLONESHOT: u32 = 1073741824; +pub const EPOLLET: u32 = 2147483648; +pub const EPOLL_CTL_ADD: u32 = 1; +pub const EPOLL_CTL_DEL: u32 = 2; +pub const EPOLL_CTL_MOD: u32 = 3; +pub const RLIMIT_CPU: u32 = 0; +pub const RLIMIT_FSIZE: u32 = 1; +pub const RLIMIT_DATA: u32 = 2; +pub const RLIMIT_STACK: u32 = 3; +pub const RLIMIT_CORE: u32 = 4; +pub const RLIMIT_RSS: u32 = 5; +pub const RLIMIT_NPROC: u32 = 6; +pub const RLIMIT_NOFILE: u32 = 7; +pub const RLIMIT_MEMLOCK: u32 = 8; +pub const RLIMIT_AS: u32 = 9; +pub const RLIMIT_LOCKS: u32 = 10; +pub const RLIMIT_SIGPENDING: u32 = 11; +pub const RLIMIT_MSGQUEUE: u32 = 12; +pub const RLIMIT_NICE: u32 = 13; +pub const RLIMIT_RTPRIO: u32 = 14; +pub const RLIMIT_RTTIME: u32 = 15; +pub const RLIMIT_NLIMITS: u32 = 16; +pub const FD_SETSIZE: u32 = 1024; +pub const _SC_ARG_MAX: u32 = 0; +pub const _SC_CHILD_MAX: u32 = 1; +pub const _SC_CLK_TCK: u32 = 2; +pub const _SC_NGROUPS_MAX: u32 = 3; +pub const _SC_OPEN_MAX: u32 = 4; +pub const _SC_STREAM_MAX: u32 = 5; +pub const _SC_TZNAME_MAX: u32 = 6; +pub const _SC_JOB_CONTROL: u32 = 7; +pub const _SC_SAVED_IDS: u32 = 8; +pub const _SC_REALTIME_SIGNALS: u32 = 9; +pub const _SC_PRIORITY_SCHEDULING: u32 = 10; +pub const _SC_TIMERS: u32 = 11; +pub const _SC_ASYNCHRONOUS_IO: u32 = 12; +pub const _SC_PRIORITIZED_IO: u32 = 13; +pub const _SC_SYNCHRONIZED_IO: u32 = 14; +pub const _SC_FSYNC: u32 = 15; +pub const _SC_MAPPED_FILES: u32 = 16; +pub const _SC_MEMLOCK: u32 = 17; +pub const _SC_MEMLOCK_RANGE: u32 = 18; +pub const _SC_MEMORY_PROTECTION: u32 = 19; +pub const _SC_MESSAGE_PASSING: u32 = 20; +pub const _SC_SEMAPHORES: u32 = 21; +pub const _SC_SHARED_MEMORY_OBJECTS: u32 = 22; +pub const _SC_AIO_LISTIO_MAX: u32 = 23; +pub const _SC_AIO_MAX: u32 = 24; +pub const _SC_AIO_PRIO_DELTA_MAX: u32 = 25; +pub const _SC_DELAYTIMER_MAX: u32 = 26; +pub const _SC_MQ_OPEN_MAX: u32 = 27; +pub const _SC_MQ_PRIO_MAX: u32 = 28; +pub const _SC_VERSION: u32 = 29; +pub const _SC_PAGE_SIZE: u32 = 30; +pub const _SC_PAGESIZE: u32 = 30; +pub const _SC_RTSIG_MAX: u32 = 31; +pub const _SC_SEM_NSEMS_MAX: u32 = 32; +pub const _SC_SEM_VALUE_MAX: u32 = 33; +pub const _SC_SIGQUEUE_MAX: u32 = 34; +pub const _SC_TIMER_MAX: u32 = 35; +pub const _SC_BC_BASE_MAX: u32 = 36; +pub const _SC_BC_DIM_MAX: u32 = 37; +pub const _SC_BC_SCALE_MAX: u32 = 38; +pub const _SC_BC_STRING_MAX: u32 = 39; +pub const _SC_COLL_WEIGHTS_MAX: u32 = 40; +pub const _SC_EXPR_NEST_MAX: u32 = 42; +pub const _SC_LINE_MAX: u32 = 43; +pub const _SC_RE_DUP_MAX: u32 = 44; +pub const _SC_2_VERSION: u32 = 46; +pub const _SC_2_C_BIND: u32 = 47; +pub const _SC_2_C_DEV: u32 = 48; +pub const _SC_2_FORT_DEV: u32 = 49; +pub const _SC_2_FORT_RUN: u32 = 50; +pub const _SC_2_SW_DEV: u32 = 51; +pub const _SC_2_LOCALEDEF: u32 = 52; +pub const _SC_UIO_MAXIOV: u32 = 60; +pub const _SC_IOV_MAX: u32 = 60; +pub const _SC_THREADS: u32 = 67; +pub const _SC_THREAD_SAFE_FUNCTIONS: u32 = 68; +pub const _SC_GETGR_R_SIZE_MAX: u32 = 69; +pub const _SC_GETPW_R_SIZE_MAX: u32 = 70; +pub const _SC_LOGIN_NAME_MAX: u32 = 71; +pub const _SC_TTY_NAME_MAX: u32 = 72; +pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: u32 = 73; +pub const _SC_THREAD_KEYS_MAX: u32 = 74; +pub const _SC_THREAD_STACK_MIN: u32 = 75; +pub const _SC_THREAD_THREADS_MAX: u32 = 76; +pub const _SC_THREAD_ATTR_STACKADDR: u32 = 77; +pub const _SC_THREAD_ATTR_STACKSIZE: u32 = 78; +pub const _SC_THREAD_PRIORITY_SCHEDULING: u32 = 79; +pub const _SC_THREAD_PRIO_INHERIT: u32 = 80; +pub const _SC_THREAD_PRIO_PROTECT: u32 = 81; +pub const _SC_THREAD_PROCESS_SHARED: u32 = 82; +pub const _SC_NPROCESSORS_CONF: u32 = 83; +pub const _SC_NPROCESSORS_ONLN: u32 = 84; +pub const _SC_PHYS_PAGES: u32 = 85; +pub const _SC_AVPHYS_PAGES: u32 = 86; +pub const _SC_ATEXIT_MAX: u32 = 87; +pub const _SC_PASS_MAX: u32 = 88; +pub const _SC_XOPEN_VERSION: u32 = 89; +pub const _SC_XOPEN_XCU_VERSION: u32 = 90; +pub const _SC_XOPEN_UNIX: u32 = 91; +pub const _SC_XOPEN_CRYPT: u32 = 92; +pub const _SC_XOPEN_ENH_I18N: u32 = 93; +pub const _SC_XOPEN_SHM: u32 = 94; +pub const _SC_2_CHAR_TERM: u32 = 95; +pub const _SC_2_UPE: u32 = 97; +pub const _SC_XOPEN_XPG2: u32 = 98; +pub const _SC_XOPEN_XPG3: u32 = 99; +pub const _SC_XOPEN_XPG4: u32 = 100; +pub const _SC_NZERO: u32 = 109; +pub const _SC_XBS5_ILP32_OFF32: u32 = 125; +pub const _SC_XBS5_ILP32_OFFBIG: u32 = 126; +pub const _SC_XBS5_LP64_OFF64: u32 = 127; +pub const _SC_XBS5_LPBIG_OFFBIG: u32 = 128; +pub const _SC_XOPEN_LEGACY: u32 = 129; +pub const _SC_XOPEN_REALTIME: u32 = 130; +pub const _SC_XOPEN_REALTIME_THREADS: u32 = 131; +pub const _SC_ADVISORY_INFO: u32 = 132; +pub const _SC_BARRIERS: u32 = 133; +pub const _SC_CLOCK_SELECTION: u32 = 137; +pub const _SC_CPUTIME: u32 = 138; +pub const _SC_THREAD_CPUTIME: u32 = 139; +pub const _SC_MONOTONIC_CLOCK: u32 = 149; +pub const _SC_READER_WRITER_LOCKS: u32 = 153; +pub const _SC_SPIN_LOCKS: u32 = 154; +pub const _SC_REGEXP: u32 = 155; +pub const _SC_SHELL: u32 = 157; +pub const _SC_SPAWN: u32 = 159; +pub const _SC_SPORADIC_SERVER: u32 = 160; +pub const _SC_THREAD_SPORADIC_SERVER: u32 = 161; +pub const _SC_TIMEOUTS: u32 = 164; +pub const _SC_TYPED_MEMORY_OBJECTS: u32 = 165; +pub const _SC_2_PBS: u32 = 168; +pub const _SC_2_PBS_ACCOUNTING: u32 = 169; +pub const _SC_2_PBS_LOCATE: u32 = 170; +pub const _SC_2_PBS_MESSAGE: u32 = 171; +pub const _SC_2_PBS_TRACK: u32 = 172; +pub const _SC_SYMLOOP_MAX: u32 = 173; +pub const _SC_STREAMS: u32 = 174; +pub const _SC_2_PBS_CHECKPOINT: u32 = 175; +pub const _SC_V6_ILP32_OFF32: u32 = 176; +pub const _SC_V6_ILP32_OFFBIG: u32 = 177; +pub const _SC_V6_LP64_OFF64: u32 = 178; +pub const _SC_V6_LPBIG_OFFBIG: u32 = 179; +pub const _SC_HOST_NAME_MAX: u32 = 180; +pub const _SC_TRACE: u32 = 181; +pub const _SC_TRACE_EVENT_FILTER: u32 = 182; +pub const _SC_TRACE_INHERIT: u32 = 183; +pub const _SC_TRACE_LOG: u32 = 184; +pub const _SC_IPV6: u32 = 235; +pub const _SC_RAW_SOCKETS: u32 = 236; +pub const _SC_V7_ILP32_OFF32: u32 = 237; +pub const _SC_V7_ILP32_OFFBIG: u32 = 238; +pub const _SC_V7_LP64_OFF64: u32 = 239; +pub const _SC_V7_LPBIG_OFFBIG: u32 = 240; +pub const _SC_SS_REPL_MAX: u32 = 241; +pub const _SC_TRACE_EVENT_NAME_MAX: u32 = 242; +pub const _SC_TRACE_NAME_MAX: u32 = 243; +pub const _SC_TRACE_SYS_MAX: u32 = 244; +pub const _SC_TRACE_USER_EVENT_MAX: u32 = 245; +pub const _SC_XOPEN_STREAMS: u32 = 246; +pub const _SC_THREAD_ROBUST_PRIO_INHERIT: u32 = 247; +pub const _SC_THREAD_ROBUST_PRIO_PROTECT: u32 = 248; +pub type size_t = usize; +pub type ssize_t = isize; +pub type clockid_t = ::core::ffi::c_int; +pub type mode_t = ::core::ffi::c_uint; +pub type nlink_t = u32; +pub type off_t = i64; +pub type ino_t = u64; +pub type dev_t = u64; +pub type blksize_t = ::core::ffi::c_long; +pub type blkcnt_t = i64; +pub type uid_t = ::core::ffi::c_uint; +pub type gid_t = ::core::ffi::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct iovec { + pub iov_base: *mut ::core::ffi::c_void, + pub iov_len: size_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of iovec"][::core::mem::size_of::() - 16usize]; + ["Alignment of iovec"][::core::mem::align_of::() - 8usize]; + ["Offset of field: iovec::iov_base"][::core::mem::offset_of!(iovec, iov_base) - 0usize]; + ["Offset of field: iovec::iov_len"][::core::mem::offset_of!(iovec, iov_len) - 8usize]; +}; +impl Default for iovec { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type socklen_t = ::core::ffi::c_uint; +pub type sa_family_t = ::core::ffi::c_ushort; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct sockaddr { + pub sa_family: sa_family_t, + pub sa_data: [::core::ffi::c_char; 14usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sockaddr"][::core::mem::size_of::() - 16usize]; + ["Alignment of sockaddr"][::core::mem::align_of::() - 2usize]; + ["Offset of field: sockaddr::sa_family"][::core::mem::offset_of!(sockaddr, sa_family) - 0usize]; + ["Offset of field: sockaddr::sa_data"][::core::mem::offset_of!(sockaddr, sa_data) - 2usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_storage { + pub ss_family: sa_family_t, + pub __ss_padding: [::core::ffi::c_char; 118usize], + pub __ss_align: ::core::ffi::c_ulong, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sockaddr_storage"][::core::mem::size_of::() - 128usize]; + ["Alignment of sockaddr_storage"][::core::mem::align_of::() - 8usize]; + ["Offset of field: sockaddr_storage::ss_family"] + [::core::mem::offset_of!(sockaddr_storage, ss_family) - 0usize]; + ["Offset of field: sockaddr_storage::__ss_padding"] + [::core::mem::offset_of!(sockaddr_storage, __ss_padding) - 2usize]; + ["Offset of field: sockaddr_storage::__ss_align"] + [::core::mem::offset_of!(sockaddr_storage, __ss_align) - 120usize]; +}; +impl Default for sockaddr_storage { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type in_port_t = u16; +pub type in_addr_t = u32; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct in_addr { + pub s_addr: in_addr_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of in_addr"][::core::mem::size_of::() - 4usize]; + ["Alignment of in_addr"][::core::mem::align_of::() - 4usize]; + ["Offset of field: in_addr::s_addr"][::core::mem::offset_of!(in_addr, s_addr) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct sockaddr_in { + pub sin_family: sa_family_t, + pub sin_port: in_port_t, + pub sin_addr: in_addr, + pub sin_zero: [u8; 8usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sockaddr_in"][::core::mem::size_of::() - 16usize]; + ["Alignment of sockaddr_in"][::core::mem::align_of::() - 4usize]; + ["Offset of field: sockaddr_in::sin_family"] + [::core::mem::offset_of!(sockaddr_in, sin_family) - 0usize]; + ["Offset of field: sockaddr_in::sin_port"] + [::core::mem::offset_of!(sockaddr_in, sin_port) - 2usize]; + ["Offset of field: sockaddr_in::sin_addr"] + [::core::mem::offset_of!(sockaddr_in, sin_addr) - 4usize]; + ["Offset of field: sockaddr_in::sin_zero"] + [::core::mem::offset_of!(sockaddr_in, sin_zero) - 8usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct in6_addr { + pub __in6_union: in6_addr__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union in6_addr__bindgen_ty_1 { + pub __s6_addr: [u8; 16usize], + pub __s6_addr16: [u16; 8usize], + pub __s6_addr32: [u32; 4usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of in6_addr__bindgen_ty_1"][::core::mem::size_of::() - 16usize]; + ["Alignment of in6_addr__bindgen_ty_1"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: in6_addr__bindgen_ty_1::__s6_addr"] + [::core::mem::offset_of!(in6_addr__bindgen_ty_1, __s6_addr) - 0usize]; + ["Offset of field: in6_addr__bindgen_ty_1::__s6_addr16"] + [::core::mem::offset_of!(in6_addr__bindgen_ty_1, __s6_addr16) - 0usize]; + ["Offset of field: in6_addr__bindgen_ty_1::__s6_addr32"] + [::core::mem::offset_of!(in6_addr__bindgen_ty_1, __s6_addr32) - 0usize]; +}; +impl Default for in6_addr__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of in6_addr"][::core::mem::size_of::() - 16usize]; + ["Alignment of in6_addr"][::core::mem::align_of::() - 4usize]; + ["Offset of field: in6_addr::__in6_union"] + [::core::mem::offset_of!(in6_addr, __in6_union) - 0usize]; +}; +impl Default for in6_addr { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct sockaddr_in6 { + pub sin6_family: sa_family_t, + pub sin6_port: in_port_t, + pub sin6_flowinfo: u32, + pub sin6_addr: in6_addr, + pub sin6_scope_id: u32, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sockaddr_in6"][::core::mem::size_of::() - 28usize]; + ["Alignment of sockaddr_in6"][::core::mem::align_of::() - 4usize]; + ["Offset of field: sockaddr_in6::sin6_family"] + [::core::mem::offset_of!(sockaddr_in6, sin6_family) - 0usize]; + ["Offset of field: sockaddr_in6::sin6_port"] + [::core::mem::offset_of!(sockaddr_in6, sin6_port) - 2usize]; + ["Offset of field: sockaddr_in6::sin6_flowinfo"] + [::core::mem::offset_of!(sockaddr_in6, sin6_flowinfo) - 4usize]; + ["Offset of field: sockaddr_in6::sin6_addr"] + [::core::mem::offset_of!(sockaddr_in6, sin6_addr) - 8usize]; + ["Offset of field: sockaddr_in6::sin6_scope_id"] + [::core::mem::offset_of!(sockaddr_in6, sin6_scope_id) - 24usize]; +}; +impl Default for sockaddr_in6 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct addrinfo { + pub ai_flags: ::core::ffi::c_int, + pub ai_family: ::core::ffi::c_int, + pub ai_socktype: ::core::ffi::c_int, + pub ai_protocol: ::core::ffi::c_int, + pub ai_addrlen: socklen_t, + pub ai_addr: *mut sockaddr, + pub ai_canonname: *mut ::core::ffi::c_char, + pub ai_next: *mut addrinfo, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of addrinfo"][::core::mem::size_of::() - 48usize]; + ["Alignment of addrinfo"][::core::mem::align_of::() - 8usize]; + ["Offset of field: addrinfo::ai_flags"][::core::mem::offset_of!(addrinfo, ai_flags) - 0usize]; + ["Offset of field: addrinfo::ai_family"][::core::mem::offset_of!(addrinfo, ai_family) - 4usize]; + ["Offset of field: addrinfo::ai_socktype"] + [::core::mem::offset_of!(addrinfo, ai_socktype) - 8usize]; + ["Offset of field: addrinfo::ai_protocol"] + [::core::mem::offset_of!(addrinfo, ai_protocol) - 12usize]; + ["Offset of field: addrinfo::ai_addrlen"] + [::core::mem::offset_of!(addrinfo, ai_addrlen) - 16usize]; + ["Offset of field: addrinfo::ai_addr"][::core::mem::offset_of!(addrinfo, ai_addr) - 24usize]; + ["Offset of field: addrinfo::ai_canonname"] + [::core::mem::offset_of!(addrinfo, ai_canonname) - 32usize]; + ["Offset of field: addrinfo::ai_next"][::core::mem::offset_of!(addrinfo, ai_next) - 40usize]; +}; +impl Default for addrinfo { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct aibuf { + pub ai: addrinfo, + pub sa: aibuf_sa, + pub lock: [::core::ffi::c_int; 1usize], + pub slot: ::core::ffi::c_short, + pub ref_: ::core::ffi::c_short, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union aibuf_sa { + pub sin: sockaddr_in, + pub sin6: sockaddr_in6, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of aibuf_sa"][::core::mem::size_of::() - 28usize]; + ["Alignment of aibuf_sa"][::core::mem::align_of::() - 4usize]; + ["Offset of field: aibuf_sa::sin"][::core::mem::offset_of!(aibuf_sa, sin) - 0usize]; + ["Offset of field: aibuf_sa::sin6"][::core::mem::offset_of!(aibuf_sa, sin6) - 0usize]; +}; +impl Default for aibuf_sa { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of aibuf"][::core::mem::size_of::() - 88usize]; + ["Alignment of aibuf"][::core::mem::align_of::() - 8usize]; + ["Offset of field: aibuf::ai"][::core::mem::offset_of!(aibuf, ai) - 0usize]; + ["Offset of field: aibuf::sa"][::core::mem::offset_of!(aibuf, sa) - 48usize]; + ["Offset of field: aibuf::lock"][::core::mem::offset_of!(aibuf, lock) - 76usize]; + ["Offset of field: aibuf::slot"][::core::mem::offset_of!(aibuf, slot) - 80usize]; + ["Offset of field: aibuf::ref_"][::core::mem::offset_of!(aibuf, ref_) - 82usize]; +}; +impl Default for aibuf { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type time_t = ::core::ffi::c_longlong; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct timeval { + pub tv_sec: time_t, + pub tv_usec: ::core::ffi::c_long, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timeval"][::core::mem::size_of::() - 16usize]; + ["Alignment of timeval"][::core::mem::align_of::() - 8usize]; + ["Offset of field: timeval::tv_sec"][::core::mem::offset_of!(timeval, tv_sec) - 0usize]; + ["Offset of field: timeval::tv_usec"][::core::mem::offset_of!(timeval, tv_usec) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct timespec { + pub tv_sec: time_t, + pub tv_nsec: ::core::ffi::c_long, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timespec"][::core::mem::size_of::() - 16usize]; + ["Alignment of timespec"][::core::mem::align_of::() - 8usize]; + ["Offset of field: timespec::tv_sec"][::core::mem::offset_of!(timespec, tv_sec) - 0usize]; + ["Offset of field: timespec::tv_nsec"][::core::mem::offset_of!(timespec, tv_nsec) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct pthread_mutex_t { + pub __l: [::core::ffi::c_long; 1usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of pthread_mutex_t"][::core::mem::size_of::() - 8usize]; + ["Alignment of pthread_mutex_t"][::core::mem::align_of::() - 8usize]; + ["Offset of field: pthread_mutex_t::__l"] + [::core::mem::offset_of!(pthread_mutex_t, __l) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct pthread_mutexattr_t { + pub __attr: ::core::ffi::c_uint, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of pthread_mutexattr_t"][::core::mem::size_of::() - 4usize]; + ["Alignment of pthread_mutexattr_t"][::core::mem::align_of::() - 4usize]; + ["Offset of field: pthread_mutexattr_t::__attr"] + [::core::mem::offset_of!(pthread_mutexattr_t, __attr) - 0usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pthread_attr_t { + pub __u: pthread_attr_t__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_attr_t__bindgen_ty_1 { + pub __i: [::core::ffi::c_int; 14usize], + pub __vi: [::core::ffi::c_int; 14usize], + pub __s: [::core::ffi::c_ulong; 7usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of pthread_attr_t__bindgen_ty_1"] + [::core::mem::size_of::() - 56usize]; + ["Alignment of pthread_attr_t__bindgen_ty_1"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: pthread_attr_t__bindgen_ty_1::__i"] + [::core::mem::offset_of!(pthread_attr_t__bindgen_ty_1, __i) - 0usize]; + ["Offset of field: pthread_attr_t__bindgen_ty_1::__vi"] + [::core::mem::offset_of!(pthread_attr_t__bindgen_ty_1, __vi) - 0usize]; + ["Offset of field: pthread_attr_t__bindgen_ty_1::__s"] + [::core::mem::offset_of!(pthread_attr_t__bindgen_ty_1, __s) - 0usize]; +}; +impl Default for pthread_attr_t__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of pthread_attr_t"][::core::mem::size_of::() - 56usize]; + ["Alignment of pthread_attr_t"][::core::mem::align_of::() - 8usize]; + ["Offset of field: pthread_attr_t::__u"][::core::mem::offset_of!(pthread_attr_t, __u) - 0usize]; +}; +impl Default for pthread_attr_t { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type pthread_t = *mut ::core::ffi::c_void; +#[repr(C)] +#[derive(Copy, Clone)] +pub union epoll_data { + pub ptr: *mut ::core::ffi::c_void, + pub fd: ::core::ffi::c_int, + pub u32_: u32, + pub u64_: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of epoll_data"][::core::mem::size_of::() - 8usize]; + ["Alignment of epoll_data"][::core::mem::align_of::() - 8usize]; + ["Offset of field: epoll_data::ptr"][::core::mem::offset_of!(epoll_data, ptr) - 0usize]; + ["Offset of field: epoll_data::fd"][::core::mem::offset_of!(epoll_data, fd) - 0usize]; + ["Offset of field: epoll_data::u32_"][::core::mem::offset_of!(epoll_data, u32_) - 0usize]; + ["Offset of field: epoll_data::u64_"][::core::mem::offset_of!(epoll_data, u64_) - 0usize]; +}; +impl Default for epoll_data { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type epoll_data_t = epoll_data; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct epoll_event { + pub events: u32, + pub data: epoll_data_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of epoll_event"][::core::mem::size_of::() - 16usize]; + ["Alignment of epoll_event"][::core::mem::align_of::() - 8usize]; + ["Offset of field: epoll_event::events"][::core::mem::offset_of!(epoll_event, events) - 0usize]; + ["Offset of field: epoll_event::data"][::core::mem::offset_of!(epoll_event, data) - 8usize]; +}; +impl Default for epoll_event { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type rlim_t = ::core::ffi::c_ulonglong; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct rlimit { + pub rlim_cur: rlim_t, + pub rlim_max: rlim_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of rlimit"][::core::mem::size_of::() - 16usize]; + ["Alignment of rlimit"][::core::mem::align_of::() - 8usize]; + ["Offset of field: rlimit::rlim_cur"][::core::mem::offset_of!(rlimit, rlim_cur) - 0usize]; + ["Offset of field: rlimit::rlim_max"][::core::mem::offset_of!(rlimit, rlim_max) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct fd_set { + pub fds_bits: [::core::ffi::c_ulong; 16usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of fd_set"][::core::mem::size_of::() - 128usize]; + ["Alignment of fd_set"][::core::mem::align_of::() - 8usize]; + ["Offset of field: fd_set::fds_bits"][::core::mem::offset_of!(fd_set, fds_bits) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct stat { + pub st_dev: dev_t, + pub st_ino: ino_t, + pub st_mode: mode_t, + pub st_nlink: nlink_t, + pub st_uid: uid_t, + pub st_gid: gid_t, + pub st_rdev: dev_t, + pub st_size: off_t, + pub st_blksize: blksize_t, + pub st_blocks: blkcnt_t, + pub st_atime: timespec, + pub st_mtime: timespec, + pub st_ctime: timespec, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of stat"][::core::mem::size_of::() - 112usize]; + ["Alignment of stat"][::core::mem::align_of::() - 8usize]; + ["Offset of field: stat::st_dev"][::core::mem::offset_of!(stat, st_dev) - 0usize]; + ["Offset of field: stat::st_ino"][::core::mem::offset_of!(stat, st_ino) - 8usize]; + ["Offset of field: stat::st_mode"][::core::mem::offset_of!(stat, st_mode) - 16usize]; + ["Offset of field: stat::st_nlink"][::core::mem::offset_of!(stat, st_nlink) - 20usize]; + ["Offset of field: stat::st_uid"][::core::mem::offset_of!(stat, st_uid) - 24usize]; + ["Offset of field: stat::st_gid"][::core::mem::offset_of!(stat, st_gid) - 28usize]; + ["Offset of field: stat::st_rdev"][::core::mem::offset_of!(stat, st_rdev) - 32usize]; + ["Offset of field: stat::st_size"][::core::mem::offset_of!(stat, st_size) - 40usize]; + ["Offset of field: stat::st_blksize"][::core::mem::offset_of!(stat, st_blksize) - 48usize]; + ["Offset of field: stat::st_blocks"][::core::mem::offset_of!(stat, st_blocks) - 56usize]; + ["Offset of field: stat::st_atime"][::core::mem::offset_of!(stat, st_atime) - 64usize]; + ["Offset of field: stat::st_mtime"][::core::mem::offset_of!(stat, st_mtime) - 80usize]; + ["Offset of field: stat::st_ctime"][::core::mem::offset_of!(stat, st_ctime) - 96usize]; +}; diff --git a/api/arceos_posix_api/src/imp/stdio.rs b/api/arceos_posix_api/src/imp/stdio.rs index 4087004f00..54a57c29f4 100644 --- a/api/arceos_posix_api/src/imp/stdio.rs +++ b/api/arceos_posix_api/src/imp/stdio.rs @@ -92,8 +92,10 @@ impl Write for Stdout { /// Constructs a new handle to the standard input of the current process. pub fn stdin() -> Stdin { - static INSTANCE: Mutex> = Mutex::new(BufReader::new(StdinRaw)); - Stdin { inner: &INSTANCE } + static INSTANCE: spin::Once>> = spin::Once::new(); + Stdin { + inner: INSTANCE.call_once(|| Mutex::new(BufReader::new(StdinRaw))), + } } /// Constructs a new handle to the standard output of the current process. diff --git a/examples/helloworld/Cargo.toml b/examples/helloworld/Cargo.toml index 31806aa9bb..e203134a51 100644 --- a/examples/helloworld/Cargo.toml +++ b/examples/helloworld/Cargo.toml @@ -3,8 +3,12 @@ name = "arceos-helloworld" version = "0.1.0" edition.workspace = true authors = ["Yuekai Jia "] - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +description = "A simple helloworld example for ArceOS" +license.workspace = true +homepage.workspace = true +repository = "https://github.com/arceos-org/arceos/tree/main/examples/helloworld" +keywords = ["arceos", "example"] +categories = ["os", "no-std"] [dependencies] axstd = { workspace = true, optional = true } diff --git a/ulib/axlibc/build.rs b/ulib/axlibc/build.rs index d8d7ce0dbe..e210ed9b20 100644 --- a/ulib/axlibc/build.rs +++ b/ulib/axlibc/build.rs @@ -25,5 +25,7 @@ fn main() { .expect("Couldn't write bindings!"); } - gen_c_to_rust_bindings("ctypes.h", "src/libctypes_gen.rs"); + let out_dir = std::env::var("OUT_DIR").unwrap(); + let out_path = format!("{out_dir}/libctypes_gen.rs"); + gen_c_to_rust_bindings("ctypes.h", &out_path); } diff --git a/ulib/axlibc/src/lib.rs b/ulib/axlibc/src/lib.rs index c271da4a88..a3c7123c9c 100644 --- a/ulib/axlibc/src/lib.rs +++ b/ulib/axlibc/src/lib.rs @@ -33,12 +33,12 @@ #[cfg(feature = "alloc")] extern crate alloc; -#[path = "."] mod ctypes { #[rustfmt::skip] - #[path = "libctypes_gen.rs"] #[allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals, clippy::upper_case_acronyms)] - mod libctypes; + mod libctypes { + include!(concat!(env!("OUT_DIR"), "/libctypes_gen.rs")); + } pub use arceos_posix_api::ctypes::*; pub use libctypes::*; From 4e55e176ca7ebd2429f8f3632a30a20323697817 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Fri, 6 Feb 2026 23:25:43 +0800 Subject: [PATCH 21/23] =?UTF-8?q?Chore:=20cargo=20publish=20axhal=20v0.2.2?= =?UTF-8?q?-preview.4,=20=20axruntime=20v0.2.2-preview.2=20=3D=3D=3D=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20arceos/modules/axhal/Cargo.tom?= =?UTF-8?q?l=20=E2=80=94=20version=200.2.2-preview.4,=20tighten=20the=20ax?= =?UTF-8?q?plat/axcpu/platform=20crate=20dependencies=20arceos/modules/axh?= =?UTF-8?q?al/src/dummy.rs=20=E2=80=94=20Aligns=20the=20axplat=20v0.3.0-pr?= =?UTF-8?q?eview.2=20API=20(adding=20kernel=5Faspace=20and=20removing=20cp?= =?UTF-8?q?u=5Fnum)=20arceos/modules/axruntime/Cargo.toml=20=E2=80=94=20ve?= =?UTF-8?q?rsion=200.2.2-preview.2,=20tighten=20the=20axplat=20dependency?= =?UTF-8?q?=20arceos/Cargo.toml=20=E2=80=94=20change=20patches=20to=20loca?= =?UTF-8?q?l=20paths=20and=20update=20version=20numbers=20Verification=20r?= =?UTF-8?q?esult:=20make=20A=3Dexamples/helloworld=20ARCH=3Driscv64=20LOG?= =?UTF-8?q?=3Dinfo=20run=20=E2=80=94=20succeeded=20cargo=20run--release=20?= =?UTF-8?q?(no=20git=20patches)=20=E2=80=94=20succeeded=20in=20the=20app-h?= =?UTF-8?q?elloworld=20directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 206 ++++++++++++++++++++++++++++------- Cargo.toml | 18 +-- modules/axhal/Cargo.toml | 14 +-- modules/axhal/src/dummy.rs | 8 +- modules/axruntime/Cargo.toml | 4 +- 5 files changed, 189 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e589fccaee..1ff097483f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,11 +128,11 @@ version = "0.1.0" dependencies = [ "axplat-aarch64-bsta1000b", "axplat-aarch64-phytium-pi", - "axplat-aarch64-qemu-virt", + "axplat-aarch64-qemu-virt 0.3.0", "axplat-aarch64-raspi", - "axplat-loongarch64-qemu-virt", - "axplat-riscv64-qemu-virt", - "axplat-x86-pc", + "axplat-loongarch64-qemu-virt 0.3.0", + "axplat-riscv64-qemu-virt 0.3.0", + "axplat-x86-pc 0.3.0", "axstd", "cfg-if", ] @@ -358,6 +358,28 @@ dependencies = [ "syn 2.0.114", ] +[[package]] +name = "axcpu" +version = "0.3.0-preview.2" +dependencies = [ + "aarch64-cpu 10.0.0", + "axbacktrace", + "cfg-if", + "lazyinit", + "linkme", + "log", + "loongArch64", + "memory_addr", + "page_table_entry", + "page_table_multiarch", + "percpu", + "riscv", + "static_assertions", + "tock-registers 0.9.0", + "x86", + "x86_64", +] + [[package]] name = "axcpu" version = "0.3.0" @@ -610,16 +632,16 @@ dependencies = [ [[package]] name = "axhal" -version = "0.2.2-preview.3" +version = "0.2.2-preview.4" dependencies = [ "axalloc", "axconfig", - "axcpu", - "axplat", - "axplat-aarch64-qemu-virt", - "axplat-loongarch64-qemu-virt", - "axplat-riscv64-qemu-virt", - "axplat-x86-pc", + "axcpu 0.3.0-preview.2", + "axplat 0.3.0-preview.2", + "axplat-aarch64-qemu-virt 0.3.0-preview.2", + "axplat-loongarch64-qemu-virt 0.3.0-preview.2", + "axplat-riscv64-qemu-virt 0.3.0-preview.2", + "axplat-x86-pc 0.3.0-preview.2", "cfg-if", "fdt-parser", "heapless 0.9.2", @@ -750,12 +772,26 @@ dependencies = [ "starry-smoltcp", ] +[[package]] +name = "axplat" +version = "0.3.0-preview.2" +dependencies = [ + "axplat-macros 0.1.0", + "bitflags 2.10.0", + "const-str", + "crate_interface", + "handler_table", + "kspin", + "memory_addr", + "percpu", +] + [[package]] name = "axplat" version = "0.3.0" source = "git+https://github.com/arceos-org/axplat_crates.git?tag=dev-v03#0df0713b1c20eafaeebdc6b0e194b2985e857949" dependencies = [ - "axplat-macros", + "axplat-macros 0.1.0 (git+https://github.com/arceos-org/axplat_crates.git?tag=dev-v03)", "bitflags 2.10.0", "const-str", "crate_interface", @@ -771,15 +807,33 @@ version = "0.3.0" source = "git+https://github.com/arceos-org/axplat_crates.git?tag=dev-v03#0df0713b1c20eafaeebdc6b0e194b2985e857949" dependencies = [ "axconfig-macros", - "axcpu", - "axplat", - "axplat-aarch64-peripherals", + "axcpu 0.3.0", + "axplat 0.3.0", + "axplat-aarch64-peripherals 0.3.0", "dw_apb_uart", "kspin", "log", "page_table_entry", ] +[[package]] +name = "axplat-aarch64-peripherals" +version = "0.3.0-preview.2" +dependencies = [ + "aarch64-cpu 10.0.0", + "arm-gic-driver", + "arm_pl011", + "arm_pl031", + "axcpu 0.3.0-preview.2", + "axplat 0.3.0-preview.2", + "int_ratio", + "kspin", + "lazyinit", + "log", + "page_table_entry", + "spin 0.10.0", +] + [[package]] name = "axplat-aarch64-peripherals" version = "0.3.0" @@ -789,8 +843,8 @@ dependencies = [ "arm-gic-driver", "arm_pl011", "arm_pl031", - "axcpu", - "axplat", + "axcpu 0.3.0", + "axplat 0.3.0", "int_ratio", "kspin", "lazyinit", @@ -805,9 +859,21 @@ version = "0.3.0" source = "git+https://github.com/arceos-org/axplat_crates.git?tag=dev-v03#0df0713b1c20eafaeebdc6b0e194b2985e857949" dependencies = [ "axconfig-macros", - "axcpu", - "axplat", - "axplat-aarch64-peripherals", + "axcpu 0.3.0", + "axplat 0.3.0", + "axplat-aarch64-peripherals 0.3.0", + "log", + "page_table_entry", +] + +[[package]] +name = "axplat-aarch64-qemu-virt" +version = "0.3.0-preview.2" +dependencies = [ + "axconfig-macros", + "axcpu 0.3.0-preview.2", + "axplat 0.3.0-preview.2", + "axplat-aarch64-peripherals 0.3.0-preview.2", "log", "page_table_entry", ] @@ -818,9 +884,9 @@ version = "0.3.0" source = "git+https://github.com/arceos-org/axplat_crates.git?tag=dev-v03#0df0713b1c20eafaeebdc6b0e194b2985e857949" dependencies = [ "axconfig-macros", - "axcpu", - "axplat", - "axplat-aarch64-peripherals", + "axcpu 0.3.0", + "axplat 0.3.0", + "axplat-aarch64-peripherals 0.3.0", "log", "page_table_entry", ] @@ -832,22 +898,37 @@ source = "git+https://github.com/arceos-org/axplat_crates.git?tag=dev-v03#0df071 dependencies = [ "aarch64-cpu 10.0.0", "axconfig-macros", - "axcpu", - "axplat", - "axplat-aarch64-peripherals", + "axcpu 0.3.0", + "axplat 0.3.0", + "axplat-aarch64-peripherals 0.3.0", "log", "page_table_entry", ] +[[package]] +name = "axplat-loongarch64-qemu-virt" +version = "0.3.0-preview.2" +dependencies = [ + "axconfig-macros", + "axcpu 0.3.0-preview.2", + "axplat 0.3.0-preview.2", + "chrono", + "kspin", + "lazyinit", + "log", + "loongArch64", + "page_table_entry", + "uart_16550", +] + [[package]] name = "axplat-loongarch64-qemu-virt" version = "0.3.0" source = "git+https://github.com/arceos-org/axplat_crates.git?tag=dev-v03#0df0713b1c20eafaeebdc6b0e194b2985e857949" dependencies = [ "axconfig-macros", - "axcpu", - "axplat", - "chrono", + "axcpu 0.3.0", + "axplat 0.3.0", "kspin", "lazyinit", "log", @@ -856,6 +937,15 @@ dependencies = [ "uart_16550", ] +[[package]] +name = "axplat-macros" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.114", +] + [[package]] name = "axplat-macros" version = "0.1.0" @@ -866,32 +956,71 @@ dependencies = [ "syn 2.0.114", ] +[[package]] +name = "axplat-riscv64-qemu-virt" +version = "0.3.0-preview.2" +dependencies = [ + "axconfig-macros", + "axcpu 0.3.0-preview.2", + "axplat 0.3.0-preview.2", + "kspin", + "lazyinit", + "log", + "riscv", + "riscv_goldfish", + "riscv_plic", + "sbi-rt", + "uart_16550", +] + [[package]] name = "axplat-riscv64-qemu-virt" version = "0.3.0" source = "git+https://github.com/arceos-org/axplat_crates.git?tag=dev-v03#0df0713b1c20eafaeebdc6b0e194b2985e857949" dependencies = [ "axconfig-macros", - "axcpu", - "axplat", + "axcpu 0.3.0", + "axplat 0.3.0", "kspin", "lazyinit", "log", "riscv", - "riscv_goldfish", "riscv_plic", "sbi-rt", "uart_16550", ] +[[package]] +name = "axplat-x86-pc" +version = "0.3.0-preview.2" +dependencies = [ + "axconfig-macros", + "axcpu 0.3.0-preview.2", + "axplat 0.3.0-preview.2", + "bitflags 2.10.0", + "heapless 0.9.2", + "int_ratio", + "kspin", + "lazyinit", + "log", + "multiboot", + "percpu", + "raw-cpuid 11.6.0", + "uart_16550", + "x2apic", + "x86", + "x86_64", + "x86_rtc", +] + [[package]] name = "axplat-x86-pc" version = "0.3.0" source = "git+https://github.com/arceos-org/axplat_crates.git?tag=dev-v03#0df0713b1c20eafaeebdc6b0e194b2985e857949" dependencies = [ "axconfig-macros", - "axcpu", - "axplat", + "axcpu 0.3.0", + "axplat 0.3.0", "bitflags 2.10.0", "heapless 0.9.2", "int_ratio", @@ -905,7 +1034,6 @@ dependencies = [ "x2apic", "x86", "x86_64", - "x86_rtc", ] [[package]] @@ -921,7 +1049,7 @@ dependencies = [ [[package]] name = "axruntime" -version = "0.2.2-preview.1" +version = "0.2.2-preview.2" dependencies = [ "axalloc", "axbacktrace", @@ -936,7 +1064,7 @@ dependencies = [ "axlog", "axmm", "axnet", - "axplat", + "axplat 0.3.0-preview.2", "axtask", "chrono", "crate_interface", @@ -2102,9 +2230,9 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "page_table_entry" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda9891ec368fda90e4b2cc36592b4881073e25a339fe7e3eddd811f0cf6bf18" +checksum = "3af51afffbce2ea801b0830b29fcea77068e821521f13c5e3e4734585abcc061" dependencies = [ "aarch64-cpu 10.0.0", "bitflags 2.10.0", diff --git a/Cargo.toml b/Cargo.toml index 11cd9a2d38..f9c69f0094 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,13 +57,13 @@ axdisplay = { version = "0.2.2-preview.1", path = "modules/axdisplay" } axdma = { version = "0.2.2-preview.1", path = "modules/axdma" } axdriver = { version = "0.2.2-preview.1", path = "modules/axdriver" } axfs = { version = "0.2.2-preview.1", path = "modules/axfs" } -axhal = { version = "0.2.2-preview.3", path = "modules/axhal" } +axhal = { version = "0.2.2-preview.4", path = "modules/axhal" } axinput = { version = "0.2.2-preview.1", path = "modules/axinput" } axipi = { version = "0.2.2-preview.2", path = "modules/axipi" } axlog = { version = "0.2.2-preview.1", path = "modules/axlog" } axmm = { version = "0.2.2-preview.1", path = "modules/axmm" } axnet = { version = "0.2.2-preview.1", path = "modules/axnet" } -axruntime = { version = "0.2.2-preview.1", path = "modules/axruntime" } +axruntime = { version = "0.2.2-preview.2", path = "modules/axruntime" } axsync = { version = "0.2.2-preview.1", path = "modules/axsync" } axtask = { version = "0.2.2-preview.3", path = "modules/axtask" } @@ -83,7 +83,7 @@ axerrno = "0.2" axfs-ng-vfs = "0.1" axio = "0.3.0-pre.1" axklib = { git = "https://github.com/arceos-hypervisor/axklib.git" } # FIXME: pin to a specific commit or tag -axplat = "0.3" +axplat = ">=0.3.0-preview.2, <0.3.0" axplat-aarch64-bsta1000b = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } axplat-aarch64-phytium-pi = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } axplat-aarch64-qemu-virt = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } @@ -122,10 +122,10 @@ axhal = { path = "modules/axhal" } axtask = { path = "modules/axtask" } axsync = { path = "modules/axsync" } axipi = { path = "modules/axipi" } -axcpu = { git = "https://github.com/arceos-org/axcpu.git", tag = "dev-v03" } -axplat = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } -axplat-x86-pc = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } -axplat-aarch64-qemu-virt = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } -axplat-riscv64-qemu-virt = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } -axplat-loongarch64-qemu-virt = { git = "https://github.com/arceos-org/axplat_crates.git", tag = "dev-v03" } +axcpu = { path = "../axcpu" } +axplat = { path = "../axplat_crates/axplat" } +axplat-x86-pc = { path = "../axplat_crates/platforms/axplat-x86-pc" } +axplat-aarch64-qemu-virt = { path = "../axplat_crates/platforms/axplat-aarch64-qemu-virt" } +axplat-riscv64-qemu-virt = { path = "../axplat_crates/platforms/axplat-riscv64-qemu-virt" } +axplat-loongarch64-qemu-virt = { path = "../axplat_crates/platforms/axplat-loongarch64-qemu-virt" } page_table_multiarch = { git = "https://github.com/arceos-org/page_table_multiarch.git", tag = "dev-v05" } diff --git a/modules/axhal/Cargo.toml b/modules/axhal/Cargo.toml index f01bb7155a..83d11ba07e 100644 --- a/modules/axhal/Cargo.toml +++ b/modules/axhal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axhal" -version = "0.2.2-preview.3" +version = "0.2.2-preview.4" edition.workspace = true authors = ["Yuekai Jia "] description = "ArceOS hardware abstraction layer, provides unified APIs for platform-specific operations" @@ -58,8 +58,8 @@ ipi = ["irq"] [dependencies] axalloc = { version = "0.2.2-preview.1", optional = true } axconfig = { version = "0.2.2-preview.1" } -axcpu = { version = "0.3.0-alpha.0" } -axplat = { version = "0.3" } +axcpu = { version = "0.3.0-preview.2" } +axplat = { version = ">=0.3.0-preview.2, <0.3.0" } cfg-if.workspace = true heapless = "0.9" kernel_guard.workspace = true @@ -72,16 +72,16 @@ percpu.workspace = true fdt-parser = "0.4" [target.'cfg(target_arch = "x86_64")'.dependencies] -axplat-x86-pc = { version = "0.3", optional = true } +axplat-x86-pc = { version = ">=0.3.0-preview.2, <0.3.0", optional = true } [target.'cfg(target_arch = "aarch64")'.dependencies] -axplat-aarch64-qemu-virt = { version = "0.3", optional = true } +axplat-aarch64-qemu-virt = { version = ">=0.3.0-preview.2, <0.3.0", optional = true } [target.'cfg(target_arch = "riscv64")'.dependencies] -axplat-riscv64-qemu-virt = { version = "0.3", optional = true } +axplat-riscv64-qemu-virt = { version = ">=0.3.0-preview.2, <0.3.0", optional = true } [target.'cfg(target_arch = "loongarch64")'.dependencies] -axplat-loongarch64-qemu-virt = { version = "0.3", optional = true } +axplat-loongarch64-qemu-virt = { version = ">=0.3.0-preview.2, <0.3.0", optional = true } [build-dependencies] axconfig = { version = "0.2.2-preview.1" } diff --git a/modules/axhal/src/dummy.rs b/modules/axhal/src/dummy.rs index dcfeb30d2b..ae9e31f716 100644 --- a/modules/axhal/src/dummy.rs +++ b/modules/axhal/src/dummy.rs @@ -64,6 +64,10 @@ impl MemIf for DummyMem { fn virt_to_phys(_vaddr: memory_addr::VirtAddr) -> memory_addr::PhysAddr { pa!(0) } + + fn kernel_aspace() -> (memory_addr::VirtAddr, usize) { + (va!(0), 0) + } } #[impl_plat_interface] @@ -96,10 +100,6 @@ impl PowerIf for DummyPower { fn system_off() -> ! { unimplemented!() } - - fn cpu_num() -> usize { - 1 - } } #[cfg(feature = "irq")] diff --git a/modules/axruntime/Cargo.toml b/modules/axruntime/Cargo.toml index b0efcb6ebf..4a1ed17a43 100644 --- a/modules/axruntime/Cargo.toml +++ b/modules/axruntime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axruntime" -version.workspace = true +version = "0.2.2-preview.2" edition.workspace = true authors = ["Yuekai Jia "] description = "Runtime library of ArceOS" @@ -43,7 +43,7 @@ axipi = { workspace = true, optional = true } axlog.workspace = true axmm = { workspace = true, optional = true } axnet = { workspace = true, optional = true } -axplat = { workspace = true } +axplat = { version = ">=0.3.0-preview.2, <0.3.0" } axtask = { workspace = true, optional = true } chrono.workspace = true crate_interface.workspace = true From 025b7fa36f411fc26e2669962b3110d9ec17b987 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Sun, 8 Feb 2026 23:08:08 +0800 Subject: [PATCH 22/23] pub mod dyn_drivers/klib for axrutime impl IoMapIf trait --- modules/axdriver/Cargo.toml | 2 +- modules/axdriver/src/dyn_drivers/mod.rs | 6 +++--- modules/axdriver/src/lib.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/axdriver/Cargo.toml b/modules/axdriver/Cargo.toml index 10bb014599..1621fef304 100644 --- a/modules/axdriver/Cargo.toml +++ b/modules/axdriver/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axdriver" -version.workspace = true +version = "0.2.2-preview.2" edition.workspace = true authors = [ "Yuekai Jia ", diff --git a/modules/axdriver/src/dyn_drivers/mod.rs b/modules/axdriver/src/dyn_drivers/mod.rs index f7f5301f1d..71bc2925e3 100644 --- a/modules/axdriver/src/dyn_drivers/mod.rs +++ b/modules/axdriver/src/dyn_drivers/mod.rs @@ -1,7 +1,7 @@ use core::{ops::Deref, ptr::NonNull}; use alloc::vec::Vec; -use axerrno::AxError; +use axerrno::AxErrorKind; use axhal::mem::{PhysAddr, phys_to_virt}; use rdrive::{ DeviceId, IrqConfig, @@ -11,7 +11,7 @@ use rdrive::{ mod cache; mod intc; -mod klib; +pub mod klib; mod pci; #[cfg(feature = "block")] @@ -37,7 +37,7 @@ pub fn setup(dtb: usize) { fn iomap(addr: PhysAddr, size: usize) -> Result, OnProbeError> { axklib::mem::iomap(addr, size) .map_err(|e| match e { - AxError::NoMemory => OnProbeError::KError(rdrive::KError::NoMem), + AxErrorKind::NoMemory => OnProbeError::KError(rdrive::KError::NoMem), _ => OnProbeError::Other(alloc::format!("{e:?}").into()), }) .map(|v| unsafe { NonNull::new_unchecked(v.as_mut_ptr()) }) diff --git a/modules/axdriver/src/lib.rs b/modules/axdriver/src/lib.rs index d7383e6e3f..98244d51f9 100644 --- a/modules/axdriver/src/lib.rs +++ b/modules/axdriver/src/lib.rs @@ -80,7 +80,7 @@ mod virtio; mod ixgbe; #[cfg(feature = "dyn")] -mod dyn_drivers; +pub mod dyn_drivers; #[cfg(feature = "dyn")] pub use dyn_drivers::setup; From 5a8093a7113b7e309fc605d0ddddfe23d623a444 Mon Sep 17 00:00:00 2001 From: chyyuu Date: Sun, 8 Feb 2026 23:13:51 +0800 Subject: [PATCH 23/23] fix: ConsoleIf/TimeIf, IrqIf:handle, PowerIf::cpu_boot, axhal/src/mem.rs --- Cargo.lock | 41 +++++++++++++++++++++++++++----------- Cargo.toml | 11 +++------- modules/axhal/Cargo.toml | 2 +- modules/axhal/src/dummy.rs | 14 ++++++++++++- modules/axhal/src/mem.rs | 3 --- 5 files changed, 46 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1ff097483f..7b0b5cded7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -360,7 +360,9 @@ dependencies = [ [[package]] name = "axcpu" -version = "0.3.0-preview.2" +version = "0.3.0-preview.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eeabf0939995cb9bcc17c8f7b49099eba7ce13fb811da1071186b584cad2656" dependencies = [ "aarch64-cpu 10.0.0", "axbacktrace", @@ -431,7 +433,7 @@ dependencies = [ [[package]] name = "axdriver" -version = "0.2.2-preview.1" +version = "0.2.2-preview.2" dependencies = [ "arm-gic-driver", "axalloc", @@ -632,11 +634,11 @@ dependencies = [ [[package]] name = "axhal" -version = "0.2.2-preview.4" +version = "0.2.2-preview.6" dependencies = [ "axalloc", "axconfig", - "axcpu 0.3.0-preview.2", + "axcpu 0.3.0-preview.3", "axplat 0.3.0-preview.2", "axplat-aarch64-qemu-virt 0.3.0-preview.2", "axplat-loongarch64-qemu-virt 0.3.0-preview.2", @@ -775,8 +777,10 @@ dependencies = [ [[package]] name = "axplat" version = "0.3.0-preview.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92cadeaefb5b95b1617dd76c0b3e1191b73dcc295f42aad7716636027cab6151" dependencies = [ - "axplat-macros 0.1.0", + "axplat-macros 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 2.10.0", "const-str", "crate_interface", @@ -819,12 +823,14 @@ dependencies = [ [[package]] name = "axplat-aarch64-peripherals" version = "0.3.0-preview.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0b6662596b170e4b4d8cb396af4ab8f133ea14fda055a207a149f437eea285f" dependencies = [ "aarch64-cpu 10.0.0", "arm-gic-driver", "arm_pl011", "arm_pl031", - "axcpu 0.3.0-preview.2", + "axcpu 0.3.0-preview.3", "axplat 0.3.0-preview.2", "int_ratio", "kspin", @@ -869,9 +875,11 @@ dependencies = [ [[package]] name = "axplat-aarch64-qemu-virt" version = "0.3.0-preview.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a846bef67308540f97d01ff64e13c0fbba111cb19a2ed9cc5055477ec021bf9" dependencies = [ "axconfig-macros", - "axcpu 0.3.0-preview.2", + "axcpu 0.3.0-preview.3", "axplat 0.3.0-preview.2", "axplat-aarch64-peripherals 0.3.0-preview.2", "log", @@ -908,9 +916,11 @@ dependencies = [ [[package]] name = "axplat-loongarch64-qemu-virt" version = "0.3.0-preview.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6950cea16d394b76a2d0c6970be4a631ef4bb30db6fbe4994e488fbc9f5ab2f" dependencies = [ "axconfig-macros", - "axcpu 0.3.0-preview.2", + "axcpu 0.3.0-preview.3", "axplat 0.3.0-preview.2", "chrono", "kspin", @@ -940,6 +950,8 @@ dependencies = [ [[package]] name = "axplat-macros" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90dfaee06a112fe4f810c60af1a86bc080af2172185b491cacc307b84dff748" dependencies = [ "proc-macro2", "quote", @@ -959,9 +971,11 @@ dependencies = [ [[package]] name = "axplat-riscv64-qemu-virt" version = "0.3.0-preview.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f0ee11922a369bd9c3c4b555cc27d5a969aad1ef1f1ea63af82c80bdbd17c5" dependencies = [ "axconfig-macros", - "axcpu 0.3.0-preview.2", + "axcpu 0.3.0-preview.3", "axplat 0.3.0-preview.2", "kspin", "lazyinit", @@ -993,9 +1007,11 @@ dependencies = [ [[package]] name = "axplat-x86-pc" version = "0.3.0-preview.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbe66f46c561de269466a386b2b844a0ff05b51b1844c808a3eacb3ca90fe16" dependencies = [ "axconfig-macros", - "axcpu 0.3.0-preview.2", + "axcpu 0.3.0-preview.3", "axplat 0.3.0-preview.2", "bitflags 2.10.0", "heapless 0.9.2", @@ -2242,8 +2258,9 @@ dependencies = [ [[package]] name = "page_table_multiarch" -version = "0.5.7" -source = "git+https://github.com/arceos-org/page_table_multiarch.git?tag=dev-v05#4594a765e361bca2a8b6ef6773a37ae6d8539840" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a012c0bb9b8b0c4887d0b90f37cf8164537b69bb5560ecdcf4ada0c3b64e3976" dependencies = [ "arrayvec", "axerrno 0.1.2", diff --git a/Cargo.toml b/Cargo.toml index f9c69f0094..3d6cb5554e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,7 +57,7 @@ axdisplay = { version = "0.2.2-preview.1", path = "modules/axdisplay" } axdma = { version = "0.2.2-preview.1", path = "modules/axdma" } axdriver = { version = "0.2.2-preview.1", path = "modules/axdriver" } axfs = { version = "0.2.2-preview.1", path = "modules/axfs" } -axhal = { version = "0.2.2-preview.4", path = "modules/axhal" } +axhal = { version = "0.2.2-preview.6", path = "modules/axhal" } axinput = { version = "0.2.2-preview.1", path = "modules/axinput" } axipi = { version = "0.2.2-preview.2", path = "modules/axipi" } axlog = { version = "0.2.2-preview.1", path = "modules/axlog" } @@ -122,10 +122,5 @@ axhal = { path = "modules/axhal" } axtask = { path = "modules/axtask" } axsync = { path = "modules/axsync" } axipi = { path = "modules/axipi" } -axcpu = { path = "../axcpu" } -axplat = { path = "../axplat_crates/axplat" } -axplat-x86-pc = { path = "../axplat_crates/platforms/axplat-x86-pc" } -axplat-aarch64-qemu-virt = { path = "../axplat_crates/platforms/axplat-aarch64-qemu-virt" } -axplat-riscv64-qemu-virt = { path = "../axplat_crates/platforms/axplat-riscv64-qemu-virt" } -axplat-loongarch64-qemu-virt = { path = "../axplat_crates/platforms/axplat-loongarch64-qemu-virt" } -page_table_multiarch = { git = "https://github.com/arceos-org/page_table_multiarch.git", tag = "dev-v05" } +# External path deps removed for publishing - use crates.io versions +# axcpu, axplat, axplat-* already published on crates.io diff --git a/modules/axhal/Cargo.toml b/modules/axhal/Cargo.toml index 83d11ba07e..05a9cb495d 100644 --- a/modules/axhal/Cargo.toml +++ b/modules/axhal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axhal" -version = "0.2.2-preview.4" +version = "0.2.2-preview.6" edition.workspace = true authors = ["Yuekai Jia "] description = "ArceOS hardware abstraction layer, provides unified APIs for platform-specific operations" diff --git a/modules/axhal/src/dummy.rs b/modules/axhal/src/dummy.rs index ae9e31f716..d692895936 100644 --- a/modules/axhal/src/dummy.rs +++ b/modules/axhal/src/dummy.rs @@ -41,6 +41,11 @@ impl ConsoleIf for DummyConsole { fn read_bytes(_bytes: &mut [u8]) -> usize { unimplemented!() } + + #[cfg(feature = "irq")] + fn irq_num() -> Option { + None + } } #[impl_plat_interface] @@ -88,6 +93,11 @@ impl TimeIf for DummyTime { 0 } + #[cfg(feature = "irq")] + fn irq_num() -> usize { + 0 + } + #[cfg(feature = "irq")] fn set_oneshot_timer(_deadline_ns: u64) {} } @@ -115,7 +125,9 @@ impl IrqIf for DummyIrq { None } - fn handle(_irq: usize) {} + fn handle(_irq: usize) -> Option { + None + } fn send_ipi(_irq: usize, _target: IpiTarget) {} } diff --git a/modules/axhal/src/mem.rs b/modules/axhal/src/mem.rs index dcb8f73a6e..e1b8ae6512 100644 --- a/modules/axhal/src/mem.rs +++ b/modules/axhal/src/mem.rs @@ -10,9 +10,6 @@ pub use axplat::mem::{ mmio_ranges, phys_ram_ranges, phys_to_virt, reserved_phys_ram_ranges, total_ram_size, virt_to_phys, }; -// `kernel_aspace` is only available in newer (unpublished) versions of axplat; -// the crates.io 0.3.0 release does not have it. -#[cfg(any(feature = "defplat", feature = "myplat"))] pub use axplat::mem::kernel_aspace; pub use memory_addr::{PAGE_SIZE_4K, PhysAddr, PhysAddrRange, VirtAddr, VirtAddrRange, pa, va};