Skip to content

Commit fcd0726

Browse files
committed
testing: update to naked_asm! in naked functions to build under rustc 2024-10-07
Ref: rust-lang/rust#128651 Signed-off-by: Zhouqi Jiang <[email protected]>
1 parent 3370a9b commit fcd0726

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

sbi-testing/src/hsm.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -235,19 +235,18 @@ fn test_batch(batch: &[usize], mut f: impl FnMut(Case)) -> bool {
235235
/// 测试用启动入口
236236
#[naked]
237237
unsafe extern "C" fn test_entry(hartid: usize, opaque: *mut ItemPerHart) -> ! {
238-
core::arch::asm!(
238+
core::arch::naked_asm!(
239239
"csrw sie, zero", // 关中断
240240
"call {set_stack}", // 设置栈
241241
"j {rust_main}", // 进入 rust
242242
set_stack = sym set_stack,
243243
rust_main = sym rust_main,
244-
options(noreturn),
245244
)
246245
}
247246

248247
#[naked]
249248
unsafe extern "C" fn set_stack(hart_id: usize, ptr: *const ItemPerHart) {
250-
core::arch::asm!("addi sp, a1, 512", "ret", options(noreturn));
249+
core::arch::naked_asm!("addi sp, a1, 512", "ret");
251250
}
252251

253252
#[inline(never)]

sbi-testing/src/thread.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl Thread {
109109
/// 裸函数。
110110
#[naked]
111111
unsafe extern "C" fn execute_naked() {
112-
core::arch::asm!(
112+
core::arch::naked_asm!(
113113
r" .altmacro
114114
.macro SAVE n
115115
sd x\n, \n*8(sp)
@@ -176,6 +176,5 @@ unsafe extern "C" fn execute_naked() {
176176
// 返回调度
177177
" ret",
178178
" .option pop",
179-
options(noreturn)
180179
)
181180
}

0 commit comments

Comments
 (0)