2006-09-08 00:07:09

by Samuel Thibault

[permalink] [raw]
Subject: [PATCH] no SA_NODEFER on sparc?

Hi,

I noticed that the sparc arch misses a definition for SA_NODEFER. Is
that on purpose? If not, here is a patch for fixing this.

Add SA_NODEFER, deprecating linuxish SA_NOMASK.

Signed-off-by: Samuel Thibault <[email protected]>

diff --git a/include/asm-sparc/signal.h b/include/asm-sparc/signal.h
index d03a21c..5484f65 100644
--- a/include/asm-sparc/signal.h
+++ b/include/asm-sparc/signal.h
@@ -133,16 +133,19 @@ #define _SV_IGNCHILD 8u /* Do not se
* the sigaction structure as a stack pointer. This is now possible due to
* the changes in signal handling. LBT 010493.
* SA_RESTART flag to get restarting signals (which were the default long ago)
+ * SA_NOMASK is the historical Linux name for the Single Unix name NODEFER.
*/
#define SA_NOCLDSTOP _SV_IGNCHILD
#define SA_STACK _SV_SSTACK
#define SA_ONSTACK _SV_SSTACK
#define SA_RESTART _SV_INTR
#define SA_ONESHOT _SV_RESET
-#define SA_NOMASK 0x20u
+#define SA_NODEFER 0x20u
#define SA_NOCLDWAIT 0x100u
#define SA_SIGINFO 0x200u

+#define SA_NOMASK SA_NODEFER
+
#define SIG_BLOCK 0x01 /* for blocking signals */
#define SIG_UNBLOCK 0x02 /* for unblocking signals */
#define SIG_SETMASK 0x04 /* for setting the signal mask */
diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h
index 9968871..f40f2bc 100644
--- a/include/asm-sparc64/signal.h
+++ b/include/asm-sparc64/signal.h
@@ -134,16 +134,18 @@ #define _SV_IGNCHILD 8u /* Do not se
* the sigaction structure as a stack pointer. This is now possible due to
* the changes in signal handling. LBT 010493.
* SA_RESTART flag to get restarting signals (which were the default long ago)
+ * SA_NOMASK is the historical Linux name for the Single Unix name NODEFER.
*/
#define SA_NOCLDSTOP _SV_IGNCHILD
#define SA_STACK _SV_SSTACK
#define SA_ONSTACK _SV_SSTACK
#define SA_RESTART _SV_INTR
#define SA_ONESHOT _SV_RESET
-#define SA_NOMASK 0x20u
+#define SA_NODEFER 0x20u
#define SA_NOCLDWAIT 0x100u
#define SA_SIGINFO 0x200u

+#define SA_NOMASK SA_NODEFER

#define SIG_BLOCK 0x01 /* for blocking signals */
#define SIG_UNBLOCK 0x02 /* for unblocking signals */


2006-09-08 00:11:47

by Samuel Thibault

[permalink] [raw]
Subject: clean SA_NOMASK usage

Given that my previous patch gets applied, here is a patch for removing
uses of linuxish SA_NOMASK.

Signed-off-by: Samuel Thibault <[email protected]>

diff --git a/arch/ia64/ia32/ia32_signal.c b/arch/ia64/ia32/ia32_signal.c
index b3355a9..0753ab4 100644
--- a/arch/ia64/ia32/ia32_signal.c
+++ b/arch/ia64/ia32/ia32_signal.c
@@ -514,7 +514,7 @@ sys32_signal (int sig, unsigned int hand
int ret;

sigact_set_handler(&new_sa, handler, 0);
- new_sa.sa.sa_flags = SA_ONESHOT | SA_NOMASK;
+ new_sa.sa.sa_flags = SA_ONESHOT | SA_NODEFER;
sigemptyset(&new_sa.sa.sa_mask);

ret = do_sigaction(sig, &new_sa, &old_sa);
diff --git a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c
index c9301b9..2aa8fe6 100644
--- a/arch/sparc/kernel/signal.c
+++ b/arch/sparc/kernel/signal.c
@@ -964,7 +964,7 @@ handle_signal(unsigned long signr, struc
}
spin_lock_irq(&current->sighand->siglock);
sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
- if (!(ka->sa.sa_flags & SA_NOMASK))
+ if (!(ka->sa.sa_flags & SA_NODEFER))
sigaddset(&current->blocked, signr);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c
index 96d56a8..63b579d 100644
--- a/arch/sparc64/kernel/signal.c
+++ b/arch/sparc64/kernel/signal.c
@@ -487,7 +487,7 @@ static inline void handle_signal(unsigne
(ka->sa.sa_flags & SA_SIGINFO) ? info : NULL);
spin_lock_irq(&current->sighand->siglock);
sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
- if (!(ka->sa.sa_flags & SA_NOMASK))
+ if (!(ka->sa.sa_flags & SA_NODEFER))
sigaddset(&current->blocked,signr);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c
index 708ba9b..fb2d82c 100644
--- a/arch/sparc64/kernel/signal32.c
+++ b/arch/sparc64/kernel/signal32.c
@@ -1232,7 +1232,7 @@ static inline void handle_signal32(unsig
}
spin_lock_irq(&current->sighand->siglock);
sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
- if (!(ka->sa.sa_flags & SA_NOMASK))
+ if (!(ka->sa.sa_flags & SA_NODEFER))
sigaddset(&current->blocked,signr);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
diff --git a/arch/sparc64/solaris/signal.c b/arch/sparc64/solaris/signal.c
index 7fa2634..21edcf0 100644
--- a/arch/sparc64/solaris/signal.c
+++ b/arch/sparc64/solaris/signal.c
@@ -83,7 +83,7 @@ static long sig_handler(int sig, u32 arg
sa.sa_restorer = NULL;
sa.sa_handler = (__sighandler_t)A(arg);
sa.sa_flags = 0;
- if (one_shot) sa.sa_flags = SA_ONESHOT | SA_NOMASK;
+ if (one_shot) sa.sa_flags = SA_ONESHOT | SA_NODEFER;
set_fs (KERNEL_DS);
ret = sys_sigaction(sig, (void __user *)&sa, (void __user *)&old);
set_fs (old_fs);
@@ -277,7 +277,7 @@ asmlinkage int solaris_sigaction(int sig
s.sa_flags = 0;
if (tmp & SOLARIS_SA_ONSTACK) s.sa_flags |= SA_STACK;
if (tmp & SOLARIS_SA_RESTART) s.sa_flags |= SA_RESTART;
- if (tmp & SOLARIS_SA_NODEFER) s.sa_flags |= SA_NOMASK;
+ if (tmp & SOLARIS_SA_NODEFER) s.sa_flags |= SA_NODEFER;
if (tmp & SOLARIS_SA_RESETHAND) s.sa_flags |= SA_ONESHOT;
if (tmp & SOLARIS_SA_NOCLDSTOP) s.sa_flags |= SA_NOCLDSTOP;
if (get_user (tmp, &p->sa_handler) ||
@@ -297,7 +297,7 @@ asmlinkage int solaris_sigaction(int sig
tmp = 0; tmp2[2] = 0; tmp2[3] = 0;
if (s2.sa_flags & SA_STACK) tmp |= SOLARIS_SA_ONSTACK;
if (s2.sa_flags & SA_RESTART) tmp |= SOLARIS_SA_RESTART;
- if (s2.sa_flags & SA_NOMASK) tmp |= SOLARIS_SA_NODEFER;
+ if (s2.sa_flags & SA_NODEFER) tmp |= SOLARIS_SA_NODEFER;
if (s2.sa_flags & SA_ONESHOT) tmp |= SOLARIS_SA_RESETHAND;
if (s2.sa_flags & SA_NOCLDSTOP) tmp |= SOLARIS_SA_NOCLDSTOP;
if (put_user (tmp, &p->sa_flags) ||
diff --git a/kernel/signal.c b/kernel/signal.c
index bfdb568..8a3b3a5 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2530,7 +2530,7 @@ sys_signal(int sig, __sighandler_t handl
int ret;

new_sa.sa.sa_handler = handler;
- new_sa.sa.sa_flags = SA_ONESHOT | SA_NOMASK;
+ new_sa.sa.sa_flags = SA_ONESHOT | SA_NODEFER;
sigemptyset(&new_sa.sa.sa_mask);

ret = do_sigaction(sig, &new_sa, &old_sa);

2006-09-24 00:39:26

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] no SA_NODEFER on sparc?

From: Samuel Thibault <[email protected]>
Date: Fri, 8 Sep 2006 02:06:02 +0200

> I noticed that the sparc arch misses a definition for SA_NODEFER. Is
> that on purpose? If not, here is a patch for fixing this.
>
> Add SA_NODEFER, deprecating linuxish SA_NOMASK.
>
> Signed-off-by: Samuel Thibault <[email protected]>

I have no problems with this patch. Userland headers already
define both SA_NODEFER and SA_NOMASK on Sparc.

2006-09-24 08:01:24

by Jan Engelhardt

[permalink] [raw]
Subject: Re: [PATCH] no SA_NODEFER on sparc?


>> I noticed that the sparc arch misses a definition for SA_NODEFER. Is
>> that on purpose? If not, here is a patch for fixing this.

BTW, some SA_* constants have been superceded by IRQF_* in the kernel,
so you might want to check the new ones.


Jan Engelhardt
--