From 7dec4064884ec6b3525a8dd1b42ee04784bbd376 Mon Sep 17 00:00:00 2001 From: Yuekai Jia Date: Thu, 18 Jul 2024 17:18:23 +0800 Subject: [PATCH] Update crates dependencies to use git or crates.io version --- Cargo.lock | 569 +++++------------- Cargo.toml | 67 +-- api/arceos_api/Cargo.toml | 24 +- api/arceos_posix_api/Cargo.toml | 26 +- api/axfeat/Cargo.toml | 24 +- apps/display/Cargo.toml | 2 +- apps/exception/Cargo.toml | 2 +- apps/fs/shell/Cargo.toml | 8 +- apps/helloworld/Cargo.toml | 2 +- apps/memtest/Cargo.toml | 2 +- apps/net/bwbench/Cargo.toml | 2 +- apps/net/echoserver/Cargo.toml | 2 +- apps/net/httpclient/Cargo.toml | 2 +- apps/net/httpserver/Cargo.toml | 2 +- apps/net/udpserver/Cargo.toml | 2 +- apps/task/parallel/Cargo.toml | 2 +- apps/task/priority/Cargo.toml | 2 +- apps/task/sleep/Cargo.toml | 2 +- apps/task/tls/Cargo.toml | 2 +- apps/task/yield/Cargo.toml | 2 +- modules/axalloc/Cargo.toml | 8 +- modules/axalloc/src/lib.rs | 2 +- modules/axdisplay/Cargo.toml | 8 +- modules/axdisplay/src/lib.rs | 4 +- modules/axdriver/Cargo.toml | 42 +- modules/axdriver/src/bus/pci.rs | 4 +- modules/axdriver/src/drivers.rs | 26 +- modules/axdriver/src/dummy.rs | 6 +- modules/axdriver/src/ixgbe.rs | 2 +- modules/axdriver/src/lib.rs | 4 +- modules/axdriver/src/prelude.rs | 8 +- modules/axdriver/src/structs/mod.rs | 2 +- modules/axdriver/src/virtio.rs | 20 +- modules/axfs/Cargo.toml | 30 +- modules/axfs/src/fops.rs | 41 +- modules/axfs/src/root.rs | 2 +- modules/axfs/tests/test_fatfs.rs | 2 +- modules/axfs/tests/test_ramfs.rs | 2 +- modules/axhal/Cargo.toml | 42 +- modules/axhal/src/paging.rs | 18 +- .../platform/aarch64_bsta1000b/dw_apb_uart.rs | 2 +- .../platform/aarch64_common/generic_timer.rs | 2 +- .../axhal/src/platform/aarch64_common/gic.rs | 5 +- .../src/platform/aarch64_common/pl011.rs | 4 +- .../src/platform/riscv64_qemu_virt/irq.rs | 2 +- modules/axhal/src/platform/x86_pc/apic.rs | 4 +- modules/axhal/src/platform/x86_pc/dtables.rs | 2 +- modules/axhal/src/platform/x86_pc/time.rs | 7 +- .../axhal/src/platform/x86_pc/uart16550.rs | 2 +- modules/axlog/Cargo.toml | 4 +- modules/axlog/src/lib.rs | 2 +- modules/axnet/Cargo.toml | 16 +- modules/axnet/src/smoltcp_impl/mod.rs | 4 +- modules/axruntime/Cargo.toml | 28 +- modules/axruntime/src/lib.rs | 2 +- modules/axsync/Cargo.toml | 8 +- modules/axsync/src/lib.rs | 6 +- modules/axtask/Cargo.toml | 22 +- modules/axtask/src/run_queue.rs | 4 +- modules/axtask/src/timers.rs | 4 +- modules/axtask/src/wait_queue.rs | 2 +- scripts/make/cargo.mk | 6 +- scripts/make/test.mk | 1 - ulib/axlibc/Cargo.toml | 8 +- ulib/axstd/Cargo.toml | 12 +- ulib/axstd/src/sync/mod.rs | 2 +- 66 files changed, 461 insertions(+), 719 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 50ee20247b..186ae37606 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,12 +23,10 @@ dependencies = [ [[package]] name = "allocator" version = "0.1.0" +source = "git+https://github.com/arceos-org/allocator.git?tag=v0.1.0#0dc4c1d429c50c69bd136bfec2fca8a5f759a01d" dependencies = [ - "allocator", "bitmap-allocator", "buddy_system_allocator", - "criterion", - "rand", "rlsf", "slab_allocator", ] @@ -48,18 +46,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - -[[package]] -name = "anstyle" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" - [[package]] name = "arceos-bwbench" version = "0.1.0" @@ -214,8 +200,10 @@ dependencies = [ ] [[package]] -name = "arm_gic" +name = "arm_gicv2" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d25e73c949c69f75d1b9dba39c5475523403b31eb8c2fdc99da4dc33bc1aca" dependencies = [ "tock-registers", ] @@ -223,6 +211,8 @@ dependencies = [ [[package]] name = "arm_pl011" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efcf6afca4502993a737ba1e00952d1321078689da92bf7aab27d4e5756c0bec" dependencies = [ "tock-registers", ] @@ -255,9 +245,9 @@ dependencies = [ "allocator", "axerrno", "cfg-if", + "kspin", "log", "memory_addr", - "spinlock", ] [[package]] @@ -273,9 +263,9 @@ name = "axdisplay" version = "0.1.0" dependencies = [ "axdriver", + "axdriver_display", "axsync", - "driver_display", - "lazy_init", + "lazyinit", "log", ] @@ -285,20 +275,76 @@ version = "0.1.0" dependencies = [ "axalloc", "axconfig", + "axdriver_base", + "axdriver_block", + "axdriver_display", + "axdriver_net", + "axdriver_pci", + "axdriver_virtio", "axhal", "cfg-if", - "driver_block", - "driver_common", - "driver_display", - "driver_net", - "driver_pci", - "driver_virtio", "log", ] +[[package]] +name = "axdriver_base" +version = "0.1.0" +source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.0#78686a7e70c9203ba29e425929c393fbb7eca208" + +[[package]] +name = "axdriver_block" +version = "0.1.0" +source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.0#78686a7e70c9203ba29e425929c393fbb7eca208" +dependencies = [ + "axdriver_base", + "bcm2835-sdhci", + "log", +] + +[[package]] +name = "axdriver_display" +version = "0.1.0" +source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.0#78686a7e70c9203ba29e425929c393fbb7eca208" +dependencies = [ + "axdriver_base", +] + +[[package]] +name = "axdriver_net" +version = "0.1.0" +source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.0#78686a7e70c9203ba29e425929c393fbb7eca208" +dependencies = [ + "axdriver_base", + "ixgbe-driver", + "log", + "spin", +] + +[[package]] +name = "axdriver_pci" +version = "0.1.0" +source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.0#78686a7e70c9203ba29e425929c393fbb7eca208" +dependencies = [ + "virtio-drivers", +] + +[[package]] +name = "axdriver_virtio" +version = "0.1.0" +source = "git+https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.0#78686a7e70c9203ba29e425929c393fbb7eca208" +dependencies = [ + "axdriver_base", + "axdriver_block", + "axdriver_display", + "axdriver_net", + "virtio-drivers", +] + [[package]] name = "axerrno" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66ccd41dd4ef364e2385901a5c2a3adea974a41eccb2529c1f24e4c8bc93d834" dependencies = [ "log", ] @@ -317,7 +363,7 @@ dependencies = [ "axruntime", "axsync", "axtask", - "spinlock", + "kspin", ] [[package]] @@ -325,6 +371,7 @@ name = "axfs" version = "0.1.0" dependencies = [ "axdriver", + "axdriver_block", "axerrno", "axfs_devfs", "axfs_ramfs", @@ -332,18 +379,19 @@ dependencies = [ "axio", "axsync", "axtask", - "capability", + "cap_access", "cfg-if", "crate_interface", - "driver_block", "fatfs", - "lazy_init", + "lazyinit", "log", ] [[package]] name = "axfs_devfs" -version = "0.1.0" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d62eff0490e10cd2c2a74be2979820f0293fa5ebe00ee8bfd87b88ac7dd7d235" dependencies = [ "axfs_vfs", "log", @@ -352,7 +400,9 @@ dependencies = [ [[package]] name = "axfs_ramfs" -version = "0.1.0" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db46c6dae25a123579d5fdcdcc502d0dc2a8af86646106004c8a9181433271b1" dependencies = [ "axfs_vfs", "log", @@ -361,7 +411,9 @@ dependencies = [ [[package]] name = "axfs_vfs" -version = "0.1.0" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2314ebe07a2fef7b1c1a7d15ab817941cd306ace651bb50024b5a8b3e8485359" dependencies = [ "axerrno", "bitflags 2.6.0", @@ -373,7 +425,7 @@ name = "axhal" version = "0.1.0" dependencies = [ "aarch64-cpu", - "arm_gic", + "arm_gicv2", "arm_pl011", "arm_pl031", "axalloc", @@ -384,19 +436,19 @@ dependencies = [ "crate_interface", "dw_apb_uart", "handler_table", + "int_ratio", "kernel_guard", - "lazy_init", + "kspin", + "lazyinit", "log", "memory_addr", - "page_table", "page_table_entry", + "page_table_multiarch", "percpu", - "ratio", "raw-cpuid 11.0.2", "riscv", "riscv_goldfish", "sbi-rt", - "spinlock", "static_assertions", "tock-registers", "x2apic", @@ -408,6 +460,8 @@ dependencies = [ [[package]] name = "axio" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8ca9c10ea4cd42bda87a2abde281fb481c76a0b05976fd03697385ea65d5122" dependencies = [ "axerrno", ] @@ -431,8 +485,8 @@ dependencies = [ "cfg-if", "chrono", "crate_interface", + "kspin", "log", - "spinlock", ] [[package]] @@ -440,14 +494,14 @@ name = "axnet" version = "0.1.0" dependencies = [ "axdriver", + "axdriver_net", "axerrno", "axhal", "axio", "axsync", "axtask", "cfg-if", - "driver_net", - "lazy_init", + "lazyinit", "log", "smoltcp", "spin", @@ -469,7 +523,7 @@ dependencies = [ "chrono", "crate_interface", "kernel_guard", - "lazy_init", + "lazyinit", "percpu", ] @@ -481,7 +535,7 @@ dependencies = [ "axerrno", "axfeat", "axio", - "spinlock", + "kspin", ] [[package]] @@ -490,8 +544,8 @@ version = "0.1.0" dependencies = [ "axsync", "axtask", + "kspin", "rand", - "spinlock", ] [[package]] @@ -504,13 +558,13 @@ dependencies = [ "cfg-if", "crate_interface", "kernel_guard", - "lazy_init", + "kspin", + "lazyinit", "log", "memory_addr", "percpu", "rand", "scheduler", - "spinlock", "timer_list", ] @@ -617,19 +671,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] -name = "capability" +name = "cap_access" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9b24894fa5f73bbf9c72196e7f495a1f81d6218a548280a09ada4a937157692" dependencies = [ - "axerrno", "bitflags 2.6.0", ] -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - [[package]] name = "cc" version = "1.0.83" @@ -668,33 +717,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - [[package]] name = "clang-sys" version = "1.6.1" @@ -706,31 +728,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "clap" -version = "4.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" -dependencies = [ - "clap_builder", -] - -[[package]] -name = "clap_builder" -version = "4.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" -dependencies = [ - "anstyle", - "clap_lex", -] - -[[package]] -name = "clap_lex" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" - [[package]] name = "const-default" version = "1.0.0" @@ -751,86 +748,21 @@ checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" [[package]] name = "crate_interface" -version = "0.1.1" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2aab5f8027e4b744b40c4a66403a71292695e83f7e16b3e0a5045d3b2093c" dependencies = [ "proc-macro2", "quote", "syn 2.0.70", ] -[[package]] -name = "criterion" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" -dependencies = [ - "anes", - "cast", - "ciborium", - "clap", - "criterion-plot", - "is-terminal", - "itertools", - "num-traits", - "once_cell", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools", -] - [[package]] name = "critical-section" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - [[package]] name = "defmt" version = "0.3.5" @@ -863,57 +795,11 @@ dependencies = [ "thiserror", ] -[[package]] -name = "driver_block" -version = "0.1.0" -dependencies = [ - "bcm2835-sdhci", - "driver_common", - "log", -] - -[[package]] -name = "driver_common" -version = "0.1.0" - -[[package]] -name = "driver_display" -version = "0.1.0" -dependencies = [ - "driver_common", -] - -[[package]] -name = "driver_net" -version = "0.1.0" -dependencies = [ - "driver_common", - "ixgbe-driver", - "log", - "spin", -] - -[[package]] -name = "driver_pci" -version = "0.1.0" -dependencies = [ - "virtio-drivers", -] - -[[package]] -name = "driver_virtio" -version = "0.1.0" -dependencies = [ - "driver_block", - "driver_common", - "driver_display", - "driver_net", - "virtio-drivers", -] - [[package]] name = "dw_apb_uart" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93d496c8faa9dc676ebfa225432e1e3b57645c9268ead889286546f6d39356d" dependencies = [ "tock-registers", ] @@ -971,6 +857,8 @@ dependencies = [ [[package]] name = "flatten_objects" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "640ae5c0dad96e72fe0acc974f42f9ab1e39c3e9708aa02579c160895d884244" dependencies = [ "bitmaps", ] @@ -1001,19 +889,11 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "half" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" -dependencies = [ - "cfg-if", - "crunchy", -] - [[package]] name = "handler_table" -version = "0.1.0" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e81913856cda07e1e7044a375043c2e4429ddb7d94a0d4ad10d4c27796ce4bd9" [[package]] name = "hash32" @@ -1043,12 +923,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "iana-time-zone" version = "0.1.60" @@ -1083,15 +957,10 @@ dependencies = [ ] [[package]] -name = "is-terminal" -version = "0.4.12" +name = "int_ratio" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys", -] +checksum = "0640a6c478a68d4899fec305f97afa6e34afce49d4d952d2b9599fd52615b2a7" [[package]] name = "itertools" @@ -1102,12 +971,6 @@ dependencies = [ "either", ] -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - [[package]] name = "ixgbe-driver" version = "0.1.0" @@ -1131,15 +994,23 @@ dependencies = [ [[package]] name = "kernel_guard" -version = "0.1.0" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36172feaa47f9967efd3bc5fc77462899286e821de3de68c5fe88176a24d3a1f" dependencies = [ "cfg-if", "crate_interface", ] [[package]] -name = "lazy_init" +name = "kspin" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51954c939251c5899b6e953aa0ed8903c5c0d1140fc7ce3a8fd60c931d694f6e" +dependencies = [ + "cfg-if", + "kernel_guard", +] [[package]] name = "lazy_static" @@ -1156,6 +1027,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +[[package]] +name = "lazyinit" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3b7566364c42c3cc7a274816fce6a9fbc50340bd3af4bd2f50cb2b6c0f1233c" + [[package]] name = "libc" version = "0.2.147" @@ -1175,6 +1052,7 @@ dependencies = [ [[package]] name = "linked_list" version = "0.1.0" +source = "git+https://github.com/arceos-org/linked_list.git?tag=v0.1.0#34c8db301882cecfeb56df0f7c89978dbc62f49a" [[package]] name = "lock_api" @@ -1206,7 +1084,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memory_addr" -version = "0.1.0" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bea53f55564acdbe43e404118414b5fb45dfe9bea0dfc9bd80b8e5bb02aeb047" [[package]] name = "micromath" @@ -1246,28 +1126,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] -name = "oorandom" -version = "11.1.3" +name = "page_table_entry" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "page_table" -version = "0.1.0" +checksum = "d268ed455b6d9bb54bdbd801838090823fdba51b46292503ac72ef25326ebab7" dependencies = [ - "log", + "aarch64-cpu", + "bitflags 2.6.0", "memory_addr", - "page_table_entry", + "x86_64 0.15.1", ] [[package]] -name = "page_table_entry" -version = "0.1.0" +name = "page_table_multiarch" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1445dd432e6b83ccf27008835c7963cfdc107852f6f15edc7a3523dcf4da1ac" dependencies = [ - "aarch64-cpu", - "bitflags 2.6.0", + "log", "memory_addr", - "x86_64 0.15.1", + "page_table_entry", ] [[package]] @@ -1278,7 +1156,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "percpu" -version = "0.1.0" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe17617fadbff9b221435e0fb91c7a7387c3bc87afab0ce92b21b0d108bdd17" dependencies = [ "cfg-if", "kernel_guard", @@ -1289,41 +1169,15 @@ dependencies = [ [[package]] name = "percpu_macros" -version = "0.1.0" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37bd51d4112e25524bd18b8a0a4bd2526f35686316ccfe7f6b890bf57b455578" dependencies = [ "proc-macro2", "quote", "syn 2.0.70", ] -[[package]] -name = "plotters" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" - -[[package]] -name = "plotters-svg" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" -dependencies = [ - "plotters-backend", -] - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1412,10 +1266,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "ratio" -version = "0.1.0" - [[package]] name = "raw-cpuid" version = "10.7.0" @@ -1434,26 +1284,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - [[package]] name = "regex" version = "1.9.3" @@ -1532,21 +1362,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - [[package]] name = "sbi-rt" version = "0.0.3" @@ -1565,6 +1380,7 @@ checksum = "e6e36312fb5ddc10d08ecdc65187402baba4ac34585cb9d1b78522ae2358d890" [[package]] name = "scheduler" version = "0.1.0" +source = "git+https://github.com/arceos-org/scheduler.git?tag=v0.1.0#c8d25d9aed146dca28dc8987afd229b52c20361a" dependencies = [ "linked_list", ] @@ -1601,17 +1417,6 @@ dependencies = [ "syn 2.0.70", ] -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "itoa", - "ryu", - "serde", -] - [[package]] name = "shlex" version = "1.1.0" @@ -1621,6 +1426,7 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[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", ] @@ -1648,14 +1454,6 @@ dependencies = [ "lock_api", ] -[[package]] -name = "spinlock" -version = "0.1.0" -dependencies = [ - "cfg-if", - "kernel_guard", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1726,16 +1524,8 @@ dependencies = [ [[package]] name = "timer_list" version = "0.1.0" - -[[package]] -name = "tinytemplate" -version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] +checksum = "158b52ace9609dd94f4af338f4828ff23b600d9160def8c001f2c73885521936" [[package]] name = "tock-registers" @@ -1760,15 +1550,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "tuple_for_each" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.70", -] - [[package]] name = "unicode-ident" version = "1.0.11" @@ -1816,16 +1597,6 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "442887c63f2c839b346c192d047a7c87e73d0689c9157b00b53dcc27dd5ea793" -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1886,16 +1657,6 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "which" version = "4.4.0" @@ -1923,15 +1684,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -1947,15 +1699,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.52.5" diff --git a/Cargo.toml b/Cargo.toml index 1db098f126..68f72ef197 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,40 +2,6 @@ resolver = "2" members = [ - "crates/allocator", - "crates/arm_gic", - "crates/arm_pl011", - "crates/dw_apb_uart", - "crates/axerrno", - "crates/axfs_devfs", - "crates/axfs_ramfs", - "crates/axfs_vfs", - "crates/axio", - "crates/capability", - "crates/crate_interface", - "crates/driver_block", - "crates/driver_common", - "crates/driver_display", - "crates/driver_net", - "crates/driver_pci", - "crates/driver_virtio", - "crates/flatten_objects", - "crates/handler_table", - "crates/kernel_guard", - "crates/lazy_init", - "crates/linked_list", - "crates/memory_addr", - "crates/page_table", - "crates/page_table_entry", - "crates/percpu", - "crates/percpu_macros", - "crates/ratio", - "crates/scheduler", - "crates/slab_allocator", - "crates/spinlock", - "crates/timer_list", - "crates/tuple_for_each", - "modules/axalloc", "modules/axconfig", "modules/axdisplay", @@ -72,8 +38,35 @@ members = [ "apps/task/tls", ] +[workspace.package] +version = "0.1.0" +authors = ["Yuekai Jia "] +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" +repository = "https://github.com/arceos-org/arceos" +keywords = ["arceos", "kernel"] +categories = ["os", "no-std"] + +[workspace.dependencies] +axstd = { path = "ulib/axstd" } +axlibc = { path = "ulib/axlibc" } + +arceos_api = { path = "api/arceos_api" } +arceos_posix_api = { path = "api/arceos_posix_api" } +axfeat = { path = "api/axfeat" } + +axalloc = { path = "modules/axalloc" } +axconfig = { path = "modules/axconfig" } +axdisplay = { path = "modules/axdisplay" } +axdriver = { path = "modules/axdriver" } +axfs = { path = "modules/axfs" } +axhal = { path = "modules/axhal" } +axlog = { path = "modules/axlog" } +axnet = { path = "modules/axnet" } +axruntime = { path = "modules/axruntime" } +axsync = { path = "modules/axsync" } +axtask = { path = "modules/axtask" } + [profile.release] lto = true - -[patch.crates-io] -crate_interface = { path = "crates/crate_interface" } diff --git a/api/arceos_api/Cargo.toml b/api/arceos_api/Cargo.toml index 79bbab84cb..507875b839 100644 --- a/api/arceos_api/Cargo.toml +++ b/api/arceos_api/Cargo.toml @@ -25,15 +25,15 @@ myfs = ["axfeat/myfs"] dummy-if-not-enabled = [] [dependencies] -axfeat = { path = "../axfeat" } -axruntime = { path = "../../modules/axruntime" } -axconfig = { path = "../../modules/axconfig" } -axlog = { path = "../../modules/axlog" } -axio = { path = "../../crates/axio" } -axerrno = { path = "../../crates/axerrno" } -axhal = { path = "../../modules/axhal" } -axalloc = { path = "../../modules/axalloc", optional = true } -axtask = { path = "../../modules/axtask", optional = true } -axfs = { path = "../../modules/axfs", optional = true } -axnet = { path = "../../modules/axnet", optional = true } -axdisplay = { path = "../../modules/axdisplay", optional = true } +axio = "0.1" +axerrno = "0.1" +axfeat = { workspace = true } +axruntime = { workspace = true } +axconfig = { workspace = true } +axlog = { workspace = true } +axhal = { workspace = true } +axalloc = { workspace = true, optional = true } +axtask = { workspace = true, optional = true } +axfs = { workspace = true, optional = true } +axnet = { workspace = true, optional = true } +axdisplay = { workspace = true, optional = true } diff --git a/api/arceos_posix_api/Cargo.toml b/api/arceos_posix_api/Cargo.toml index 2195378e69..3f5b864d86 100644 --- a/api/arceos_posix_api/Cargo.toml +++ b/api/arceos_posix_api/Cargo.toml @@ -31,24 +31,24 @@ epoll = ["fd"] [dependencies] # ArceOS modules -axfeat = { path = "../axfeat" } -axruntime = { path = "../../modules/axruntime" } -axconfig = { path = "../../modules/axconfig" } -axlog = { path = "../../modules/axlog" } -axhal = { path = "../../modules/axhal" } -axsync = { path = "../../modules/axsync" } -axalloc = { path = "../../modules/axalloc", optional = true } -axtask = { path = "../../modules/axtask", optional = true } -axfs = { path = "../../modules/axfs", optional = true } -axnet = { path = "../../modules/axnet", optional = true } +axfeat = { workspace = true } +axruntime = { workspace = true } +axconfig = { workspace = true } +axlog = { workspace = true } +axhal = { workspace = true } +axsync = { workspace = true } +axalloc = { workspace = true, optional = true } +axtask = { workspace = true, optional = true } +axfs = { workspace = true, optional = true } +axnet = { workspace = true, optional = true } # Other crates -axio = { path = "../../crates/axio" } -axerrno = { path = "../../crates/axerrno" } +axio = "0.1" +axerrno = "0.1" +flatten_objects = "0.1" static_assertions = "1.1.0" spin = { version = "0.9" } lazy_static = { version = "1.5", features = ["spin_no_std"] } -flatten_objects = { path = "../../crates/flatten_objects" } [build-dependencies] bindgen ={ version = "0.69" } diff --git a/api/axfeat/Cargo.toml b/api/axfeat/Cargo.toml index 4f033d4fec..d331891dc3 100644 --- a/api/axfeat/Cargo.toml +++ b/api/axfeat/Cargo.toml @@ -13,7 +13,7 @@ documentation = "https://arceos-org.github.io/arceos/axfeat/index.html" default = [] # Multicore -smp = ["axhal/smp", "axruntime/smp", "spinlock/smp"] +smp = ["axhal/smp", "axruntime/smp", "kspin/smp"] # Floating point/SIMD fp_simd = ["axhal/fp_simd"] @@ -64,14 +64,14 @@ log-level-debug = ["axlog/log-level-debug"] log-level-trace = ["axlog/log-level-trace"] [dependencies] -axruntime = { path = "../../modules/axruntime" } -axhal = { path = "../../modules/axhal" } -axlog = { path = "../../modules/axlog" } -axalloc = { path = "../../modules/axalloc", optional = true } -axdriver = { path = "../../modules/axdriver", optional = true } -axfs = { path = "../../modules/axfs", optional = true } -axnet = { path = "../../modules/axnet", optional = true } -axdisplay = { path = "../../modules/axdisplay", optional = true } -axsync = { path = "../../modules/axsync", optional = true } -axtask = { path = "../../modules/axtask", optional = true } -spinlock = { path = "../../crates/spinlock", optional = true } +axruntime = { workspace = true } +axhal = { workspace = true } +axlog = { workspace = true } +axalloc = { workspace = true, optional = true } +axdriver = { workspace = true, optional = true } +axfs = { workspace = true, optional = true } +axnet = { workspace = true, optional = true } +axdisplay = { workspace = true, optional = true } +axsync = { workspace = true, optional = true } +axtask = { workspace = true, optional = true } +kspin = { version = "0.1", optional = true } diff --git a/apps/display/Cargo.toml b/apps/display/Cargo.toml index 4cfc2ba437..7c68b01045 100644 --- a/apps/display/Cargo.toml +++ b/apps/display/Cargo.toml @@ -7,5 +7,5 @@ authors = ["Shiping Yuan "] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -axstd = { path = "../../ulib/axstd", features = ["display"], optional = true } +axstd = { workspace = true, features = ["display"], optional = true } embedded-graphics = "0.8" diff --git a/apps/exception/Cargo.toml b/apps/exception/Cargo.toml index 1be50f0d1d..7211cd14c2 100644 --- a/apps/exception/Cargo.toml +++ b/apps/exception/Cargo.toml @@ -7,4 +7,4 @@ authors = ["Yuekai Jia "] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -axstd = { path = "../../ulib/axstd", optional = true } +axstd = { workspace = true, optional = true } diff --git a/apps/fs/shell/Cargo.toml b/apps/fs/shell/Cargo.toml index bd99c1d11b..5c9342fdbf 100644 --- a/apps/fs/shell/Cargo.toml +++ b/apps/fs/shell/Cargo.toml @@ -11,7 +11,7 @@ use-ramfs = ["axstd/myfs", "dep:axfs_vfs", "dep:axfs_ramfs", "dep:crate_interfac default = [] [dependencies] -axfs_vfs = { path = "../../../crates/axfs_vfs", optional = true } -axfs_ramfs = { path = "../../../crates/axfs_ramfs", optional = true } -crate_interface = { path = "../../../crates/crate_interface", optional = true } -axstd = { path = "../../../ulib/axstd", features = ["alloc", "fs"], optional = true } +axfs_vfs = { version = "0.1", optional = true } +axfs_ramfs = { version = "0.1", optional = true } +crate_interface = { version = "0.1", optional = true } +axstd = { workspace = true, features = ["alloc", "fs"], optional = true } diff --git a/apps/helloworld/Cargo.toml b/apps/helloworld/Cargo.toml index 9b759ec55a..67f5f358e3 100644 --- a/apps/helloworld/Cargo.toml +++ b/apps/helloworld/Cargo.toml @@ -7,4 +7,4 @@ authors = ["Yuekai Jia "] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -axstd = { path = "../../ulib/axstd", optional = true } +axstd = { workspace = true, optional = true } diff --git a/apps/memtest/Cargo.toml b/apps/memtest/Cargo.toml index 592b6c4f15..f782517fab 100644 --- a/apps/memtest/Cargo.toml +++ b/apps/memtest/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Yuekai Jia "] [dependencies] rand = { version = "0.8", default-features = false, features = ["small_rng"] } -axstd = { path = "../../ulib/axstd", features = ["alloc"], optional = true } +axstd = { workspace = true, features = ["alloc"], optional = true } diff --git a/apps/net/bwbench/Cargo.toml b/apps/net/bwbench/Cargo.toml index 4cc2454873..1ff055aa1d 100644 --- a/apps/net/bwbench/Cargo.toml +++ b/apps/net/bwbench/Cargo.toml @@ -7,5 +7,5 @@ authors = ["ChengXiang Qi "] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -axstd = { path = "../../../ulib/axstd", features = ["net"] } +axstd = { workspace = true, features = ["net"] } axnet = { path = "../../../modules/axnet" } diff --git a/apps/net/echoserver/Cargo.toml b/apps/net/echoserver/Cargo.toml index 7698bf0c11..c346ced462 100644 --- a/apps/net/echoserver/Cargo.toml +++ b/apps/net/echoserver/Cargo.toml @@ -7,4 +7,4 @@ authors = ["Yuekai Jia "] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -axstd = { path = "../../../ulib/axstd", features = ["alloc", "multitask", "net"], optional = true } +axstd = { workspace = true, features = ["alloc", "multitask", "net"], optional = true } diff --git a/apps/net/httpclient/Cargo.toml b/apps/net/httpclient/Cargo.toml index 8efffa0328..bce4bc026f 100644 --- a/apps/net/httpclient/Cargo.toml +++ b/apps/net/httpclient/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Yuekai Jia ", "Dashuai Wu "] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -axstd = { path = "../../../ulib/axstd", features = ["alloc", "multitask", "net"], optional = true } +axstd = { workspace = true, features = ["alloc", "multitask", "net"], optional = true } diff --git a/apps/net/udpserver/Cargo.toml b/apps/net/udpserver/Cargo.toml index 0c6b86a4aa..1d34111872 100644 --- a/apps/net/udpserver/Cargo.toml +++ b/apps/net/udpserver/Cargo.toml @@ -5,4 +5,4 @@ edition = "2021" authors = ["Dashuai Wu "] [dependencies] -axstd = { path = "../../../ulib/axstd", features = ["net"], optional = true } +axstd = { workspace = true, features = ["net"], optional = true } diff --git a/apps/task/parallel/Cargo.toml b/apps/task/parallel/Cargo.toml index ea93409921..637315c91a 100644 --- a/apps/task/parallel/Cargo.toml +++ b/apps/task/parallel/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Yuekai Jia "] [dependencies] rand = { version = "0.8", default-features = false, features = ["small_rng"] } -axstd = { path = "../../../ulib/axstd", features = ["alloc", "multitask", "irq"], optional = true } +axstd = { workspace = true, features = ["alloc", "multitask", "irq"], optional = true } diff --git a/apps/task/priority/Cargo.toml b/apps/task/priority/Cargo.toml index 5c4061a094..5d66ef6110 100644 --- a/apps/task/priority/Cargo.toml +++ b/apps/task/priority/Cargo.toml @@ -11,4 +11,4 @@ sched_rr = ["axstd?/sched_rr"] sched_cfs = ["axstd?/sched_cfs"] [dependencies] -axstd = { path = "../../../ulib/axstd", features = ["alloc", "multitask"], optional = true } +axstd = { workspace = true, features = ["alloc", "multitask"], optional = true } diff --git a/apps/task/sleep/Cargo.toml b/apps/task/sleep/Cargo.toml index 2608c3db8c..24111e5322 100644 --- a/apps/task/sleep/Cargo.toml +++ b/apps/task/sleep/Cargo.toml @@ -7,4 +7,4 @@ authors = ["Yuekai Jia "] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -axstd = { path = "../../../ulib/axstd", features = ["multitask", "irq"], optional = true } +axstd = { workspace = true, features = ["multitask", "irq"], optional = true } diff --git a/apps/task/tls/Cargo.toml b/apps/task/tls/Cargo.toml index 86cbe1bd48..14acba4bd1 100644 --- a/apps/task/tls/Cargo.toml +++ b/apps/task/tls/Cargo.toml @@ -7,4 +7,4 @@ authors = ["Yuekai Jia "] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -axstd = { path = "../../../ulib/axstd", features = ["tls", "alloc", "multitask"], optional = true } +axstd = { workspace = true, features = ["tls", "alloc", "multitask"], optional = true } diff --git a/apps/task/yield/Cargo.toml b/apps/task/yield/Cargo.toml index b8d775bc6c..3b27528859 100644 --- a/apps/task/yield/Cargo.toml +++ b/apps/task/yield/Cargo.toml @@ -11,4 +11,4 @@ sched_rr = ["axstd?/sched_rr"] sched_cfs = ["axstd?/sched_cfs"] [dependencies] -axstd = { path = "../../../ulib/axstd", features = ["multitask"], optional = true } +axstd = { workspace = true, features = ["multitask"], optional = true } diff --git a/modules/axalloc/Cargo.toml b/modules/axalloc/Cargo.toml index bc23332df9..1d059765ec 100644 --- a/modules/axalloc/Cargo.toml +++ b/modules/axalloc/Cargo.toml @@ -18,7 +18,7 @@ buddy = ["allocator/buddy"] [dependencies] log = "0.4" cfg-if = "1.0" -spinlock = { path = "../../crates/spinlock" } -memory_addr = { path = "../../crates/memory_addr" } -allocator = { path = "../../crates/allocator", features = ["bitmap"] } -axerrno = { path = "../../crates/axerrno" } +kspin = "0.1" +memory_addr = "0.2" +axerrno = "0.1" +allocator = { git = "https://github.com/arceos-org/allocator.git", tag ="v0.1.0", features = ["bitmap"] } diff --git a/modules/axalloc/src/lib.rs b/modules/axalloc/src/lib.rs index e0d8d386d0..c8ed547636 100644 --- a/modules/axalloc/src/lib.rs +++ b/modules/axalloc/src/lib.rs @@ -16,7 +16,7 @@ mod page; use allocator::{AllocResult, BaseAllocator, BitmapPageAllocator, ByteAllocator, PageAllocator}; use core::alloc::{GlobalAlloc, Layout}; use core::ptr::NonNull; -use spinlock::SpinNoIrq; +use kspin::SpinNoIrq; const PAGE_SIZE: usize = 0x1000; const MIN_HEAP_SIZE: usize = 0x8000; // 32 K diff --git a/modules/axdisplay/Cargo.toml b/modules/axdisplay/Cargo.toml index 160e7b61d2..fff91c8322 100644 --- a/modules/axdisplay/Cargo.toml +++ b/modules/axdisplay/Cargo.toml @@ -11,7 +11,7 @@ documentation = "https://arceos-org.github.io/arceos/axdisplay/index.html" [dependencies] log = "0.4" -axdriver = { path = "../axdriver", features = ["display"] } -lazy_init = { path = "../../crates/lazy_init" } -axsync = { path = "../axsync" } -driver_display = { path = "../../crates/driver_display" } +lazyinit = "0.1" +axdriver = { workspace = true, features = ["display"] } +axsync = { workspace = true } +axdriver_display = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.0" } diff --git a/modules/axdisplay/src/lib.rs b/modules/axdisplay/src/lib.rs index 4c4717392e..2cc548b05c 100644 --- a/modules/axdisplay/src/lib.rs +++ b/modules/axdisplay/src/lib.rs @@ -8,11 +8,11 @@ extern crate log; #[doc(no_inline)] -pub use driver_display::DisplayInfo; +pub use axdriver_display::DisplayInfo; use axdriver::{prelude::*, AxDeviceContainer}; use axsync::Mutex; -use lazy_init::LazyInit; +use lazyinit::LazyInit; static MAIN_DISPLAY: LazyInit> = LazyInit::new(); diff --git a/modules/axdriver/Cargo.toml b/modules/axdriver/Cargo.toml index 0dac991b1c..28395103b9 100644 --- a/modules/axdriver/Cargo.toml +++ b/modules/axdriver/Cargo.toml @@ -12,34 +12,34 @@ documentation = "https://arceos-org.github.io/arceos/axdriver/index.html" [features] dyn = [] bus-mmio = [] -bus-pci = ["dep:driver_pci", "dep:axhal", "dep:axconfig"] -net = ["driver_net"] -block = ["driver_block"] -display = ["driver_display"] +bus-pci = ["dep:axdriver_pci", "dep:axhal", "dep:axconfig"] +net = ["axdriver_net"] +block = ["axdriver_block"] +display = ["axdriver_display"] # Enabled by features `virtio-*` -virtio = ["driver_virtio", "dep:axalloc", "dep:axhal", "dep:axconfig"] +virtio = ["axdriver_virtio", "dep:axalloc", "dep:axhal", "dep:axconfig"] # various types of drivers -virtio-blk = ["block", "virtio", "driver_virtio/block"] -virtio-net = ["net", "virtio", "driver_virtio/net"] -virtio-gpu = ["display", "virtio", "driver_virtio/gpu"] -ramdisk = ["block", "driver_block/ramdisk"] -bcm2835-sdhci = ["block", "driver_block/bcm2835-sdhci"] -ixgbe = ["net", "driver_net/ixgbe", "dep:axalloc", "dep:axhal"] -# more devices example: e1000 = ["net", "driver_net/e1000"] +virtio-blk = ["block", "virtio", "axdriver_virtio/block"] +virtio-net = ["net", "virtio", "axdriver_virtio/net"] +virtio-gpu = ["display", "virtio", "axdriver_virtio/gpu"] +ramdisk = ["block", "axdriver_block/ramdisk"] +bcm2835-sdhci = ["block", "axdriver_block/bcm2835-sdhci"] +ixgbe = ["net", "axdriver_net/ixgbe", "dep:axalloc", "dep:axhal"] +# more devices example: e1000 = ["net", "axdriver_net/e1000"] default = ["bus-mmio"] [dependencies] log = "0.4" cfg-if = "1.0" -driver_common = { path = "../../crates/driver_common" } -driver_block = { path = "../../crates/driver_block", optional = true } -driver_net = { path = "../../crates/driver_net", optional = true } -driver_display = { path = "../../crates/driver_display", optional = true } -driver_pci = { path = "../../crates/driver_pci", optional = true } -driver_virtio = { path = "../../crates/driver_virtio", optional = true } -axalloc = { path = "../axalloc", optional = true } -axhal = { path = "../axhal", optional = true } -axconfig = { path = "../axconfig", optional = true } +axdriver_base = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.0" } +axdriver_block = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.0", optional = true } +axdriver_net = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.0", optional = true } +axdriver_display = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.0", optional = true } +axdriver_pci = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.0", optional = true } +axdriver_virtio = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.0", optional = true } +axalloc = { workspace = true, optional = true } +axhal = { workspace = true, optional = true } +axconfig = { workspace = true, optional = true } diff --git a/modules/axdriver/src/bus/pci.rs b/modules/axdriver/src/bus/pci.rs index f47b2757e6..a83ae9af59 100644 --- a/modules/axdriver/src/bus/pci.rs +++ b/modules/axdriver/src/bus/pci.rs @@ -1,8 +1,8 @@ use crate::{prelude::*, AllDevices}; -use axhal::mem::phys_to_virt; -use driver_pci::{ +use axdriver_pci::{ BarInfo, Cam, Command, DeviceFunction, HeaderType, MemoryBarType, PciRangeAllocator, PciRoot, }; +use axhal::mem::phys_to_virt; const PCI_BAR_NUM: u8 = 6; diff --git a/modules/axdriver/src/drivers.rs b/modules/axdriver/src/drivers.rs index 8266506ef5..d7c84e27f8 100644 --- a/modules/axdriver/src/drivers.rs +++ b/modules/axdriver/src/drivers.rs @@ -3,13 +3,13 @@ #![allow(unused_imports)] use crate::AxDeviceEnum; -use driver_common::DeviceType; +use axdriver_base::DeviceType; #[cfg(feature = "virtio")] use crate::virtio::{self, VirtIoDevMeta}; #[cfg(feature = "bus-pci")] -use driver_pci::{DeviceFunction, DeviceFunctionInfo, PciRoot}; +use axdriver_pci::{DeviceFunction, DeviceFunctionInfo, PciRoot}; pub use super::dummy::*; @@ -55,13 +55,13 @@ register_display_driver!( cfg_if::cfg_if! { if #[cfg(block_dev = "ramdisk")] { pub struct RamDiskDriver; - register_block_driver!(RamDiskDriver, driver_block::ramdisk::RamDisk); + register_block_driver!(RamDiskDriver, axdriver_block::ramdisk::RamDisk); impl DriverProbe for RamDiskDriver { fn probe_global() -> Option { // TODO: format RAM disk Some(AxDeviceEnum::from_block( - driver_block::ramdisk::RamDisk::new(0x100_0000), // 16 MiB + axdriver_block::ramdisk::RamDisk::new(0x100_0000), // 16 MiB )) } } @@ -71,12 +71,12 @@ cfg_if::cfg_if! { cfg_if::cfg_if! { if #[cfg(block_dev = "bcm2835-sdhci")]{ pub struct BcmSdhciDriver; - register_block_driver!(MmckDriver, driver_block::bcm2835sdhci::SDHCIDriver); + register_block_driver!(MmckDriver, axdriver_block::bcm2835sdhci::SDHCIDriver); impl DriverProbe for BcmSdhciDriver { fn probe_global() -> Option { debug!("mmc probe"); - driver_block::bcm2835sdhci::SDHCIDriver::try_new().ok().map(AxDeviceEnum::from_block) + axdriver_block::bcm2835sdhci::SDHCIDriver::try_new().ok().map(AxDeviceEnum::from_block) } } } @@ -87,15 +87,15 @@ cfg_if::cfg_if! { use crate::ixgbe::IxgbeHalImpl; use axhal::mem::phys_to_virt; pub struct IxgbeDriver; - register_net_driver!(IxgbeDriver, driver_net::ixgbe::IxgbeNic); + register_net_driver!(IxgbeDriver, axdriver_net::ixgbe::IxgbeNic); impl DriverProbe for IxgbeDriver { fn probe_pci( - root: &mut driver_pci::PciRoot, - bdf: driver_pci::DeviceFunction, - dev_info: &driver_pci::DeviceFunctionInfo, + root: &mut axdriver_pci::PciRoot, + bdf: axdriver_pci::DeviceFunction, + dev_info: &axdriver_pci::DeviceFunctionInfo, ) -> Option { use crate::ixgbe::IxgbeHalImpl; - use driver_net::ixgbe::{INTEL_82599, INTEL_VEND, IxgbeNic}; + use axdriver_net::ixgbe::{INTEL_82599, INTEL_VEND, IxgbeNic}; if dev_info.vendor_id == INTEL_VEND && dev_info.device_id == INTEL_82599 { // Intel 10Gb Network info!("ixgbe PCI device found at {:?}", bdf); @@ -106,7 +106,7 @@ cfg_if::cfg_if! { const QS: usize = 1024; let bar_info = root.bar_info(bdf, 0).unwrap(); match bar_info { - driver_pci::BarInfo::Memory { + axdriver_pci::BarInfo::Memory { address, size, .. @@ -118,7 +118,7 @@ cfg_if::cfg_if! { .expect("failed to initialize ixgbe device"); return Some(AxDeviceEnum::from_net(ixgbe_nic)); } - driver_pci::BarInfo::IO { .. } => { + axdriver_pci::BarInfo::IO { .. } => { error!("ixgbe: BAR0 is of I/O type"); return None; } diff --git a/modules/axdriver/src/dummy.rs b/modules/axdriver/src/dummy.rs index 7a02fb0248..1bea0fcb9c 100644 --- a/modules/axdriver/src/dummy.rs +++ b/modules/axdriver/src/dummy.rs @@ -8,7 +8,7 @@ use cfg_if::cfg_if; cfg_if! { if #[cfg(net_dev = "dummy")] { - use driver_net::{EthernetAddress, NetBuf, NetBufBox, NetBufPool, NetBufPtr}; + use axdriver_net::{EthernetAddress, NetBuf, NetBufBox, NetBufPool, NetBufPtr}; pub struct DummyNetDev; pub struct DummyNetDrvier; @@ -85,10 +85,10 @@ cfg_if! { } impl DisplayDriverOps for DummyDisplayDev { - fn info(&self) -> driver_display::DisplayInfo { + fn info(&self) -> axdriver_display::DisplayInfo { unreachable!() } - fn fb(&self) -> driver_display::FrameBuffer { + fn fb(&self) -> axdriver_display::FrameBuffer { unreachable!() } fn need_flush(&self) -> bool { diff --git a/modules/axdriver/src/ixgbe.rs b/modules/axdriver/src/ixgbe.rs index 34d9267190..15f6a3a07b 100644 --- a/modules/axdriver/src/ixgbe.rs +++ b/modules/axdriver/src/ixgbe.rs @@ -1,7 +1,7 @@ use axalloc::global_allocator; +use axdriver_net::ixgbe::{IxgbeHal, PhysAddr as IxgbePhysAddr}; use axhal::mem::{phys_to_virt, virt_to_phys}; use core::{alloc::Layout, ptr::NonNull}; -use driver_net::ixgbe::{IxgbeHal, PhysAddr as IxgbePhysAddr}; pub struct IxgbeHalImpl; diff --git a/modules/axdriver/src/lib.rs b/modules/axdriver/src/lib.rs index 8f9854135c..72e5f5647f 100644 --- a/modules/axdriver/src/lib.rs +++ b/modules/axdriver/src/lib.rs @@ -49,8 +49,8 @@ //! - `block`: use block storage devices. Similar to the `net` feature. //! - `display`: use graphics display devices. Similar to the `net` feature. //! -//! [`VirtioNetDev`]: driver_virtio::VirtIoNetDev -//! [`Box`]: driver_net::NetDriverOps +//! [`VirtioNetDev`]: axdriver_virtio::VirtIoNetDev +//! [`Box`]: axdriver_net::NetDriverOps //! [trait objects]: https://doc.rust-lang.org/book/ch17-02-trait-objects.html //! [dyn]: https://doc.rust-lang.org/std/keyword.dyn.html diff --git a/modules/axdriver/src/prelude.rs b/modules/axdriver/src/prelude.rs index d41f7fb810..11e960feeb 100644 --- a/modules/axdriver/src/prelude.rs +++ b/modules/axdriver/src/prelude.rs @@ -1,10 +1,10 @@ //! Device driver prelude that includes some traits and types. -pub use driver_common::{BaseDriverOps, DevError, DevResult, DeviceType}; +pub use axdriver_base::{BaseDriverOps, DevError, DevResult, DeviceType}; #[cfg(feature = "block")] -pub use {crate::structs::AxBlockDevice, driver_block::BlockDriverOps}; +pub use {crate::structs::AxBlockDevice, axdriver_block::BlockDriverOps}; #[cfg(feature = "display")] -pub use {crate::structs::AxDisplayDevice, driver_display::DisplayDriverOps}; +pub use {crate::structs::AxDisplayDevice, axdriver_display::DisplayDriverOps}; #[cfg(feature = "net")] -pub use {crate::structs::AxNetDevice, driver_net::NetDriverOps}; +pub use {crate::structs::AxNetDevice, axdriver_net::NetDriverOps}; diff --git a/modules/axdriver/src/structs/mod.rs b/modules/axdriver/src/structs/mod.rs index d373100fb9..da8be37c70 100644 --- a/modules/axdriver/src/structs/mod.rs +++ b/modules/axdriver/src/structs/mod.rs @@ -2,7 +2,7 @@ #[cfg_attr(not(feature = "dyn"), path = "static.rs")] mod imp; -use driver_common::{BaseDriverOps, DeviceType}; +use axdriver_base::{BaseDriverOps, DeviceType}; pub use imp::*; diff --git a/modules/axdriver/src/virtio.rs b/modules/axdriver/src/virtio.rs index 70a3e7ba95..6d3d9ac543 100644 --- a/modules/axdriver/src/virtio.rs +++ b/modules/axdriver/src/virtio.rs @@ -2,19 +2,19 @@ use core::marker::PhantomData; use core::ptr::NonNull; use axalloc::global_allocator; +use axdriver_base::{BaseDriverOps, DevResult, DeviceType}; +use axdriver_virtio::{BufferDirection, PhysAddr, VirtIoHal}; use axhal::mem::{phys_to_virt, virt_to_phys}; use cfg_if::cfg_if; -use driver_common::{BaseDriverOps, DevResult, DeviceType}; -use driver_virtio::{BufferDirection, PhysAddr, VirtIoHal}; use crate::{drivers::DriverProbe, AxDeviceEnum}; cfg_if! { if #[cfg(bus = "pci")] { - use driver_pci::{PciRoot, DeviceFunction, DeviceFunctionInfo}; - type VirtIoTransport = driver_virtio::PciTransport; + use axdriver_pci::{PciRoot, DeviceFunction, DeviceFunctionInfo}; + type VirtIoTransport = axdriver_virtio::PciTransport; } else if #[cfg(bus = "mmio")] { - type VirtIoTransport = driver_virtio::MmioTransport; + type VirtIoTransport = axdriver_virtio::MmioTransport; } } @@ -34,7 +34,7 @@ cfg_if! { impl VirtIoDevMeta for VirtIoNet { const DEVICE_TYPE: DeviceType = DeviceType::Net; - type Device = driver_virtio::VirtIoNetDev; + type Device = axdriver_virtio::VirtIoNetDev; fn try_new(transport: VirtIoTransport) -> DevResult { Ok(AxDeviceEnum::from_net(Self::Device::try_new(transport)?)) @@ -49,7 +49,7 @@ cfg_if! { impl VirtIoDevMeta for VirtIoBlk { const DEVICE_TYPE: DeviceType = DeviceType::Block; - type Device = driver_virtio::VirtIoBlkDev; + type Device = axdriver_virtio::VirtIoBlkDev; fn try_new(transport: VirtIoTransport) -> DevResult { Ok(AxDeviceEnum::from_block(Self::Device::try_new(transport)?)) @@ -64,7 +64,7 @@ cfg_if! { impl VirtIoDevMeta for VirtIoGpu { const DEVICE_TYPE: DeviceType = DeviceType::Display; - type Device = driver_virtio::VirtIoGpuDev; + type Device = axdriver_virtio::VirtIoGpuDev; fn try_new(transport: VirtIoTransport) -> DevResult { Ok(AxDeviceEnum::from_display(Self::Device::try_new(transport)?)) @@ -81,7 +81,7 @@ impl DriverProbe for VirtIoDriver { fn probe_mmio(mmio_base: usize, mmio_size: usize) -> Option { let base_vaddr = phys_to_virt(mmio_base.into()); if let Some((ty, transport)) = - driver_virtio::probe_mmio_device(base_vaddr.as_mut_ptr(), mmio_size) + axdriver_virtio::probe_mmio_device(base_vaddr.as_mut_ptr(), mmio_size) { if ty == D::DEVICE_TYPE { match D::try_new(transport) { @@ -118,7 +118,7 @@ impl DriverProbe for VirtIoDriver { } if let Some((ty, transport)) = - driver_virtio::probe_pci_device::(root, bdf, dev_info) + axdriver_virtio::probe_pci_device::(root, bdf, dev_info) { if ty == D::DEVICE_TYPE { match D::try_new(transport) { diff --git a/modules/axfs/Cargo.toml b/modules/axfs/Cargo.toml index ff7f45ce88..97643f37a9 100644 --- a/modules/axfs/Cargo.toml +++ b/modules/axfs/Cargo.toml @@ -23,17 +23,17 @@ default = ["devfs", "ramfs", "fatfs", "procfs", "sysfs"] [dependencies] log = "0.4" cfg-if = "1.0" -lazy_init = { path = "../../crates/lazy_init" } -capability = { path = "../../crates/capability" } -driver_block = { path = "../../crates/driver_block" } -axio = { path = "../../crates/axio", features = ["alloc"] } -axerrno = { path = "../../crates/axerrno" } -axfs_vfs = { path = "../../crates/axfs_vfs" } -axfs_devfs = { path = "../../crates/axfs_devfs", optional = true } -axfs_ramfs = { path = "../../crates/axfs_ramfs", optional = true } -axdriver = { path = "../axdriver", features = ["block"] } -axsync = { path = "../axsync" } -crate_interface = { path = "../../crates/crate_interface", optional = true } +lazyinit = "0.1" +cap_access = "0.1" +axio = { version = "0.1", features = ["alloc"] } +axerrno = "0.1" +axfs_vfs = "0.1" +axfs_devfs = { version = "0.1", optional = true } +axfs_ramfs = { version = "0.1", optional = true } +crate_interface = { version = "0.1", optional = true } +axsync = { workspace = true } +axdriver = { workspace = true, features = ["block"] } +axdriver_block = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.0" } [dependencies.fatfs] git = "https://github.com/rafalh/rust-fatfs" @@ -48,7 +48,7 @@ features = [ # no std ] [dev-dependencies] -axdriver = { path = "../axdriver", features = ["block", "ramdisk"] } -driver_block = { path = "../../crates/driver_block", features = ["ramdisk"] } -axsync = { path = "../axsync", features = ["multitask"] } -axtask = { path = "../axtask", features = ["test"] } +axdriver = { workspace = true, features = ["block", "ramdisk"] } +axdriver_block = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.0", features = ["ramdisk"] } +axsync = { workspace = true, features = ["multitask"] } +axtask = { workspace = true, features = ["test"] } diff --git a/modules/axfs/src/fops.rs b/modules/axfs/src/fops.rs index dea021e2a9..621a09450a 100644 --- a/modules/axfs/src/fops.rs +++ b/modules/axfs/src/fops.rs @@ -1,9 +1,9 @@ //! Low-level filesystem operations. -use axerrno::{ax_err, ax_err_type, AxResult}; +use axerrno::{ax_err, ax_err_type, AxError, AxResult}; use axfs_vfs::{VfsError, VfsNodeRef}; use axio::SeekFrom; -use capability::{Cap, WithCap}; +use cap_access::{Cap, WithCap}; use core::fmt; #[cfg(feature = "myfs")] @@ -112,6 +112,10 @@ impl OpenOptions { } impl File { + fn access_node(&self, cap: Cap) -> AxResult<&VfsNodeRef> { + self.node.access_or_err(cap, AxError::PermissionDenied) + } + fn _open_at(dir: Option<&VfsNodeRef>, path: &str, opts: &OpenOptions) -> AxResult { debug!("open file: {} {:?}", path, opts); if !opts.is_valid() { @@ -167,7 +171,7 @@ impl File { /// Truncates the file to the specified size. pub fn truncate(&self, size: u64) -> AxResult { - self.node.access(Cap::WRITE)?.truncate(size)?; + self.access_node(Cap::WRITE)?.truncate(size)?; Ok(()) } @@ -176,7 +180,7 @@ impl File { /// /// After the read, the cursor will be advanced by the number of bytes read. pub fn read(&mut self, buf: &mut [u8]) -> AxResult { - let node = self.node.access(Cap::READ)?; + let node = self.access_node(Cap::READ)?; let read_len = node.read_at(self.offset, buf)?; self.offset += read_len as u64; Ok(read_len) @@ -186,7 +190,7 @@ impl File { /// /// It does not update the file cursor. pub fn read_at(&self, offset: u64, buf: &mut [u8]) -> AxResult { - let node = self.node.access(Cap::READ)?; + let node = self.access_node(Cap::READ)?; let read_len = node.read_at(offset, buf)?; Ok(read_len) } @@ -197,12 +201,14 @@ impl File { /// After the write, the cursor will be advanced by the number of bytes /// written. pub fn write(&mut self, buf: &[u8]) -> AxResult { - let node = self.node.access(Cap::WRITE)?; - if self.is_append { - self.offset = self.get_attr()?.size(); + let offset = if self.is_append { + self.get_attr()?.size() + } else { + self.offset }; - let write_len = node.write_at(self.offset, buf)?; - self.offset += write_len as u64; + let node = self.access_node(Cap::WRITE)?; + let write_len = node.write_at(offset, buf)?; + self.offset = offset + write_len as u64; Ok(write_len) } @@ -211,14 +217,14 @@ impl File { /// /// It does not update the file cursor. pub fn write_at(&self, offset: u64, buf: &[u8]) -> AxResult { - let node = self.node.access(Cap::WRITE)?; + let node = self.access_node(Cap::WRITE)?; let write_len = node.write_at(offset, buf)?; Ok(write_len) } /// Flushes the file, writes all buffered data to the underlying device. pub fn flush(&self) -> AxResult { - self.node.access(Cap::WRITE)?.fsync()?; + self.access_node(Cap::WRITE)?.fsync()?; Ok(()) } @@ -238,11 +244,15 @@ impl File { /// Gets the file attributes. pub fn get_attr(&self) -> AxResult { - self.node.access(Cap::empty())?.get_attr() + self.access_node(Cap::empty())?.get_attr() } } impl Directory { + fn access_node(&self, cap: Cap) -> AxResult<&VfsNodeRef> { + self.node.access_or_err(cap, AxError::PermissionDenied) + } + fn _open_dir_at(dir: Option<&VfsNodeRef>, path: &str, opts: &OpenOptions) -> AxResult { debug!("open dir: {}", path); if !opts.read { @@ -273,7 +283,7 @@ impl Directory { if path.starts_with('/') { Ok(None) } else { - Ok(Some(self.node.access(Cap::EXECUTE)?)) + Ok(Some(self.access_node(Cap::EXECUTE)?)) } } @@ -322,8 +332,7 @@ impl Directory { /// read. pub fn read_dir(&mut self, dirents: &mut [DirEntry]) -> AxResult { let n = self - .node - .access(Cap::READ)? + .access_node(Cap::READ)? .read_dir(self.entry_idx, dirents)?; self.entry_idx += n; Ok(n) diff --git a/modules/axfs/src/root.rs b/modules/axfs/src/root.rs index 9bf02dce16..47dbe5247c 100644 --- a/modules/axfs/src/root.rs +++ b/modules/axfs/src/root.rs @@ -6,7 +6,7 @@ use alloc::{string::String, sync::Arc, vec::Vec}; use axerrno::{ax_err, AxError, AxResult}; use axfs_vfs::{VfsNodeAttr, VfsNodeOps, VfsNodeRef, VfsNodeType, VfsOps, VfsResult}; use axsync::Mutex; -use lazy_init::LazyInit; +use lazyinit::LazyInit; use crate::{api::FileType, fs, mounts}; diff --git a/modules/axfs/tests/test_fatfs.rs b/modules/axfs/tests/test_fatfs.rs index f8d046f395..b05950d507 100644 --- a/modules/axfs/tests/test_fatfs.rs +++ b/modules/axfs/tests/test_fatfs.rs @@ -3,7 +3,7 @@ mod test_common; use axdriver::AxDeviceContainer; -use driver_block::ramdisk::RamDisk; +use axdriver_block::ramdisk::RamDisk; const IMG_PATH: &str = "resources/fat16.img"; diff --git a/modules/axfs/tests/test_ramfs.rs b/modules/axfs/tests/test_ramfs.rs index 09a92978ad..914c245bc6 100644 --- a/modules/axfs/tests/test_ramfs.rs +++ b/modules/axfs/tests/test_ramfs.rs @@ -5,12 +5,12 @@ mod test_common; use std::sync::Arc; use axdriver::AxDeviceContainer; +use axdriver_block::ramdisk::RamDisk; use axfs::api::{self as fs, File}; use axfs::fops::{Disk, MyFileSystemIf}; use axfs_ramfs::RamFileSystem; use axfs_vfs::VfsOps; use axio::{Result, Write}; -use driver_block::ramdisk::RamDisk; struct MyFileSystemIfImpl; diff --git a/modules/axhal/Cargo.toml b/modules/axhal/Cargo.toml index 1cba51344b..d593a756f0 100644 --- a/modules/axhal/Cargo.toml +++ b/modules/axhal/Cargo.toml @@ -13,7 +13,7 @@ documentation = "https://arceos-org.github.io/arceos/axhal/index.html" smp = [] alloc = [] fp_simd = [] -paging = ["axalloc", "page_table"] +paging = ["axalloc", "page_table_multiarch"] irq = [] tls = ["alloc"] rtc = ["x86_rtc", "riscv_goldfish", "arm_pl031"] @@ -24,39 +24,39 @@ log = "0.4" cfg-if = "1.0" bitflags = "2.6" static_assertions = "1.1.0" -axlog = { path = "../axlog" } -axconfig = { path = "../axconfig" } -axalloc = { path = "../axalloc", optional = true } -kernel_guard = { path = "../../crates/kernel_guard" } -spinlock = { path = "../../crates/spinlock" } -ratio = { path = "../../crates/ratio" } -lazy_init = { path = "../../crates/lazy_init" } -page_table = { path = "../../crates/page_table", optional = true } -page_table_entry = { path = "../../crates/page_table_entry" } -percpu = { path = "../../crates/percpu" } -memory_addr = { path = "../../crates/memory_addr" } -handler_table = { path = "../../crates/handler_table" } -crate_interface = { path = "../../crates/crate_interface" } +kernel_guard = "0.1" +kspin = "0.1" +int_ratio = "0.1" +lazyinit = "0.1" +percpu = "0.1" +memory_addr = "0.2" +handler_table = "0.1" +crate_interface = "0.1" +page_table_entry = "0.1" +page_table_multiarch = { version = "0.1", optional = true } +axlog = { workspace = true } +axconfig = { workspace = true } +axalloc = { workspace = true, optional = true } [target.'cfg(target_arch = "x86_64")'.dependencies] x86 = "0.52" x86_64 = "0.15" x2apic = "0.4" raw-cpuid = "11.0" -x86_rtc = { version = "0.1.1", optional = true } +x86_rtc = { version = "0.1", optional = true } [target.'cfg(any(target_arch = "riscv32", target_arch = "riscv64"))'.dependencies] riscv = "0.11" sbi-rt = { version = "0.0.3", features = ["legacy"] } -riscv_goldfish = { version = "0.1.1", optional = true } +riscv_goldfish = { version = "0.1", optional = true } [target.'cfg(target_arch = "aarch64")'.dependencies] aarch64-cpu = "9.4" tock-registers = "0.8" -arm_gic = { path = "../../crates/arm_gic" } -arm_pl011 = { path = "../../crates/arm_pl011" } -arm_pl031 = { version = "0.1.1", optional = true } -dw_apb_uart = { path = "../../crates/dw_apb_uart" } +arm_gicv2 = "0.1" +arm_pl011 = "0.1" +arm_pl031 = { version = "0.1", optional = true } +dw_apb_uart = "0.1" [build-dependencies] -axconfig = { path = "../axconfig" } +axconfig = { workspace = true } diff --git a/modules/axhal/src/paging.rs b/modules/axhal/src/paging.rs index 2d035e5c62..c9f25cc3c7 100644 --- a/modules/axhal/src/paging.rs +++ b/modules/axhal/src/paging.rs @@ -1,12 +1,12 @@ //! Page table manipulation. use axalloc::global_allocator; -use page_table::PagingIf; +use page_table_multiarch::PagingHandler; use crate::mem::{phys_to_virt, virt_to_phys, MemRegionFlags, PhysAddr, VirtAddr, PAGE_SIZE_4K}; #[doc(no_inline)] -pub use page_table::{MappingFlags, PageSize, PagingError, PagingResult}; +pub use page_table_multiarch::{MappingFlags, PageSize, PagingError, PagingResult}; impl From for MappingFlags { fn from(f: MemRegionFlags) -> Self { @@ -30,11 +30,11 @@ impl From for MappingFlags { } } -/// Implementation of [`PagingIf`], to provide physical memory manipulation to -/// the [page_table] crate. -pub struct PagingIfImpl; +/// Implementation of [`PagingHandler`], to provide physical memory manipulation to +/// the [page_table_multiarch] crate. +pub struct PagingHandlerImpl; -impl PagingIf for PagingIfImpl { +impl PagingHandler for PagingHandlerImpl { fn alloc_frame() -> Option { global_allocator() .alloc_pages(1, PAGE_SIZE_4K) @@ -55,12 +55,12 @@ impl PagingIf for PagingIfImpl { cfg_if::cfg_if! { if #[cfg(target_arch = "x86_64")] { /// The architecture-specific page table. - pub type PageTable = page_table::x86_64::X64PageTable; + pub type PageTable = page_table_multiarch::x86_64::X64PageTable; } else if #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] { /// The architecture-specific page table. - pub type PageTable = page_table::riscv::Sv39PageTable; + pub type PageTable = page_table_multiarch::riscv::Sv39PageTable; } else if #[cfg(target_arch = "aarch64")]{ /// The architecture-specific page table. - pub type PageTable = page_table::aarch64::A64PageTable; + pub type PageTable = page_table_multiarch::aarch64::A64PageTable; } } diff --git a/modules/axhal/src/platform/aarch64_bsta1000b/dw_apb_uart.rs b/modules/axhal/src/platform/aarch64_bsta1000b/dw_apb_uart.rs index 844a3cbb3c..b8087b1b98 100644 --- a/modules/axhal/src/platform/aarch64_bsta1000b/dw_apb_uart.rs +++ b/modules/axhal/src/platform/aarch64_bsta1000b/dw_apb_uart.rs @@ -2,8 +2,8 @@ use crate::mem::phys_to_virt; use dw_apb_uart::DW8250; +use kspin::SpinNoIrq; use memory_addr::PhysAddr; -use spinlock::SpinNoIrq; const UART_BASE: PhysAddr = PhysAddr::from(axconfig::UART_PADDR); diff --git a/modules/axhal/src/platform/aarch64_common/generic_timer.rs b/modules/axhal/src/platform/aarch64_common/generic_timer.rs index 0caafa4b10..6e479c2f9e 100644 --- a/modules/axhal/src/platform/aarch64_common/generic_timer.rs +++ b/modules/axhal/src/platform/aarch64_common/generic_timer.rs @@ -1,7 +1,7 @@ #![allow(unused_imports)] use aarch64_cpu::registers::{CNTFRQ_EL0, CNTPCT_EL0, CNTP_CTL_EL0, CNTP_TVAL_EL0}; -use ratio::Ratio; +use int_ratio::Ratio; use tock_registers::interfaces::{Readable, Writeable}; static mut CNTPCT_TO_NANOS_RATIO: Ratio = Ratio::zero(); diff --git a/modules/axhal/src/platform/aarch64_common/gic.rs b/modules/axhal/src/platform/aarch64_common/gic.rs index 362a73ec78..a47e3921c9 100644 --- a/modules/axhal/src/platform/aarch64_common/gic.rs +++ b/modules/axhal/src/platform/aarch64_common/gic.rs @@ -1,8 +1,7 @@ use crate::{irq::IrqHandler, mem::phys_to_virt}; -use arm_gic::gic_v2::{GicCpuInterface, GicDistributor}; -use arm_gic::{translate_irq, InterruptType}; +use arm_gicv2::{translate_irq, GicCpuInterface, GicDistributor, InterruptType}; +use kspin::SpinNoIrq; use memory_addr::PhysAddr; -use spinlock::SpinNoIrq; /// The maximum number of IRQs. pub const MAX_IRQ_COUNT: usize = 1024; diff --git a/modules/axhal/src/platform/aarch64_common/pl011.rs b/modules/axhal/src/platform/aarch64_common/pl011.rs index e1c9083e79..5f4e7fd32b 100644 --- a/modules/axhal/src/platform/aarch64_common/pl011.rs +++ b/modules/axhal/src/platform/aarch64_common/pl011.rs @@ -1,8 +1,8 @@ //! PL011 UART. -use arm_pl011::pl011::Pl011Uart; +use arm_pl011::Pl011Uart; +use kspin::SpinNoIrq; use memory_addr::PhysAddr; -use spinlock::SpinNoIrq; use crate::mem::phys_to_virt; diff --git a/modules/axhal/src/platform/riscv64_qemu_virt/irq.rs b/modules/axhal/src/platform/riscv64_qemu_virt/irq.rs index f8effde7df..667648a319 100644 --- a/modules/axhal/src/platform/riscv64_qemu_virt/irq.rs +++ b/modules/axhal/src/platform/riscv64_qemu_virt/irq.rs @@ -1,7 +1,7 @@ //! TODO: PLIC use crate::irq::IrqHandler; -use lazy_init::LazyInit; +use lazyinit::LazyInit; use riscv::register::sie; /// `Interrupt` bit in `scause` diff --git a/modules/axhal/src/platform/x86_pc/apic.rs b/modules/axhal/src/platform/x86_pc/apic.rs index eb4e3e5930..0f93df9971 100644 --- a/modules/axhal/src/platform/x86_pc/apic.rs +++ b/modules/axhal/src/platform/x86_pc/apic.rs @@ -1,8 +1,8 @@ #![allow(dead_code)] -use lazy_init::LazyInit; +use kspin::SpinNoIrq; +use lazyinit::LazyInit; use memory_addr::PhysAddr; -use spinlock::SpinNoIrq; use x2apic::ioapic::IoApic; use x2apic::lapic::{xapic_base, LocalApic, LocalApicBuilder}; use x86_64::instructions::port::Port; diff --git a/modules/axhal/src/platform/x86_pc/dtables.rs b/modules/axhal/src/platform/x86_pc/dtables.rs index f40edb2e3d..f259c29558 100644 --- a/modules/axhal/src/platform/x86_pc/dtables.rs +++ b/modules/axhal/src/platform/x86_pc/dtables.rs @@ -1,7 +1,7 @@ //! Description tables (per-CPU GDT, per-CPU ISS, IDT) use crate::arch::{GdtStruct, IdtStruct, TaskStateSegment}; -use lazy_init::LazyInit; +use lazyinit::LazyInit; static IDT: LazyInit = LazyInit::new(); diff --git a/modules/axhal/src/platform/x86_pc/time.rs b/modules/axhal/src/platform/x86_pc/time.rs index c47535de89..871ad9c3fb 100644 --- a/modules/axhal/src/platform/x86_pc/time.rs +++ b/modules/axhal/src/platform/x86_pc/time.rs @@ -1,10 +1,13 @@ use raw_cpuid::CpuId; +#[cfg(feature = "irq")] +use int_ratio::Ratio; + #[cfg(feature = "irq")] const LAPIC_TICKS_PER_SEC: u64 = 1_000_000_000; // TODO: need to calibrate #[cfg(feature = "irq")] -static mut NANOS_TO_LAPIC_TICKS_RATIO: ratio::Ratio = ratio::Ratio::zero(); +static mut NANOS_TO_LAPIC_TICKS_RATIO: Ratio = Ratio::zero(); static mut INIT_TICK: u64 = 0; static mut CPU_FREQ_MHZ: u64 = axconfig::TIMER_FREQUENCY as u64 / 1_000_000; @@ -88,7 +91,7 @@ pub(super) fn init_primary() { lapic.enable_timer(); // TODO: calibrate with HPET - NANOS_TO_LAPIC_TICKS_RATIO = ratio::Ratio::new( + NANOS_TO_LAPIC_TICKS_RATIO = Ratio::new( LAPIC_TICKS_PER_SEC as u32, crate::time::NANOS_PER_SEC as u32, ); diff --git a/modules/axhal/src/platform/x86_pc/uart16550.rs b/modules/axhal/src/platform/x86_pc/uart16550.rs index 7627c080bd..3c773d3074 100644 --- a/modules/axhal/src/platform/x86_pc/uart16550.rs +++ b/modules/axhal/src/platform/x86_pc/uart16550.rs @@ -1,6 +1,6 @@ //! Uart 16550. -use spinlock::SpinNoIrq; +use kspin::SpinNoIrq; use x86_64::instructions::port::{Port, PortReadOnly, PortWriteOnly}; const UART_CLOCK_FACTOR: usize = 16; diff --git a/modules/axlog/Cargo.toml b/modules/axlog/Cargo.toml index a5b099cbe8..3776c8e657 100644 --- a/modules/axlog/Cargo.toml +++ b/modules/axlog/Cargo.toml @@ -22,8 +22,8 @@ default = [] [dependencies] cfg-if = "1.0" log = "0.4" -spinlock = { path = "../../crates/spinlock" } -crate_interface = { path = "../../crates/crate_interface" } +kspin = "0.1" +crate_interface = "0.1" chrono = { version = "0.4", optional = true } [dev-dependencies] diff --git a/modules/axlog/src/lib.rs b/modules/axlog/src/lib.rs index 7e63490324..f5b10b31c3 100644 --- a/modules/axlog/src/lib.rs +++ b/modules/axlog/src/lib.rs @@ -226,7 +226,7 @@ impl Log for Logger { /// Prints the formatted string to the console. pub fn print_fmt(args: fmt::Arguments) -> fmt::Result { - use spinlock::SpinNoIrq; // TODO: more efficient + use kspin::SpinNoIrq; // TODO: more efficient static LOCK: SpinNoIrq<()> = SpinNoIrq::new(()); let _guard = LOCK.lock(); diff --git a/modules/axnet/Cargo.toml b/modules/axnet/Cargo.toml index 710e7aad40..5b68776f22 100644 --- a/modules/axnet/Cargo.toml +++ b/modules/axnet/Cargo.toml @@ -17,14 +17,14 @@ default = ["smoltcp"] log = "0.4" cfg-if = "1.0" spin = "0.9" -driver_net = { path = "../../crates/driver_net" } -lazy_init = { path = "../../crates/lazy_init" } -axerrno = { path = "../../crates/axerrno" } -axhal = { path = "../axhal" } -axsync = { path = "../axsync" } -axtask = { path = "../axtask" } -axdriver = { path = "../axdriver", features = ["net"] } -axio = { path = "../../crates/axio" } +lazyinit = "0.1" +axerrno = "0.1" +axio = "0.1" +axhal = { workspace = true } +axsync = { workspace = true } +axtask = { workspace = true } +axdriver = { workspace = true, features = ["net"] } +axdriver_net = { git = "https://github.com/arceos-org/axdriver_crates.git", tag = "v0.1.0" } [dependencies.smoltcp] git = "https://github.com/rcore-os/smoltcp.git" diff --git a/modules/axnet/src/smoltcp_impl/mod.rs b/modules/axnet/src/smoltcp_impl/mod.rs index d95c64b2e4..3428ad2808 100644 --- a/modules/axnet/src/smoltcp_impl/mod.rs +++ b/modules/axnet/src/smoltcp_impl/mod.rs @@ -10,10 +10,10 @@ use core::cell::RefCell; use core::ops::DerefMut; use axdriver::prelude::*; +use axdriver_net::{DevError, NetBufPtr}; use axhal::time::{wall_time_nanos, NANOS_PER_MICROS}; use axsync::Mutex; -use driver_net::{DevError, NetBufPtr}; -use lazy_init::LazyInit; +use lazyinit::LazyInit; use smoltcp::iface::{Config, Interface, SocketHandle, SocketSet}; use smoltcp::phy::{Device, DeviceCapabilities, Medium, RxToken, TxToken}; use smoltcp::socket::{self, AnySocket}; diff --git a/modules/axruntime/Cargo.toml b/modules/axruntime/Cargo.toml index 83e1bfbbb4..9957fc8195 100644 --- a/modules/axruntime/Cargo.toml +++ b/modules/axruntime/Cargo.toml @@ -16,7 +16,7 @@ smp = ["axhal/smp"] irq = ["axhal/irq", "axtask?/irq", "percpu", "kernel_guard"] tls = ["axhal/tls", "axtask?/tls"] alloc = ["axalloc"] -paging = ["axhal/paging", "lazy_init"] +paging = ["axhal/paging", "lazyinit"] multitask = ["axtask/multitask"] fs = ["axdriver", "axfs"] @@ -25,19 +25,19 @@ display = ["axdriver", "axdisplay"] rtc = [] [dependencies] -axhal = { path = "../axhal" } -axlog = { path = "../axlog" } -axconfig = { path = "../axconfig" } -axalloc = { path = "../axalloc", optional = true } -axdriver = { path = "../axdriver", optional = true } -axfs = { path = "../axfs", optional = true } -axnet = { path = "../axnet", optional = true } -axdisplay = { path = "../axdisplay", optional = true } -axtask = { path = "../axtask", optional = true } +axhal = { workspace = true } +axlog = { workspace = true } +axconfig = { workspace = true } +axalloc = { workspace = true, optional = true } +axdriver = { workspace = true, optional = true } +axfs = { workspace = true, optional = true } +axnet = { workspace = true, optional = true } +axdisplay = { workspace = true, optional = true } +axtask = { workspace = true, optional = true } -crate_interface = { path = "../../crates/crate_interface" } -percpu = { path = "../../crates/percpu", optional = true } -kernel_guard = { path = "../../crates/kernel_guard", optional = true } -lazy_init = { path = "../../crates/lazy_init", optional = true } +crate_interface = "0.1" +percpu = { version = "0.1", optional = true } +kernel_guard = { version = "0.1", optional = true } +lazyinit = { version = "0.1", optional = true } chrono = { version = "0.4.38", default-features = false } diff --git a/modules/axruntime/src/lib.rs b/modules/axruntime/src/lib.rs index 7530593467..37d5b75a8b 100644 --- a/modules/axruntime/src/lib.rs +++ b/modules/axruntime/src/lib.rs @@ -238,7 +238,7 @@ fn init_allocator() { fn remap_kernel_memory() -> Result<(), axhal::paging::PagingError> { use axhal::mem::{memory_regions, phys_to_virt}; use axhal::paging::PageTable; - use lazy_init::LazyInit; + use lazyinit::LazyInit; static KERNEL_PAGE_TABLE: LazyInit = LazyInit::new(); diff --git a/modules/axsync/Cargo.toml b/modules/axsync/Cargo.toml index 148b718627..e145a1a106 100644 --- a/modules/axsync/Cargo.toml +++ b/modules/axsync/Cargo.toml @@ -14,10 +14,10 @@ multitask = ["axtask/multitask"] default = [] [dependencies] -spinlock = { path = "../../crates/spinlock" } -axtask = { path = "../axtask" } +kspin = "0.1" +axtask = { workspace = true } [dev-dependencies] rand = "0.8" -axsync = { path = ".", features = ["multitask"] } -axtask = { path = "../axtask", features = ["test"] } +axsync = { workspace = true, features = ["multitask"] } +axtask = { workspace = true, features = ["test"] } diff --git a/modules/axsync/src/lib.rs b/modules/axsync/src/lib.rs index 2b49cf7319..cc71a12833 100644 --- a/modules/axsync/src/lib.rs +++ b/modules/axsync/src/lib.rs @@ -3,7 +3,7 @@ //! Currently supported primitives: //! //! - [`Mutex`]: A mutual exclusion primitive. -//! - mod [`spin`](spinlock): spin-locks. +//! - mod [`spin`]: spinlocks imported from the [`kspin`] crate. //! //! # Cargo Features //! @@ -14,7 +14,7 @@ #![cfg_attr(not(test), no_std)] #![feature(doc_cfg)] -pub use spinlock as spin; +pub use kspin as spin; #[cfg(feature = "multitask")] mod mutex; @@ -25,4 +25,4 @@ pub use self::mutex::{Mutex, MutexGuard}; #[cfg(not(feature = "multitask"))] #[doc(cfg(not(feature = "multitask")))] -pub use spinlock::{SpinNoIrq as Mutex, SpinNoIrqGuard as MutexGuard}; +pub use kspin::{SpinNoIrq as Mutex, SpinNoIrqGuard as MutexGuard}; diff --git a/modules/axtask/Cargo.toml b/modules/axtask/Cargo.toml index 8ea3e431d3..65e55dd199 100644 --- a/modules/axtask/Cargo.toml +++ b/modules/axtask/Cargo.toml @@ -13,7 +13,7 @@ documentation = "https://arceos-org.github.io/arceos/axtask/index.html" default = [] multitask = [ - "dep:axconfig", "dep:percpu", "dep:spinlock", "dep:lazy_init", "dep:memory_addr", + "dep:axconfig", "dep:percpu", "dep:kspin", "dep:lazyinit", "dep:memory_addr", "dep:scheduler", "dep:timer_list", "kernel_guard", "dep:crate_interface", ] irq = [] @@ -29,16 +29,16 @@ test = ["percpu?/sp-naive"] [dependencies] cfg-if = "1.0" log = "0.4" -axhal = { path = "../axhal" } -axconfig = { path = "../axconfig", optional = true } -percpu = { path = "../../crates/percpu", optional = true } -spinlock = { path = "../../crates/spinlock", optional = true } -lazy_init = { path = "../../crates/lazy_init", optional = true } -memory_addr = { path = "../../crates/memory_addr", optional = true } -scheduler = { path = "../../crates/scheduler", optional = true } -timer_list = { path = "../../crates/timer_list", optional = true } -kernel_guard = { path = "../../crates/kernel_guard", optional = true } -crate_interface = { path = "../../crates/crate_interface", optional = true } +axhal = { workspace = true } +axconfig = { workspace = true, optional = true } +percpu = { version = "0.1", optional = true } +kspin = { version = "0.1", optional = true } +lazyinit = { version = "0.1", optional = true } +memory_addr = { version = "0.2", optional = true } +timer_list = { version = "0.1", optional = true } +kernel_guard = { version = "0.1", optional = true } +crate_interface = { version = "0.1", optional = true } +scheduler = { git = "https://github.com/arceos-org/scheduler.git", tag = "v0.1.0", optional = true } [dev-dependencies] rand = "0.8" diff --git a/modules/axtask/src/run_queue.rs b/modules/axtask/src/run_queue.rs index b837ffbf7f..6e93c134ac 100644 --- a/modules/axtask/src/run_queue.rs +++ b/modules/axtask/src/run_queue.rs @@ -1,8 +1,8 @@ use alloc::collections::VecDeque; use alloc::sync::Arc; -use lazy_init::LazyInit; +use kspin::SpinNoIrq; +use lazyinit::LazyInit; use scheduler::BaseScheduler; -use spinlock::SpinNoIrq; use crate::task::{CurrentTask, TaskState}; use crate::{AxTaskRef, Scheduler, TaskInner, WaitQueue}; diff --git a/modules/axtask/src/timers.rs b/modules/axtask/src/timers.rs index 1d0f165ecc..f930f50ecb 100644 --- a/modules/axtask/src/timers.rs +++ b/modules/axtask/src/timers.rs @@ -1,7 +1,7 @@ use alloc::sync::Arc; use axhal::time::wall_time; -use lazy_init::LazyInit; -use spinlock::SpinNoIrq; +use kspin::SpinNoIrq; +use lazyinit::LazyInit; use timer_list::{TimeValue, TimerEvent, TimerList}; use crate::{AxTaskRef, RUN_QUEUE}; diff --git a/modules/axtask/src/wait_queue.rs b/modules/axtask/src/wait_queue.rs index 1694e80b4b..d13628ad6f 100644 --- a/modules/axtask/src/wait_queue.rs +++ b/modules/axtask/src/wait_queue.rs @@ -1,6 +1,6 @@ use alloc::collections::VecDeque; use alloc::sync::Arc; -use spinlock::SpinRaw; +use kspin::SpinRaw; use crate::{AxRunQueue, AxTaskRef, CurrentTask, RUN_QUEUE}; diff --git a/scripts/make/cargo.mk b/scripts/make/cargo.mk index 8d4be28fce..50f15494cb 100644 --- a/scripts/make/cargo.mk +++ b/scripts/make/cargo.mk @@ -30,12 +30,10 @@ endef clippy_args := -A clippy::new_without_default define cargo_clippy - $(call run_cmd,cargo clippy,--all-features --workspace --exclude axlog $(1) $(verbose) -- $(clippy_args)) - $(call run_cmd,cargo clippy,-p axlog -p percpu -p percpu_macros $(1) $(verbose) -- $(clippy_args)) + $(call run_cmd,cargo clippy,--all-features --workspace $(1) $(verbose) -- $(clippy_args)) endef all_packages := \ - $(shell ls $(CURDIR)/crates) \ $(shell ls $(CURDIR)/modules) \ axfeat arceos_api axstd axlibc @@ -45,6 +43,4 @@ define cargo_doc $(foreach p,$(all_packages), \ $(call run_cmd,cargo rustdoc,--all-features -p $(p) $(verbose)) ) - @# for some crates, re-generate without `--all-features` - $(call run_cmd,cargo doc,--no-deps -p percpu $(verbose)) endef diff --git a/scripts/make/test.mk b/scripts/make/test.mk index a29d670b8c..5686a68679 100644 --- a/scripts/make/test.mk +++ b/scripts/make/test.mk @@ -1,7 +1,6 @@ # Test scripts define unit_test - $(call run_cmd,cargo test,-p percpu $(1) -- --nocapture) $(call run_cmd,cargo test,-p axfs $(1) --features "myfs" -- --nocapture) $(call run_cmd,cargo test,--workspace --exclude "arceos-*" $(1) -- --nocapture) endef diff --git a/ulib/axlibc/Cargo.toml b/ulib/axlibc/Cargo.toml index 9aed32ffa0..d420d0c309 100644 --- a/ulib/axlibc/Cargo.toml +++ b/ulib/axlibc/Cargo.toml @@ -51,10 +51,10 @@ select = ["arceos_posix_api/select"] epoll = ["arceos_posix_api/epoll"] [dependencies] -axfeat = { path = "../../api/axfeat" } -arceos_posix_api = { path = "../../api/arceos_posix_api" } -axio = { path = "../../crates/axio" } -axerrno = { path = "../../crates/axerrno" } +axfeat = { workspace = true } +arceos_posix_api = { workspace = true } +axio = "0.1" +axerrno = "0.1" [build-dependencies] bindgen ={ version = "0.69" } diff --git a/ulib/axstd/Cargo.toml b/ulib/axstd/Cargo.toml index 08226f64e2..e09d9a2ccc 100644 --- a/ulib/axstd/Cargo.toml +++ b/ulib/axstd/Cargo.toml @@ -20,7 +20,7 @@ documentation = "https://arceos-org.github.io/arceos/axstd/index.html" default = [] # Multicore -smp = ["axfeat/smp", "spinlock/smp"] +smp = ["axfeat/smp", "kspin/smp"] # Floating point/SIMD fp_simd = ["axfeat/fp_simd"] @@ -72,8 +72,8 @@ log-level-debug = ["axfeat/log-level-debug"] log-level-trace = ["axfeat/log-level-trace"] [dependencies] -axfeat = { path = "../../api/axfeat" } -arceos_api = { path = "../../api/arceos_api" } -axio = { path = "../../crates/axio" } -axerrno = { path = "../../crates/axerrno" } -spinlock = { path = "../../crates/spinlock" } +axfeat = { workspace = true } +arceos_api = { workspace = true } +axio = "0.1" +axerrno = "0.1" +kspin = "0.1" diff --git a/ulib/axstd/src/sync/mod.rs b/ulib/axstd/src/sync/mod.rs index 75f003fa5a..45546e77c7 100644 --- a/ulib/axstd/src/sync/mod.rs +++ b/ulib/axstd/src/sync/mod.rs @@ -16,4 +16,4 @@ pub use self::mutex::{Mutex, MutexGuard}; #[cfg(not(feature = "multitask"))] #[doc(cfg(not(feature = "multitask")))] -pub use spinlock::{SpinRaw as Mutex, SpinRawGuard as MutexGuard}; // never used in IRQ context +pub use kspin::{SpinRaw as Mutex, SpinRawGuard as MutexGuard}; // never used in IRQ context