Changeset 7f1c620 in mainline for generic/src/synch
- Timestamp:
- 2006-07-04T17:17:56Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0ffa3ef5
- Parents:
- 991779c5
- Location:
- generic/src/synch
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/synch/condvar.c
r991779c5 r7f1c620 88 88 * @return See comment for waitq_sleep_timeout(). 89 89 */ 90 int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, __u32usec, int flags)90 int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec, int flags) 91 91 { 92 92 int rc; -
generic/src/synch/futex.c
r991779c5 r7f1c620 59 59 static void futex_initialize(futex_t *futex); 60 60 61 static futex_t *futex_find( __addresspaddr);62 static index_t futex_ht_hash( __native*key);63 static bool futex_ht_compare( __native*key, count_t keys, link_t *item);61 static futex_t *futex_find(uintptr_t paddr); 62 static index_t futex_ht_hash(unative_t *key); 63 static bool futex_ht_compare(unative_t *key, count_t keys, link_t *item); 64 64 static void futex_ht_remove_callback(link_t *item); 65 65 … … 109 109 * If there is no physical mapping for uaddr ENOENT is returned. 110 110 */ 111 __native sys_futex_sleep_timeout(__address uaddr, __u32usec, int flags)112 { 113 futex_t *futex; 114 __addresspaddr;111 unative_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, int flags) 112 { 113 futex_t *futex; 114 uintptr_t paddr; 115 115 pte_t *t; 116 116 ipl_t ipl; … … 126 126 page_table_unlock(AS, true); 127 127 interrupts_restore(ipl); 128 return ( __native) ENOENT;128 return (unative_t) ENOENT; 129 129 } 130 130 paddr = PTE_GET_FRAME(t) + (uaddr - ALIGN_DOWN(uaddr, PAGE_SIZE)); … … 135 135 futex = futex_find(paddr); 136 136 137 return ( __native) waitq_sleep_timeout(&futex->wq, usec, flags | SYNCH_FLAGS_INTERRUPTIBLE);137 return (unative_t) waitq_sleep_timeout(&futex->wq, usec, flags | SYNCH_FLAGS_INTERRUPTIBLE); 138 138 } 139 139 … … 144 144 * @return ENOENT if there is no physical mapping for uaddr. 145 145 */ 146 __native sys_futex_wakeup(__addressuaddr)147 { 148 futex_t *futex; 149 __addresspaddr;146 unative_t sys_futex_wakeup(uintptr_t uaddr) 147 { 148 futex_t *futex; 149 uintptr_t paddr; 150 150 pte_t *t; 151 151 ipl_t ipl; … … 161 161 page_table_unlock(AS, true); 162 162 interrupts_restore(ipl); 163 return ( __native) ENOENT;163 return (unative_t) ENOENT; 164 164 } 165 165 paddr = PTE_GET_FRAME(t) + (uaddr - ALIGN_DOWN(uaddr, PAGE_SIZE)); … … 183 183 * @return Address of the kernel futex structure. 184 184 */ 185 futex_t *futex_find( __addresspaddr)185 futex_t *futex_find(uintptr_t paddr) 186 186 { 187 187 link_t *item; … … 276 276 * @return Index into futex hash table. 277 277 */ 278 index_t futex_ht_hash( __native*key)278 index_t futex_ht_hash(unative_t *key) 279 279 { 280 280 return *key & (FUTEX_HT_SIZE-1); … … 287 287 * @return True if the item matches the key. False otherwise. 288 288 */ 289 bool futex_ht_compare( __native*key, count_t keys, link_t *item)289 bool futex_ht_compare(unative_t *key, count_t keys, link_t *item) 290 290 { 291 291 futex_t *futex; … … 324 324 for (i = 0; i < node->keys; i++) { 325 325 futex_t *ftx; 326 __addresspaddr = node->key[i];326 uintptr_t paddr = node->key[i]; 327 327 328 328 ftx = (futex_t *) node->value[i]; -
generic/src/synch/mutex.c
r991779c5 r7f1c620 65 65 * @return See comment for waitq_sleep_timeout(). 66 66 */ 67 int _mutex_lock_timeout(mutex_t *mtx, __u32usec, int flags)67 int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, int flags) 68 68 { 69 69 return _semaphore_down_timeout(&mtx->sem, usec, flags); -
generic/src/synch/rwlock.c
r991779c5 r7f1c620 102 102 * @return See comment for waitq_sleep_timeout(). 103 103 */ 104 int _rwlock_write_lock_timeout(rwlock_t *rwl, __u32usec, int flags)104 int _rwlock_write_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags) 105 105 { 106 106 ipl_t ipl; … … 156 156 * @return See comment for waitq_sleep_timeout(). 157 157 */ 158 int _rwlock_read_lock_timeout(rwlock_t *rwl, __u32usec, int flags)158 int _rwlock_read_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags) 159 159 { 160 160 int rc; -
generic/src/synch/semaphore.c
r991779c5 r7f1c620 79 79 * @return See comment for waitq_sleep_timeout(). 80 80 */ 81 int _semaphore_down_timeout(semaphore_t *s, __u32usec, int flags)81 int _semaphore_down_timeout(semaphore_t *s, uint32_t usec, int flags) 82 82 { 83 83 return waitq_sleep_timeout(&s->wq, usec, flags); -
generic/src/synch/spinlock.c
r991779c5 r7f1c620 109 109 if (i++ > DEADLOCK_THRESHOLD) { 110 110 printf("cpu%d: looping on spinlock %.*p:%s, caller=%.*p", 111 CPU->id, sizeof( __address) * 2, sl, sl->name, sizeof(__address) * 2, CALLER);111 CPU->id, sizeof(uintptr_t) * 2, sl, sl->name, sizeof(uintptr_t) * 2, CALLER); 112 112 symbol = get_symtab_entry(CALLER); 113 113 if (symbol) -
generic/src/synch/waitq.c
r991779c5 r7f1c620 215 215 * attempted. 216 216 */ 217 int waitq_sleep_timeout(waitq_t *wq, __u32usec, int flags)217 int waitq_sleep_timeout(waitq_t *wq, uint32_t usec, int flags) 218 218 { 219 219 ipl_t ipl; … … 298 298 * @return See waitq_sleep_timeout(). 299 299 */ 300 int waitq_sleep_timeout_unsafe(waitq_t *wq, __u32usec, int flags)300 int waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, int flags) 301 301 { 302 302 /* checks whether to go to sleep at all */ … … 352 352 } 353 353 THREAD->timeout_pending = true; 354 timeout_register(&THREAD->sleep_timeout, ( __u64) usec, waitq_timeouted_sleep, THREAD);354 timeout_register(&THREAD->sleep_timeout, (uint64_t) usec, waitq_timeouted_sleep, THREAD); 355 355 } 356 356
Note:
See TracChangeset
for help on using the changeset viewer.
