Skip to content

Commit 1699e34

Browse files
committed
fix: 识别 qemu7.2 设备树里的 serial 节点
Signed-off-by: YdrMaster <ydrml@hotmail.com>
1 parent bbe9586 commit 1699e34

File tree

7 files changed

+44
-20
lines changed

7 files changed

+44
-20
lines changed

Cargo.lock

Lines changed: 28 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bench-kernel/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ publish = false
99

1010
[dependencies]
1111
sbi-rt = "0.0.2"
12-
riscv = "0.9.0"
12+
riscv = "0.10.1"
1313
uart_16550 = "0.2"
1414
rcore-console = "0.0.0"

rustsbi-qemu/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ edition = "2021"
1919
[dependencies]
2020
rustsbi = "0.3.0"
2121
sbi-spec = { version = "0.0.4", features = ["legacy"] }
22-
riscv = "0.9.0"
22+
riscv = "0.10.1"
2323
spin = "0.9"
2424
uart_16550 = "0.2"
2525
rcore-console = "0.0.0"

rustsbi-qemu/src/device_tree.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ pub(crate) fn parse(opaque: usize) -> BoardInfo {
3232
const MEMORY: &str = "memory";
3333
const SOC: &str = "soc";
3434
const UART: &str = "uart";
35+
const SERIAL: &str = "serial";
3536
const TEST: &str = "test";
3637
const CLINT: &str = "clint";
3738

@@ -61,7 +62,11 @@ pub(crate) fn parse(opaque: usize) -> BoardInfo {
6162
StepOver
6263
}
6364
} else if current == Str::from(SOC) {
64-
if name.starts_with(UART) || name.starts_with(TEST) || name.starts_with(CLINT) {
65+
if name.starts_with(UART)
66+
|| name.starts_with(SERIAL)
67+
|| name.starts_with(TEST)
68+
|| name.starts_with(CLINT)
69+
{
6570
StepInto
6671
} else {
6772
StepOver
@@ -80,7 +85,7 @@ pub(crate) fn parse(opaque: usize) -> BoardInfo {
8085
}
8186
DtbObj::Property(Property::Reg(mut reg)) => {
8287
let node = ctx.name();
83-
if node.starts_with(UART) {
88+
if node.starts_with(UART) || node.starts_with(SERIAL) {
8489
ans.uart = reg.next().unwrap();
8590
StepOut
8691
} else if node.starts_with(TEST) {

test-kernel/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ publish = false
1010
[dependencies]
1111
sbi-testing = { version = "0.0.1", features = ["log"] }
1212
log = "0.4.17"
13-
riscv = "0.9.0"
13+
riscv = "0.10.1"
1414
spin = "0.9"
1515
uart_16550 = "0.2"
1616
rcore-console = "0.0.0"

test-kernel/src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,16 @@ impl BoardInfo {
121121
} else if ctx.name() == Str::from("cpus") && name.starts_with("cpu@") {
122122
ans.smp += 1;
123123
StepOver
124-
} else if ctx.name() == Str::from("soc") && name.starts_with("uart") {
124+
} else if ctx.name() == Str::from("soc")
125+
&& (name.starts_with("uart") || name.starts_with("serial"))
126+
{
125127
StepInto
126128
} else {
127129
StepOver
128130
}
129131
}
130132
DtbObj::Property(Property::Reg(mut reg)) => {
131-
if ctx.name().starts_with("uart") {
133+
if ctx.name().starts_with("uart") || ctx.name().starts_with("serial") {
132134
ans.uart = reg.next().unwrap().start;
133135
}
134136
StepOut

xtask/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ publish = false
99
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1010

1111
[dependencies]
12-
clap = { version = "4.0", features = ["derive"] }
12+
clap = { version = "4.1", features = ["derive"] }
1313
os-xtask-utils = "0.0.0"
14-
once_cell = "1.16"
14+
once_cell = "1.17"

0 commit comments

Comments
 (0)