From 496a3b1f658d32d5ed000ef2ee765245a29a6c67 Mon Sep 17 00:00:00 2001 From: kib Date: Thu, 16 Jun 2016 12:05:44 +0000 Subject: Update comments for the MD functions managing contexts for new threads, to make it less confusing and using modern kernel terms. Rename the functions to reflect current use of the functions, instead of the historic KSE conventions: cpu_set_fork_handler -> cpu_fork_kthread_handler (for kthreads) cpu_set_upcall -> cpu_copy_thread (for forks) cpu_set_upcall_kse -> cpu_set_upcall (for new threads creation) Reviewed by: jhb (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (hrs) Differential revision: https://reviews.freebsd.org/D6731 --- sys/mips/mips/vm_machdep.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'sys/mips') diff --git a/sys/mips/mips/vm_machdep.c b/sys/mips/mips/vm_machdep.c index f952ecc..177f634 100644 --- a/sys/mips/mips/vm_machdep.c +++ b/sys/mips/mips/vm_machdep.c @@ -194,7 +194,7 @@ cpu_fork(register struct thread *td1,register struct proc *p2, * This is needed to make kernel threads stay in kernel mode. */ void -cpu_set_fork_handler(struct thread *td, void (*func) __P((void *)), void *arg) +cpu_fork_kthread_handler(struct thread *td, void (*func)(void *), void *arg) { /* * Note that the trap frame follows the args, so the function @@ -352,14 +352,14 @@ cpu_set_syscall_retval(struct thread *td, int error) } /* - * Initialize machine state (pcb and trap frame) for a new thread about to - * upcall. Put enough state in the new thread's PCB to get it to go back - * userret(), where we can intercept it again to set the return (upcall) - * Address and stack, along with those from upcalls that are from other sources - * such as those generated in thread_userret() itself. + * Initialize machine state, mostly pcb and trap frame for a new + * thread, about to return to userspace. Put enough state in the new + * thread's PCB to get it to go back to the fork_return(), which + * finalizes the thread state and handles peculiarities of the first + * return to userspace for the new thread. */ void -cpu_set_upcall(struct thread *td, struct thread *td0) +cpu_copy_thread(struct thread *td, struct thread *td0) { struct pcb *pcb2; @@ -415,12 +415,11 @@ cpu_set_upcall(struct thread *td, struct thread *td0) } /* - * Set that machine state for performing an upcall that has to - * be done in thread_userret() so that those upcalls generated - * in thread_userret() itself can be done as well. + * Set that machine state for performing an upcall that starts + * the entry function with the given argument. */ void -cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, +cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, stack_t *stack) { struct trapframe *tf; -- cgit v1.1