Changeset 81e55099 in mainline
- Timestamp:
- 2006-03-17T19:56:16Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0a862b65
- Parents:
- e5a1f82f
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
init/init.c
re5a1f82f r81e55099 38 38 void utest(void *arg) 39 39 { 40 //printf("Uspace thread started.\n");40 printf("Uspace thread started.\n"); 41 41 for (;;) 42 42 ; -
libc/generic/thread.c
re5a1f82f r81e55099 33 33 #include <kernel/proc/uarg.h> 34 34 35 /** Main thread function. 36 * 37 * This function is called from __thread_entry() and is used 38 * to call the thread's implementing function and perform cleanup 39 * and exit when thread returns back. Do not call this function 40 * directly. 41 * 42 * @param uarg Pointer to userspace argument structure. 43 */ 35 44 void thread_main(uspace_arg_t *uarg) 36 45 { … … 41 50 } 42 51 52 /** Create userspace thread. 53 * 54 * This function creates new userspace thread and allocates userspace 55 * stack and userspace argument structure for it. 56 * 57 * @param function Function implementing the thread. 58 * @param arg Argument to be passed to thread. 59 * @param name Symbolic name of the thread. 60 * 61 * @param TID of the new thread on success or -1 on failure. 62 */ 43 63 int thread_create(void (* function)(void *), void *arg, char *name) 44 64 { … … 55 75 return -1; 56 76 } 77 57 78 uarg->uspace_entry = (void *) FADDR(__thread_entry); 58 79 uarg->uspace_stack = (void *) stack; 59 uarg->uspace_thread_function = (void *) FADDR(function);80 uarg->uspace_thread_function = function; 60 81 uarg->uspace_thread_arg = arg; 61 82 uarg->uspace_uarg = uarg; … … 64 85 } 65 86 87 /** Terminate current thread. 88 * 89 * @param stat Exit status. Currently not used. 90 */ 66 91 void thread_exit(int status) 67 92 {
Note:
See TracChangeset
for help on using the changeset viewer.