Commit b15e85a2 authored by Russell King's avatar Russell King

[ARM] Convert semaphore initialisers to C99 syntax.

The semaphore initialisers were using the old gcc syntax.  Add
sema_count() implementation for the sa11x0 audio implementation.
parent 16ebbe34
...@@ -22,19 +22,18 @@ struct semaphore { ...@@ -22,19 +22,18 @@ struct semaphore {
}; };
#if WAITQUEUE_DEBUG #if WAITQUEUE_DEBUG
# define __SEM_DEBUG_INIT(name) \ # define __SEM_DEBUG_INIT(name) .__magic = (long)&(name).__magic
, (long)&(name).__magic
#else #else
# define __SEM_DEBUG_INIT(name) # define __SEM_DEBUG_INIT(name)
#endif #endif
#define __SEMAPHORE_INIT(name,count) \ #define __SEMAPHORE_INIT(name,cnt) { \
{ ATOMIC_INIT(count), 0, \ .count = ATOMIC_INIT(cnt), \
__WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \
__SEM_DEBUG_INIT(name) } __SEM_DEBUG_INIT(name) \
}
#define __MUTEX_INITIALIZER(name) \ #define __MUTEX_INITIALIZER(name) __SEMAPHORE_INIT(name,1)
__SEMAPHORE_INIT(name,1)
#define __DECLARE_SEMAPHORE_GENERIC(name,count) \ #define __DECLARE_SEMAPHORE_GENERIC(name,count) \
struct semaphore name = __SEMAPHORE_INIT(name,count) struct semaphore name = __SEMAPHORE_INIT(name,count)
...@@ -62,6 +61,11 @@ static inline void init_MUTEX_LOCKED(struct semaphore *sem) ...@@ -62,6 +61,11 @@ static inline void init_MUTEX_LOCKED(struct semaphore *sem)
sema_init(sem, 0); sema_init(sem, 0);
} }
static inline int sema_count(struct semaphore *sem)
{
return atomic_read(&sem->count);
}
/* /*
* special register calling convention * special register calling convention
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment