summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S18
1 files changed, 17 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
index d503cbbf3e..fa37abd6da 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
@@ -22,8 +22,10 @@
 #define __ASSEMBLY__
 #include <asm/ptrace.h>
 #include "ucontext_i.h"
+#include <asm/errno.h>
 
 ENTRY(__setcontext)
+#ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
   mflr  r0
   std   r31,-8(1)
   std   r0,FRAME_LR_SAVE(r1)
@@ -47,7 +49,7 @@ ENTRY(__setcontext)
   li    r5,0
   addi  r4,r3,UCONTEXT_SIGMASK
   li    r3,SIG_SETMASK
-  bl    .sigprocmask
+  bl    JUMPTARGET(sigprocmask)
   nop
   cmpdi r3,0
   bne   L(error_exit)
@@ -156,6 +158,20 @@ L(do_sigret):
   li   r0,SYS_ify(rt_sigreturn)
   sc
   /* No return.  */
+#else
+  /* If the kernel is not at least 2.4.21 then generate a ENOSYS stub.  */
+  mflr r0
+  std  r0,FRAME_LR_SAVE(r1)
+  stdu r1,-128(r1)
+  li   r3,ENOSYS
+  bl   JUMPTARGET(__syscall_error)
+  nop
+  li   r3,-1
+  ld   r0,128+FRAME_LR_SAVE(r1)  
+  addi r1,r1,128
+  mtlr r0
+  blr
+#endif
 
 PSEUDO_END(__setcontext)