Skip to content

Commit

Permalink
parisc/signal: Add FPE_CONDTRAP for conditional trap handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Helge Deller committed Apr 11, 2018
1 parent b284d4d commit 75abf64
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
7 changes: 0 additions & 7 deletions arch/parisc/include/uapi/asm/siginfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions arch/parisc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/signal_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion include/uapi/asm-generic/siginfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 75abf64

Please sign in to comment.