aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/rcupdate.h
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2010-11-18 11:45:33 +0000
committerKeir Fraser <keir@xen.org>2010-11-18 11:45:33 +0000
commit652ec2d1ec8c2c79dce01dc9136c0dfefeabc13e (patch)
tree5c31a11a97e5c3143712dd2c4dfc2e3da5a38505 /xen/include/xen/rcupdate.h
parentc03ec255cdfe2ee762e27be80132ee240be50314 (diff)
downloadxen-652ec2d1ec8c2c79dce01dc9136c0dfefeabc13e.tar.gz
xen-652ec2d1ec8c2c79dce01dc9136c0dfefeabc13e.tar.bz2
xen-652ec2d1ec8c2c79dce01dc9136c0dfefeabc13e.zip
Define Linux-style <preempt.h> interface.
Use it to disable sleeping in spinlock and rcu-read regions. Signed-off-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include/xen/rcupdate.h')
-rw-r--r--xen/include/xen/rcupdate.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/xen/include/xen/rcupdate.h b/xen/include/xen/rcupdate.h
index 68f98acfda..bb4af9d6e0 100644
--- a/xen/include/xen/rcupdate.h
+++ b/xen/include/xen/rcupdate.h
@@ -36,6 +36,7 @@
#include <xen/spinlock.h>
#include <xen/percpu.h>
#include <xen/cpumask.h>
+#include <xen/preempt.h>
/**
* struct rcu_head - callback structure for use with RCU
@@ -145,14 +146,14 @@ typedef struct _rcu_read_lock rcu_read_lock_t;
*
* It is illegal to block while in an RCU read-side critical section.
*/
-#define rcu_read_lock(x) ((void)(x))
+#define rcu_read_lock(x) ({ ((void)(x)); preempt_disable(); })
/**
* rcu_read_unlock - marks the end of an RCU read-side critical section.
*
* See rcu_read_lock() for more information.
*/
-#define rcu_read_unlock(x) ((void)(x))
+#define rcu_read_unlock(x) ({ ((void)(x)); preempt_enable(); })
/*
* So where is rcu_write_lock()? It does not exist, as there is no