Browse Source

Add i386 __restore_rt

Jeremy Soller 2 years ago
parent
commit
abe30ba884
1 changed files with 19 additions and 8 deletions
  1. 19 8
      src/header/signal/redox.rs

+ 19 - 8
src/header/signal/redox.rs

@@ -1,24 +1,35 @@
 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
-// rax is register, 119 is SIGRETURN
-#[cfg(target_arch = "x86_64")]
+// eax is register, 119 is SIGRETURN
+#[cfg(target_arch = "x86")]
 global_asm!(
     "
     .global __restore_rt
     __restore_rt:
-        mov rax, 119
-        syscall
+        mov eax, 119
+        int 0x80
 "
 );
-// x8 is register, 119 is SIGRETURN
-#[cfg(target_arch = "aarch64")]
+// 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")]
 global_asm!(
     "
     .global __restore_rt
     __restore_rt:
-        mov x8, #119
-        svc 0
+        mov rax, 119
+        syscall
 "
 );