diff options
author | Keir Fraser <keir@xen.org> | 2010-11-18 11:45:33 +0000 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2010-11-18 11:45:33 +0000 |
commit | 652ec2d1ec8c2c79dce01dc9136c0dfefeabc13e (patch) | |
tree | 5c31a11a97e5c3143712dd2c4dfc2e3da5a38505 /xen/common/preempt.c | |
parent | c03ec255cdfe2ee762e27be80132ee240be50314 (diff) | |
download | xen-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/common/preempt.c')
-rw-r--r-- | xen/common/preempt.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/xen/common/preempt.c b/xen/common/preempt.c new file mode 100644 index 0000000000..e2133ea50a --- /dev/null +++ b/xen/common/preempt.c @@ -0,0 +1,25 @@ +/****************************************************************************** + * preempt.c + * + * Track atomic regions in the hypervisor which disallow sleeping. + * + * Copyright (c) 2010, Keir Fraser <keir@xen.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <xen/preempt.h> + +DEFINE_PER_CPU(unsigned int, __preempt_count); |