| #ifndef _H8300_SEMAPHORE_HELPER_H |
| #define _H8300_SEMAPHORE_HELPER_H |
| * SMP- and interrupt-safe semaphores helper functions. |
| * (C) Copyright 1996 Linus Torvalds |
| * m68k version by Andreas Schwab |
| * These two _must_ execute atomically wrt each other. |
| static inline void wake_one_more(struct semaphore * sem) |
| atomic_inc((atomic_t *)&sem->sleepers); |
| static inline int waking_non_zero(struct semaphore *sem) |
| spin_lock_irqsave(&semaphore_wake_lock, flags); |
| spin_unlock_irqrestore(&semaphore_wake_lock, flags); |
| * waking_non_zero_interruptible: |
| static inline int waking_non_zero_interruptible(struct semaphore *sem, |
| spin_lock_irqsave(&semaphore_wake_lock, flags); |
| } else if (signal_pending(tsk)) { |
| spin_unlock_irqrestore(&semaphore_wake_lock, flags); |
| * waking_non_zero_trylock: |
| static inline int waking_non_zero_trylock(struct semaphore *sem) |
| spin_lock_irqsave(&semaphore_wake_lock, flags); |
| spin_unlock_irqrestore(&semaphore_wake_lock, flags); |