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.
Unified · Split
| @@ -8,11 +8,4 @@ · 7 unmodified lines | ||
| 8 | 8 | |
| 9 | 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 | 11 | #endif |
| @@ -627,9 +627,10 @@ void notrace handle_interruption(int code, struct pt_regs *regs) · 626 unmodified lines | ||
| 627 | 627 | on condition */ |
| 628 | 628 | if(user_mode(regs)){ |
| 629 | 629 | 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; | |
| 633 | 634 | si.si_addr = (void __user *) regs->iaoq[0]; |
| 634 | 635 | force_sig_info(SIGFPE, &si, current); |
| 635 | 636 | return; |
| @@ -26,7 +26,7 @@ static inline void signal_compat_build_tests(void) · 25 unmodified lines | ||
| 26 | 26 | * new fields are handled in copy_siginfo_to_user32()! |
| 27 | 27 | */ |
| 28 | 28 | BUILD_BUG_ON(NSIGILL != 11); |
| 29 | − BUILD_BUG_ON(NSIGFPE != 14); | |
| 29 | + BUILD_BUG_ON(NSIGFPE != 15); | |
| 30 | 30 | BUILD_BUG_ON(NSIGSEGV != 7); |
| 31 | 31 | BUILD_BUG_ON(NSIGBUS != 5); |
| 32 | 32 | BUILD_BUG_ON(NSIGTRAP != 4); |
| @@ -211,7 +211,8 @@ typedef struct siginfo { · 210 unmodified lines | ||
| 211 | 211 | #define __FPE_INVASC 12 /* invalid ASCII digit */ |
| 212 | 212 | #define __FPE_INVDEC 13 /* invalid decimal digit */ |
| 213 | 213 | #define FPE_FLTUNK 14 /* undiagnosed floating-point exception */ |
| 214 | −#define NSIGFPE 14 | |
| 214 | +#define FPE_CONDTRAP 15 /* trap on condition */ | |
| 215 | +#define NSIGFPE 15 | |
| 215 | 216 | |
| 216 | 217 | /* |
| 217 | 218 | * SIGSEGV si_codes |