From fbb1c9f5d35a8b89bbebb55a4a49c3da2f189c05 Mon Sep 17 00:00:00 2001 From: Zheng Da Date: Sun, 28 Feb 2010 05:24:57 +0100 Subject: implement cli/sti with a lock. In order to avoid dead lock caused by spin_lock_irq or spin_lock_irqsave, I remove irq disabling in them. It's really unnecessary to do spin_lock_irq and spin_lock_irqsave any more because interrupt isn't handled in a real interrupt context. --- libdde_linux26/include/linux/spinlock.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'libdde_linux26/include') diff --git a/libdde_linux26/include/linux/spinlock.h b/libdde_linux26/include/linux/spinlock.h index ab862f99..7fb7a251 100644 --- a/libdde_linux26/include/linux/spinlock.h +++ b/libdde_linux26/include/linux/spinlock.h @@ -394,7 +394,7 @@ extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); #define read_lock(lock) spin_lock(lock) #define write_lock(lock) spin_lock(lock) -#define spin_lock_irq(lock) local_irq_disable(); spin_lock(lock) +#define spin_lock_irq(lock) spin_lock(lock) #define spin_lock_bh(lock) spin_lock(lock) #define read_lock_irq(lock) spin_lock_irq(lock) #define read_lock_bh(lock) spin_lock_bh(lock) @@ -411,7 +411,7 @@ extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); #define read_unlock(lock) spin_unlock(lock) #define write_unlock(lock) spin_unlock(lock) -#define spin_unlock_irq(lock) spin_unlock(lock); local_irq_enable() +#define spin_unlock_irq(lock) spin_unlock(lock) #define spin_unlock_bh(lock) spin_unlock(lock) #define read_unlock_irq(lock) spin_unlock_irq(lock) #define read_unlock_bh(lock) spin_unlock_bh(lock) @@ -420,7 +420,6 @@ extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); #define spin_lock_irqsave(lock, flags) \ do { \ - local_irq_save(flags); \ spin_lock(lock);\ } while (0); @@ -430,7 +429,6 @@ extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); #define spin_unlock_irqrestore(lock, flags) \ do { \ spin_unlock(lock); \ - local_irq_restore(flags); \ } while (0); #define read_unlock_irqrestore(lock, flags) spin_unlock_irqrestore(lock, flags) @@ -448,7 +446,6 @@ static int __lockfunc spin_trylock(spinlock_t *lock) #define spin_trylock_irqsave(lock, flags) \ ({ \ - local_irq_save(flags); \ spin_trylock(lock) ? \ 1 : ({ local_irq_restore(flags); 0; }); \ }) -- cgit v1.2.3