Browse Source

Merge pull request #62 from guttatus/ci

feat: add ci and refactor code
guttatus 2 months ago
parent
commit
82d4e5bf2f

+ 49 - 0
.github/workflows/workflow.yml

@@ -0,0 +1,49 @@
+# This workflow uses actions that are not certified by GitHub.
+# They are provided by a third-party and are governed by
+# separate terms of service, privacy policy, and support
+# documentation.
+# rust-clippy is a tool that runs a bunch of lints to catch common
+# mistakes in your Rust code and help improve your Rust code.
+# More details at https://github.com/rust-lang/rust-clippy
+# and https://rust-lang.github.io/rust-clippy/
+
+name: CI
+
+on:
+  pull_request:
+  push:
+    paths-ignore:
+      - '**.md'
+      - 'LICENSE'
+
+jobs:
+  rust-clippy-analyze:
+    name: Run rust-clippy analyzing
+    runs-on: ubuntu-latest
+    permissions:
+      security-events: write
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v4
+
+      - name: Check format
+        run: cargo fmt --check
+
+      - name: Run test
+        run: cargo test
+
+      - name: Install required cargo
+        run: cargo install clippy-sarif sarif-fmt
+
+      - name: Run rust-clippy
+        run: |
+          cargo clippy -p rustsbi-prototyper --target riscv64imac-unknown-none-elf  --message-format=json  | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
+          cargo clippy -p rustsbi-test-kernel --target riscv64imac-unknown-none-elf --message-format=json  | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
+          cargo clippy -p rustsbi-bench-kernel --target riscv64imac-unknown-none-elf --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
+        continue-on-error: true
+
+      - name: Upload analysis results to GitHub
+        uses: github/codeql-action/upload-sarif@v3
+        with:
+          sarif_file: rust-clippy-results.sarif
+          wait-for-processing: true

+ 4 - 509
Cargo.lock

@@ -2,15 +2,6 @@
 # It is not intended for manual editing.
 # It is not intended for manual editing.
 version = 4
 version = 4
 
 
-[[package]]
-name = "aarch64-cpu"
-version = "10.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a21cd0131c25c438e19cd6a774adf7e3f64f7f4d723022882facc2dee0f8bc9"
-dependencies = [
- "tock-registers 0.9.0",
-]
-
 [[package]]
 [[package]]
 name = "aclint"
 name = "aclint"
 version = "0.1.0"
 version = "0.1.0"
@@ -67,39 +58,6 @@ dependencies = [
  "windows-sys",
  "windows-sys",
 ]
 ]
 
 
-[[package]]
-name = "arceos_api"
-version = "0.1.0"
-source = "git+https://github.com/arceos-org/arceos.git#bb52cf1ae6a605e69c751d322280204c083778ce"
-dependencies = [
- "axconfig",
- "axerrno",
- "axfeat",
- "axhal",
- "axio",
- "axlog",
- "axruntime",
- "axsync",
-]
-
-[[package]]
-name = "arm_gicv2"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47d25e73c949c69f75d1b9dba39c5475523403b31eb8c2fdc99da4dc33bc1aca"
-dependencies = [
- "tock-registers 0.8.1",
-]
-
-[[package]]
-name = "arm_pl011"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "efcf6afca4502993a737ba1e00952d1321078689da92bf7aab27d4e5756c0bec"
-dependencies = [
- "tock-registers 0.8.1",
-]
-
 [[package]]
 [[package]]
 name = "as-slice"
 name = "as-slice"
 version = "0.2.1"
 version = "0.2.1"
@@ -115,169 +73,12 @@ version = "1.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
 checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
 
 
-[[package]]
-name = "axconfig"
-version = "0.1.0"
-source = "git+https://github.com/arceos-org/arceos.git#bb52cf1ae6a605e69c751d322280204c083778ce"
-dependencies = [
- "axconfig-gen-macros",
-]
-
-[[package]]
-name = "axconfig-gen"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ffa518605969ff8f4ebce2cdc3b6090345152c14987ec540601335effbf36d5"
-dependencies = [
- "clap",
- "toml_edit",
-]
-
-[[package]]
-name = "axconfig-gen-macros"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92110c7e7a5633d7fb8a402393c91c326ad6d19710bb9cfa5ab4095e63c25948"
-dependencies = [
- "axconfig-gen",
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "axerrno"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "66ccd41dd4ef364e2385901a5c2a3adea974a41eccb2529c1f24e4c8bc93d834"
-dependencies = [
- "log",
-]
-
-[[package]]
-name = "axfeat"
-version = "0.1.0"
-source = "git+https://github.com/arceos-org/arceos.git#bb52cf1ae6a605e69c751d322280204c083778ce"
-dependencies = [
- "axhal",
- "axlog",
- "axruntime",
-]
-
-[[package]]
-name = "axhal"
-version = "0.1.0"
-source = "git+https://github.com/arceos-org/arceos.git#bb52cf1ae6a605e69c751d322280204c083778ce"
-dependencies = [
- "aarch64-cpu",
- "arm_gicv2",
- "arm_pl011",
- "axconfig",
- "axlog",
- "bitflags 2.8.0",
- "cfg-if",
- "dw_apb_uart",
- "handler_table",
- "int_ratio",
- "kernel_guard",
- "kspin",
- "lazyinit",
- "linkme",
- "log",
- "memory_addr",
- "page_table_entry",
- "percpu",
- "raw-cpuid 11.3.0",
- "riscv 0.12.1",
- "sbi-rt 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "static_assertions",
- "tock-registers 0.9.0",
- "x2apic",
- "x86",
- "x86_64 0.15.2",
-]
-
-[[package]]
-name = "axio"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8ca9c10ea4cd42bda87a2abde281fb481c76a0b05976fd03697385ea65d5122"
-dependencies = [
- "axerrno",
-]
-
-[[package]]
-name = "axlog"
-version = "0.1.0"
-source = "git+https://github.com/arceos-org/arceos.git#bb52cf1ae6a605e69c751d322280204c083778ce"
-dependencies = [
- "cfg-if",
- "crate_interface",
- "kspin",
- "log",
-]
-
-[[package]]
-name = "axruntime"
-version = "0.1.0"
-source = "git+https://github.com/arceos-org/arceos.git#bb52cf1ae6a605e69c751d322280204c083778ce"
-dependencies = [
- "axconfig",
- "axhal",
- "axlog",
- "chrono",
- "crate_interface",
-]
-
-[[package]]
-name = "axstd"
-version = "0.1.0"
-source = "git+https://github.com/arceos-org/arceos.git#bb52cf1ae6a605e69c751d322280204c083778ce"
-dependencies = [
- "arceos_api",
- "axerrno",
- "axfeat",
- "axio",
- "kspin",
-]
-
-[[package]]
-name = "axsync"
-version = "0.1.0"
-source = "git+https://github.com/arceos-org/arceos.git#bb52cf1ae6a605e69c751d322280204c083778ce"
-dependencies = [
- "axtask",
- "kspin",
-]
-
-[[package]]
-name = "axtask"
-version = "0.1.0"
-source = "git+https://github.com/arceos-org/arceos.git#bb52cf1ae6a605e69c751d322280204c083778ce"
-dependencies = [
- "axhal",
- "cfg-if",
- "log",
-]
-
-[[package]]
-name = "bit"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b645c5c09a7d4035949cfce1a915785aaad6f17800c35fda8a8c311c491f284"
-
 [[package]]
 [[package]]
 name = "bit_field"
 name = "bit_field"
 version = "0.10.2"
 version = "0.10.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61"
 checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61"
 
 
-[[package]]
-name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
 [[package]]
 [[package]]
 name = "bitflags"
 name = "bitflags"
 version = "2.8.0"
 version = "2.8.0"
@@ -315,15 +116,6 @@ version = "1.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
 checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
 
 
-[[package]]
-name = "chrono"
-version = "0.4.39"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825"
-dependencies = [
- "num-traits",
-]
-
 [[package]]
 [[package]]
 name = "clap"
 name = "clap"
 version = "4.5.28"
 version = "4.5.28"
@@ -380,17 +172,6 @@ version = "1.0.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
 checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
 
 
-[[package]]
-name = "crate_interface"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70272a03a2cef15589bac05d3d15c023752f5f8f2da8be977d983a9d9e6250fb"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
 [[package]]
 [[package]]
 name = "critical-section"
 name = "critical-section"
 version = "1.2.0"
 version = "1.2.0"
@@ -403,15 +184,6 @@ version = "0.2.0-alpha.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "9404d41caa1aa659f7be44d5a902e318c0672900822fe9ca41d9e38c14b52332"
 checksum = "9404d41caa1aa659f7be44d5a902e318c0672900822fe9ca41d9e38c14b52332"
 
 
-[[package]]
-name = "dw_apb_uart"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f93d496c8faa9dc676ebfa225432e1e3b57645c9268ead889286546f6d39356d"
-dependencies = [
- "tock-registers 0.8.1",
-]
-
 [[package]]
 [[package]]
 name = "embedded-hal"
 name = "embedded-hal"
 version = "0.2.7"
 version = "0.2.7"
@@ -453,104 +225,24 @@ dependencies = [
  "num",
  "num",
 ]
 ]
 
 
-[[package]]
-name = "equivalent"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
-
 [[package]]
 [[package]]
 name = "fast-trap"
 name = "fast-trap"
 version = "0.1.0"
 version = "0.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "46da95e6fcc7619a12d05594693e48591c0b574aef6fe5d7a7e765e6763a2cb2"
 checksum = "46da95e6fcc7619a12d05594693e48591c0b574aef6fe5d7a7e765e6763a2cb2"
 
 
-[[package]]
-name = "handler_table"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "702cb690200d6303c1e1992bc648f3f3bf9c1d6a27fcf50551c513d61f339c99"
-
-[[package]]
-name = "hashbrown"
-version = "0.15.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
-
 [[package]]
 [[package]]
 name = "heck"
 name = "heck"
 version = "0.5.0"
 version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
 checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
 
 
-[[package]]
-name = "indexmap"
-version = "2.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652"
-dependencies = [
- "equivalent",
- "hashbrown",
-]
-
-[[package]]
-name = "int_ratio"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd361c344145620f0c02e56200ca3e3a45203121447376519a9070e546b2916f"
-
 [[package]]
 [[package]]
 name = "is_terminal_polyfill"
 name = "is_terminal_polyfill"
 version = "1.70.1"
 version = "1.70.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
 checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
 
 
-[[package]]
-name = "kernel_guard"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "307e6be468f3d6b6d895e191f63c11602e4e76575ecca68325d8c8dbebe2870e"
-dependencies = [
- "cfg-if",
- "crate_interface",
-]
-
-[[package]]
-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 = "lazyinit"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3861aac8febbb038673bf945ee47ac67940ca741b94d1bb3ff6066af2a181338"
-
-[[package]]
-name = "linkme"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "566336154b9e58a4f055f6dd4cbab62c7dc0826ce3c0a04e63b2d2ecd784cdae"
-dependencies = [
- "linkme-impl",
-]
-
-[[package]]
-name = "linkme-impl"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "edbe595006d355eaf9ae11db92707d4338cd2384d16866131cc1afdbdd35d8d9"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
 [[package]]
 [[package]]
 name = "lock_api"
 name = "lock_api"
 version = "0.4.12"
 version = "0.4.12"
@@ -567,18 +259,6 @@ version = "0.4.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
 checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
 
 
-[[package]]
-name = "memchr"
-version = "2.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
-
-[[package]]
-name = "memory_addr"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f769efcf10b9dfb4c913bebb409cda77b1a3f072b249bf5465e250bcb30eb49"
-
 [[package]]
 [[package]]
 name = "nb"
 name = "nb"
 version = "0.1.3"
 version = "0.1.3"
@@ -662,18 +342,6 @@ version = "1.20.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e"
 checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e"
 
 
-[[package]]
-name = "page_table_entry"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "937b855b31ff3fa1274a5a4dfc1e57f124d26321adfa80ba03cdcc65921e8718"
-dependencies = [
- "aarch64-cpu",
- "bitflags 2.8.0",
- "memory_addr",
- "x86_64 0.15.2",
-]
-
 [[package]]
 [[package]]
 name = "panic-halt"
 name = "panic-halt"
 version = "1.0.0"
 version = "1.0.0"
@@ -686,29 +354,6 @@ version = "1.0.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
 checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
 
 
-[[package]]
-name = "percpu"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01e56c0c558952222967b592899f98765b48590e7bd7403bfd7075f73afc6ed6"
-dependencies = [
- "cfg-if",
- "percpu_macros",
- "spin",
- "x86",
-]
-
-[[package]]
-name = "percpu_macros"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a9f4cc54a2e471ff72f1499461ba381ad4eae9cbd60d29c258545b995e406e0"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
 [[package]]
 [[package]]
 name = "plic"
 name = "plic"
 version = "0.0.2"
 version = "0.0.2"
@@ -733,24 +378,6 @@ dependencies = [
  "proc-macro2",
  "proc-macro2",
 ]
 ]
 
 
-[[package]]
-name = "raw-cpuid"
-version = "10.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332"
-dependencies = [
- "bitflags 1.3.2",
-]
-
-[[package]]
-name = "raw-cpuid"
-version = "11.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6928fa44c097620b706542d428957635951bade7143269085389d42c8a4927e"
-dependencies = [
- "bitflags 2.8.0",
-]
-
 [[package]]
 [[package]]
 name = "rcore-console"
 name = "rcore-console"
 version = "0.0.0"
 version = "0.0.0"
@@ -780,7 +407,6 @@ dependencies = [
  "critical-section",
  "critical-section",
  "embedded-hal 1.0.0",
  "embedded-hal 1.0.0",
  "paste",
  "paste",
- "riscv-macros",
  "riscv-pac",
  "riscv-pac",
 ]
 ]
 
 
@@ -790,17 +416,6 @@ version = "0.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "cf8b4cfb0da0528321d22daee4299a23a8c5ac8848623d716e898d2a9eec0694"
 checksum = "cf8b4cfb0da0528321d22daee4299a23a8c5ac8848623d716e898d2a9eec0694"
 
 
-[[package]]
-name = "riscv-macros"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f265be5d634272320a7de94cea15c22a3bfdd4eb42eb43edc528415f066a1f25"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
 [[package]]
 [[package]]
 name = "riscv-pac"
 name = "riscv-pac"
 version = "0.2.0"
 version = "0.2.0"
@@ -868,13 +483,6 @@ dependencies = [
  "xuantie-riscv",
  "xuantie-riscv",
 ]
 ]
 
 
-[[package]]
-name = "rustsbi-supervisor"
-version = "0.0.0"
-dependencies = [
- "axstd",
-]
-
 [[package]]
 [[package]]
 name = "rustsbi-test-kernel"
 name = "rustsbi-test-kernel"
 version = "0.0.0"
 version = "0.0.0"
@@ -888,21 +496,6 @@ dependencies = [
  "uart16550",
  "uart16550",
 ]
 ]
 
 
-[[package]]
-name = "rustversion"
-version = "1.0.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
-
-[[package]]
-name = "sbi-rt"
-version = "0.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fbaa69be1eedc61c426e6d489b2260482e928b465360576900d52d496a58bd0"
-dependencies = [
- "sbi-spec 0.0.7",
-]
-
 [[package]]
 [[package]]
 name = "sbi-rt"
 name = "sbi-rt"
 version = "0.0.3"
 version = "0.0.3"
@@ -936,7 +529,7 @@ name = "sbi-spec"
 version = "0.0.8"
 version = "0.0.8"
 source = "git+https://github.com/rustsbi/rustsbi?rev=4821073#4821073b56a7223781c11a49aba743785d89d3ea"
 source = "git+https://github.com/rustsbi/rustsbi?rev=4821073#4821073b56a7223781c11a49aba743785d89d3ea"
 dependencies = [
 dependencies = [
- "bitflags 2.8.0",
+ "bitflags",
 ]
 ]
 
 
 [[package]]
 [[package]]
@@ -944,7 +537,7 @@ name = "sbi-spec"
 version = "0.0.8"
 version = "0.0.8"
 source = "git+https://github.com/rustsbi/rustsbi#99f4177fbed12c96c2c62121d51953b1bfa0ff43"
 source = "git+https://github.com/rustsbi/rustsbi#99f4177fbed12c96c2c62121d51953b1bfa0ff43"
 dependencies = [
 dependencies = [
- "bitflags 2.8.0",
+ "bitflags",
 ]
 ]
 
 
 [[package]]
 [[package]]
@@ -1024,12 +617,6 @@ version = "1.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
 checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
 
 
-[[package]]
-name = "static_assertions"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
-
 [[package]]
 [[package]]
 name = "strsim"
 name = "strsim"
 version = "0.11.1"
 version = "0.11.1"
@@ -1047,35 +634,6 @@ dependencies = [
  "unicode-ident",
  "unicode-ident",
 ]
 ]
 
 
-[[package]]
-name = "tock-registers"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "696941a0aee7e276a165a978b37918fd5d22c55c3d6bda197813070ca9c0f21c"
-
-[[package]]
-name = "tock-registers"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b9e2fdb3a1e862c0661768b7ed25390811df1947a8acbfbefe09b47078d93c4"
-
-[[package]]
-name = "toml_datetime"
-version = "0.6.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41"
-
-[[package]]
-name = "toml_edit"
-version = "0.22.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02a8b472d1a3d7c18e2d61a489aee3453fd9031c33e4f55bd533f4a7adca1bee"
-dependencies = [
- "indexmap",
- "toml_datetime",
- "winnow",
-]
-
 [[package]]
 [[package]]
 name = "uart16550"
 name = "uart16550"
 version = "0.0.1"
 version = "0.0.1"
@@ -1087,7 +645,7 @@ name = "uart_xilinx"
 version = "0.2.0"
 version = "0.2.0"
 source = "git+https://github.com/duskmoon314/uart-rs/#12be91421ad140f2a4bf4179578fd7a8fbc7ff5c"
 source = "git+https://github.com/duskmoon314/uart-rs/#12be91421ad140f2a4bf4179578fd7a8fbc7ff5c"
 dependencies = [
 dependencies = [
- "bitflags 2.8.0",
+ "bitflags",
  "volatile-register",
  "volatile-register",
 ]
 ]
 
 
@@ -1115,12 +673,6 @@ version = "1.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
 checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
 
 
-[[package]]
-name = "volatile"
-version = "0.4.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "442887c63f2c839b346c192d047a7c87e73d0689c9157b00b53dcc27dd5ea793"
-
 [[package]]
 [[package]]
 name = "volatile-register"
 name = "volatile-register"
 version = "0.2.2"
 version = "0.2.2"
@@ -1203,63 +755,6 @@ version = "0.52.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
 checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
 
 
-[[package]]
-name = "winnow"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86e376c75f4f43f44db463cf729e0d3acbf954d13e22c51e26e4c264b4ab545f"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "x2apic"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cbcd582541cbb8ef1dfc24a3c849a64ff074b1b512af723ad90056558d424602"
-dependencies = [
- "bit",
- "bitflags 1.3.2",
- "paste",
- "raw-cpuid 10.7.0",
- "x86_64 0.14.13",
-]
-
-[[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.7.0",
-]
-
-[[package]]
-name = "x86_64"
-version = "0.14.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c101112411baafbb4bf8d33e4c4a80ab5b02d74d2612331c61e8192fc9710491"
-dependencies = [
- "bit_field",
- "bitflags 2.8.0",
- "rustversion",
- "volatile",
-]
-
-[[package]]
-name = "x86_64"
-version = "0.15.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f042214de98141e9c8706e8192b73f56494087cc55ebec28ce10f26c5c364ae"
-dependencies = [
- "bit_field",
- "bitflags 2.8.0",
- "rustversion",
- "volatile",
-]
-
 [[package]]
 [[package]]
 name = "xtask"
 name = "xtask"
 version = "0.1.0"
 version = "0.1.0"
@@ -1275,7 +770,7 @@ version = "0.0.0"
 source = "git+https://github.com/rustsbi/xuantie#7a521c0400dc7edb7a3ee103206dd8246c78d542"
 source = "git+https://github.com/rustsbi/xuantie#7a521c0400dc7edb7a3ee103206dd8246c78d542"
 dependencies = [
 dependencies = [
  "bit_field",
  "bit_field",
- "bitflags 2.8.0",
+ "bitflags",
  "plic",
  "plic",
  "volatile-register",
  "volatile-register",
 ]
 ]

+ 1 - 1
Cargo.toml

@@ -1,6 +1,6 @@
 [workspace]
 [workspace]
 resolver = "3"
 resolver = "3"
-members = ["prototyper", "bench-kernel", "test-kernel", "supervisor", "xtask"]
+members = ["prototyper", "bench-kernel", "test-kernel", "xtask"]
 
 
 [workspace.package]
 [workspace.package]
 edition = "2024"
 edition = "2024"

+ 6 - 18
prototyper/src/platform/mod.rs

@@ -1,7 +1,7 @@
-use alloc::boxed::Box;
+use alloc::string::String;
+use alloc::{boxed::Box, string::ToString};
 use clint::{SifiveClintWrap, THeadClintWrap};
 use clint::{SifiveClintWrap, THeadClintWrap};
 use core::{
 use core::{
-    fmt::{Display, Formatter, Result},
     ops::Range,
     ops::Range,
     sync::atomic::{AtomicBool, Ordering},
     sync::atomic::{AtomicBool, Ordering},
 };
 };
@@ -35,16 +35,6 @@ mod console;
 mod reset;
 mod reset;
 
 
 type BaseAddress = usize;
 type BaseAddress = usize;
-/// Store finite-length string on the stack.
-pub(crate) struct StringInline<const N: usize>(usize, [u8; N]);
-
-impl<const N: usize> Display for StringInline<N> {
-    fn fmt(&self, f: &mut Formatter<'_>) -> Result {
-        write!(f, "{}", unsafe {
-            core::str::from_utf8_unchecked(&self.1[..self.0])
-        })
-    }
-}
 
 
 type CpuEnableList = [bool; NUM_HART_MAX];
 type CpuEnableList = [bool; NUM_HART_MAX];
 
 
@@ -55,7 +45,7 @@ pub struct BoardInfo {
     pub ipi: Option<(BaseAddress, MachineClintType)>,
     pub ipi: Option<(BaseAddress, MachineClintType)>,
     pub cpu_num: Option<usize>,
     pub cpu_num: Option<usize>,
     pub cpu_enabled: Option<CpuEnableList>,
     pub cpu_enabled: Option<CpuEnableList>,
-    pub model: StringInline<128>,
+    pub model: String,
 }
 }
 
 
 impl BoardInfo {
 impl BoardInfo {
@@ -67,7 +57,7 @@ impl BoardInfo {
             ipi: None,
             ipi: None,
             cpu_enabled: None,
             cpu_enabled: None,
             cpu_num: None,
             cpu_num: None,
-            model: StringInline(0, [0u8; 128]),
+            model: String::new(),
         }
         }
     }
     }
 }
 }
@@ -149,12 +139,10 @@ impl Platform {
         // Get model info
         // Get model info
         if let Some(model) = tree.model {
         if let Some(model) = tree.model {
             let model = model.iter().next().unwrap_or("<unspecified>");
             let model = model.iter().next().unwrap_or("<unspecified>");
-            self.info.model.0 = model.as_bytes().len();
-            self.info.model.1[..self.info.model.0].copy_from_slice(model.as_bytes());
+            self.info.model = model.to_string();
         } else {
         } else {
             let model = "<unspecified>";
             let model = "<unspecified>";
-            self.info.model.0 = model.as_bytes().len();
-            self.info.model.1[..self.info.model.0].copy_from_slice(model.as_bytes());
+            self.info.model = model.to_string();
         }
         }
 
 
         // TODO: Need a better extension initialization method
         // TODO: Need a better extension initialization method

+ 1 - 0
prototyper/src/sbi/trap/handler.rs

@@ -73,6 +73,7 @@ pub fn msoft_handler(ctx: FastContext) -> FastResult {
 }
 }
 
 
 #[inline]
 #[inline]
+#[allow(clippy::too_many_arguments)]
 pub fn sbi_call_handler(
 pub fn sbi_call_handler(
     mut ctx: FastContext,
     mut ctx: FastContext,
     a1: usize,
     a1: usize,

+ 0 - 15
supervisor/Cargo.toml

@@ -1,15 +0,0 @@
-[package]
-name = "rustsbi-supervisor"
-version = "0.0.0"
-edition.workspace = true
-license.workspace = true
-repository.workspace = true
-
-[dependencies]
-axstd = { git = "https://github.com/arceos-org/arceos.git", optional = true }
-
-[features]
-default = ["axstd"]
-axstd = ["dep:axstd"]
-
-log-level-trace = ["axstd/log-level-trace"]

+ 0 - 81
supervisor/axconfig.toml

@@ -1,81 +0,0 @@
-# Architecture identifier.
-arch = "riscv64" # str
-# Platform identifier.
-platform = "riscv64-qemu-virt" # str
-# Number of CPUs
-smp = 1 # uint
-# Stack size of each task.
-task-stack-size = 0x40000 # uint
-# Number of timer ticks per second (Hz). A timer tick may contain several timer
-# interrupts.
-ticks-per-sec = 100 # uint
-
-#
-# Device specifications
-#
-[devices]
-# MMIO regions with format (`base_paddr`, `size`).
-mmio-regions = [
-    [0x0010_1000, 0x1000],
-    [0x0c00_0000, 0x21_0000],
-    [0x1000_0000, 0x1000],
-    [0x1000_1000, 0x8000],
-    [0x3000_0000, 0x1000_0000],
-    [0x4000_0000, 0x4000_0000]
-] # [(uint, uint)]
-# End PCI bus number (`bus-range` property in device tree).
-pci-bus-end = 0xff # uint
-# Base physical address of the PCIe ECAM space.
-pci-ecam-base = 0x3000_0000 # uint
-# PCI device memory ranges (`ranges` property in device tree).
-pci-ranges = [
-    [0x0300_0000, 0x1_0000],
-    [0x4000_0000, 0x4000_0000],
-    [0x4_0000_0000, 0x4_0000_0000]
-] # [(uint, uint)]
-# rtc@101000 {
-#     interrupts = <0x0b>;
-#     interrupt-parent = <0x03>;
-#     reg = <0x00 0x101000 0x00 0x1000>;
-#     compatible = "google,goldfish-rtc";
-# };
-# RTC (goldfish) Address
-rtc-paddr = 0x10_1000 # uint
-# Timer interrupt frequency in Hz.
-timer-frequency = 10_000_000 # uint
-# VirtIO MMIO regions with format (`base_paddr`, `size`).
-virtio-mmio-regions = [
-    [0x1000_1000, 0x1000],
-    [0x1000_2000, 0x1000],
-    [0x1000_3000, 0x1000],
-    [0x1000_4000, 0x1000],
-    [0x1000_5000, 0x1000],
-    [0x1000_6000, 0x1000],
-    [0x1000_7000, 0x1000],
-    [0x1000_8000, 0x1000]
-] # [(uint, uint)]
-
-#
-# Platform configs
-#
-[plat]
-# Platform family.
-family = "riscv64-qemu-virt" # str
-# Kernel address space base.
-kernel-aspace-base = "0xffff_ffc0_0000_0000" # uint
-# Kernel address space size.
-kernel-aspace-size = "0x0000_003f_ffff_f000" # uint
-# Base physical address of the kernel image.
-kernel-base-paddr = 0x8020_0000 # uint
-# Base virtual address of the kernel image.
-kernel-base-vaddr = "0xffff_ffc0_8020_0000" # uint
-# Offset of bus address and phys address. some boards, the bus address is
-# different from the physical address.
-phys-bus-offset = 0 # uint
-# Base address of the whole physical memory.
-phys-memory-base = 0x8000_0000 # uint
-# Size of the whole physical memory. (128M)
-phys-memory-size = 0x800_0000 # uint
-# Linear mapping offset, for quick conversions between physical and virtual
-# addresses.
-phys-virt-offset = "0xffff_ffc0_0000_0000" # uint

+ 0 - 5
supervisor/build.rs

@@ -1,5 +0,0 @@
-fn main() {
-    println!(
-        "cargo:rustc-link-arg=-Ttarget/riscv64imac-unknown-none-elf/release/linker_riscv64-qemu-virt.lds"
-    );
-}

+ 0 - 10
supervisor/src/main.rs

@@ -1,10 +0,0 @@
-#![cfg_attr(feature = "axstd", no_std)]
-#![cfg_attr(feature = "axstd", no_main)]
-
-#[cfg(feature = "axstd")]
-use axstd::println;
-
-#[cfg_attr(feature = "axstd", no_mangle)]
-fn main() {
-    println!("Hello, world!");
-}

+ 4 - 1
test-kernel/src/main.rs

@@ -6,7 +6,10 @@
 #[macro_use]
 #[macro_use]
 extern crate rcore_console;
 extern crate rcore_console;
 
 
-use core::{arch::{asm, naked_asm} , ptr::null};
+use core::{
+    arch::{asm, naked_asm},
+    ptr::null,
+};
 use sbi_testing::sbi;
 use sbi_testing::sbi;
 use uart16550::Uart16550;
 use uart16550::Uart16550;