aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/spinlock.h
diff options
context:
space:
mode:
authorkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>2004-10-25 10:31:11 +0000
committerkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>2004-10-25 10:31:11 +0000
commitfca921e0a5d89c1b0efc12bcf910e25c0c5219f2 (patch)
tree1595598ce9281128d5da8da0b20c51078e76b710 /xen/include/xen/spinlock.h
parentf660368917e3c1015c1ed9a5436b327b659be5bf (diff)
downloadxen-fca921e0a5d89c1b0efc12bcf910e25c0c5219f2.tar.gz
xen-fca921e0a5d89c1b0efc12bcf910e25c0c5219f2.tar.bz2
xen-fca921e0a5d89c1b0efc12bcf910e25c0c5219f2.zip
bitkeeper revision 1.1159.1.270 (417cd5efuYLEDeFTqZTJOYsZwD2mag)
Get rid of critical-region checking. It gets in the way and has found precisely zero real bugs!
Diffstat (limited to 'xen/include/xen/spinlock.h')
-rw-r--r--xen/include/xen/spinlock.h51
1 files changed, 0 insertions, 51 deletions
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index 8998c29894..ef58ba591b 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -72,46 +72,6 @@ typedef struct { int gcc_is_buggy; } rwlock_t;
#endif
-#ifndef NDEBUG
-
-extern void criticalregion_enter(void);
-extern void criticalregion_exit(void);
-extern void ASSERT_no_criticalregion(void);
-extern void disable_criticalregion_checking(void);
-
-#define spin_lock(_lock) \
- do { criticalregion_enter(); _raw_spin_lock(_lock); } while (0)
-#define spin_unlock(_lock) \
- do { _raw_spin_unlock(_lock); criticalregion_exit(); } while (0)
-#define spin_lock_recursive(_lock) \
- do { criticalregion_enter(); _raw_spin_lock_recursive(_lock); } while (0)
-#define spin_unlock_recursive(_lock) \
- do { _raw_spin_unlock_recursive(_lock); criticalregion_exit(); } while (0)
-#define read_lock(_lock) \
- do { criticalregion_enter(); _raw_read_lock(_lock); } while (0)
-#define read_unlock(_lock) \
- do { _raw_read_unlock(_lock); criticalregion_exit(); } while (0)
-#define write_lock(_lock) \
- do { criticalregion_enter(); _raw_write_lock(_lock); } while (0)
-#define write_unlock(_lock) \
- do { _raw_write_unlock(_lock); criticalregion_exit(); } while (0)
-
-static inline int spin_trylock(spinlock_t *lock)
-{
- criticalregion_enter();
- if ( !_raw_spin_trylock(lock) )
- {
- criticalregion_exit();
- return 0;
- }
- return 1;
-}
-
-#else
-
-#define ASSERT_no_criticalregion() ((void)0)
-#define disable_criticalregion_checking() ((void)0)
-
#define spin_lock(_lock) _raw_spin_lock(_lock)
#define spin_trylock(_lock) _raw_spin_trylock(_lock)
#define spin_unlock(_lock) _raw_spin_unlock(_lock)
@@ -122,15 +82,4 @@ static inline int spin_trylock(spinlock_t *lock)
#define write_lock(_lock) _raw_write_lock(_lock)
#define write_unlock(_lock) _raw_write_unlock(_lock)
-#endif
-
-/*
- * Use these if you have taken special care to ensure that certain unsafe
- * things can occur in your critical region (e.g., faults, user-space
- * accesses).
- */
-#define spin_lock_nochecking(_lock) _raw_spin_lock(_lock)
-#define spin_trylock_nochecking(_lock) _raw_spin_trylock(_lock)
-#define spin_unlock_nochecking(_lock) _raw_spin_unlock(_lock)
-
#endif /* __SPINLOCK_H__ */