ia64/xen-unstable

changeset 18705:ad39300ca063

spinlock: Add assertions for lock_irq() variants.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Oct 22 15:07:30 2008 +0100 (2008-10-22)
parents 876618c33914
children 94227875c13d
files xen/common/spinlock.c
line diff
     1.1 --- a/xen/common/spinlock.c	Wed Oct 22 15:06:01 2008 +0100
     1.2 +++ b/xen/common/spinlock.c	Wed Oct 22 15:07:30 2008 +0100
     1.3 @@ -9,6 +9,7 @@ void _spin_lock(spinlock_t *lock)
     1.4  
     1.5  void _spin_lock_irq(spinlock_t *lock)
     1.6  {
     1.7 +    ASSERT(local_irq_is_enabled());
     1.8      local_irq_disable();
     1.9      _raw_spin_lock(&lock->raw);
    1.10  }
    1.11 @@ -96,6 +97,7 @@ void _read_lock(rwlock_t *lock)
    1.12  
    1.13  void _read_lock_irq(rwlock_t *lock)
    1.14  {
    1.15 +    ASSERT(local_irq_is_enabled());
    1.16      local_irq_disable();
    1.17      _raw_read_lock(&lock->raw);
    1.18  }
    1.19 @@ -132,6 +134,7 @@ void _write_lock(rwlock_t *lock)
    1.20  
    1.21  void _write_lock_irq(rwlock_t *lock)
    1.22  {
    1.23 +    ASSERT(local_irq_is_enabled());
    1.24      local_irq_disable();
    1.25      _raw_write_lock(&lock->raw);
    1.26  }