Lines Matching refs:td

114 cpu_thread_swapin(struct thread *td)
119 cpu_thread_swapout(struct thread *td)
124 cpu_set_syscall_retval(struct thread *td, int error)
128 frame = td->td_frame;
132 frame->tf_a[0] = td->td_retval[0];
133 frame->tf_a[1] = td->td_retval[1];
156 cpu_copy_thread(struct thread *td, struct thread *td0)
159 bcopy(td0->td_frame, td->td_frame, sizeof(struct trapframe));
160 bcopy(td0->td_pcb, td->td_pcb, sizeof(struct pcb));
162 td->td_pcb->pcb_s[0] = (uintptr_t)fork_return;
163 td->td_pcb->pcb_s[1] = (uintptr_t)td;
164 td->td_pcb->pcb_ra = (uintptr_t)fork_trampoline;
165 td->td_pcb->pcb_sp = (uintptr_t)td->td_frame;
168 td->td_md.md_spinlock_count = 1;
169 td->td_md.md_saved_sstatus_ie = 1;
177 cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg,
180 struct trapframe *tf = td->td_frame;
188 cpu_set_user_tls(struct thread *td, void *tls_base)
195 pcb = td->td_pcb;
202 cpu_thread_exit(struct thread *td)
207 cpu_thread_alloc(struct thread *td)
210 td->td_pcb = (struct pcb *)(td->td_kstack +
211 td->td_kstack_pages * PAGE_SIZE) - 1;
212 td->td_frame = (struct trapframe *)STACKALIGN(
213 (caddr_t)td->td_pcb - 8 - sizeof(struct trapframe));
217 cpu_thread_free(struct thread *td)
222 cpu_thread_clean(struct thread *td)
233 cpu_fork_kthread_handler(struct thread *td, void (*func)(void *), void *arg)
236 td->td_pcb->pcb_s[0] = (uintptr_t)func;
237 td->td_pcb->pcb_s[1] = (uintptr_t)arg;
238 td->td_pcb->pcb_ra = (uintptr_t)fork_trampoline;
239 td->td_pcb->pcb_sp = (uintptr_t)td->td_frame;
243 cpu_exit(struct thread *td)