History

parisc/signal: Add FPE_CONDTRAP for conditional trap handling

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.

Helge Deller committed 8 years ago

Commit 75abf641 parent b284d4d4 files · +7 −12Browse files

Unified · Split

4 files
  1. arch/parisc/include/uapi/asm/siginfo.h +0 −7
  2. arch/parisc/kernel/traps.c +4 −3
  3. arch/x86/kernel/signal_compat.c +1 −1
  4. include/uapi/asm-generic/siginfo.h +2 −1
arch/parisc/include/uapi/asm/siginfo.h+0−7
@@ -8,11 +8,4 @@ · 7 unmodified lines
8 8
9#include <asm-generic/siginfo.h>9#include <asm-generic/siginfo.h>
10 10
11/*
12 * SIGFPE si_codes
13 */
14#ifdef __KERNEL__
15#define FPE_FIXME 0 /* Broken dup of SI_USER */
16#endif /* __KERNEL__ */
17
18#endif11#endif
arch/parisc/kernel/traps.c+4−3
@@ -627,9 +627,10 @@ void notrace handle_interruption(int code, struct pt_regs *regs) · 626 unmodified lines
627 on condition */627 on condition */
628 if(user_mode(regs)){628 if(user_mode(regs)){
629 si.si_signo = SIGFPE;629 si.si_signo = SIGFPE;
630 /* Set to zero, and let the userspace app figure it out from630 /* Let userspace app figure it out from the insn pointed
631 the insn pointed to by si_addr */631 * to by si_addr.
632 si.si_code = FPE_FIXME;632 */
633 si.si_code = FPE_CONDTRAP;
633 si.si_addr = (void __user *) regs->iaoq[0];634 si.si_addr = (void __user *) regs->iaoq[0];
634 force_sig_info(SIGFPE, &si, current);635 force_sig_info(SIGFPE, &si, current);
635 return;636 return;
arch/x86/kernel/signal_compat.c+1−1
@@ -26,7 +26,7 @@ static inline void signal_compat_build_tests(void) · 25 unmodified lines
26 * new fields are handled in copy_siginfo_to_user32()!26 * new fields are handled in copy_siginfo_to_user32()!
27 */27 */
28 BUILD_BUG_ON(NSIGILL != 11);28 BUILD_BUG_ON(NSIGILL != 11);
29 BUILD_BUG_ON(NSIGFPE != 14);29 BUILD_BUG_ON(NSIGFPE != 15);
30 BUILD_BUG_ON(NSIGSEGV != 7);30 BUILD_BUG_ON(NSIGSEGV != 7);
31 BUILD_BUG_ON(NSIGBUS != 5);31 BUILD_BUG_ON(NSIGBUS != 5);
32 BUILD_BUG_ON(NSIGTRAP != 4);32 BUILD_BUG_ON(NSIGTRAP != 4);
include/uapi/asm-generic/siginfo.h+2−1
@@ -211,7 +211,8 @@ typedef struct siginfo { · 210 unmodified lines
211#define __FPE_INVASC 12 /* invalid ASCII digit */211#define __FPE_INVASC 12 /* invalid ASCII digit */
212#define __FPE_INVDEC 13 /* invalid decimal digit */212#define __FPE_INVDEC 13 /* invalid decimal digit */
213#define FPE_FLTUNK 14 /* undiagnosed floating-point exception */213#define FPE_FLTUNK 14 /* undiagnosed floating-point exception */
214#define NSIGFPE 14214#define FPE_CONDTRAP 15 /* trap on condition */
215#define NSIGFPE 15
215 216
216/*217/*
217 * SIGSEGV si_codes218 * SIGSEGV si_codes