summaryrefslogtreecommitdiff
path: root/libdde_linux26/include
diff options
context:
space:
mode:
authorZheng Da <zhengda1936@gmail.com>2010-02-28 05:24:57 +0100
committerZheng Da <zhengda1936@gmail.com>2010-02-28 05:24:57 +0100
commitfbb1c9f5d35a8b89bbebb55a4a49c3da2f189c05 (patch)
tree478fb31c2121ff8b509f1d0b4ccce6c6f047ba58 /libdde_linux26/include
parentf36fe67a1ec4914bef96f0bc8003a5ee0dd08c8c (diff)
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.
Diffstat (limited to 'libdde_linux26/include')
-rw-r--r--libdde_linux26/include/linux/spinlock.h7
1 files changed, 2 insertions, 5 deletions
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; }); \
})