m68k: fix sigset_t accessor functions
PATCH 1/1 m68k: fix sigset_t accessor functions
The sigaddset/sigdelset/sigismember functions that are implemented with bitfield insn cannot allow the sigset argument to be placed in a data register since the sigset is wider than 32 bits. Remove the "d" constraint from the asm statements.
The effect of the bug is that sending RT signals does not work, the signal number is truncated modulo 32.
--- arch/m68k/include/asm/signal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/m68k/include/asm/signal.h +3 -3
@@ -156,7 +156,7 @@ typedef struct sigaltstack {static inline void sigaddset (sigset_t *set,int _sig) { asm ("bfset %0{%1,#1}" - :"+od" (*set) + :"+o" (*set) :"id" ((_sig -1 ) ^31 ) :"cc" ); }
@@ -164,7 +164,7 @@ static inline void sigaddset(sigset_t *set, int _sig)static inline void sigdelset (sigset_t *set,int _sig) { asm ("bfclr %0{%1,#1}" - :"+od" (*set) + :"+o" (*set) :"id" ((_sig -1 ) ^31 ) :"cc" ); }
@@ -180,7 +180,7 @@ static inline int __gen_sigismember(sigset_t *set, int _sig)int ret; asm ("bfextu %1{%2,#1},%0" :"=d" (ret) - :"od" (*set),"id" ((_sig-1 ) ^31 ) + :"o" (*set),"id" ((_sig-1 ) ^31 ) :"cc" );return ret; }
Signature · 7 lines
1.8.0 -- Andreas Schwab, [email protected] GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Hi Andreas,
Quoted 7 lines · Andreas Schwab
The sigaddset/sigdelset/sigismember functions that are implemented with bitfield insn cannot allow the sigset argument to be placed in a data register since the sigset is wider than 32 bits. Remove the "d" constraint from the asm statements.
The effect of the bug is that sending RT signals does not work, the signal number is truncated modulo 32.
Thanks, applied and queued for 3.7 and stable.
Quoted 28 lines
Signed-off-by Andreas Schwab <[email protected]>--- arch/m68k/include/asm/signal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)arch/m68k/include/asm/signal.h +2
-2@@ -156,7 +156,7 @@ typedef struct sigaltstack {static inline void sigaddset (sigset_t *set,int _sig) { asm ("bfset %0{%1,#1}" - :"+od" (*set) + :"+o" (*set) :"id" ((_sig -1 ) ^31 ) :"cc" ); }@@ -164,7 +164,7 @@ static inline void sigaddset(sigset_t *set, int _sig)static inline void sigdelset (sigset_t *set,int _sig) { asm ("bfclr %0{%1,#1}" - :"+od" (*set) + :"+o" (*set) :"id" ((_sig -1 ) ^31 ) :"cc" ); }
arch/m68k/include/asm/signal.h static inline int __gen_sigismember(sigset_t *set, int _sig) · line 186
Quoted 8 lines
arch/m68k/include/asm/signal.h +1
-1@@ -180,7 +180,7 @@ static inline int __gen_sigismember(sigset_t *set, int _sig)int ret; asm ("bfextu %1{%2,#1},%0" :"=d" (ret) - :"od" (*set),"id" ((_sig-1 ) ^31 ) + :"o" (*set),"id" ((_sig-1 ) ^31 ) :"cc" );return ret; }
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds