Changeset 7f1c620 in mainline for generic/src/synch


Ignore:
Timestamp:
2006-07-04T17:17:56Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0ffa3ef5
Parents:
991779c5
Message:

Replace old u?? types with respective C99 variants (e.g. uint32_t, int64_t, uintptr_t etc.).

Location:
generic/src/synch
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • generic/src/synch/condvar.c

    r991779c5 r7f1c620  
    8888 * @return See comment for waitq_sleep_timeout().
    8989 */
    90 int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, __u32 usec, int flags)
     90int _condvar_wait_timeout(condvar_t *cv, mutex_t *mtx, uint32_t usec, int flags)
    9191{
    9292        int rc;
  • generic/src/synch/futex.c

    r991779c5 r7f1c620  
    5959static void futex_initialize(futex_t *futex);
    6060
    61 static futex_t *futex_find(__address paddr);
    62 static index_t futex_ht_hash(__native *key);
    63 static bool futex_ht_compare(__native *key, count_t keys, link_t *item);
     61static futex_t *futex_find(uintptr_t paddr);
     62static index_t futex_ht_hash(unative_t *key);
     63static bool futex_ht_compare(unative_t *key, count_t keys, link_t *item);
    6464static void futex_ht_remove_callback(link_t *item);
    6565
     
    109109 *         If there is no physical mapping for uaddr ENOENT is returned.
    110110 */
    111 __native sys_futex_sleep_timeout(__address uaddr, __u32 usec, int flags)
    112 {
    113         futex_t *futex;
    114         __address paddr;
     111unative_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, int flags)
     112{
     113        futex_t *futex;
     114        uintptr_t paddr;
    115115        pte_t *t;
    116116        ipl_t ipl;
     
    126126                page_table_unlock(AS, true);
    127127                interrupts_restore(ipl);
    128                 return (__native) ENOENT;
     128                return (unative_t) ENOENT;
    129129        }
    130130        paddr = PTE_GET_FRAME(t) + (uaddr - ALIGN_DOWN(uaddr, PAGE_SIZE));
     
    135135        futex = futex_find(paddr);
    136136       
    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);
    138138}
    139139
     
    144144 * @return ENOENT if there is no physical mapping for uaddr.
    145145 */
    146 __native sys_futex_wakeup(__address uaddr)
    147 {
    148         futex_t *futex;
    149         __address paddr;
     146unative_t sys_futex_wakeup(uintptr_t uaddr)
     147{
     148        futex_t *futex;
     149        uintptr_t paddr;
    150150        pte_t *t;
    151151        ipl_t ipl;
     
    161161                page_table_unlock(AS, true);
    162162                interrupts_restore(ipl);
    163                 return (__native) ENOENT;
     163                return (unative_t) ENOENT;
    164164        }
    165165        paddr = PTE_GET_FRAME(t) + (uaddr - ALIGN_DOWN(uaddr, PAGE_SIZE));
     
    183183 * @return Address of the kernel futex structure.
    184184 */
    185 futex_t *futex_find(__address paddr)
     185futex_t *futex_find(uintptr_t paddr)
    186186{
    187187        link_t *item;
     
    276276 * @return Index into futex hash table.
    277277 */
    278 index_t futex_ht_hash(__native *key)
     278index_t futex_ht_hash(unative_t *key)
    279279{
    280280        return *key & (FUTEX_HT_SIZE-1);
     
    287287 * @return True if the item matches the key. False otherwise.
    288288 */
    289 bool futex_ht_compare(__native *key, count_t keys, link_t *item)
     289bool futex_ht_compare(unative_t *key, count_t keys, link_t *item)
    290290{
    291291        futex_t *futex;
     
    324324                for (i = 0; i < node->keys; i++) {
    325325                        futex_t *ftx;
    326                         __address paddr = node->key[i];
     326                        uintptr_t paddr = node->key[i];
    327327                       
    328328                        ftx = (futex_t *) node->value[i];
  • generic/src/synch/mutex.c

    r991779c5 r7f1c620  
    6565 * @return See comment for waitq_sleep_timeout().
    6666 */
    67 int _mutex_lock_timeout(mutex_t *mtx, __u32 usec, int flags)
     67int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, int flags)
    6868{
    6969        return _semaphore_down_timeout(&mtx->sem, usec, flags);
  • generic/src/synch/rwlock.c

    r991779c5 r7f1c620  
    102102 * @return See comment for waitq_sleep_timeout().
    103103 */
    104 int _rwlock_write_lock_timeout(rwlock_t *rwl, __u32 usec, int flags)
     104int _rwlock_write_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags)
    105105{
    106106        ipl_t ipl;
     
    156156 * @return See comment for waitq_sleep_timeout().
    157157 */
    158 int _rwlock_read_lock_timeout(rwlock_t *rwl, __u32 usec, int flags)
     158int _rwlock_read_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags)
    159159{
    160160        int rc;
  • generic/src/synch/semaphore.c

    r991779c5 r7f1c620  
    7979 * @return See comment for waitq_sleep_timeout().
    8080 */
    81 int _semaphore_down_timeout(semaphore_t *s, __u32 usec, int flags)
     81int _semaphore_down_timeout(semaphore_t *s, uint32_t usec, int flags)
    8282{
    8383        return waitq_sleep_timeout(&s->wq, usec, flags);
  • generic/src/synch/spinlock.c

    r991779c5 r7f1c620  
    109109                if (i++ > DEADLOCK_THRESHOLD) {
    110110                        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);
    112112                        symbol = get_symtab_entry(CALLER);
    113113                        if (symbol)
  • generic/src/synch/waitq.c

    r991779c5 r7f1c620  
    215215 * attempted.
    216216 */
    217 int waitq_sleep_timeout(waitq_t *wq, __u32 usec, int flags)
     217int waitq_sleep_timeout(waitq_t *wq, uint32_t usec, int flags)
    218218{
    219219        ipl_t ipl;
     
    298298 * @return See waitq_sleep_timeout().
    299299 */
    300 int waitq_sleep_timeout_unsafe(waitq_t *wq, __u32 usec, int flags)
     300int waitq_sleep_timeout_unsafe(waitq_t *wq, uint32_t usec, int flags)
    301301{
    302302        /* checks whether to go to sleep at all */
     
    352352                }
    353353                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);
    355355        }
    356356
Note: See TracChangeset for help on using the changeset viewer.