Deleted Added
full compact
kern_synch.c (3098) kern_synch.c (3291)
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.

--- 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_synch.c 8.6 (Berkeley) 1/21/94
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.

--- 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_synch.c 8.6 (Berkeley) 1/21/94
39 * $Id: kern_synch.c,v 1.4 1994/09/01 05:12:41 davidg Exp $
39 * $Id: kern_synch.c,v 1.5 1994/09/25 19:33:44 phk Exp $
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/proc.h>
45#include <sys/kernel.h>
46#include <sys/buf.h>
47#include <sys/signalvar.h>

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

604void
605rqinit()
606{
607 register int i;
608
609 for (i = 0; i < NQS; i++) {
610 qs[i].ph_link = qs[i].ph_rlink = (struct proc *)&qs[i];
611 rtqs[i].ph_link = rtqs[i].ph_rlink = (struct proc *)&rtqs[i];
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/proc.h>
45#include <sys/kernel.h>
46#include <sys/buf.h>
47#include <sys/signalvar.h>

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

604void
605rqinit()
606{
607 register int i;
608
609 for (i = 0; i < NQS; i++) {
610 qs[i].ph_link = qs[i].ph_rlink = (struct proc *)&qs[i];
611 rtqs[i].ph_link = rtqs[i].ph_rlink = (struct proc *)&rtqs[i];
612 idqs[i].ph_link = idqs[i].ph_rlink = (struct proc *)&idqs[i];
612 }
613}
614
615/*
616 * Change process state to be runnable,
617 * placing it on the run queue if it is in memory,
618 * and awakening the swapper if it isn't in memory.
619 */

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

657 * than that of the current process.
658 */
659void
660resetpriority(p)
661 register struct proc *p;
662{
663 register unsigned int newpriority;
664
613 }
614}
615
616/*
617 * Change process state to be runnable,
618 * placing it on the run queue if it is in memory,
619 * and awakening the swapper if it isn't in memory.
620 */

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

658 * than that of the current process.
659 */
660void
661resetpriority(p)
662 register struct proc *p;
663{
664 register unsigned int newpriority;
665
665 if (p->p_rtprio == RTPRIO_RTOFF) {
666 if (p->p_rtprio.type == RTP_PRIO_NORMAL) {
666 newpriority = PUSER + p->p_estcpu / 4 + 2 * p->p_nice;
667 newpriority = min(newpriority, MAXPRI);
668 p->p_usrpri = newpriority;
669 if (newpriority < curpriority)
670 need_resched();
671 } else {
672 need_resched();
673 }
674}
667 newpriority = PUSER + p->p_estcpu / 4 + 2 * p->p_nice;
668 newpriority = min(newpriority, MAXPRI);
669 p->p_usrpri = newpriority;
670 if (newpriority < curpriority)
671 need_resched();
672 } else {
673 need_resched();
674 }
675}