use crate::{LINUX_SYS as SYS, global_asm};
#[cfg(target_arch = "x86_64")]
global_asm! {
".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",
".hidden __devela_linux_restore",
".type __devela_linux_restore,@function",
"__devela_linux_restore:",
"popl eax",
"movl eax, {SIGRETURN}",
"int 0x80",
".global __devela_linux_restore_rt",
".hidden __devela_linux_restore_rt",
".type __devela_linux_restore_rt,@function",
"__devela_linux_restore_rt:",
"movl eax, {RT_SIGRETURN}",
"int 0x80",
SIGRETURN = const SYS::SIGRETURN,
RT_SIGRETURN = const SYS::RT_SIGRETURN,
);
#[cfg(target_arch = "arm")]
global_asm!(
".syntax unified",
".global __devela_linux_restore",
".hidden __devela_linux_restore",
".type __devela_linux_restore,%function",
"__devela_linux_restore:",
"mov r7, {SIGRETURN}",
"swi 0x0",
".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",
SIGRETURN = const SYS::SIGRETURN,
RT_SIGRETURN = const SYS::RT_SIGRETURN,
);
#[cfg(target_arch = "aarch64")]
global_asm!(
".global __devela_linux_restore",
".hidden __devela_linux_restore",
".type __devela_linux_restore,%function",
"__devela_linux_restore:",
".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,
);