diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/powerpc32')
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/powerpc32/Dist | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/powerpc32/fe_nomask.c | 29 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S | 7 |
3 files changed, 29 insertions, 8 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Dist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Dist index 381f878080..297e031620 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Dist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Dist @@ -1,2 +1,3 @@ clone.S kernel_stat.h +fe_nomask.c diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fe_nomask.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fe_nomask.c index e51714d312..2c85a3a9e9 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fe_nomask.c +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fe_nomask.c @@ -21,7 +21,11 @@ #include <errno.h> #include <signal.h> #include <unistd.h> +#include <sysdep.h> +#include <sys/prctl.h> +#include "kernel-features.h" +#if __ASSUME_NEW_PRCTL_SYSCALL == 0 /* This is rather fiddly under Linux. We don't have direct access, and there is no system call, but we can change the bits in a signal handler's context... */ @@ -34,18 +38,31 @@ fe_nomask_handler (int signum, struct sigcontext *sc) sc->regs->msr |= 0x900ul; /* FE0 | FE1 */ sigaction (SIGUSR1, &oact, NULL); } +#endif const fenv_t * __fe_nomask_env (void) { - struct sigaction act; +#if __ASSUME_NEW_PRCTL_SYSCALL == 0 +# if defined PR_SET_FPEXC && defined PR_FP_EXC_PRECISE + int result = INLINE_SYSCALL (prctl, 2, PR_SET_FPEXC, PR_FP_EXC_PRECISE); - act.sa_handler = (sighandler_t) fe_nomask_handler; - sigemptyset (&act.sa_mask); - act.sa_flags = 0; + if (result == -1 && errno == EINVAL) +# endif + { + struct sigaction act; - sigaction (SIGUSR1, &act, &oact); - raise (SIGUSR1); + act.sa_handler = (sighandler_t) fe_nomask_handler; + sigemptyset (&act.sa_mask); + act.sa_flags = 0; + + sigaction (SIGUSR1, &act, &oact); + raise (SIGUSR1); + } +#else + INTERNAL_SYSCALL_DECL (err); + INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_PRECISE); +#endif return FE_ENABLED_ENV; } diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S index 9a0f53e99e..5fb7868c31 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S @@ -38,7 +38,7 @@ ENTRY (__vfork) bnslr+ /* Check if vfork syscall is known at all. */ cmpwi r3,ENOSYS - bne JUMPTARGET(__syscall_error) + bne- .Lsyscall_error # endif #endif @@ -47,7 +47,10 @@ ENTRY (__vfork) /* If we don't have vfork, fork is close enough. */ DO_CALL (SYS_ify (fork)) - PSEUDO_RET + bnslr+ + +.Lsyscall_error: + b JUMPTARGET(__syscall_error) #endif PSEUDO_END (__vfork) |