Changeset 7f1c620 in mainline for generic/src/proc/thread.c
- Timestamp:
- 2006-07-04T17:17:56Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0ffa3ef5
- Parents:
- 991779c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/proc/thread.c
r991779c5 r7f1c620 91 91 92 92 SPINLOCK_INITIALIZE(tidlock); 93 __u32last_tid = 0;93 uint32_t last_tid = 0; 94 94 95 95 static slab_cache_t *thread_slab; … … 255 255 256 256 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); 258 258 spinlock_unlock(&threads_lock); 259 259 … … 300 300 301 301 /* 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); 303 303 304 304 ipl = interrupts_disable(); … … 309 309 310 310 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); 312 312 313 313 the_initialize((the_t *) t->kstack); … … 369 369 */ 370 370 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); 372 372 spinlock_unlock(&threads_lock); 373 373 … … 412 412 * 413 413 */ 414 void thread_sleep( __u32sec)414 void thread_sleep(uint32_t sec) 415 415 { 416 416 thread_usleep(sec*1000000); … … 425 425 * @return An error code from errno.h or an error code from synch.h. 426 426 */ 427 int thread_join_timeout(thread_t *t, __u32usec, int flags)427 int thread_join_timeout(thread_t *t, uint32_t usec, int flags) 428 428 { 429 429 ipl_t ipl; … … 485 485 * 486 486 */ 487 void thread_usleep( __u32usec)487 void thread_usleep(uint32_t usec) 488 488 { 489 489 waitq_t wq; … … 565 565 btree_node_t *leaf; 566 566 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; 568 568 } 569 569 … … 571 571 * 572 572 */ 573 __nativesys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name)573 unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name) 574 574 { 575 575 thread_t *t; 576 576 char namebuf[THREAD_NAME_BUFLEN]; 577 577 uspace_arg_t *kernel_uarg; 578 __u32tid;578 uint32_t tid; 579 579 int rc; 580 580 581 581 rc = copy_from_uspace(namebuf, uspace_name, THREAD_NAME_BUFLEN); 582 582 if (rc != 0) 583 return ( __native) rc;583 return (unative_t) rc; 584 584 585 585 kernel_uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t), 0); … … 587 587 if (rc != 0) { 588 588 free(kernel_uarg); 589 return ( __native) rc;589 return (unative_t) rc; 590 590 } 591 591 … … 593 593 tid = t->tid; 594 594 thread_ready(t); 595 return ( __native) tid;595 return (unative_t) tid; 596 596 } else { 597 597 free(kernel_uarg); 598 598 } 599 599 600 return ( __native) ENOMEM;600 return (unative_t) ENOMEM; 601 601 } 602 602 … … 604 604 * 605 605 */ 606 __nativesys_thread_exit(int uspace_status)606 unative_t sys_thread_exit(int uspace_status) 607 607 { 608 608 thread_exit();
Note:
See TracChangeset
for help on using the changeset viewer.