Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/kern_thr.c
Show First 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | if ((param->child_tid != NULL && | ||||
(param->parent_tid != NULL && | (param->parent_tid != NULL && | ||||
suword_lwpid(param->parent_tid, td->td_tid))) | suword_lwpid(param->parent_tid, td->td_tid))) | ||||
return (EFAULT); | return (EFAULT); | ||||
/* Set up our machine context. */ | /* Set up our machine context. */ | ||||
stack.ss_sp = param->stack_base; | stack.ss_sp = param->stack_base; | ||||
stack.ss_size = param->stack_size; | stack.ss_size = param->stack_size; | ||||
/* Set upcall address to user thread entry function. */ | /* Set upcall address to user thread entry function. */ | ||||
cpu_set_upcall_kse(td, param->start_func, param->arg, &stack); | cpu_set_upcall(td, param->start_func, param->arg, &stack); | ||||
/* Setup user TLS address and TLS pointer register. */ | /* Setup user TLS address and TLS pointer register. */ | ||||
return (cpu_set_user_tls(td, param->tls_base)); | return (cpu_set_user_tls(td, param->tls_base)); | ||||
} | } | ||||
int | int | ||||
kern_thr_new(struct thread *td, struct thr_param *param) | kern_thr_new(struct thread *td, struct thr_param *param) | ||||
{ | { | ||||
struct rtprio rtp, *rtpp; | struct rtprio rtp, *rtpp; | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | #ifdef RACCT | ||||
} | } | ||||
#endif | #endif | ||||
/* Initialize our td */ | /* Initialize our td */ | ||||
error = kern_thr_alloc(p, 0, &newtd); | error = kern_thr_alloc(p, 0, &newtd); | ||||
if (error) | if (error) | ||||
goto fail; | goto fail; | ||||
cpu_set_upcall(newtd, td); | cpu_copy_thread(newtd, td); | ||||
bzero(&newtd->td_startzero, | bzero(&newtd->td_startzero, | ||||
__rangeof(struct thread, td_startzero, td_endzero)); | __rangeof(struct thread, td_startzero, td_endzero)); | ||||
bcopy(&td->td_startcopy, &newtd->td_startcopy, | bcopy(&td->td_startcopy, &newtd->td_startcopy, | ||||
__rangeof(struct thread, td_startcopy, td_endcopy)); | __rangeof(struct thread, td_startcopy, td_endcopy)); | ||||
newtd->td_proc = td->td_proc; | newtd->td_proc = td->td_proc; | ||||
thread_cow_get(newtd, td); | thread_cow_get(newtd, td); | ||||
▲ Show 20 Lines • Show All 373 Lines • Show Last 20 Lines |