From 27cfca1ec98e91261b1a5355d10a8996464b63af Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 17 Mar 1998 22:05:47 +0000 Subject: Look Ma' what I found on my harddisk ... o New faster syscalls for 2.1.x, too o Upgrade to 2.1.89. Don't try to run this. It's flaky as hell. But feel free to debug ... --- include/asm-i386/semaphore.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'include/asm-i386/semaphore.h') diff --git a/include/asm-i386/semaphore.h b/include/asm-i386/semaphore.h index 3ba3f8af5..a68b23fc6 100644 --- a/include/asm-i386/semaphore.h +++ b/include/asm-i386/semaphore.h @@ -21,6 +21,7 @@ #include #include +#include struct semaphore { atomic_t count; @@ -38,6 +39,8 @@ asmlinkage void __up_wakeup(void /* special register calling convention */); extern void __down(struct semaphore * sem); extern void __up(struct semaphore * sem); +extern spinlock_t semaphore_wake_lock; + #define sema_init(sem, val) atomic_set(&((sem)->count), (val)) /* @@ -55,10 +58,9 @@ static inline void wake_one_more(struct semaphore * sem) { unsigned long flags; - save_flags(flags); - cli(); + spin_lock_irqsave(&semaphore_wake_lock, flags); sem->waking++; - restore_flags(flags); + spin_unlock_irqrestore(&semaphore_wake_lock, flags); } static inline int waking_non_zero(struct semaphore *sem) @@ -66,13 +68,12 @@ static inline int waking_non_zero(struct semaphore *sem) unsigned long flags; int ret = 0; - save_flags(flags); - cli(); + spin_lock_irqsave(&semaphore_wake_lock, flags); if (sem->waking > 0) { sem->waking--; ret = 1; } - restore_flags(flags); + spin_unlock_irqrestore(&semaphore_wake_lock, flags); return ret; } -- cgit v1.2.3