Changeset 0f250f9 in mainline for generic/src/proc/thread.c
- Timestamp:
- 2006-03-17T18:07:56Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 69f293e
- Parents:
- 6c6a19e6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/proc/thread.c
r6c6a19e6 r0f250f9 30 30 #include <proc/thread.h> 31 31 #include <proc/task.h> 32 #include <proc/uarg.h> 32 33 #include <mm/frame.h> 33 34 #include <mm/page.h> … … 430 431 * 431 432 */ 432 __native sys_thread_create( __address function, void *arg, void *stack, char *name)433 __native sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name) 433 434 { 434 435 thread_t *t; 435 436 char namebuf[THREAD_NAME_BUFLEN]; 436 uspace_arg_t * uarg;437 uspace_arg_t *kernel_uarg; /* TODO: store kernel_uarg in thread_t */ 437 438 __u32 tid; 438 439 439 copy_from_uspace(namebuf, name, THREAD_NAME_BUFLEN); 440 uarg = (uspace_arg_t *) malloc(sizeof(uarg), 0); 441 442 uarg->uspace_entry = function; 443 uarg->uspace_stack = (__address) stack; 444 445 if ((t = thread_create(uinit, uarg, TASK, 0, namebuf))) { 440 copy_from_uspace(namebuf, uspace_name, THREAD_NAME_BUFLEN); 441 442 kernel_uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t), 0); 443 copy_from_uspace(kernel_uarg, uspace_uarg, sizeof(uspace_arg_t)); 444 445 if ((t = thread_create(uinit, kernel_uarg, TASK, 0, namebuf))) { 446 446 tid = t->tid; 447 447 thread_ready(t); 448 448 return (__native) tid; 449 449 } else { 450 free(namebuf);450 free(kernel_uarg); 451 451 } 452 452 … … 457 457 * 458 458 */ 459 __native sys_thread_exit(int status)459 __native sys_thread_exit(int uspace_status) 460 460 { 461 461 thread_exit();
Note:
See TracChangeset
for help on using the changeset viewer.