From: blaisorblade_spam@yahoo.it
To: jdike@addtoit.com
Cc: user-mode-linux-devel@lists.sourceforge.net, blaisorblade_spam@yahoo.it
Subject: [uml-devel] [patch 2/2] add-SIGPROF-get-set_signals
Date: Sun, 12 Sep 2004 20:26:29 +0200 [thread overview]
Message-ID: <20040912182629.3FEC49F37@zion.localdomain> (raw)
Since local_irq_save() and local_irq_disable() should match (apart from saving the
flags), [gs]et_signals must match [un]block_signals, i.e. they must act onto
SIGPROF, too. At least IMHO.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
---
uml-linux-2.6.8.1-paolo/arch/um/kernel/signal_user.c | 20 +++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff -puN arch/um/kernel/signal_user.c~uml-add-SIGPROF-get-set_signals arch/um/kernel/signal_user.c
--- uml-linux-2.6.8.1/arch/um/kernel/signal_user.c~uml-add-SIGPROF-get-set_signals 2004-08-29 14:40:54.102986872 +0200
+++ uml-linux-2.6.8.1-paolo/arch/um/kernel/signal_user.c 2004-08-29 14:40:54.104986568 +0200
@@ -83,14 +83,21 @@ void unblock_signals(void)
#define SIGIO_BIT 0
#define SIGVTALRM_BIT 1
+#define SIGPROF_BIT 2
-static int enable_mask(sigset_t *mask)
+/*
+ * Inverts the signal mask:
+ * @mask: a sigset_t* point to the mask of blocked signals.
+ * Returns a mask (of different type) of *unblocked* signals.
+ */
+static inline int enable_mask(const sigset_t *mask)
{
int sigs;
sigs = sigismember(mask, SIGIO) ? 0 : 1 << SIGIO_BIT;
sigs |= sigismember(mask, SIGVTALRM) ? 0 : 1 << SIGVTALRM_BIT;
sigs |= sigismember(mask, SIGALRM) ? 0 : 1 << SIGVTALRM_BIT;
+ sigs |= sigismember(mask, SIGPROF) ? 0 : 1 << SIGPROF_BIT;
return(sigs);
}
@@ -103,21 +110,26 @@ int get_signals(void)
return(enable_mask(&mask));
}
+/*Returns the old mask of the old active signals (not sigset_t, but
+ * suitable for set_signals.*/
int set_signals(int enable)
{
sigset_t mask;
+ sigset_t old_mask;
int ret;
sigemptyset(&mask);
- if(enable & (1 << SIGIO_BIT))
+ if(enable & (1 << SIGIO_BIT))
sigaddset(&mask, SIGIO);
if(enable & (1 << SIGVTALRM_BIT)){
sigaddset(&mask, SIGVTALRM);
sigaddset(&mask, SIGALRM);
}
- if(sigprocmask(SIG_UNBLOCK, &mask, &mask) < 0)
+ if(enable & (1 << SIGPROF_BIT))
+ sigaddset(&mask, SIGPROF);
+ if(sigprocmask(SIG_UNBLOCK, &mask, &old_mask) < 0)
panic("Failed to enable signals");
- ret = enable_mask(&mask);
+ ret = enable_mask(&old_mask);
sigemptyset(&mask);
if((enable & (1 << SIGIO_BIT)) == 0)
sigaddset(&mask, SIGIO);
_
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next reply other threads:[~2004-09-12 18:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-12 18:26 blaisorblade_spam [this message]
2004-09-13 3:32 ` [uml-devel] Re: [patch 2/2] add-SIGPROF-get-set_signals Jeff Dike
2004-09-13 18:12 ` BlaisorBlade
2004-09-13 22:15 ` Jeff Dike
2004-09-14 19:26 ` Jeff Dike
2004-09-17 18:52 ` BlaisorBlade
2004-09-18 0:45 ` Jeff Dike
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040912182629.3FEC49F37@zion.localdomain \
--to=blaisorblade_spam@yahoo.it \
--cc=jdike@addtoit.com \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox