Skip to content

Commit 0a55d54

Browse files
committed
test(port_riscv): add boot-rt Cargo feature to the test driver
S-mode will need alteration to the boot process, hence needing a separate boot mode.
1 parent fa3fea0 commit 0a55d54

File tree

5 files changed

+19
-3
lines changed

5 files changed

+19
-3
lines changed

src/r3_port_riscv_test_driver/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ run = [
1313
"r3_port_riscv",
1414
"r3_portkit",
1515
"r3",
16-
"riscv-rt",
1716
"riscv",
1817
"log",
1918
]
2019

20+
boot-rt = [
21+
"riscv-rt",
22+
]
23+
2124
output-rtt = [
2225
"rtt-target",
2326
]

src/r3_port_riscv_test_driver/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ macro_rules! instantiate_test {
7878

7979
type System = r3_kernel::System<SystemTraits>;
8080
port::use_port!(unsafe struct SystemTraits);
81+
#[cfg(feature = "boot-rt")]
8182
port::use_rt!(unsafe SystemTraits);
8283
port::use_mtime!(unsafe impl PortTimer for SystemTraits);
8384

src/r3_test_runner/src/targets/jlink.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ impl Target for RedV {
2828

2929
fn cargo_features(&self) -> &[&str] {
3030
&[
31+
"boot-rt",
3132
"output-rtt",
3233
"interrupt-e310x",
3334
"board-e310x-red-v",

src/r3_test_runner/src/targets/kflash.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ impl Target for Maix {
2727

2828
fn cargo_features(&self) -> &[&str] {
2929
&[
30+
"boot-rt",
3031
"output-k210-uart",
3132
"interrupt-k210",
3233
"board-maix",

src/r3_test_runner/src/targets/qemu/riscv.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ impl Target for QemuSiFiveE {
1616
}
1717

1818
fn cargo_features(&self) -> &[&str] {
19-
&["output-e310x-uart", "interrupt-e310x", "board-e310x-qemu"]
19+
&[
20+
"boot-rt",
21+
"output-e310x-uart",
22+
"interrupt-e310x",
23+
"board-e310x-qemu",
24+
]
2025
}
2126

2227
fn memory_layout_script(&self) -> String {
@@ -80,7 +85,12 @@ impl Target for QemuSiFiveU {
8085
}
8186

8287
fn cargo_features(&self) -> &[&str] {
83-
&["output-u540-uart", "interrupt-u540-qemu", "board-u540-qemu"]
88+
&[
89+
"boot-rt",
90+
"output-u540-uart",
91+
"interrupt-u540-qemu",
92+
"board-u540-qemu",
93+
]
8494
}
8595

8696
fn memory_layout_script(&self) -> String {

0 commit comments

Comments
 (0)