Deleted Added
full compact
kern_synch.c (118835) kern_synch.c (118893)
1/*-
2 * Copyright (c) 1982, 1986, 1990, 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.

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

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_synch.c 8.9 (Berkeley) 5/19/95
39 */
40
41#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1990, 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.

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

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_synch.c 8.9 (Berkeley) 5/19/95
39 */
40
41#include <sys/cdefs.h>
42__FBSDID("$FreeBSD: head/sys/kern/kern_synch.c 118835 2003-08-12 19:33:36Z jhb $");
42__FBSDID("$FreeBSD: head/sys/kern/kern_synch.c 118893 2003-08-14 03:56:24Z grehan $");
43
44#include "opt_ddb.h"
45#include "opt_ktrace.h"
46
47#include <sys/param.h>
48#include <sys/systm.h>
49#include <sys/condvar.h>
50#include <sys/kernel.h>

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

454/*
455 * The machine independent parts of mi_switch().
456 */
457void
458mi_switch(void)
459{
460 struct bintime new_switchtime;
461 struct thread *td;
43
44#include "opt_ddb.h"
45#include "opt_ktrace.h"
46
47#include <sys/param.h>
48#include <sys/systm.h>
49#include <sys/condvar.h>
50#include <sys/kernel.h>

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

454/*
455 * The machine independent parts of mi_switch().
456 */
457void
458mi_switch(void)
459{
460 struct bintime new_switchtime;
461 struct thread *td;
462#if !defined(__powerpc__)
463 struct thread *newtd;
462 struct thread *newtd;
464#endif
465 struct proc *p;
466 u_int sched_nest;
467
468 mtx_assert(&sched_lock, MA_OWNED | MA_NOTRECURSED);
469 td = curthread; /* XXX */
470 p = td->td_proc; /* XXX */
471 KASSERT(!TD_ON_RUNQ(td), ("mi_switch: called by old code"));
472#ifdef INVARIANTS

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

512 PCPU_SET(switchtime, new_switchtime);
513 CTR3(KTR_PROC, "mi_switch: old thread %p (pid %d, %s)", td, p->p_pid,
514 p->p_comm);
515 sched_nest = sched_lock.mtx_recurse;
516 if (td->td_proc->p_flag & P_SA)
517 thread_switchout(td);
518 sched_switchout(td);
519
463 struct proc *p;
464 u_int sched_nest;
465
466 mtx_assert(&sched_lock, MA_OWNED | MA_NOTRECURSED);
467 td = curthread; /* XXX */
468 p = td->td_proc; /* XXX */
469 KASSERT(!TD_ON_RUNQ(td), ("mi_switch: called by old code"));
470#ifdef INVARIANTS

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

510 PCPU_SET(switchtime, new_switchtime);
511 CTR3(KTR_PROC, "mi_switch: old thread %p (pid %d, %s)", td, p->p_pid,
512 p->p_comm);
513 sched_nest = sched_lock.mtx_recurse;
514 if (td->td_proc->p_flag & P_SA)
515 thread_switchout(td);
516 sched_switchout(td);
517
520#if !defined(__powerpc__)
521 newtd = choosethread();
522 if (td != newtd)
523 cpu_switch(td, newtd); /* SHAZAM!! */
518 newtd = choosethread();
519 if (td != newtd)
520 cpu_switch(td, newtd); /* SHAZAM!! */
524#else
525 cpu_switch(); /* SHAZAM!!*/
526#endif
527
528 sched_lock.mtx_recurse = sched_nest;
529 sched_lock.mtx_lock = (uintptr_t)td;
530 sched_switchin(td);
531
532 /*
533 * Start setting up stats etc. for the incoming thread.
534 * Similar code in fork_exit() is returned to by cpu_switch()

--- 153 unchanged lines hidden ---
521
522 sched_lock.mtx_recurse = sched_nest;
523 sched_lock.mtx_lock = (uintptr_t)td;
524 sched_switchin(td);
525
526 /*
527 * Start setting up stats etc. for the incoming thread.
528 * Similar code in fork_exit() is returned to by cpu_switch()

--- 153 unchanged lines hidden ---