We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9dfe396 commit c2843d3Copy full SHA for c2843d3
rustsbi-qemu/src/main.rs
@@ -124,7 +124,7 @@ extern "C" fn rust_main(_hartid: usize, opaque: usize) {
124
if !GENESIS.swap(true, AcqRel) {
125
// 清零 bss 段
126
zero_bss();
127
- // 解析设备树,需要堆来保存结果里的字符串等
+ // 解析设备树
128
let board_info = BOARD_INFO.call_once(|| device_tree::parse(opaque));
129
// 初始化外设
130
rustsbi::legacy_stdio::init_legacy_stdio(
@@ -177,8 +177,10 @@ extern "C" fn rust_main(_hartid: usize, opaque: usize) {
177
}
178
179
/// 准备好不可恢复休眠或关闭
180
+///
181
+/// 在隔离的环境(汇编)调用,以确保 main 中使用的堆资源完全释放。
182
+/// (只是作为示例,因为这个版本完全不使用堆)
183
extern "C" fn finalize() {
- //! 在隔离的环境调用,以确保 main 中使用的堆资源完全释放
184
HSM.wait().finallize_before_stop();
185
unsafe { riscv::interrupt::enable() };
186
0 commit comments