parisc/signal: Add FPE_CONDTRAP for conditional trap handling
authorHelge Deller <deller@gmx.de>
Sun, 14 Jan 2018 01:32:43 +0000 (19:32 -0600)
committerHelge Deller <deller@gmx.de>
Wed, 11 Apr 2018 09:40:35 +0000 (11:40 +0200)
Posix and common sense requires that SI_USER not be a signal specific
si_code. Thus add a new FPE_CONDTRAP si_code for conditional traps.

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
arch/parisc/include/uapi/asm/siginfo.h
arch/parisc/kernel/traps.c
arch/x86/kernel/signal_compat.c
include/uapi/asm-generic/siginfo.h

index be40331f757da4e58aa423521a3c7542c2a2e45e..4a1062e05aaff7f35fe2927e85ab89fe3b6e1290 100644 (file)
@@ -8,11 +8,4 @@
 
 #include <asm-generic/siginfo.h>
 
-/*
- * SIGFPE si_codes
- */
-#ifdef __KERNEL__
-#define FPE_FIXME      0       /* Broken dup of SI_USER */
-#endif /* __KERNEL__ */
-
 #endif
index c919e6c0a687c44c2d69d054cd92a4596b225b81..68e671a11987a6f2fe3de6823e8e3e1ed497334d 100644 (file)
@@ -627,9 +627,10 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
                   on condition  */
                if(user_mode(regs)){
                        si.si_signo = SIGFPE;
-                       /* Set to zero, and let the userspace app figure it out from
-                          the insn pointed to by si_addr */
-                       si.si_code = FPE_FIXME;
+                       /* Let userspace app figure it out from the insn pointed
+                        * to by si_addr.
+                        */
+                       si.si_code = FPE_CONDTRAP;
                        si.si_addr = (void __user *) regs->iaoq[0];
                        force_sig_info(SIGFPE, &si, current);
                        return;
index df92605d87244e9c0ed63cec557e6cce7addbf09..14c057f2997969023f3ebeecb36669beaf9c8a47 100644 (file)
@@ -26,7 +26,7 @@ static inline void signal_compat_build_tests(void)
         * new fields are handled in copy_siginfo_to_user32()!
         */
        BUILD_BUG_ON(NSIGILL  != 11);
-       BUILD_BUG_ON(NSIGFPE  != 14);
+       BUILD_BUG_ON(NSIGFPE  != 15);
        BUILD_BUG_ON(NSIGSEGV != 7);
        BUILD_BUG_ON(NSIGBUS  != 5);
        BUILD_BUG_ON(NSIGTRAP != 4);
index 544208fd3db17a84938b2cea1ca94cc2ac579fbf..558b902f18d4129261dfe2de451dba23dba98dff 100644 (file)
@@ -211,7 +211,8 @@ typedef struct siginfo {
 #define __FPE_INVASC   12      /* invalid ASCII digit */
 #define __FPE_INVDEC   13      /* invalid decimal digit */
 #define FPE_FLTUNK     14      /* undiagnosed floating-point exception */
-#define NSIGFPE                14
+#define FPE_CONDTRAP   15      /* trap on condition */
+#define NSIGFPE                15
 
 /*
  * SIGSEGV si_codes