Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83205
b: refs/heads/master
c: fce8c41
h: refs/heads/master
i:
  83203: 5f7e980
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Feb 5, 2008
1 parent ff8a043 commit 7ab6500
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0983a88b9f0ceffb2116ce92c7b273ce2aec7b93
refs/heads/master: fce8c41c9f68b9af36f3076bae8f1d469a6e7aab
28 changes: 8 additions & 20 deletions trunk/arch/um/os-Linux/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
#include "sysdep/sigcontext.h"
#include "user.h"

/* Copied from linux/compiler-gcc.h since we can't include it directly */
#define barrier() __asm__ __volatile__("": : :"memory")

/*
* These are the asynchronous signals. SIGPROF is excluded because we want to
* be able to profile all of UML, not just the non-critical sections. If
Expand All @@ -27,13 +30,8 @@
#define SIGVTALRM_BIT 1
#define SIGVTALRM_MASK (1 << SIGVTALRM_BIT)

/*
* These are used by both the signal handlers and
* block/unblock_signals. I don't want modifications cached in a
* register - they must go straight to memory.
*/
static volatile int signals_enabled = 1;
static volatile int pending = 0;
static int signals_enabled;
static unsigned int pending;

void sig_handler(int sig, struct sigcontext *sc)
{
Expand Down Expand Up @@ -198,7 +196,7 @@ void block_signals(void)
* This might matter if gcc figures out how to inline this and
* decides to shuffle this code into the caller.
*/
mb();
barrier();
}

void unblock_signals(void)
Expand All @@ -224,21 +222,11 @@ void unblock_signals(void)
* Setting signals_enabled and reading pending must
* happen in this order.
*/
mb();
barrier();

save_pending = pending;
if (save_pending == 0) {
/*
* This must return with signals enabled, so
* this barrier ensures that writes are
* flushed out before the return. This might
* matter if gcc figures out how to inline
* this (unlikely, given its size) and decides
* to shuffle this code into the caller.
*/
mb();
if (save_pending == 0)
return;
}

pending = 0;

Expand Down

0 comments on commit 7ab6500

Please sign in to comment.