From 96b9a12bd20f300ee8fcf003538e8aa560536c2c Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 10 Sep 2001 04:28:58 +0000 Subject: Rip some well duplicated code out of cpu_wait() and cpu_exit() and move it to the MI area. KSE touched cpu_wait() which had the same change replicated five ways for each platform. Now it can just do it once. The only MD parts seemed to be dealing with fpu state cleanup and things like vm86 cleanup on x86. The rest was identical. XXX: ia64 and powerpc did not have cpu_throw(), so I've put a functional stub in place. Reviewed by: jake, tmm, dillon --- sys/kern/kern_fork.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/kern/kern_fork.c') diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index dea8ff0..af154c3 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -235,7 +235,7 @@ fork1(p1, flags, procp) * certain parts of a process from itself. */ if ((flags & RFPROC) == 0) { - vm_fork(p1, 0, flags); + vm_forkproc(p1, 0, flags); /* * Close all file descriptors. @@ -412,7 +412,7 @@ again: /* * Duplicate sub-structures as needed. * Increase reference counts on shared objects. - * The p_stats and p_sigacts substructs are set in vm_fork. + * The p_stats and p_sigacts substructs are set in vm_forkproc. */ p2->p_flag = 0; mtx_lock_spin(&sched_lock); @@ -461,7 +461,7 @@ again: PROC_LOCK(p1); bcopy(p1->p_procsig, p2->p_procsig, sizeof(*p2->p_procsig)); p2->p_procsig->ps_refcnt = 1; - p2->p_sigacts = NULL; /* finished in vm_fork() */ + p2->p_sigacts = NULL; /* finished in vm_forkproc() */ } if (flags & RFLINUXTHPN) p2->p_sigparent = SIGUSR1; @@ -573,7 +573,7 @@ again: * Finish creating the child process. It will return via a different * execution path later. (ie: directly into user mode) */ - vm_fork(p1, p2, flags); + vm_forkproc(p1, p2, flags); if (flags == (RFFDG | RFPROC)) { cnt.v_forks++; -- cgit v1.1