Skip to content

Commit c2843d3

Browse files
committed
typo
Signed-off-by: YdrMaster <ydrml@hotmail.com>
1 parent 9dfe396 commit c2843d3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rustsbi-qemu/src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ extern "C" fn rust_main(_hartid: usize, opaque: usize) {
124124
if !GENESIS.swap(true, AcqRel) {
125125
// 清零 bss 段
126126
zero_bss();
127-
// 解析设备树,需要堆来保存结果里的字符串等
127+
// 解析设备树
128128
let board_info = BOARD_INFO.call_once(|| device_tree::parse(opaque));
129129
// 初始化外设
130130
rustsbi::legacy_stdio::init_legacy_stdio(
@@ -177,8 +177,10 @@ extern "C" fn rust_main(_hartid: usize, opaque: usize) {
177177
}
178178

179179
/// 准备好不可恢复休眠或关闭
180+
///
181+
/// 在隔离的环境(汇编)调用,以确保 main 中使用的堆资源完全释放。
182+
/// (只是作为示例,因为这个版本完全不使用堆)
180183
extern "C" fn finalize() {
181-
//! 在隔离的环境调用,以确保 main 中使用的堆资源完全释放
182184
HSM.wait().finallize_before_stop();
183185
unsafe { riscv::interrupt::enable() };
184186
}

0 commit comments

Comments
 (0)