prevent formatting of assembly

This commit is contained in:
bunnie 2024-05-31 03:34:21 +08:00
parent f4c127684b
commit 1761b38b23

View file

@ -553,6 +553,7 @@ impl Swap {
let working_stack_ptr: usize =
EXCEPTION_STACK_TOP - self.oom_stack_backing.len() * core::mem::size_of::<usize>();
unsafe {
#[rustfmt::skip]
core::arch::asm!(
"mv a7, {working_stack_end}",
"mv a6, {working_stack_ptr}",
@ -569,7 +570,7 @@ impl Swap {
working_stack_ptr = in(reg) working_stack_ptr,
backup_stack_ptr = in(reg) backup_stack_ptr,
current_sp = out(reg) current_sp,
)
);
}
// this assert will hopefully save us during CI testing if parameters changed and we have to fix them
// the assert itself would modify stack, but, we're on the path to a panic so that's OK
@ -588,6 +589,7 @@ impl Swap {
let working_restore_ptr: usize =
EXCEPTION_STACK_TOP - self.oom_stack_backing.len() * core::mem::size_of::<usize>();
unsafe {
#[rustfmt::skip]
core::arch::asm!(
"mv a7, {working_restore_end}",
"mv a6, {working_restore_ptr}",
@ -602,7 +604,7 @@ impl Swap {
working_restore_end = in(reg) working_restore_end,
working_restore_ptr = in(reg) working_restore_ptr,
restore_stack_ptr = in(reg) restore_stack_ptr,
)
);
}
#[cfg(feature = "debug-swap-verbose")]