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
88
99 #include <asm-generic/siginfo.h>
1010
11−/*
12− * SIGFPE si_codes
13− */
14−#ifdef __KERNEL__
15−#define FPE_FIXME 0 /* Broken dup of SI_USER */
16−#endif /* __KERNEL__ */
17−
1811 #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
627627 on condition */
628628 if(user_mode(regs)){
629629 si.si_signo = SIGFPE;
630− /* Set to zero, and let the userspace app figure it out from
631− the insn pointed to by si_addr */
632− si.si_code = FPE_FIXME;
630+ /* Let userspace app figure it out from the insn pointed
631+ * to by si_addr.
632+ */
633+ si.si_code = FPE_CONDTRAP;
633634 si.si_addr = (void __user *) regs->iaoq[0];
634635 force_sig_info(SIGFPE, &si, current);
635636 return;
arch/x86/kernel/signal_compat.c+1−1
@@ -26,7 +26,7 @@ static inline void signal_compat_build_tests(void) · 25 unmodified lines
2626 * new fields are handled in copy_siginfo_to_user32()!
2727 */
2828 BUILD_BUG_ON(NSIGILL != 11);
29− BUILD_BUG_ON(NSIGFPE != 14);
29+ BUILD_BUG_ON(NSIGFPE != 15);
3030 BUILD_BUG_ON(NSIGSEGV != 7);
3131 BUILD_BUG_ON(NSIGBUS != 5);
3232 BUILD_BUG_ON(NSIGTRAP != 4);
include/uapi/asm-generic/siginfo.h+2−1
@@ -211,7 +211,8 @@ typedef struct siginfo { · 210 unmodified lines
211211 #define __FPE_INVASC 12 /* invalid ASCII digit */
212212 #define __FPE_INVDEC 13 /* invalid decimal digit */
213213 #define FPE_FLTUNK 14 /* undiagnosed floating-point exception */
214−#define NSIGFPE 14
214+#define FPE_CONDTRAP 15 /* trap on condition */
215+#define NSIGFPE 15
215216
216217 /*
217218 * SIGSEGV si_codes