Add missed clobbered registers in asm block
Fixes mis-compilation described in rust-lang/rust#68812.
This commit is contained in:
parent
589696a500
commit
44ef31ff77
|
@ -11,11 +11,12 @@ pub mod semihosting {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub fn sys_write0_call(text: &str) {
|
pub fn sys_write0_call(text: &str) {
|
||||||
// SAFETY: text must be \0-terminated!
|
// SAFETY: text must be \0-terminated!
|
||||||
|
let cmd = 0x04;
|
||||||
unsafe {
|
unsafe {
|
||||||
asm!(
|
asm!(
|
||||||
"mov w0, #0x04
|
"hlt #0xF000"
|
||||||
hlt #0xF000"
|
, in("w0") cmd
|
||||||
, in("x1") text.as_ptr() as u64
|
, in("x1") text.as_ptr() as u64
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue