Bladeren bron

lib: rearrange RustSBI library into rustsbi path

Signed-off-by: DongQing <[email protected]>
DongQing 1 jaar geleden
bovenliggende
commit
c615ee256e

+ 13 - 13
.github/workflows/rust.yml

@@ -31,7 +31,7 @@ jobs:
           args: --all -- --check
 
   check-stable:
-    name: Cargo check (stable)
+    name: Cargo check crate RustSBI (stable)
     runs-on: ubuntu-latest
     needs: fmt
     strategy:
@@ -52,26 +52,26 @@ jobs:
       - name: Check (no default features)
         uses: actions-rs/cargo@v1
         with:
-          command: check
-          args: --target ${{ matrix.TARGET }} --verbose
-      - name: Check (machine)
+          command: check 
+          args: --target ${{ matrix.TARGET }} --verbose -p rustsbi
+      - name: Check crate rustsbi (machine)
         uses: actions-rs/cargo@v1
         with:
           command: check
-          args: --target ${{ matrix.TARGET }} --features "machine" --verbose
-      - name: Check (forward)
+          args: --target ${{ matrix.TARGET }} --features "machine" --verbose -p rustsbi
+      - name: Check crate rustsbi (forward)
         uses: actions-rs/cargo@v1
         with:
           command: check
-          args: --target ${{ matrix.TARGET }} --features "forward" --verbose
-      - name: Check (machine + forward)
+          args: --target ${{ matrix.TARGET }} --features "forward" --verbose -p rustsbi
+      - name: Check crate rustsbi (machine + forward)
         uses: actions-rs/cargo@v1
         with:
           command: check
-          args: --target ${{ matrix.TARGET }} --features "machine, forward" --verbose
+          args: --target ${{ matrix.TARGET }} --features "machine, forward" --verbose -p rustsbi
 
   check-nightly:
-    name: Cargo check (nightly)
+    name: Cargo check crate RustSBI (nightly)
     runs-on: ubuntu-latest
     needs: fmt
     strategy:
@@ -91,7 +91,7 @@ jobs:
           key: ${{ matrix.TARGET }}
 
   tests:
-    name: Run tests
+    name: Run crate RustSBI tests
     needs: fmt
     runs-on: ubuntu-latest
     steps:
@@ -112,9 +112,9 @@ jobs:
         uses: actions-rs/cargo@v1
         with:
           command: test
-          args: --verbose
+          args: --verbose -p rustsbi
       - name: Run tests (machine)
         uses: actions-rs/cargo@v1
         with:
           command: test
-          args: --features "machine" --verbose
+          args: --features "machine" --verbose -p rustsbi

+ 5 - 46
Cargo.toml

@@ -1,47 +1,6 @@
-[package]
-name = "rustsbi"
-description = "Minimal RISC-V's SBI implementation library in Rust"
-version = "0.4.0-alpha.1"
-authors = [
-    "Luo Jia <[email protected]>",
-    "Campbell He <[email protected]>",
-    "Yifan Wu <[email protected]>",
-]
-repository = "https://github.com/rustsbi/rustsbi"
-documentation = "https://docs.rs/rustsbi"
-license = "MulanPSL-2.0 OR MIT"
-readme = "README.md"
-keywords = ["riscv", "sbi", "rustsbi"]
-categories = ["os", "embedded", "hardware-support", "no-std"]
-edition = "2021"
-exclude = ["/.github"]
-
-[dependencies]
-sbi-spec = "0.0.7-alpha.3"
-riscv = { version = "0.10.1", optional = true }
-sbi-rt = { version = "0.0.3-rc.5", features = ["integer-impls"], optional = true }
-rustsbi-macros = { version = "0.0.0", path = "macros" }
-
-[features]
-default = []
-# Run RustSBI on machine mode.
-# This feature enables to use RISC-V primitives on current machine mode environment
-# If you are developing a cross-architecture virtual machine, consider disabling this feature
-# to customize environment variables for RISC-V architecture like mvendorid, mimpid, etc.
-machine = ["rustsbi-macros/machine", "dep:riscv"]
-# Enables the struct `Forward`.
-# Struct `Forward` uses current SBI environment to implement the RustSBI environment.
-# This feature is only usable when current software runs on another SBI environment,
-# e.g. hypervisors for RISC-V architecture.
-forward = ["dep:sbi-rt"]
-
-[package.metadata.docs.rs]
-default-target = "riscv64imac-unknown-none-elf"
-targets = [
-    "riscv32imac-unknown-none-elf", "riscv64imac-unknown-none-elf",
-]
-
 [workspace]
-members = ["macros"]
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+members = [
+    "rustsbi",
+    "rustsbi/macros",
+]
+resolver = "2"

+ 44 - 0
rustsbi/Cargo.toml

@@ -0,0 +1,44 @@
+[package]
+name = "rustsbi"
+description = "Minimal RISC-V's SBI implementation library in Rust"
+version = "0.4.0-alpha.1"
+authors = [
+    "Luo Jia <[email protected]>",
+    "Campbell He <[email protected]>",
+    "Yifan Wu <[email protected]>",
+]
+repository = "https://github.com/rustsbi/rustsbi"
+documentation = "https://docs.rs/rustsbi"
+license = "MulanPSL-2.0 OR MIT"
+readme = "README.md"
+keywords = ["riscv", "sbi", "rustsbi"]
+categories = ["os", "embedded", "hardware-support", "no-std"]
+edition = "2021"
+exclude = ["/.github"]
+
+[dependencies]
+sbi-spec = "0.0.7-alpha.3"
+riscv = { version = "0.10.1", optional = true }
+sbi-rt = { version = "0.0.3-rc.5", features = ["integer-impls"], optional = true }
+rustsbi-macros = { version = "0.0.0", path = "macros" }
+
+[features]
+default = []
+# Run RustSBI on machine mode.
+# This feature enables to use RISC-V primitives on current machine mode environment
+# If you are developing a cross-architecture virtual machine, consider disabling this feature
+# to customize environment variables for RISC-V architecture like mvendorid, mimpid, etc.
+machine = ["rustsbi-macros/machine", "dep:riscv"]
+# Enables the struct `Forward`.
+# Struct `Forward` uses current SBI environment to implement the RustSBI environment.
+# This feature is only usable when current software runs on another SBI environment,
+# e.g. hypervisors for RISC-V architecture.
+forward = ["dep:sbi-rt"]
+
+[package.metadata.docs.rs]
+default-target = "riscv64imac-unknown-none-elf"
+targets = [
+    "riscv32imac-unknown-none-elf", "riscv64imac-unknown-none-elf",
+]
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

+ 0 - 0
examples/derive/commons.rs → rustsbi/examples/derive/commons.rs


+ 0 - 0
examples/derive/main.rs → rustsbi/examples/derive/main.rs


+ 0 - 0
macros/Cargo.toml → rustsbi/macros/Cargo.toml


+ 0 - 0
macros/src/lib.rs → rustsbi/macros/src/lib.rs


+ 0 - 0
src/console.rs → rustsbi/src/console.rs


+ 0 - 0
src/cppc.rs → rustsbi/src/cppc.rs


+ 0 - 0
src/forward.rs → rustsbi/src/forward.rs


+ 0 - 0
src/hsm.rs → rustsbi/src/hsm.rs


+ 0 - 0
src/ipi.rs → rustsbi/src/ipi.rs


+ 0 - 0
src/lib.rs → rustsbi/src/lib.rs


+ 0 - 0
src/nacl.rs → rustsbi/src/nacl.rs


+ 0 - 0
src/pmu.rs → rustsbi/src/pmu.rs


+ 0 - 0
src/reset.rs → rustsbi/src/reset.rs


+ 0 - 0
src/rfence.rs → rustsbi/src/rfence.rs


+ 0 - 0
src/sta.rs → rustsbi/src/sta.rs


+ 0 - 0
src/susp.rs → rustsbi/src/susp.rs


+ 0 - 0
src/timer.rs → rustsbi/src/timer.rs


+ 0 - 0
src/traits.rs → rustsbi/src/traits.rs


+ 0 - 0
tests/build-full.rs → rustsbi/tests/build-full.rs


+ 0 - 0
tests/build-generics.rs → rustsbi/tests/build-generics.rs


+ 0 - 0
tests/build-rename.rs → rustsbi/tests/build-rename.rs


+ 0 - 0
tests/build-skip.rs → rustsbi/tests/build-skip.rs


+ 0 - 0
tests/forward-struct.rs → rustsbi/tests/forward-struct.rs