Changeset 7f1c620 in mainline for generic/src/proc/thread.c


Ignore:
Timestamp:
2006-07-04T17:17:56Z (19 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.).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/proc/thread.c

    r991779c5 r7f1c620  
    9191
    9292SPINLOCK_INITIALIZE(tidlock);
    93 __u32 last_tid = 0;
     93uint32_t last_tid = 0;
    9494
    9595static slab_cache_t *thread_slab;
     
    255255
    256256        spinlock_lock(&threads_lock);
    257         btree_remove(&threads_btree, (btree_key_t) ((__address ) t), NULL);
     257        btree_remove(&threads_btree, (btree_key_t) ((uintptr_t ) t), NULL);
    258258        spinlock_unlock(&threads_lock);
    259259
     
    300300       
    301301        /* Not needed, but good for debugging */
    302         memsetb((__address)t->kstack, THREAD_STACK_SIZE * 1<<STACK_FRAMES, 0);
     302        memsetb((uintptr_t)t->kstack, THREAD_STACK_SIZE * 1<<STACK_FRAMES, 0);
    303303       
    304304        ipl = interrupts_disable();
     
    309309       
    310310        context_save(&t->saved_context);
    311         context_set(&t->saved_context, FADDR(cushion), (__address) t->kstack, THREAD_STACK_SIZE);
     311        context_set(&t->saved_context, FADDR(cushion), (uintptr_t) t->kstack, THREAD_STACK_SIZE);
    312312       
    313313        the_initialize((the_t *) t->kstack);
     
    369369         */
    370370        spinlock_lock(&threads_lock);
    371         btree_insert(&threads_btree, (btree_key_t) ((__address) t), (void *) t, NULL);
     371        btree_insert(&threads_btree, (btree_key_t) ((uintptr_t) t), (void *) t, NULL);
    372372        spinlock_unlock(&threads_lock);
    373373       
     
    412412 *
    413413 */
    414 void thread_sleep(__u32 sec)
     414void thread_sleep(uint32_t sec)
    415415{
    416416        thread_usleep(sec*1000000);
     
    425425 * @return An error code from errno.h or an error code from synch.h.
    426426 */
    427 int thread_join_timeout(thread_t *t, __u32 usec, int flags)
     427int thread_join_timeout(thread_t *t, uint32_t usec, int flags)
    428428{
    429429        ipl_t ipl;
     
    485485 *
    486486 */     
    487 void thread_usleep(__u32 usec)
     487void thread_usleep(uint32_t usec)
    488488{
    489489        waitq_t wq;
     
    565565        btree_node_t *leaf;
    566566       
    567         return btree_search(&threads_btree, (btree_key_t) ((__address) t), &leaf) != NULL;
     567        return btree_search(&threads_btree, (btree_key_t) ((uintptr_t) t), &leaf) != NULL;
    568568}
    569569
     
    571571 *
    572572 */
    573 __native sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name)
     573unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name)
    574574{
    575575        thread_t *t;
    576576        char namebuf[THREAD_NAME_BUFLEN];
    577577        uspace_arg_t *kernel_uarg;
    578         __u32 tid;
     578        uint32_t tid;
    579579        int rc;
    580580
    581581        rc = copy_from_uspace(namebuf, uspace_name, THREAD_NAME_BUFLEN);
    582582        if (rc != 0)
    583                 return (__native) rc;
     583                return (unative_t) rc;
    584584
    585585        kernel_uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t), 0);
     
    587587        if (rc != 0) {
    588588                free(kernel_uarg);
    589                 return (__native) rc;
     589                return (unative_t) rc;
    590590        }
    591591
     
    593593                tid = t->tid;
    594594                thread_ready(t);
    595                 return (__native) tid;
     595                return (unative_t) tid;
    596596        } else {
    597597                free(kernel_uarg);
    598598        }
    599599
    600         return (__native) ENOMEM;
     600        return (unative_t) ENOMEM;
    601601}
    602602
     
    604604 *
    605605 */
    606 __native sys_thread_exit(int uspace_status)
     606unative_t sys_thread_exit(int uspace_status)
    607607{
    608608        thread_exit();
Note: See TracChangeset for help on using the changeset viewer.