]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-parisc/semaphore.h
IB/ipath: Misc changes to prepare for IB7220 introduction
[linux-2.6-omap-h63xx.git] / include / asm-parisc / semaphore.h
index c9ee41cd0707948d9b031cbb2587f39b0d2ba973..a16271cdc748831ae1cd3ad958f06b7e587f6d70 100644 (file)
@@ -53,9 +53,8 @@ struct semaphore {
        struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
 
 #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
-#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
 
-extern inline void sema_init (struct semaphore *sem, int val)
+static inline void sema_init (struct semaphore *sem, int val)
 {
        *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val);
 }
@@ -83,7 +82,7 @@ asmlinkage void __up(struct semaphore * sem);
  * interrupts while we're messing with the semaphore.  Sorry.
  */
 
-extern __inline__ void down(struct semaphore * sem)
+static inline void down(struct semaphore * sem)
 {
        might_sleep();
        spin_lock_irq(&sem->sentry);
@@ -95,7 +94,7 @@ extern __inline__ void down(struct semaphore * sem)
        spin_unlock_irq(&sem->sentry);
 }
 
-extern __inline__ int down_interruptible(struct semaphore * sem)
+static inline int down_interruptible(struct semaphore * sem)
 {
        int ret = 0;
        might_sleep();
@@ -113,9 +112,10 @@ extern __inline__ int down_interruptible(struct semaphore * sem)
  * down_trylock returns 0 on success, 1 if we failed to get the lock.
  * May not sleep, but must preserve irq state
  */
-extern __inline__ int down_trylock(struct semaphore * sem)
+static inline int down_trylock(struct semaphore * sem)
 {
-       int flags, count;
+       unsigned long flags;
+       int count;
 
        spin_lock_irqsave(&sem->sentry, flags);
        count = sem->count - 1;
@@ -129,9 +129,10 @@ extern __inline__ int down_trylock(struct semaphore * sem)
  * Note! This is subtle. We jump to wake people up only if
  * the semaphore was negative (== somebody was waiting on it).
  */
-extern __inline__ void up(struct semaphore * sem)
+static inline void up(struct semaphore * sem)
 {
-       int flags;
+       unsigned long flags;
+
        spin_lock_irqsave(&sem->sentry, flags);
        if (sem->count < 0) {
                __up(sem);