summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S14
1 files changed, 13 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
index 59dfb82ef5..ddbf40b8d9 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S
@@ -21,9 +21,11 @@
 
 #define __ASSEMBLY__
 #include <asm/ptrace.h>
+#include <asm/errno.h>
 #include "ucontext_i.h"
 
 ENTRY(__getcontext)
+#ifdef __ASSUME_NEW_RT_SIGRETURN_SYSCALL
   std  r0,(SIGCONTEXT_GP_REGS+(PT_R0*8))(r3)
   std  r1,(SIGCONTEXT_GP_REGS+(PT_R1*8))(r3)
   mflr  r0
@@ -126,8 +128,18 @@ ENTRY(__getcontext)
   addi  r5,r3,UCONTEXT_SIGMASK
   li  r4,0
   li  r3,SIG_BLOCK
-  bl  .sigprocmask
+  bl  JUMPTARGET(sigprocmask)
   nop
+#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
+#endif
   
   ld    r0,128+FRAME_LR_SAVE(r1)  
   addi  r1,r1,128