/linux-2.4.37.9/lib/ |
D | rwsem-spinlock.c | 24 void rwsemtrace(struct rw_semaphore *sem, const char *str) in rwsemtrace() argument 26 if (sem->debug) in rwsemtrace() 28 current->pid,str,sem->activity,list_empty(&sem->wait_list)?0:1); in rwsemtrace() 35 void fastcall init_rwsem(struct rw_semaphore *sem) in init_rwsem() argument 37 sem->activity = 0; in init_rwsem() 38 spin_lock_init(&sem->wait_lock); in init_rwsem() 39 INIT_LIST_HEAD(&sem->wait_list); in init_rwsem() 41 sem->debug = 0; in init_rwsem() 53 static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem) in __rwsem_do_wake() argument 59 rwsemtrace(sem,"Entering __rwsem_do_wake"); in __rwsem_do_wake() [all …]
|
D | rwsem.c | 21 void rwsemtrace(struct rw_semaphore *sem, const char *str) in rwsemtrace() argument 23 printk("sem=%p\n",sem); in rwsemtrace() 24 printk("(sem)=%08lx\n",sem->count); in rwsemtrace() 25 if (sem->debug) in rwsemtrace() 26 printk("[%d] %s({%08lx})\n",current->pid,str,sem->count); in rwsemtrace() 39 static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem) in __rwsem_do_wake() argument 46 rwsemtrace(sem,"Entering __rwsem_do_wake"); in __rwsem_do_wake() 50 oldcount = rwsem_atomic_update(RWSEM_ACTIVE_BIAS,sem) - RWSEM_ACTIVE_BIAS; in __rwsem_do_wake() 54 waiter = list_entry(sem->wait_list.next,struct rwsem_waiter,list); in __rwsem_do_wake() 80 if (waiter->list.next==&sem->wait_list) in __rwsem_do_wake() [all …]
|
/linux-2.4.37.9/include/asm-parisc/ |
D | semaphore.h | 54 extern inline void sema_init (struct semaphore *sem, int val) in sema_init() argument 56 *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); in sema_init() 59 static inline void init_MUTEX (struct semaphore *sem) in init_MUTEX() argument 61 sema_init(sem, 1); in init_MUTEX() 64 static inline void init_MUTEX_LOCKED (struct semaphore *sem) in init_MUTEX_LOCKED() argument 66 sema_init(sem, 0); in init_MUTEX_LOCKED() 69 static inline int sem_getcount(struct semaphore *sem) in sem_getcount() argument 71 return sem->count; in sem_getcount() 74 asmlinkage void __down(struct semaphore * sem); 75 asmlinkage int __down_interruptible(struct semaphore * sem); [all …]
|
/linux-2.4.37.9/include/asm-alpha/ |
D | rwsem.h | 21 extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem); 22 extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem); 56 static inline void init_rwsem(struct rw_semaphore *sem) in init_rwsem() argument 58 sem->count = RWSEM_UNLOCKED_VALUE; in init_rwsem() 59 spin_lock_init(&sem->wait_lock); in init_rwsem() 60 INIT_LIST_HEAD(&sem->wait_list); in init_rwsem() 62 sem->debug = 0; in init_rwsem() 66 static inline void __down_read(struct rw_semaphore *sem) in __down_read() argument 70 oldcount = sem->count; in __down_read() 71 sem->count += RWSEM_ACTIVE_READ_BIAS; in __down_read() [all …]
|
D | semaphore.h | 49 static inline void sema_init(struct semaphore *sem, int val) in sema_init() argument 57 atomic_set(&sem->count, val); in sema_init() 58 atomic_set(&sem->waking, -1); in sema_init() 59 init_waitqueue_head(&sem->wait); in sema_init() 61 sem->__magic = (long)&sem->__magic; in sema_init() 65 static inline void init_MUTEX (struct semaphore *sem) in init_MUTEX() argument 67 sema_init(sem, 1); in init_MUTEX() 70 static inline void init_MUTEX_LOCKED (struct semaphore *sem) in init_MUTEX_LOCKED() argument 72 sema_init(sem, 0); in init_MUTEX_LOCKED() 83 static inline int sem_getcount(struct semaphore *sem) in sem_getcount() argument [all …]
|
/linux-2.4.37.9/include/asm-mips/ |
D | semaphore.h | 56 static inline void sema_init (struct semaphore *sem, int val) in sema_init() argument 58 atomic_set(&sem->count, val); in sema_init() 59 atomic_set(&sem->waking, 0); in sema_init() 60 init_waitqueue_head(&sem->wait); in sema_init() 62 sem->__magic = (long)&sem->__magic; in sema_init() 66 static inline void init_MUTEX (struct semaphore *sem) in init_MUTEX() argument 68 sema_init(sem, 1); in init_MUTEX() 71 static inline void init_MUTEX_LOCKED (struct semaphore *sem) in init_MUTEX_LOCKED() argument 73 sema_init(sem, 0); in init_MUTEX_LOCKED() 84 extern void __down_failed(struct semaphore * sem); [all …]
|
/linux-2.4.37.9/include/asm-mips64/ |
D | semaphore.h | 56 static inline void sema_init (struct semaphore *sem, int val) in sema_init() argument 58 atomic_set(&sem->count, val); in sema_init() 59 atomic_set(&sem->waking, 0); in sema_init() 60 init_waitqueue_head(&sem->wait); in sema_init() 62 sem->__magic = (long)&sem->__magic; in sema_init() 66 static inline void init_MUTEX (struct semaphore *sem) in init_MUTEX() argument 68 sema_init(sem, 1); in init_MUTEX() 71 static inline void init_MUTEX_LOCKED (struct semaphore *sem) in init_MUTEX_LOCKED() argument 73 sema_init(sem, 0); in init_MUTEX_LOCKED() 84 extern void __down_failed(struct semaphore * sem); [all …]
|
/linux-2.4.37.9/include/asm-ia64/ |
D | rwsem.h | 62 extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem); 63 extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem); 64 extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem); 65 extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem); 68 init_rwsem (struct rw_semaphore *sem) in init_rwsem() argument 70 sem->count = RWSEM_UNLOCKED_VALUE; in init_rwsem() 71 spin_lock_init(&sem->wait_lock); in init_rwsem() 72 INIT_LIST_HEAD(&sem->wait_list); in init_rwsem() 74 sem->debug = 0; in init_rwsem() 82 __down_read (struct rw_semaphore *sem) in __down_read() argument [all …]
|
D | semaphore.h | 44 sema_init (struct semaphore *sem, int val) in sema_init() argument 46 *sem = (struct semaphore) __SEMAPHORE_INITIALIZER(*sem, val); in sema_init() 50 init_MUTEX (struct semaphore *sem) in init_MUTEX() argument 52 sema_init(sem, 1); in init_MUTEX() 56 init_MUTEX_LOCKED (struct semaphore *sem) in init_MUTEX_LOCKED() argument 58 sema_init(sem, 0); in init_MUTEX_LOCKED() 61 extern void __down (struct semaphore * sem); 62 extern int __down_interruptible (struct semaphore * sem); 63 extern int __down_trylock (struct semaphore * sem); 64 extern void __up (struct semaphore * sem); [all …]
|
/linux-2.4.37.9/include/asm-sh/ |
D | semaphore.h | 51 static inline void sema_init (struct semaphore *sem, int val) in sema_init() argument 59 atomic_set(&sem->count, val); in sema_init() 60 sem->sleepers = 0; in sema_init() 61 init_waitqueue_head(&sem->wait); in sema_init() 63 sem->__magic = (int)&sem->__magic; in sema_init() 67 static inline void init_MUTEX (struct semaphore *sem) in init_MUTEX() argument 69 sema_init(sem, 1); in init_MUTEX() 72 static inline void init_MUTEX_LOCKED (struct semaphore *sem) in init_MUTEX_LOCKED() argument 74 sema_init(sem, 0); in init_MUTEX_LOCKED() 84 asmlinkage void __down(struct semaphore * sem); [all …]
|
/linux-2.4.37.9/include/linux/ |
D | rwsem.h | 34 extern void FASTCALL(rwsemtrace(struct rw_semaphore *sem, const char *str)); 43 static inline void down_read(struct rw_semaphore *sem) in down_read() argument 45 rwsemtrace(sem,"Entering down_read"); in down_read() 46 __down_read(sem); in down_read() 47 rwsemtrace(sem,"Leaving down_read"); in down_read() 53 static inline int down_read_trylock(struct rw_semaphore *sem) in down_read_trylock() argument 56 rwsemtrace(sem,"Entering down_read_trylock"); in down_read_trylock() 57 ret = __down_read_trylock(sem); in down_read_trylock() 58 rwsemtrace(sem,"Leaving down_read_trylock"); in down_read_trylock() 65 static inline void down_write(struct rw_semaphore *sem) in down_write() argument [all …]
|
/linux-2.4.37.9/include/asm-i386/ |
D | rwsem.h | 48 extern struct rw_semaphore *FASTCALL(rwsem_down_read_failed(struct rw_semaphore *sem)); 49 extern struct rw_semaphore *FASTCALL(rwsem_down_write_failed(struct rw_semaphore *sem)); 86 static inline void init_rwsem(struct rw_semaphore *sem) in init_rwsem() argument 88 sem->count = RWSEM_UNLOCKED_VALUE; in init_rwsem() 89 spin_lock_init(&sem->wait_lock); in init_rwsem() 90 INIT_LIST_HEAD(&sem->wait_list); in init_rwsem() 92 sem->debug = 0; in init_rwsem() 99 static inline void __down_read(struct rw_semaphore *sem) in __down_read() argument 116 : "=m"(sem->count) in __down_read() 117 : "a"(sem), "m"(sem->count) in __down_read() [all …]
|
D | semaphore.h | 73 static inline void sema_init (struct semaphore *sem, int val) in sema_init() argument 81 atomic_set(&sem->count, val); in sema_init() 82 sem->sleepers = 0; in sema_init() 83 init_waitqueue_head(&sem->wait); in sema_init() 85 sem->__magic = (int)&sem->__magic; in sema_init() 89 static inline void init_MUTEX (struct semaphore *sem) in init_MUTEX() argument 91 sema_init(sem, 1); in init_MUTEX() 94 static inline void init_MUTEX_LOCKED (struct semaphore *sem) in init_MUTEX_LOCKED() argument 96 sema_init(sem, 0); in init_MUTEX_LOCKED() 104 asmlinkage void __down(struct semaphore * sem); [all …]
|
/linux-2.4.37.9/include/asm-x86_64/ |
D | semaphore.h | 75 static inline void sema_init (struct semaphore *sem, int val) in sema_init() argument 83 atomic_set(&sem->count, val); in sema_init() 84 sem->sleepers = 0; in sema_init() 85 init_waitqueue_head(&sem->wait); in sema_init() 87 sem->__magic = (int)&sem->__magic; in sema_init() 91 static inline void init_MUTEX (struct semaphore *sem) in init_MUTEX() argument 93 sema_init(sem, 1); in init_MUTEX() 96 static inline void init_MUTEX_LOCKED (struct semaphore *sem) in init_MUTEX_LOCKED() argument 98 sema_init(sem, 0); in init_MUTEX_LOCKED() 106 asmlinkage void __down(struct semaphore * sem); [all …]
|
/linux-2.4.37.9/arch/alpha/kernel/ |
D | semaphore.c | 56 __down_failed(struct semaphore *sem) in __down_failed() argument 62 current->comm, current->pid, sem); in __down_failed() 67 add_wait_queue_exclusive(&sem->wait, &wait); in __down_failed() 87 : "=r"(ret), "=&r"(tmp), "=m"(sem->waking) in __down_failed() 97 remove_wait_queue(&sem->wait, &wait); in __down_failed() 102 current->comm, current->pid, sem); in __down_failed() 107 __down_failed_interruptible(struct semaphore *sem) in __down_failed_interruptible() argument 114 current->comm, current->pid, sem); in __down_failed_interruptible() 119 add_wait_queue_exclusive(&sem->wait, &wait); in __down_failed_interruptible() 169 "=&r"(tmp3), "=m"(*sem) in __down_failed_interruptible() [all …]
|
/linux-2.4.37.9/include/asm-sh64/ |
D | semaphore.h | 51 static inline void sema_init (struct semaphore *sem, int val) in sema_init() argument 59 atomic_set(&sem->count, val); in sema_init() 60 sem->sleepers = 0; in sema_init() 61 init_waitqueue_head(&sem->wait); in sema_init() 63 sem->__magic = (int)&sem->__magic; in sema_init() 67 static inline void init_MUTEX (struct semaphore *sem) in init_MUTEX() argument 69 sema_init(sem, 1); in init_MUTEX() 72 static inline void init_MUTEX_LOCKED (struct semaphore *sem) in init_MUTEX_LOCKED() argument 74 sema_init(sem, 0); in init_MUTEX_LOCKED() 84 asmlinkage void __down(struct semaphore * sem); [all …]
|
/linux-2.4.37.9/include/asm-ppc/ |
D | semaphore.h | 58 static inline void sema_init (struct semaphore *sem, int val) in sema_init() argument 60 atomic_set(&sem->count, val); in sema_init() 61 init_waitqueue_head(&sem->wait); in sema_init() 63 sem->__magic = (long)&sem->__magic; in sema_init() 67 static inline void init_MUTEX (struct semaphore *sem) in init_MUTEX() argument 69 sema_init(sem, 1); in init_MUTEX() 72 static inline void init_MUTEX_LOCKED (struct semaphore *sem) in init_MUTEX_LOCKED() argument 74 sema_init(sem, 0); in init_MUTEX_LOCKED() 77 extern void __down(struct semaphore * sem); 78 extern int __down_interruptible(struct semaphore * sem); [all …]
|
D | rwsem.h | 52 extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem); 53 extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem); 54 extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem); 56 static inline void init_rwsem(struct rw_semaphore *sem) in init_rwsem() argument 58 sem->count = RWSEM_UNLOCKED_VALUE; in init_rwsem() 59 spin_lock_init(&sem->wait_lock); in init_rwsem() 60 INIT_LIST_HEAD(&sem->wait_list); in init_rwsem() 62 sem->debug = 0; in init_rwsem() 69 static inline void __down_read(struct rw_semaphore *sem) in __down_read() argument 71 if (atomic_inc_return((atomic_t *)(&sem->count)) >= 0) in __down_read() [all …]
|
/linux-2.4.37.9/include/asm-ppc64/ |
D | semaphore.h | 52 static inline void sema_init (struct semaphore *sem, int val) in sema_init() argument 54 atomic_set(&sem->count, val); in sema_init() 55 init_waitqueue_head(&sem->wait); in sema_init() 57 sem->__magic = (long)&sem->__magic; in sema_init() 61 static inline void init_MUTEX (struct semaphore *sem) in init_MUTEX() argument 63 sema_init(sem, 1); in init_MUTEX() 66 static inline void init_MUTEX_LOCKED (struct semaphore *sem) in init_MUTEX_LOCKED() argument 68 sema_init(sem, 0); in init_MUTEX_LOCKED() 71 extern void __down(struct semaphore * sem); 72 extern int __down_interruptible(struct semaphore * sem); [all …]
|
D | rwsem.h | 57 extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem); 58 extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem); 59 extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem); 61 static inline void init_rwsem(struct rw_semaphore *sem) in init_rwsem() argument 63 sem->count = RWSEM_UNLOCKED_VALUE; in init_rwsem() 64 spin_lock_init(&sem->wait_lock); in init_rwsem() 65 INIT_LIST_HEAD(&sem->wait_list); in init_rwsem() 67 sem->debug = 0; in init_rwsem() 74 static inline void __down_read(struct rw_semaphore *sem) in __down_read() argument 76 if (atomic_inc_return((atomic_t *)(&sem->count)) >= 0) in __down_read() [all …]
|
/linux-2.4.37.9/include/asm-arm/ |
D | semaphore.h | 45 static inline void sema_init(struct semaphore *sem, int val) in sema_init() argument 47 atomic_set(&sem->count, val); in sema_init() 48 sem->sleepers = 0; in sema_init() 49 init_waitqueue_head(&sem->wait); in sema_init() 51 sem->__magic = (long)&sem->__magic; in sema_init() 55 static inline void init_MUTEX(struct semaphore *sem) in init_MUTEX() argument 57 sema_init(sem, 1); in init_MUTEX() 60 static inline void init_MUTEX_LOCKED(struct semaphore *sem) in init_MUTEX_LOCKED() argument 62 sema_init(sem, 0); in init_MUTEX_LOCKED() 73 extern void __down(struct semaphore * sem); [all …]
|
/linux-2.4.37.9/include/asm-cris/ |
D | semaphore.h | 50 extern inline void sema_init(struct semaphore *sem, int val) in sema_init() argument 52 *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); in sema_init() 55 extern inline void init_MUTEX (struct semaphore *sem) in init_MUTEX() argument 57 sema_init(sem, 1); in init_MUTEX() 60 extern inline void init_MUTEX_LOCKED (struct semaphore *sem) in init_MUTEX_LOCKED() argument 62 sema_init(sem, 0); in init_MUTEX_LOCKED() 65 extern void __down(struct semaphore * sem); 66 extern int __down_interruptible(struct semaphore * sem); 67 extern int __down_trylock(struct semaphore * sem); 68 extern void __up(struct semaphore * sem); [all …]
|
/linux-2.4.37.9/arch/s390x/kernel/ |
D | semaphore.c | 47 void __up(struct semaphore *sem) in __up() argument 49 wake_up(&sem->wait); in __up() 54 void __down(struct semaphore * sem) in __down() argument 59 add_wait_queue_exclusive(&sem->wait, &wait); in __down() 62 sem->sleepers++; in __down() 64 int sleepers = sem->sleepers; in __down() 70 if (!atomic_add_negative(sleepers - 1, &sem->count)) { in __down() 71 sem->sleepers = 0; in __down() 74 sem->sleepers = 1; /* us - see -1 above */ in __down() 82 remove_wait_queue(&sem->wait, &wait); in __down() [all …]
|
/linux-2.4.37.9/arch/arm/kernel/ |
D | semaphore.c | 50 void __up(struct semaphore *sem) in __up() argument 52 wake_up(&sem->wait); in __up() 57 void __down(struct semaphore * sem) in __down() argument 62 add_wait_queue_exclusive(&sem->wait, &wait); in __down() 65 sem->sleepers++; in __down() 67 int sleepers = sem->sleepers; in __down() 73 if (!atomic_add_negative(sleepers - 1, &sem->count)) { in __down() 74 sem->sleepers = 0; in __down() 77 sem->sleepers = 1; /* us - see -1 above */ in __down() 85 remove_wait_queue(&sem->wait, &wait); in __down() [all …]
|
/linux-2.4.37.9/arch/x86_64/kernel/ |
D | semaphore.c | 51 void __up(struct semaphore *sem) in __up() argument 53 wake_up(&sem->wait); in __up() 58 void __down(struct semaphore * sem) in __down() argument 63 add_wait_queue_exclusive(&sem->wait, &wait); in __down() 66 sem->sleepers++; in __down() 68 int sleepers = sem->sleepers; in __down() 74 if (!atomic_add_negative(sleepers - 1, &sem->count)) { in __down() 75 sem->sleepers = 0; in __down() 78 sem->sleepers = 1; /* us - see -1 above */ in __down() 86 remove_wait_queue(&sem->wait, &wait); in __down() [all …]
|