use crate::{LINUX_SYS as SYS, global_asm};
#[cfg(target_arch = "x86_64")]
global_asm! {
"nop",
".global __devela_linux_restore_rt",
".hidden __devela_linux_restore_rt",
".type __devela_linux_restore_rt,@function",
"__devela_linux_restore_rt:",
"mov rax, {RT_SIGRETURN}",
"syscall",
RT_SIGRETURN = const SYS::RT_SIGRETURN,
}
#[cfg(target_arch = "x86")]
global_asm!(
".global __devela_linux_restore_rt",
".hidden __devela_linux_restore_rt",
".type __devela_linux_restore_rt,@function",
"__devela_linux_restore_rt:",
"mov eax, {RT_SIGRETURN}",
"int 0x80",
RT_SIGRETURN = const SYS::RT_SIGRETURN,
);
#[cfg(target_arch = "arm")]
global_asm!(
".syntax unified", ".global __devela_linux_restore_rt",
".hidden __devela_linux_restore_rt",
".type __devela_linux_restore_rt,%function",
"__devela_linux_restore_rt:",
"mov r7, #{RT_SIGRETURN}",
"swi 0x0",
RT_SIGRETURN = const SYS::RT_SIGRETURN,
);
#[cfg(target_arch = "aarch64")]
global_asm!(
".global __devela_linux_restore_rt",
".hidden __devela_linux_restore_rt",
".type __devela_linux_restore_rt,%function",
"__devela_linux_restore_rt:",
"mov x8, #{RT_SIGRETURN}",
"svc 0",
RT_SIGRETURN = const SYS::RT_SIGRETURN,
);
#[cfg(any_target_arch_riscv)]
global_asm!(
".global __devela_linux_restore_rt",
".type __devela_linux_restore_rt, %function",
"__devela_linux_restore_rt:",
"li a7, {RT_SIGRETURN}",
"ecall",
RT_SIGRETURN = const SYS::RT_SIGRETURN,
);