Deleted Added
full compact
kern_fork.c (92852) kern_fork.c (93264)
1/*
2 * Copyright (c) 1982, 1986, 1989, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)kern_fork.c 8.6 (Berkeley) 4/8/94
1/*
2 * Copyright (c) 1982, 1986, 1989, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)kern_fork.c 8.6 (Berkeley) 4/8/94
39 * $FreeBSD: head/sys/kern/kern_fork.c 92852 2002-03-21 02:47:51Z benno $
39 * $FreeBSD: head/sys/kern/kern_fork.c 93264 2002-03-27 05:39:23Z dillon $
40 */
41
42#include "opt_ktrace.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/sysproto.h>
47#include <sys/filedesc.h>

--- 721 unchanged lines hidden (view full) ---

769 void *arg;
770 struct trapframe *frame;
771{
772 struct thread *td = curthread;
773 struct proc *p = td->td_proc;
774
775 td->td_kse->ke_oncpu = PCPU_GET(cpuid);
776 /*
40 */
41
42#include "opt_ktrace.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/sysproto.h>
47#include <sys/filedesc.h>

--- 721 unchanged lines hidden (view full) ---

769 void *arg;
770 struct trapframe *frame;
771{
772 struct thread *td = curthread;
773 struct proc *p = td->td_proc;
774
775 td->td_kse->ke_oncpu = PCPU_GET(cpuid);
776 /*
777 * Setup the sched_lock state so that we can release it.
777 * Finish setting up thread glue. We need to initialize
778 * the thread into a td_critnest=1 state. Some platforms
779 * may have already partially or fully initialized td_critnest
780 * and/or td_md.md_savecrit (when applciable).
781 *
782 * see <arch>/<arch>/critical.c
778 */
779 sched_lock.mtx_lock = (uintptr_t)td;
780 sched_lock.mtx_recurse = 0;
783 */
784 sched_lock.mtx_lock = (uintptr_t)td;
785 sched_lock.mtx_recurse = 0;
781 td->td_critnest = 1;
782 td->td_savecrit = CRITICAL_FORK;
786 cpu_critical_fork_exit();
783 CTR3(KTR_PROC, "fork_exit: new proc %p (pid %d, %s)", p, p->p_pid,
784 p->p_comm);
785 if (PCPU_GET(switchtime.sec) == 0)
786 binuptime(PCPU_PTR(switchtime));
787 PCPU_SET(switchticks, ticks);
788 mtx_unlock_spin(&sched_lock);
789
790 /*

--- 46 unchanged lines hidden ---
787 CTR3(KTR_PROC, "fork_exit: new proc %p (pid %d, %s)", p, p->p_pid,
788 p->p_comm);
789 if (PCPU_GET(switchtime.sec) == 0)
790 binuptime(PCPU_PTR(switchtime));
791 PCPU_SET(switchticks, ticks);
792 mtx_unlock_spin(&sched_lock);
793
794 /*

--- 46 unchanged lines hidden ---