Skip to content

Commit 75abf64

Browse files
committed
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. Signed-off-by: Helge Deller <[email protected]> Cc: Stephen Rothwell <[email protected]>
1 parent b284d4d commit 75abf64

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

arch/parisc/include/uapi/asm/siginfo.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,4 @@
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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,10 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static inline void signal_compat_build_tests(void)
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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ typedef struct siginfo {
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

0 commit comments

Comments
 (0)