Add i386 __restore_rt

This commit is contained in:
Jeremy Soller
2022-07-22 19:24:05 -06:00
parent ece0bd090d
commit abe30ba884
+21 -10
View File
@@ -1,5 +1,26 @@
use core::arch::global_asm;
// x8 is register, 119 is SIGRETURN
#[cfg(target_arch = "aarch64")]
global_asm!(
"
.global __restore_rt
__restore_rt:
mov x8, #119
svc 0
"
);
// Needs to be defined in assembly because it can't have a function prologue
// eax is register, 119 is SIGRETURN
#[cfg(target_arch = "x86")]
global_asm!(
"
.global __restore_rt
__restore_rt:
mov eax, 119
int 0x80
"
);
// Needs to be defined in assembly because it can't have a function prologue
// rax is register, 119 is SIGRETURN
#[cfg(target_arch = "x86_64")]
@@ -11,16 +32,6 @@ global_asm!(
syscall
"
);
// x8 is register, 119 is SIGRETURN
#[cfg(target_arch = "aarch64")]
global_asm!(
"
.global __restore_rt
__restore_rt:
mov x8, #119
svc 0
"
);
pub const SIGHUP: usize = 1;
pub const SIGINT: usize = 2;