diff --git a/.envrc b/.envrc new file mode 100644 index 000000000..09fcbb730 --- /dev/null +++ b/.envrc @@ -0,0 +1,3 @@ +#use_flake_if_supported +use flake . +eval "$shellHook" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae10d47e5..98585d022 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ on: - cron: '0 22 * * *' # every day at 22:00 UTC env: - rust_toolchain: nightly-2022-08-05 + rust_toolchain: nightly-2023-10-01 jobs: workspace: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bf9bca9ef..b469f5df0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,7 +5,7 @@ on: pull_request: env: - rust_toolchain: nightly-2022-08-05 + rust_toolchain: nightly-2023-10-01 jobs: doc: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c88816b09..d1f04866b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ on: - cron: '0 22 * * *' # every day at 22:00 UTC env: - rust_toolchain: nightly-2022-08-05 + rust_toolchain: nightly-2023-10-01 qemu_version: 7.0.0 jobs: diff --git a/Cargo.lock b/Cargo.lock index 4f1ff994c..826a155cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,22 +2,36 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aarch64-cpu" +version = "9.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac42a04a61c19fc8196dd728022a784baecc5d63d7e256c01ad1b3fbfab26287" +dependencies = [ + "tock-registers 0.8.1", +] + [[package]] name = "acpi" -version = "4.1.1" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654f48ab3178632ea535be1765073b990895cb62f70a7e5671975d7150c26d15" +checksum = "e248409195304021f61b39ba2628f62a45a3abf6119669d44b3399d60eabe4c3" dependencies = [ "bit_field", "log", - "rsdp", ] [[package]] name = "ahash" -version = "0.4.7" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] [[package]] name = "aho-corasick" @@ -28,6 +42,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -46,6 +66,54 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstream" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" + +[[package]] +name = "anstyle-parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + [[package]] name = "arrayvec" version = "0.5.2" @@ -59,7 +127,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" dependencies = [ "quote", - "syn", + "syn 1.0.102", ] [[package]] @@ -140,7 +208,7 @@ dependencies = [ "async-io", "autocfg", "blocking", - "cfg-if 1.0.0", + "cfg-if", "event-listener", "futures-lite", "libc", @@ -191,7 +259,7 @@ checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.102", ] [[package]] @@ -206,7 +274,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -243,9 +311,9 @@ checksum = "23067a77080631c5d676e61865867f5e595a3f9a50bf6973e24fb7ce5c20ee91" [[package]] name = "bit_field" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" [[package]] name = "bitflags" @@ -253,6 +321,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + [[package]] name = "bitmap-allocator" version = "0.1.0" @@ -323,12 +397,6 @@ dependencies = [ "jobserver", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -358,7 +426,7 @@ checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "ansi_term", "atty", - "bitflags", + "bitflags 1.3.2", "strsim 0.8.0", "textwrap", "unicode-width", @@ -367,40 +435,43 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.15" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bf8832993da70a4c6d13c581f4463c2bdda27b9bf1c5498dc4365543abe6d6f" +checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" dependencies = [ - "atty", - "bitflags", + "clap_builder", "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" +dependencies = [ + "anstream", + "anstyle", "clap_lex", - "once_cell", "strsim 0.10.0", - "termcolor", ] [[package]] name = "clap_derive" -version = "4.0.13" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck 0.4.0", - "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 2.0.38", ] [[package]] name = "clap_lex" -version = "0.3.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" -dependencies = [ - "os_str_bytes", -] +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "codespan-reporting" @@ -412,6 +483,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "concurrent-queue" version = "1.2.4" @@ -453,16 +530,22 @@ version = "7.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdecfbb28672ad3664e71ae05a398a52df430d86d660691501b28968cc4467e6" dependencies = [ - "tock-registers", + "tock-registers 0.7.0", ] +[[package]] +name = "critical-section" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" + [[package]] name = "crossbeam" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-channel", "crossbeam-deque", "crossbeam-epoch", @@ -476,7 +559,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -486,7 +569,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -498,7 +581,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "memoffset", "scopeguard", @@ -510,7 +593,7 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cd42583b04998a5363558e5f9291ee5a5ff6b49944332103f251e7479a82aa7" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -520,17 +603,7 @@ version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "ctor" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb" -dependencies = [ - "quote", - "syn", + "cfg-if", ] [[package]] @@ -563,7 +636,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 1.0.102", ] [[package]] @@ -580,17 +653,17 @@ checksum = "dcb67a6de1f602736dd7eaead0080cf3435df806c61b24b13328db128c58868f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.102", ] [[package]] name = "d1-pac" -version = "0.0.27" +version = "0.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e11a44a3cc47dcc77ffd8b9eae36eccc123f6c31213a4d32c1b7c270350c7617" +checksum = "e03be09af0d1db27a816e681f260bb4be2412153a6ef0afbf94d974414630ceb" dependencies = [ "bare-metal", - "riscv 0.8.0", + "riscv 0.10.1", "vcell", ] @@ -674,6 +747,35 @@ dependencies = [ "termcolor", ] +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -683,17 +785,16 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "executor" version = "0.1.0" -source = "git+https://github.com/DeathWish5/PreemptiveScheduler?rev=e8cd353#e8cd353100046d2381f752261c3747bd9ee7b79e" +source = "git+https://github.com/KaminariOS/PreemptiveScheduler?rev=d558a02af5269dec0c4a9ac4197974577e02e165#d558a02af5269dec0c4a9ac4197974577e02e165" dependencies = [ + "aarch64-cpu", "bit-iter", - "cfg-if 1.0.0", - "cortex-a", + "cfg-if", "lazy_static", "log", - "raw-cpuid 10.6.0", - "riscv 0.8.0", + "raw-cpuid 11.0.1", + "riscv 0.10.1", "spin 0.9.4", - "tock-registers", "unicycle", "woke", "x86_64", @@ -714,10 +815,10 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -809,7 +910,7 @@ checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.102", ] [[package]] @@ -844,7 +945,7 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] @@ -868,7 +969,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 1.0.102", ] [[package]] @@ -877,7 +978,7 @@ version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0155506aab710a86160ddb504a480d2964d7ab5b9e62419be69e0032bc5931c" dependencies = [ - "bitflags", + "bitflags 1.3.2", "libc", "libgit2-sys", "log", @@ -898,11 +999,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.9.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -929,6 +1031,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + [[package]] name = "humantime" version = "2.1.0" @@ -969,13 +1077,34 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown", +] + [[package]] name = "instant" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", +] + +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi 0.3.3", + "rustix", + "windows-sys 0.48.0", ] [[package]] @@ -990,7 +1119,7 @@ version = "0.1.0" source = "git+https://github.com/rcore-os/isomorphic_drivers?rev=f7cd97a8#f7cd97a867057142f06de7f254accf7960514a79" dependencies = [ "bit_field", - "bitflags", + "bitflags 1.3.2", "log", "spin 0.9.4", "volatile 0.3.0", @@ -1029,9 +1158,9 @@ name = "kernel-hal" version = "0.1.0" dependencies = [ "async-std", - "bitflags", + "bitflags 2.4.1", "bitmap-allocator", - "cfg-if 1.0.0", + "cfg-if", "cortex-a", "executor", "git-version", @@ -1039,19 +1168,19 @@ dependencies = [ "lock", "log", "naive-timer", - "nix", + "nix 0.27.1", "numeric-enum-macro", "raw-cpuid 9.1.1", - "riscv 0.9.0", + "riscv 0.10.1", "sbi-rt", "smoltcp", "spin 0.9.4", "tempfile", - "tock-registers", + "tock-registers 0.7.0", "trapframe", "uefi", "x2apic", - "x86", + "x86 0.52.0", "x86-smpboot", "x86_64", "zcore-drivers", @@ -1077,9 +1206,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.135" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libgit2-sys" @@ -1119,8 +1248,8 @@ name = "linux-object" version = "0.1.0" dependencies = [ "async-trait", - "bitflags", - "cfg-if 1.0.0", + "bitflags 2.4.1", + "cfg-if", "downcast-rs", "hashbrown", "kernel-hal", @@ -1139,12 +1268,18 @@ dependencies = [ "zircon-object", ] +[[package]] +name = "linux-raw-sys" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" + [[package]] name = "linux-syscall" version = "0.1.0" dependencies = [ "async-std", - "bitflags", + "bitflags 2.4.1", "bitvec", "futures", "kernel-hal", @@ -1163,12 +1298,12 @@ name = "lock" version = "0.1.0" source = "git+https://github.com/DeathWish5/kernel-sync?rev=8486b8#8486b817a71ec5141836e00c817fefb94c9cfbb7" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cortex-a", "raw-cpuid 10.6.0", "riscv 0.7.0", "spin 0.9.4", - "tock-registers", + "tock-registers 0.7.0", "x86_64", ] @@ -1184,11 +1319,10 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" dependencies = [ - "cfg-if 1.0.0", "value-bag", ] @@ -1246,13 +1380,24 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "memoffset", ] +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.4.1", + "cfg-if", + "libc", +] + [[package]] name = "num-integer" version = "0.1.45" @@ -1278,7 +1423,7 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", ] @@ -1312,19 +1457,13 @@ dependencies = [ "once_cell", ] -[[package]] -name = "os_str_bytes" -version = "6.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" - [[package]] name = "page-table" version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82a394e6c402fb630dbb6e33a84a342c482a603ae32b2a26d61202bfaba2b2c0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "static_assertions", ] @@ -1345,7 +1484,7 @@ name = "pci" version = "0.0.1" source = "git+https://github.com/elliott10/pci-rs?rev=8f33774b#8f33774bf86472d4a58be5ad2a2be0c06e3dc567" dependencies = [ - "bitflags", + "bitflags 1.3.2", "log", ] @@ -1380,7 +1519,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "899b00b9c8ab553c743b3e11e87c5c7d423b2a2de229ba95b24a756344748011" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "libc", "log", "wepoll-ffi", @@ -1402,7 +1541,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.102", "version_check", ] @@ -1425,18 +1564,18 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.21" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -1489,7 +1628,7 @@ version = "9.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1733f6f80c9c24268736a501cd00d41a9849b4faa7a9f9334c096e5d10553206" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1498,7 +1637,16 @@ version = "10.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6823ea29436221176fe662da99998ad3b4db2c7f31e7b6f5fe43adccd6320bb" dependencies = [ - "bitflags", + "bitflags 1.3.2", +] + +[[package]] +name = "raw-cpuid" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" +dependencies = [ + "bitflags 2.4.1", ] [[package]] @@ -1507,7 +1655,7 @@ version = "2.0.0" source = "git+https://github.com/Luchangcheng2333/rayboot?rev=b19c6c3#b19c6c3c8c43bf3a10bdefbe9c4a211f558d5555" dependencies = [ "bit_field", - "bitflags", + "bitflags 1.3.2", "font8x8", "log", "serde", @@ -1554,7 +1702,7 @@ name = "rcore-console" version = "0.1.0" source = "git+https://github.com/rcore-os/rcore-console?rev=ca5b1bc#ca5b1bc02ab54fa5f39ba827a40a62b2b403e6c7" dependencies = [ - "bitflags", + "bitflags 1.3.2", "embedded-graphics", "lazy_static", "vte", @@ -1585,7 +1733,7 @@ name = "rcore-fs-fuse" version = "0.1.0" source = "git+https://github.com/rcore-os/rcore-fs?rev=1a3246b#1a3246b1d3754f414817d72a6217fc7b6076ff30" dependencies = [ - "env_logger", + "env_logger 0.9.1", "git-version", "libc", "log", @@ -1603,7 +1751,7 @@ version = "0.1.0" source = "git+https://github.com/rcore-os/rcore-fs?rev=1a3246b#1a3246b1d3754f414817d72a6217fc7b6076ff30" dependencies = [ "log", - "nix", + "nix 0.23.1", "rcore-fs", ] @@ -1658,7 +1806,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1681,7 +1829,7 @@ checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "region-alloc" version = "0.1.0" -source = "git+https://github.com/rzswh/region-allocator?rev=122c7a71#122c7a7153fa992f81edabe3af2f3f6fd08abf73" +source = "git+https://github.com/KaminariOS/region-allocator#90502467aeca0490628fab2f7e66c649a69dbecb" [[package]] name = "remove_dir_all" @@ -1705,23 +1853,12 @@ dependencies = [ [[package]] name = "riscv" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2856a701069e2d262b264750d382407d272d5527f7a51d3777d1805b4e2d3c" -dependencies = [ - "bare-metal", - "bit_field", - "embedded-hal", -] - -[[package]] -name = "riscv" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fc4bc7113424814738fe79755a5764e392b3d4d1bc757e6aa6f61cede32095" +checksum = "aa3145d2fae3778b1e31ec2e827b228bdc6abd9b74bb5705ba46dcb82069bc4f" dependencies = [ - "bare-metal", "bit_field", + "critical-section", "embedded-hal", ] @@ -1736,12 +1873,16 @@ dependencies = [ ] [[package]] -name = "rsdp" -version = "2.0.0" +name = "rustix" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d3add2fc55ef37511bcf81a08ee7a09eff07b23aae38b06a29024a38c604b1" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ - "log", + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1791,11 +1932,11 @@ checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" [[package]] name = "sdl2" -version = "0.34.5" +version = "0.35.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deecbc3fa9460acff5a1e563e05cb5f31bba0aa0c214bb49a43db8159176d54b" +checksum = "f7959277b623f1fb9e04aea73686c3ca52f01b2145f8ea16f4ff30d8b7623b1a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "lazy_static", "libc", "sdl2-sys", @@ -1803,11 +1944,11 @@ dependencies = [ [[package]] name = "sdl2-sys" -version = "0.34.5" +version = "0.35.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41a29aa21f175b5a41a6e26da572d5e5d1ee5660d35f9f9d0913e8a802098f74" +checksum = "e3586be2cf6c0a8099a79a12b4084357aa9b3e0b0d7980e3b67aaf7a9d55f9f0" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "libc", "version-compare", ] @@ -1829,7 +1970,16 @@ checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.102", +] + +[[package]] +name = "serde_spanned" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +dependencies = [ + "serde", ] [[package]] @@ -1877,7 +2027,7 @@ name = "smoltcp" version = "0.8.0" source = "git+https://github.com/smoltcp-rs/smoltcp?rev=35e833e3#35e833e33dfd3e4efc3eb7d5de06bec17c54b011" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "log", "managed", @@ -1962,7 +2112,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.102", ] [[package]] @@ -1976,6 +2126,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "tap" version = "1.0.1" @@ -1988,7 +2149,7 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "libc", "redox_syscall", @@ -2056,13 +2217,44 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee8fba06c1f4d0b396ef61a54530bb6b28f0dc61c38bc8bc5a5a48161e6282e" +[[package]] +name = "tock-registers" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "696941a0aee7e276a165a978b37918fd5d22c55c3d6bda197813070ca9c0f21c" + [[package]] name = "toml" -version = "0.5.9" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ff9e3abce27ee2c9a37f9ad37238c1bdd4e789c84ba37df76aa4d528f5072cc" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ + "indexmap", "serde", + "serde_spanned", + "toml_datetime", + "winnow", ] [[package]] @@ -2090,7 +2282,7 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e69e94934e3a8fb9d652408385a1ce5199bbe31df2baba1973bcd1ba2c973fd" dependencies = [ - "bitflags", + "bitflags 1.3.2", "log", "ucs2", "uefi-macros", @@ -2104,7 +2296,7 @@ checksum = "f618e22256b6ecc841fe2f24b5978fa47221b5006712da01236b5407c8474866" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.102", ] [[package]] @@ -2172,19 +2364,15 @@ dependencies = [ [[package]] name = "utf8parse" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "value-bag" -version = "1.0.0-alpha.9" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" -dependencies = [ - "ctor", - "version_check", -] +checksum = "4a72e1902dde2bd6441347de2b70b7f5d59bf157c6c62f0c44572607a1d55bbe" [[package]] name = "vcell" @@ -2206,9 +2394,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version-compare" -version = "0.0.10" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" +checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" [[package]] name = "version_check" @@ -2221,7 +2409,7 @@ name = "virtio-drivers" version = "0.1.0" source = "git+https://github.com/rcore-os/virtio-drivers?rev=2aaf7d6#2aaf7d60c557ffdfaa2403bef420d41e469009ba" dependencies = [ - "bitflags", + "bitflags 1.3.2", "log", "volatile 0.3.0", ] @@ -2300,7 +2488,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -2315,7 +2503,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.102", "wasm-bindgen-shared", ] @@ -2325,7 +2513,7 @@ version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -2349,7 +2537,7 @@ checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.102", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2416,48 +2604,123 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winnow" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176b6138793677221d420fd2f0aeeced263f197688b36484660da767bca2fa32" +dependencies = [ + "memchr", +] + [[package]] name = "woke" -version = "0.0.2" +version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eafdab77c9ee549298ca6585107832aa89d77b14ba13cda220fec6105b17dbb1" +checksum = "f84a0acf95762131790eb4f458d5b9c8ae90dc521f8c5901906203764b261b0b" [[package]] name = "wyz" @@ -2475,7 +2738,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32b6a3e030cfc71d614954e1de6dcb09e40bf1437f620c27b4526f978bee912e" dependencies = [ "bit", - "bitflags", + "bitflags 1.3.2", "paste", "raw-cpuid 10.6.0", "x86_64", @@ -2488,7 +2751,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6297379090b1be212a2d59dd57708c99b42b4bcbeee2ce6fb80babbe7b63e89a" dependencies = [ "bit_field", - "bitflags", + "bitflags 1.3.2", + "raw-cpuid 10.6.0", +] + +[[package]] +name = "x86" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2781db97787217ad2a2845c396a5efe286f87467a5810836db6d74926e94a385" +dependencies = [ + "bit_field", + "bitflags 1.3.2", "raw-cpuid 10.6.0", ] @@ -2497,7 +2771,7 @@ name = "x86-smpboot" version = "0.1.0" source = "git+https://github.com/rcore-os/x86-smpboot?rev=1069df3#1069df357e1cb212930f02c98b84debb6d17dc80" dependencies = [ - "x86", + "x86 0.46.0", ] [[package]] @@ -2507,7 +2781,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "100555a863c0092238c2e0e814c1096c1e5cf066a309c696a87e907b5f8c5d69" dependencies = [ "bit_field", - "bitflags", + "bitflags 1.3.2", "rustversion", "volatile 0.4.5", ] @@ -2534,7 +2808,7 @@ dependencies = [ name = "xtask" version = "0.1.0" dependencies = [ - "clap 4.0.15", + "clap 4.4.7", "dircpy", "num_cpus", "once_cell", @@ -2563,7 +2837,7 @@ dependencies = [ "async-std", "bitmap-allocator", "buddy_system_allocator", - "cfg-if 1.0.0", + "cfg-if", "chrono", "customizable-buddy", "dtb-walker", @@ -2579,7 +2853,7 @@ dependencies = [ "rcore-fs", "rcore-fs-hostfs", "rcore-fs-sfs", - "riscv 0.9.0", + "riscv 0.10.1", "sbi-rt", "spin 0.9.4", "zcore-loader", @@ -2592,9 +2866,9 @@ version = "0.1.0" dependencies = [ "acpi", "async-std", - "bitflags", + "bitflags 2.4.1", "bitmap-allocator", - "cfg-if 1.0.0", + "cfg-if", "d1-pac", "device_tree", "isomorphic_drivers", @@ -2604,7 +2878,7 @@ dependencies = [ "numeric-enum-macro", "pci", "rcore-console", - "riscv 0.9.0", + "riscv 0.10.1", "sdl2", "smoltcp", "virtio-drivers", @@ -2618,8 +2892,8 @@ name = "zcore-loader" version = "0.1.0" dependencies = [ "async-std", - "cfg-if 1.0.0", - "env_logger", + "cfg-if", + "env_logger 0.10.0", "executor", "kernel-hal", "linux-object", @@ -2637,13 +2911,33 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f1bc8a6b2005884962297587045002d8cfb8dcec9db332f4ca216ddc5de82c5" +[[package]] +name = "zerocopy" +version = "0.7.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686b7e407015242119c33dab17b8f61ba6843534de936d94368856528eae4dcc" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020f3dfe25dfc38dfea49ce62d5d45ecdd7f0d8a724fa63eb36b6eba4ec76806" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "zircon-object" version = "0.1.0" dependencies = [ "async-std", - "bitflags", - "cfg-if 1.0.0", + "bitflags 2.4.1", + "cfg-if", "downcast-rs", "futures", "hashbrown", @@ -2660,8 +2954,8 @@ dependencies = [ name = "zircon-syscall" version = "0.1.0" dependencies = [ - "bitflags", - "cfg-if 1.0.0", + "bitflags 2.4.1", + "cfg-if", "futures", "kernel-hal", "lock", diff --git a/Cargo.toml b/Cargo.toml index ff2247acd..9d650f0fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,17 @@ members = [ ] default-members = ["xtask"] exclude = ["zircon-user", "rboot"] +resolver = "2" [profile.release] lto = true debug = true + +[workspace.dependencies] +log = "0.4" +riscv = "0.10.1" +executor = { git = "https://github.com/KaminariOS/PreemptiveScheduler", rev = "d558a02af5269dec0c4a9ac4197974577e02e165" } +hashbrown = "0.14.2" +bitflags = "2.4.1" +cfg-if = "1.0" +lazy_static = "1.4" diff --git a/drivers/Cargo.toml b/drivers/Cargo.toml index 2cc3f42ad..c5b79e164 100644 --- a/drivers/Cargo.toml +++ b/drivers/Cargo.toml @@ -20,10 +20,10 @@ allwinner = ["d1-pac"] fu740 = [] [dependencies] -log = "0.4" -cfg-if = "1.0" -bitflags = "1.3" -lazy_static = "1.4" +log.workspace = true +cfg-if.workspace = true +bitflags.workspace = true +lazy_static.workspace = true numeric-enum-macro = "0.2" device_tree = { git = "https://github.com/rcore-os/device_tree-rs", rev = "2f2e55f" } bitmap-allocator = { git = "https://github.com/rcore-os/bitmap-allocator", rev = "88e871a5" } @@ -49,18 +49,18 @@ smoltcp = { git = "https://github.com/smoltcp-rs/smoltcp", rev = "35e833e3", def "socket-icmp", "async", ] } -d1-pac = { version = "0.0.27", optional = true } +d1-pac = { version = "0.0.31", optional = true } volatile = "0.3" # LibOS mode [target.'cfg(not(target_os = "none"))'.dependencies] async-std = { version = "1.10", optional = true } -sdl2 = { version = "0.34", optional = true } +sdl2 = { version = "0.35", optional = true } [target.'cfg(target_arch = "x86_64")'.dependencies] -acpi = "4.1" +acpi = "5.0" x2apic = "0.4" x86_64 = "0.14" [target.'cfg(any(target_arch = "riscv32", target_arch = "riscv64"))'.dependencies] -riscv = "0.9" +riscv.workspace = true diff --git a/drivers/src/input/mouse.rs b/drivers/src/input/mouse.rs index fabecd509..5fac9ee42 100644 --- a/drivers/src/input/mouse.rs +++ b/drivers/src/input/mouse.rs @@ -7,7 +7,7 @@ use crate::scheme::{impl_event_scheme, InputScheme}; use crate::utils::EventListener; bitflags::bitflags! { - #[derive(Default)] + #[derive(Default, Clone, Copy, Debug, PartialEq)] pub struct MouseFlags: u8 { /// Whether or not the left mouse button is pressed. const LEFT_BTN = 1 << 0; diff --git a/drivers/src/uart/uart_pl011.rs b/drivers/src/uart/uart_pl011.rs index 5f92585a6..8822997bf 100644 --- a/drivers/src/uart/uart_pl011.rs +++ b/drivers/src/uart/uart_pl011.rs @@ -130,7 +130,7 @@ impl Pl011Inner { // Enable IRQs let flags = UartImscFlags::RXIM; - self.write_reg(self.intr_mask_setclr_reg, flags.bits); + self.write_reg(self.intr_mask_setclr_reg, flags.bits()); // Clear pending interrupts self.write_reg(self.intr_clr_reg, 0x7ff); diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..1dfe76779 --- /dev/null +++ b/flake.lock @@ -0,0 +1,130 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1697059129, + "narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5e4c2ada4fcd54b99d56d7bd62f384511a7e2593", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1681358109, + "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1697508761, + "narHash": "sha256-QKWiXUlnke+EiJw3pek1l7xyJ4YsxYXZeQJt/YLgjvA=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "6f74c92caaf2541641b50ec623676430101d1fd4", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..5b84d46dd --- /dev/null +++ b/flake.nix @@ -0,0 +1,54 @@ +{ + description = "Xv6"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + rust-overlay.url = "github:oxalica/rust-overlay"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { nixpkgs, rust-overlay, flake-utils,... }: let + lib = { + inherit (flake-utils.lib) defaultSystems eachSystem; + }; + supportedSystems = [ "x86_64-linux" ]; + in lib.eachSystem supportedSystems (system: let + # nightlyVersion = "2023-10-01"; + pkgs = import nixpkgs { + inherit system; + overlays = [ + (import rust-overlay) + ]; + }; + pinnedRust = (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override { + # extensions = ["rustc-dev" "rust-src" "rust-analyzer-preview" "llvm-tools-preview"]; + targets = [ "riscv64gc-unknown-none-elf"]; + }; + # rustPlatform = pkgs.makeRustPlatform { + # rustc = pinnedRust; + # cargo = pinnedRust; + # }; + #cargoPlay = pkgs.cargo-feature.override { inherit rustPlatform; }; + in { +devShell = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + qemu + openssl + pkg-config + python3 + (python3.withPackages (ps: with ps; [ termcolor])) + (with pkgsCross.riscv64; [ musl.stdenv.cc binutils]) + cargo-binutils + # Cross Compile + ] ++ [pinnedRust + ]; + buildInputs = with pkgs; [ + + ]; + + shellHook = '' + ''; +}; + + }); +} diff --git a/kernel-hal/Cargo.toml b/kernel-hal/Cargo.toml index e48c087cf..906411834 100644 --- a/kernel-hal/Cargo.toml +++ b/kernel-hal/Cargo.toml @@ -36,10 +36,10 @@ allwinner-drivers = ["zcore-drivers/allwinner"] fu740-drivers = ["zcore-drivers/fu740"] [dependencies] -log = "0.4" +log.workspace = true spin = "0.9" -cfg-if = "1.0" -bitflags = "1.3" +cfg-if.workspace = true +bitflags.workspace = true trapframe = "0.9.0" git-version = "0.3" numeric-enum-macro = "0.2" @@ -61,7 +61,7 @@ smoltcp = { git = "https://github.com/smoltcp-rs/smoltcp", rev = "35e833e3", def "socket-icmp", "async", ] } -nix = { version = "0.23", optional = true } +nix = { version = "0.27", optional = true, features = ["fs", "mman"]} tempfile = { version = "3", optional = true } async-std = { version = "1.10", optional = true } bitmap-allocator = { git = "https://github.com/rcore-os/bitmap-allocator.git", rev = "88e871a5", optional = true } @@ -69,16 +69,16 @@ bitmap-allocator = { git = "https://github.com/rcore-os/bitmap-allocator.git", r # Bare-metal mode [target.'cfg(target_os = "none")'.dependencies] naive-timer = "0.2.0" -executor = { git = "https://github.com/DeathWish5/PreemptiveScheduler", rev = "e8cd353" } +executor.workspace = true # For riscv [target.'cfg(any(target_arch = "riscv32", target_arch = "riscv64"))'.dependencies] -riscv = "0.9" +riscv.workspace = true sbi-rt = { version = "0.0.2", features = ["legacy"] } # For x86_64 [target.'cfg(target_arch = "x86_64")'.dependencies] -x86 = "0.46" +x86 = "0.52" x86_64 = "0.14" # For aarch64 diff --git a/kernel-hal/src/bare/thread.rs b/kernel-hal/src/bare/thread.rs index e4b9fb655..b0a3f85ec 100644 --- a/kernel-hal/src/bare/thread.rs +++ b/kernel-hal/src/bare/thread.rs @@ -3,7 +3,7 @@ use alloc::sync::Arc; use core::{any::Any, future::Future}; -use crate::{config::MAX_CORE_NUM, utils::PerCpuCell}; +use crate::{configs::MAX_CORE_NUM, utils::PerCpuCell}; #[allow(clippy::declare_interior_mutable_const)] const DEFAULT_THREAD: PerCpuCell>> = PerCpuCell::new(None); diff --git a/kernel-hal/src/common/defs.rs b/kernel-hal/src/common/defs.rs index e664c84f6..ca108f515 100644 --- a/kernel-hal/src/common/defs.rs +++ b/kernel-hal/src/common/defs.rs @@ -11,6 +11,7 @@ pub type HalResult = core::result::Result; bitflags! { /// Generic memory flags. + #[derive(Debug, Eq, PartialEq, Copy, Clone)] pub struct MMUFlags: usize { #[allow(clippy::identity_op)] const CACHE_1 = 1 << 0; @@ -21,7 +22,7 @@ bitflags! { const USER = 1 << 5; const HUGE_PAGE = 1 << 6; const DEVICE = 1 << 7; - const RXW = Self::READ.bits | Self::WRITE.bits | Self::EXECUTE.bits; + const RXW = Self::READ.bits() | Self::WRITE.bits() | Self::EXECUTE.bits(); } } numeric_enum! { diff --git a/kernel-hal/src/common/ipi.rs b/kernel-hal/src/common/ipi.rs index e4777cf4f..70f205693 100644 --- a/kernel-hal/src/common/ipi.rs +++ b/kernel-hal/src/common/ipi.rs @@ -1,4 +1,4 @@ -use crate::{config::MAX_CORE_NUM, utils::mpsc_queue::MpscQueue}; +use crate::{configs::MAX_CORE_NUM, utils::mpsc_queue::MpscQueue}; use alloc::vec::Vec; const REASON_SIZE: usize = 16; diff --git a/kernel-hal/src/config.rs b/kernel-hal/src/configs.rs similarity index 100% rename from kernel-hal/src/config.rs rename to kernel-hal/src/configs.rs diff --git a/kernel-hal/src/lib.rs b/kernel-hal/src/lib.rs index f66403e58..92eb82d83 100644 --- a/kernel-hal/src/lib.rs +++ b/kernel-hal/src/lib.rs @@ -22,7 +22,7 @@ extern crate lazy_static; mod macros; mod common; -mod config; +mod configs; mod hal_fn; mod kernel_handler; mod utils; @@ -39,11 +39,11 @@ cfg_if! { } } -pub(crate) use config::KCONFIG; +pub(crate) use configs::KCONFIG; pub(crate) use kernel_handler::KHANDLER; pub use common::{addr, console, context, defs::*, ipi::*, user}; -pub use config::KernelConfig; +pub use configs::KernelConfig; pub use imp::{ boot::{primary_init, primary_init_early, secondary_init}, *, diff --git a/kernel-hal/src/libos/mock_mem.rs b/kernel-hal/src/libos/mock_mem.rs index ff0d08735..118ed729c 100644 --- a/kernel-hal/src/libos/mock_mem.rs +++ b/kernel-hal/src/libos/mock_mem.rs @@ -1,8 +1,10 @@ -use std::os::unix::io::RawFd; - +use core::convert::TryInto; +use core::mem; use nix::fcntl::{self, OFlag}; use nix::sys::mman::{self, MapFlags, ProtFlags}; use nix::{sys::stat::Mode, unistd}; +use std::os::fd::FromRawFd; +use std::os::unix::io::RawFd; use super::mem::PMEM_MAP_VADDR; use crate::{MMUFlags, PhysAddr, VirtAddr}; @@ -23,8 +25,9 @@ impl MockMemory { Mode::S_IRWXU, ) .expect("faild to open"); - unistd::ftruncate(fd, size as _).expect("failed to set size of shared memory!"); - + let mut f = unsafe { std::fs::File::from_raw_fd(fd) }; + unistd::ftruncate(&mut f, size as _).expect("failed to set size of shared memory!"); + core::mem::forget(f); let mem = Self { size, fd }; mem.mmap(PMEM_MAP_VADDR, size, 0, MMUFlags::READ | MMUFlags::WRITE); mem @@ -55,15 +58,24 @@ impl MockMemory { vaddr, prot, ); - - unsafe { mman::mmap(vaddr as _, len, prot_noexec, flags, fd, offset) }.unwrap_or_else( - |err| { - panic!( - "failed to mmap: fd={}, offset={:#x}, len={:#x}, vaddr={:#x}, prot={:?}: {:?}", - fd, offset, len, vaddr, prot, err - ) - }, - ); + let mut f = unsafe { std::fs::File::from_raw_fd(fd) }; + unsafe { + mman::mmap( + vaddr.try_into().ok(), + len.try_into().unwrap(), + prot_noexec, + flags, + Some(&mut f), + offset, + ) + } + .unwrap_or_else(|err| { + panic!( + "failed to mmap: fd={}, offset={:#x}, len={:#x}, vaddr={:#x}, prot={:?}: {:?}", + fd, offset, len, vaddr, prot, err + ) + }); + mem::forget(f); if prot.contains(MMUFlags::EXECUTE) { self.mprotect(vaddr, len, prot); } diff --git a/linux-object/Cargo.toml b/linux-object/Cargo.toml index d93e09f46..a2047b0b3 100644 --- a/linux-object/Cargo.toml +++ b/linux-object/Cargo.toml @@ -12,10 +12,10 @@ mock-disk = [] [dependencies] async-trait = "0.1" -log = "0.4" +log.workspace = true xmas-elf = "0.7" -bitflags = "1.3" -hashbrown = "0.9" +bitflags.workspace = true +hashbrown.workspace = true numeric-enum-macro = "0.2" zircon-object = { path = "../zircon-object", features = ["elf"] } kernel-hal = { path = "../kernel-hal", default-features = false } diff --git a/linux-object/src/fs/file.rs b/linux-object/src/fs/file.rs index 4b67658fa..3d2f2238d 100644 --- a/linux-object/src/fs/file.rs +++ b/linux-object/src/fs/file.rs @@ -16,6 +16,7 @@ use zircon_object::vm::PAGE_SIZE_LOG2; bitflags::bitflags! { /// File open flags + #[derive(Clone, Copy, Debug)] pub struct OpenFlags: usize { /// read only const RDONLY = 0; @@ -64,6 +65,7 @@ impl OpenFlags { } bitflags::bitflags! { + #[derive(Debug, Clone, Copy)] pub struct PollEvents: u16 { /// There is data to read. const IN = 0x0001; diff --git a/linux-object/src/lib.rs b/linux-object/src/lib.rs index 439c17441..b19b444e9 100644 --- a/linux-object/src/lib.rs +++ b/linux-object/src/lib.rs @@ -5,7 +5,6 @@ // #![deny(missing_docs)] 形同虚设了 #![allow(clippy::upper_case_acronyms)] #![allow(clippy::uninit_vec)] -#![feature(map_first_last)] #![feature(core_intrinsics)] #[macro_use] diff --git a/linux-object/src/net/netlink.rs b/linux-object/src/net/netlink.rs index 4381e7147..c28964895 100644 --- a/linux-object/src/net/netlink.rs +++ b/linux-object/src/net/netlink.rs @@ -283,6 +283,7 @@ struct RouteAttr { } bitflags! { + #[derive(Clone, Copy, Debug)] struct NetlinkMessageFlags : u16 { const REQUEST = 0x01; const MULTI = 0x02; diff --git a/linux-object/src/signal/action.rs b/linux-object/src/signal/action.rs index 64545a5fb..116fee859 100644 --- a/linux-object/src/signal/action.rs +++ b/linux-object/src/signal/action.rs @@ -1,6 +1,6 @@ use crate::signal::Signal; -use _core::convert::TryFrom; use bitflags::*; +use core::convert::TryFrom; pub const SIG_ERR: usize = usize::max_value() - 1; pub const SIG_DFL: usize = 0; @@ -125,7 +125,7 @@ pub enum SignalCode { } bitflags! { - #[derive(Default)] + #[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] pub struct SignalActionFlags : usize { const NOCLDSTOP = 1; const NOCLDWAIT = 2; diff --git a/linux-object/src/signal/mod.rs b/linux-object/src/signal/mod.rs index 7960325dd..5381d0452 100644 --- a/linux-object/src/signal/mod.rs +++ b/linux-object/src/signal/mod.rs @@ -198,6 +198,7 @@ pub struct SignalFrame { } bitflags! { + #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct SignalStackFlags : u32 { const ONSTACK = 1; const DISABLE = 2; diff --git a/linux-object/src/sync/event_bus.rs b/linux-object/src/sync/event_bus.rs index 05cb8e3cb..7dc39a08a 100644 --- a/linux-object/src/sync/event_bus.rs +++ b/linux-object/src/sync/event_bus.rs @@ -12,7 +12,7 @@ use core::{ use lock::Mutex; bitflags! { - #[derive(Default)] + #[derive(Default, PartialEq, Clone, Copy)] /// event bus Event flags pub struct Event: u32 { /// File: is readable diff --git a/linux-syscall/Cargo.toml b/linux-syscall/Cargo.toml index 6b7a23d45..1e6cde438 100644 --- a/linux-syscall/Cargo.toml +++ b/linux-syscall/Cargo.toml @@ -8,8 +8,8 @@ description = "Linux syscalls implementation" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -log = "0.4" -bitflags = "1.3" +log.workspace = true +bitflags.workspace = true numeric-enum-macro = "0.2" static_assertions = "1.1.0" zircon-object = { path = "../zircon-object" } diff --git a/linux-syscall/src/file/dir.rs b/linux-syscall/src/file/dir.rs index 985ec24d2..95b7155b7 100644 --- a/linux-syscall/src/file/dir.rs +++ b/linux-syscall/src/file/dir.rs @@ -357,6 +357,7 @@ impl From for DirentType { } bitflags! { + #[derive(Debug, Clone, Copy)] pub struct AtFlags: usize { const EMPTY_PATH = 0x1000; const SYMLINK_NOFOLLOW = 0x100; diff --git a/linux-syscall/src/file/fd.rs b/linux-syscall/src/file/fd.rs index 96f2e3fdc..f65c95fa5 100644 --- a/linux-syscall/src/file/fd.rs +++ b/linux-syscall/src/file/fd.rs @@ -127,6 +127,7 @@ impl Syscall<'_> { /// TODO: handle operation pub fn sys_flock(&mut self, fd: FileDesc, operation: usize) -> SysResult { bitflags! { + #[derive(Debug)] struct Operation: u8 { const LOCK_SH = 1; const LOCK_EX = 2; diff --git a/linux-syscall/src/file/stat.rs b/linux-syscall/src/file/stat.rs index 98c23c5c0..c216ee9ba 100644 --- a/linux-syscall/src/file/stat.rs +++ b/linux-syscall/src/file/stat.rs @@ -223,6 +223,7 @@ impl From for Stat { } bitflags! { + #[derive(Debug)] pub struct StatMode: u32 { /// Type const TYPE_MASK = 0o170_000; diff --git a/linux-syscall/src/misc.rs b/linux-syscall/src/misc.rs index d4557c716..8c1509528 100644 --- a/linux-syscall/src/misc.rs +++ b/linux-syscall/src/misc.rs @@ -186,6 +186,7 @@ impl Syscall<'_> { bitflags! { /// for op argument in futex() + #[derive(Debug, PartialEq, Eq)] struct FutexFlags: u32 { /// tests that the value at the futex word pointed /// to by the address uaddr still contains the expected value val, diff --git a/linux-syscall/src/task.rs b/linux-syscall/src/task.rs index 35c890bb6..199713927 100644 --- a/linux-syscall/src/task.rs +++ b/linux-syscall/src/task.rs @@ -199,6 +199,7 @@ impl Syscall<'_> { Pid(KoID), } bitflags! { + #[derive(Debug)] struct WaitFlags: u32 { const NOHANG = 1; const STOPPED = 2; diff --git a/linux-syscall/src/vm.rs b/linux-syscall/src/vm.rs index 34dc79190..22fdb86d6 100644 --- a/linux-syscall/src/vm.rs +++ b/linux-syscall/src/vm.rs @@ -172,6 +172,7 @@ impl Syscall<'_> { bitflags! { /// for the flag argument in mmap() + #[derive(Clone, Copy, PartialEq, Eq, Debug)] pub struct MmapFlags: usize { #[allow(clippy::identity_op)] /// Changes are shared. @@ -193,6 +194,7 @@ const MMAP_ANONYMOUS: usize = 1 << 5; bitflags! { /// for the prot argument in mmap() + #[derive(Clone, Copy, PartialEq, Eq, Debug)] pub struct MmapProt: usize { #[allow(clippy::identity_op)] /// Data can be read diff --git a/loader/Cargo.toml b/loader/Cargo.toml index ae3863a06..8549c570e 100644 --- a/loader/Cargo.toml +++ b/loader/Cargo.toml @@ -5,21 +5,21 @@ authors = [ "Runji Wang ", "Yuekai Jia ", ] -edition = "2018" +edition = "2021" description = "Linux and Zircon user programs loader and runner." # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -log = "0.4" -cfg-if = "1.0" +log.workspace = true +cfg-if.workspace = true xmas-elf = { version = "0.7", optional = true } kernel-hal = { path = "../kernel-hal", default-features = false } zircon-object = { path = "../zircon-object", features = ["elf"] } linux-object = { path = "../linux-object", optional = true } zircon-syscall = { path = "../zircon-syscall", optional = true } linux-syscall = { path = "../linux-syscall", optional = true } -executor = { git = "https://github.com/DeathWish5/PreemptiveScheduler", rev = "e8cd353" } +executor.workspace = true [features] default = ["libos", "linux", "zircon"] @@ -28,7 +28,7 @@ zircon = ["zircon-syscall", "xmas-elf"] libos = ["kernel-hal/libos", "zircon-object/aspace-separate"] [dev-dependencies] -env_logger = "0.9" +env_logger = "0.10" async-std = { version = "1.10", features = ["attributes"] } rcore-fs-hostfs = { git = "https://github.com/rcore-os/rcore-fs", rev = "1a3246b" } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 08b9f2fa9..fc00102fe 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] profile = "minimal" -channel = "nightly-2022-08-05" +channel = "nightly-2023-10-01" components = ["rust-src", "llvm-tools-preview", "rustfmt", "clippy"] diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index ab20ed9db..29caa165f 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -9,7 +9,7 @@ build = "build.rs" [dependencies] z-config = { path = "../z-config" } -clap = { version = "4.0", features = ["derive"] } +clap = { version = "4.4.7", features = ["derive"] } dircpy = "0.3" rand = "0.8" once_cell = "1.15.0" diff --git a/z-config/Cargo.toml b/z-config/Cargo.toml index cb51bc118..43b2560d4 100644 --- a/z-config/Cargo.toml +++ b/z-config/Cargo.toml @@ -8,4 +8,4 @@ edition = "2021" [dependencies] serde = "1.0" serde_derive = "1.0" -toml = "0.5.9" +toml = "0.8.6" diff --git a/zCore/Cargo.toml b/zCore/Cargo.toml index ea39f7c89..b917ad5f7 100644 --- a/zCore/Cargo.toml +++ b/zCore/Cargo.toml @@ -62,15 +62,15 @@ board-fu740 = ["link-user-img", "kernel-hal/fu740-drivers"] mock-disk = ["linux-object/mock-disk"] [dependencies] -log = "0.4" -cfg-if = "1.0" +log.workspace = true +cfg-if.workspace = true spin = "0.9.4" customizable-buddy = "0.0.3" kernel-hal = { path = "../kernel-hal", default-features = false } zcore-loader = { path = "../loader", default-features = false } zircon-object = { path = "../zircon-object" } lock = { git = "https://github.com/DeathWish5/kernel-sync", rev = "8486b8" } -executor = { git = "https://github.com/DeathWish5/PreemptiveScheduler", rev = "e8cd353" } +executor.workspace = true linux-object = { path = "../linux-object", optional = true } rcore-fs = { git = "https://github.com/rcore-os/rcore-fs", rev = "1a3246b", optional = true } @@ -86,7 +86,7 @@ rcore-fs-hostfs = { git = "https://github.com/rcore-os/rcore-fs", rev = "1a3246b # RISC-V [target.'cfg(any(target_arch = "riscv32", target_arch = "riscv64"))'.dependencies] r0 = "1" -riscv = "0.9" +riscv.workspace = true dtb-walker = "=0.2.0-alpha.3" page-table = "0.0.6" sbi-rt = { version = "0.0.2", features = ["legacy"] } diff --git a/zCore/src/main.rs b/zCore/src/main.rs index 5a71dbf55..dfb1a7288 100644 --- a/zCore/src/main.rs +++ b/zCore/src/main.rs @@ -1,8 +1,7 @@ #![cfg_attr(not(feature = "libos"), no_std)] #![deny(warnings)] #![no_main] -#![feature(naked_functions, asm_sym, asm_const)] -#![feature(default_alloc_error_handler)] +#![feature(naked_functions, asm_const)] use core::sync::atomic::{AtomicBool, Ordering}; diff --git a/zCore/src/platform/riscv/kernel-vars.ld b/zCore/src/platform/riscv/kernel-vars.ld new file mode 100644 index 000000000..259e37667 --- /dev/null +++ b/zCore/src/platform/riscv/kernel-vars.ld @@ -0,0 +1,2 @@ +/* Generated by build.rs. DO NOT EDIT. */ +PROVIDE_HIDDEN(BASE_ADDRESS = 0xffffffc080200000); diff --git a/zircon-object/Cargo.toml b/zircon-object/Cargo.toml index 3b1dc244d..229147288 100644 --- a/zircon-object/Cargo.toml +++ b/zircon-object/Cargo.toml @@ -20,9 +20,9 @@ libos = [ ] [dependencies] -bitflags = "1.3" -log = "0.4" -hashbrown = "0.9" +bitflags.workspace = true +log.workspace = true +hashbrown.workspace = true downcast-rs = { version = "1.2", default-features = false } kernel-hal = { path = "../kernel-hal", default-features = false } numeric-enum-macro = "0.2" @@ -31,9 +31,9 @@ futures = { version = "0.3", default-features = false, features = [ "async-await", ] } xmas-elf = { version = "0.7", optional = true } -region-alloc = { git = "https://github.com/rzswh/region-allocator", rev = "122c7a71" } +region-alloc = { git = "https://github.com/KaminariOS/region-allocator"} lazy_static = { version = "1.4", features = ["spin_no_std"] } -cfg-if = "1.0" +cfg-if.workspace = true #rvm = { git = "https://github.com/rcore-os/RVM", rev = "382fc60", optional = true } lock = { git = "https://github.com/DeathWish5/kernel-sync", rev = "8486b8" } diff --git a/zircon-object/src/dev/interrupt/mod.rs b/zircon-object/src/dev/interrupt/mod.rs index b67908396..030304699 100644 --- a/zircon-object/src/dev/interrupt/mod.rs +++ b/zircon-object/src/dev/interrupt/mod.rs @@ -349,6 +349,7 @@ bitflags! { bitflags! { /// Interrupt bind flags. + #[derive(PartialEq, Clone, Copy, Debug)] pub struct InterruptOptions: u32 { #[allow(clippy::identity_op)] /// Remap interrupt request(IRQ). diff --git a/zircon-object/src/dev/iommu.rs b/zircon-object/src/dev/iommu.rs index ec196078d..8ba8a59ca 100644 --- a/zircon-object/src/dev/iommu.rs +++ b/zircon-object/src/dev/iommu.rs @@ -92,6 +92,7 @@ impl Iommu { bitflags! { /// IOMMU permission flags. + #[derive(PartialEq, Copy, Clone)] pub struct IommuPerms: u32 { #[allow(clippy::identity_op)] /// Read Permission. diff --git a/zircon-object/src/dev/pci/nodes.rs b/zircon-object/src/dev/pci/nodes.rs index d7c3f8655..6fd34e27a 100644 --- a/zircon-object/src/dev/pci/nodes.rs +++ b/zircon-object/src/dev/pci/nodes.rs @@ -665,7 +665,7 @@ impl PcieDevice { continue; } let upstream = inner.upstream.upgrade().ok_or(ZxError::UNAVAILABLE)?; - let mut bar_info = &mut inner.bars[i]; + let bar_info = &mut inner.bars[i]; if bar_info.bus_addr != 0 { let allocator = if upstream.node_type() == PciNodeType::Bridge && bar_info.is_prefetchable { diff --git a/zircon-object/src/dev/resource.rs b/zircon-object/src/dev/resource.rs index 3941866e0..1b636d04d 100644 --- a/zircon-object/src/dev/resource.rs +++ b/zircon-object/src/dev/resource.rs @@ -19,7 +19,8 @@ numeric_enum! { } bitflags! { - /// Bits for Resource.flags. + /// bits() for Resource.flags. + #[derive(Clone, Copy)] pub struct ResourceFlags: u32 { #[allow(clippy::identity_op)] /// Exclusive resource. @@ -102,7 +103,7 @@ impl Resource { name_vec[..name.len()].clone_from_slice(name); ResourceInfo { kind: self.kind as _, - flags: self.flags.bits, + flags: self.flags.bits(), base: self.addr as _, size: self.len as _, name: name_vec, diff --git a/zircon-object/src/ipc/socket.rs b/zircon-object/src/ipc/socket.rs index 819401b1f..f6effb5c2 100644 --- a/zircon-object/src/ipc/socket.rs +++ b/zircon-object/src/ipc/socket.rs @@ -42,7 +42,7 @@ impl_kobject!(Socket bitflags! { /// Signals that waitable kernel objects expose to applications. - #[derive(Default)] + #[derive(Default, Copy, Clone, Debug)] pub struct SocketFlags: u32 { #[allow(clippy::identity_op)] // These options can be passed to socket_shutdown(). @@ -51,7 +51,7 @@ bitflags! { /// Via this option to `socket_shutdown()`, one end of the socket can be closed for reading. const SHUTDOWN_READ = 1 << 1; /// Valid flags of `socket_shutdown()`. - const SHUTDOWN_MASK = Self::SHUTDOWN_WRITE.bits | Self::SHUTDOWN_READ.bits; + const SHUTDOWN_MASK = Self::SHUTDOWN_WRITE.bits() | Self::SHUTDOWN_READ.bits(); // These can be passed to socket_create(). // const STREAM = 0; // Don't use contains @@ -61,7 +61,7 @@ bitflags! { /// [`write`]: struct.Socket.html#method.write const DATAGRAM = 1; /// Valid flags of `socket_create()`. - const CREATE_MASK = Self::DATAGRAM.bits; + const CREATE_MASK = Self::DATAGRAM.bits(); // These can be passed to socket_read(). /// Leave the message in the socket. @@ -395,7 +395,7 @@ mod tests { fn test_basics() { assert_eq!(Socket::create(1 << 10).unwrap_err(), ZxError::INVALID_ARGS); assert_eq!( - Socket::create(SocketFlags::SOCKET_PEEK.bits).unwrap_err(), + Socket::create(SocketFlags::SOCKET_PEEK.bits()).unwrap_err(), ZxError::INVALID_ARGS ); let (end0, end1) = Socket::create(1).unwrap(); @@ -499,7 +499,7 @@ mod tests { assert_eq!( end0.get_info(), SocketInfo { - options: SocketFlags::DATAGRAM.bits, + options: SocketFlags::DATAGRAM.bits(), padding1: 0, rx_buf_max: SOCKET_SIZE as _, rx_buf_size: 0, @@ -511,7 +511,7 @@ mod tests { assert_eq!( end1.get_info(), SocketInfo { - options: SocketFlags::DATAGRAM.bits, + options: SocketFlags::DATAGRAM.bits(), padding1: 0, rx_buf_max: SOCKET_SIZE as _, rx_buf_size: 7, diff --git a/zircon-object/src/object/mod.rs b/zircon-object/src/object/mod.rs index bb65a9e14..4de8b36c1 100644 --- a/zircon-object/src/object/mod.rs +++ b/zircon-object/src/object/mod.rs @@ -108,11 +108,11 @@ use { lock::Mutex, }; -pub use {super::*, handle::*, rights::*, signal::*}; +pub use {super::*, handle::*, rights::*, signals::*}; mod handle; mod rights; -mod signal; +mod signals; /// Common interface of a kernel object. /// diff --git a/zircon-object/src/object/rights.rs b/zircon-object/src/object/rights.rs index 7c2d5b2ec..1370489f5 100644 --- a/zircon-object/src/object/rights.rs +++ b/zircon-object/src/object/rights.rs @@ -7,7 +7,7 @@ use { bitflags! { /// Rights are associated with handles and convey privileges to perform actions on /// either the associated handle or the object associated with the handle. - #[derive(Default)] + #[derive(Default, Clone, Debug, Copy, PartialEq)] pub struct Rights: u32 { /// Allows handle duplication via `zx_handle_duplicate()`. #[allow(clippy::identity_op)] @@ -77,87 +77,87 @@ bitflags! { /// TRANSFER | DUPLICATE | WAIT | INSPECT - const BASIC = Self::TRANSFER.bits | Self::DUPLICATE.bits | Self::WAIT.bits | Self::INSPECT.bits; + const BASIC = Self::TRANSFER.bits() | Self::DUPLICATE.bits() | Self::WAIT.bits() | Self::INSPECT.bits(); /// READ | WRITE - const IO = Self::READ.bits | Self::WRITE.bits; + const IO = Self::READ.bits() | Self::WRITE.bits(); /// GET_PROPERTY | SET_PROPERTY - const PROPERTY = Self::GET_PROPERTY.bits | Self::SET_PROPERTY.bits; + const PROPERTY = Self::GET_PROPERTY.bits() | Self::SET_PROPERTY.bits(); /// GET_POLICY | SET_POLICY - const POLICY = Self::GET_POLICY.bits | Self::SET_POLICY.bits; + const POLICY = Self::GET_POLICY.bits() | Self::SET_POLICY.bits(); /// BASIC & !Self::DUPLICATE | IO | SIGNAL | SIGNAL_PEER - const DEFAULT_CHANNEL = Self::BASIC.bits & !Self::DUPLICATE.bits | Self::IO.bits | Self::SIGNAL.bits | Self::SIGNAL_PEER.bits; + const DEFAULT_CHANNEL = Self::BASIC.bits() & !Self::DUPLICATE.bits() | Self::IO.bits() | Self::SIGNAL.bits() | Self::SIGNAL_PEER.bits(); /// BASIC | IO | PROPERTY | ENUMERATE | DESTROY | SIGNAL | MANAGE_PROCESS | MANAGE_THREAD - const DEFAULT_PROCESS = Self::BASIC.bits | Self::IO.bits | Self::PROPERTY.bits | Self::ENUMERATE.bits | Self::DESTROY.bits - | Self::SIGNAL.bits | Self::MANAGE_PROCESS.bits | Self::MANAGE_THREAD.bits; + const DEFAULT_PROCESS = Self::BASIC.bits() | Self::IO.bits() | Self::PROPERTY.bits() | Self::ENUMERATE.bits() | Self::DESTROY.bits() + | Self::SIGNAL.bits() | Self::MANAGE_PROCESS.bits() | Self::MANAGE_THREAD.bits(); /// BASIC | IO | PROPERTY | DESTROY | SIGNAL | MANAGE_THREAD - const DEFAULT_THREAD = Self::BASIC.bits | Self::IO.bits | Self::PROPERTY.bits | Self::DESTROY.bits | Self::SIGNAL.bits | Self::MANAGE_THREAD.bits; + const DEFAULT_THREAD = Self::BASIC.bits() | Self::IO.bits() | Self::PROPERTY.bits() | Self::DESTROY.bits() | Self::SIGNAL.bits() | Self::MANAGE_THREAD.bits(); /// BASIC | IO | PROPERTY | MAP | SIGNAL - const DEFAULT_VMO = Self::BASIC.bits | Self::IO.bits | Self::PROPERTY.bits | Self::MAP.bits | Self::SIGNAL.bits; + const DEFAULT_VMO = Self::BASIC.bits() | Self::IO.bits() | Self::PROPERTY.bits() | Self::MAP.bits() | Self::SIGNAL.bits(); /// BASIC | WAIT - const DEFAULT_VMAR = Self::BASIC.bits & !Self::WAIT.bits; + const DEFAULT_VMAR = Self::BASIC.bits() & !Self::WAIT.bits(); /// BASIC | IO | PROPERTY | POLICY | ENUMERATE | DESTROY | SIGNAL | MANAGE_JOB | MANAGE_PROCESS | MANAGE_THREAD - const DEFAULT_JOB = Self::BASIC.bits | Self::IO.bits | Self::PROPERTY.bits | Self::POLICY.bits | Self::ENUMERATE.bits - | Self::DESTROY.bits | Self::SIGNAL.bits | Self::MANAGE_JOB.bits | Self::MANAGE_PROCESS.bits | Self::MANAGE_THREAD.bits; + const DEFAULT_JOB = Self::BASIC.bits() | Self::IO.bits() | Self::PROPERTY.bits() | Self::POLICY.bits() | Self::ENUMERATE.bits() + | Self::DESTROY.bits() | Self::SIGNAL.bits() | Self::MANAGE_JOB.bits() | Self::MANAGE_PROCESS.bits() | Self::MANAGE_THREAD.bits(); /// TRANSFER | DUPLICATE | WRITE | INSPECT - const DEFAULT_RESOURCE = Self::TRANSFER.bits | Self::DUPLICATE.bits | Self::WRITE.bits | Self::INSPECT.bits; + const DEFAULT_RESOURCE = Self::TRANSFER.bits() | Self::DUPLICATE.bits() | Self::WRITE.bits() | Self::INSPECT.bits(); /// BASIC | WRITE | SIGNAL - const DEFAULT_DEBUGLOG = Self::BASIC.bits | Self::WRITE.bits | Self::SIGNAL.bits; + const DEFAULT_DEBUGLOG = Self::BASIC.bits() | Self::WRITE.bits() | Self::SIGNAL.bits(); /// TRANSFER | INSPECT - const DEFAULT_SUSPEND_TOKEN = Self::TRANSFER.bits | Self::INSPECT.bits; + const DEFAULT_SUSPEND_TOKEN = Self::TRANSFER.bits() | Self::INSPECT.bits(); /// (BASIC & !WAIT) | IO - const DEFAULT_PORT = (Self::BASIC.bits & !Self::WAIT.bits) | Self::IO.bits; + const DEFAULT_PORT = (Self::BASIC.bits() & !Self::WAIT.bits()) | Self::IO.bits(); /// BASIC | WRITE | SIGNAL - const DEFAULT_TIMER = Self::BASIC.bits | Self::WRITE.bits | Self::SIGNAL.bits; + const DEFAULT_TIMER = Self::BASIC.bits() | Self::WRITE.bits() | Self::SIGNAL.bits(); /// BASIC | SIGNAL - const DEFAULT_EVENT = Self::BASIC.bits | Self::SIGNAL.bits; + const DEFAULT_EVENT = Self::BASIC.bits() | Self::SIGNAL.bits(); /// BASIC | SIGNAL | SIGNAL_PEER - const DEFAULT_EVENTPAIR = Self::BASIC.bits | Self::SIGNAL.bits | Self::SIGNAL_PEER.bits; + const DEFAULT_EVENTPAIR = Self::BASIC.bits() | Self::SIGNAL.bits() | Self::SIGNAL_PEER.bits(); /// BASIC | IO | SIGNAL | SIGNAL_PEER - const DEFAULT_FIFO = Self::BASIC.bits | Self::IO.bits | Self::SIGNAL.bits | Self::SIGNAL_PEER.bits; + const DEFAULT_FIFO = Self::BASIC.bits() | Self::IO.bits() | Self::SIGNAL.bits() | Self::SIGNAL_PEER.bits(); /// BASIC | IO | PROPERTY | SIGNAL | SIGNAL_PEER - const DEFAULT_SOCKET = Self::BASIC.bits | Self::IO.bits | Self::PROPERTY.bits | Self::SIGNAL.bits | Self::SIGNAL_PEER.bits; + const DEFAULT_SOCKET = Self::BASIC.bits() | Self::IO.bits() | Self::PROPERTY.bits() | Self::SIGNAL.bits() | Self::SIGNAL_PEER.bits(); /// BASIC | PROPERTY | SIGNAL - const DEFAULT_STREAM = Self::BASIC.bits | Self::PROPERTY.bits | Self::SIGNAL.bits; + const DEFAULT_STREAM = Self::BASIC.bits() | Self::PROPERTY.bits() | Self::SIGNAL.bits(); /// (BASIC & !WAIT) | IO | MAP - const DEFAULT_BTI = (Self::BASIC.bits & !Self::WAIT.bits) | Self::IO.bits | Self::MAP.bits; + const DEFAULT_BTI = (Self::BASIC.bits() & !Self::WAIT.bits()) | Self::IO.bits() | Self::MAP.bits(); /// BASIC | IO | SIGNAL - const DEFAULT_INTERRUPT = Self::BASIC.bits | Self::IO.bits | Self::SIGNAL.bits; + const DEFAULT_INTERRUPT = Self::BASIC.bits() | Self::IO.bits() | Self::SIGNAL.bits(); /// BASIC | IO - const DEFAULT_DEVICE = Self::BASIC.bits | Self::IO.bits; + const DEFAULT_DEVICE = Self::BASIC.bits() | Self::IO.bits(); /// BASIC | IO | SIGNAL - const DEFAULT_PCI_INTERRUPT = Self::BASIC.bits | Self::IO.bits | Self::SIGNAL.bits; + const DEFAULT_PCI_INTERRUPT = Self::BASIC.bits() | Self::IO.bits() | Self::SIGNAL.bits(); /// TRANSFER | PROPERTY | INSPECT - const DEFAULT_EXCEPTION = Self::TRANSFER.bits | Self::PROPERTY.bits | Self::INSPECT.bits; + const DEFAULT_EXCEPTION = Self::TRANSFER.bits() | Self::PROPERTY.bits() | Self::INSPECT.bits(); /// TRANSFER | DUPLICATE | WRITE | INSPECT | MANAGE_PROCESS - const DEFAULT_GUEST = Self::TRANSFER.bits | Self::DUPLICATE.bits | Self::WRITE.bits | Self::INSPECT.bits | Self::MANAGE_PROCESS.bits; + const DEFAULT_GUEST = Self::TRANSFER.bits() | Self::DUPLICATE.bits() | Self::WRITE.bits() | Self::INSPECT.bits() | Self::MANAGE_PROCESS.bits(); /// BASIC | IO | EXECUTE | SIGNAL - const DEFAULT_VCPU = Self::BASIC.bits | Self::IO.bits | Self::EXECUTE.bits | Self::SIGNAL.bits; + const DEFAULT_VCPU = Self::BASIC.bits() | Self::IO.bits() | Self::EXECUTE.bits() | Self::SIGNAL.bits(); } } diff --git a/zircon-object/src/object/signal.rs b/zircon-object/src/object/signals.rs similarity index 97% rename from zircon-object/src/object/signal.rs rename to zircon-object/src/object/signals.rs index cb14c701a..fcaf225cb 100644 --- a/zircon-object/src/object/signal.rs +++ b/zircon-object/src/object/signals.rs @@ -3,7 +3,7 @@ use bitflags::bitflags; bitflags! { /// Signals that waitable kernel objects expose to applications. - #[derive(Default)] + #[derive(Default, Copy, Clone, Debug, PartialEq, Eq)] pub struct Signal: u32 { #[allow(clippy::identity_op)] const READABLE = 1 << 0; @@ -27,19 +27,19 @@ bitflags! { const SOCKET_WRITE_THRESHOLD = 1 << 11; - const TASK_TERMINATED = Self::SIGNALED.bits; + const TASK_TERMINATED = Self::SIGNALED.bits(); - const JOB_TERMINATED = Self::SIGNALED.bits; + const JOB_TERMINATED = Self::SIGNALED.bits(); const JOB_NO_JOBS = 1 << 4; const JOB_NO_PROCESSES = 1 << 5; - const PROCESS_TERMINATED = Self::SIGNALED.bits; + const PROCESS_TERMINATED = Self::SIGNALED.bits(); - const THREAD_TERMINATED = Self::SIGNALED.bits; + const THREAD_TERMINATED = Self::SIGNALED.bits(); const THREAD_RUNNING = 1 << 4; const THREAD_SUSPENDED = 1 << 5; - const VMO_ZERO_CHILDREN = Self::SIGNALED.bits; + const VMO_ZERO_CHILDREN = Self::SIGNALED.bits(); const INTERRUPT_SIGNAL = 1 << 4; diff --git a/zircon-object/src/task/thread.rs b/zircon-object/src/task/thread.rs index dfe9c78c2..98443c001 100644 --- a/zircon-object/src/task/thread.rs +++ b/zircon-object/src/task/thread.rs @@ -178,7 +178,7 @@ impl ThreadInner { bitflags! { /// Thread flags. - #[derive(Default)] + #[derive(Default, Clone, Copy)] pub struct ThreadFlag: usize { /// The thread currently has a VCPU. const VCPU = 1 << 3; diff --git a/zircon-object/src/vm/vmar.rs b/zircon-object/src/vm/vmar.rs index e4375ed1f..4b4c574f8 100644 --- a/zircon-object/src/vm/vmar.rs +++ b/zircon-object/src/vm/vmar.rs @@ -11,6 +11,7 @@ use { bitflags! { /// Creation flags for VmAddressRegion. + #[derive(Copy, Clone)] pub struct VmarFlags: u32 { #[allow(clippy::identity_op)] /// When randomly allocating subregions, reduce sprawl by placing allocations @@ -36,9 +37,9 @@ bitflags! { const ALLOW_FAULTS = 1 << 8; /// Allow VmMappings to be created inside the region with read, write and execute permissions. - const CAN_MAP_RXW = Self::CAN_MAP_READ.bits | Self::CAN_MAP_EXECUTE.bits | Self::CAN_MAP_WRITE.bits; + const CAN_MAP_RXW = Self::CAN_MAP_READ.bits() | Self::CAN_MAP_EXECUTE.bits() | Self::CAN_MAP_WRITE.bits(); /// Creation flags for root VmAddressRegion - const ROOT_FLAGS = Self::CAN_MAP_RXW.bits | Self::CAN_MAP_SPECIFIC.bits; + const ROOT_FLAGS = Self::CAN_MAP_RXW.bits() | Self::CAN_MAP_SPECIFIC.bits(); } } diff --git a/zircon-syscall/Cargo.toml b/zircon-syscall/Cargo.toml index edf1db9e8..0641a9beb 100644 --- a/zircon-syscall/Cargo.toml +++ b/zircon-syscall/Cargo.toml @@ -12,8 +12,8 @@ description = "Zircon syscalls implementation" deny-page-fault = [] [dependencies] -log = "0.4" -bitflags = "1.3" +log.workspace = true +bitflags.workspace = true numeric-enum-macro = "0.2" zircon-object = { path = "../zircon-object" } kernel-hal = { path = "../kernel-hal", default-features = false } @@ -21,5 +21,5 @@ futures = { version = "0.3", default-features = false, features = [ "alloc", "async-await", ] } -cfg-if = "1.0" +cfg-if.workspace = true lock = { git = "https://github.com/DeathWish5/kernel-sync", rev = "8486b8" } diff --git a/zircon-syscall/src/ddk.rs b/zircon-syscall/src/ddk.rs index d52007a5e..c3618f48b 100644 --- a/zircon-syscall/src/ddk.rs +++ b/zircon-syscall/src/ddk.rs @@ -281,6 +281,7 @@ const IOMMU_MAX_DESC_LEN: usize = 4096; const IOMMU_DESC_SIZE: usize = 1; bitflags! { + #[derive(Debug, Clone, Copy)] struct BtiOptions: u32 { #[allow(clippy::identity_op)] const PERM_READ = 1 << 0; diff --git a/zircon-syscall/src/vmar.rs b/zircon-syscall/src/vmar.rs index 742c74f89..45d7d9668 100644 --- a/zircon-syscall/src/vmar.rs +++ b/zircon-syscall/src/vmar.rs @@ -224,6 +224,7 @@ impl Syscall<'_> { } bitflags! { + #[derive(Clone, Copy)] struct VmOptions: u32 { #[allow(clippy::identity_op)] const PERM_READ = 1 << 0; @@ -239,8 +240,8 @@ bitflags! { const MAP_RANGE = 1 << 10; const REQUIRE_NON_RESIZABLE = 1 << 11; const ALLOW_FAULTS = 1 << 12; - const CAN_MAP_RXW = Self::CAN_MAP_READ.bits | Self::CAN_MAP_EXECUTE.bits | Self::CAN_MAP_WRITE.bits; - const PERM_RXW = Self::PERM_READ.bits | Self::PERM_WRITE.bits | Self::PERM_EXECUTE.bits; + const CAN_MAP_RXW = Self::CAN_MAP_READ.bits()| Self::CAN_MAP_EXECUTE.bits()| Self::CAN_MAP_WRITE.bits(); + const PERM_RXW = Self::PERM_READ.bits()| Self::PERM_WRITE.bits()| Self::PERM_EXECUTE.bits(); } } diff --git a/zircon-syscall/src/vmo.rs b/zircon-syscall/src/vmo.rs index 69d79ba72..b8fa570b0 100644 --- a/zircon-syscall/src/vmo.rs +++ b/zircon-syscall/src/vmo.rs @@ -307,6 +307,7 @@ impl Syscall<'_> { } bitflags! { + #[derive(PartialEq, Debug)] struct VmoCloneFlags: u32 { #[allow(clippy::identity_op)] const SNAPSHOT = 1 << 0;