Deleted Added
full compact
kern_synch.c (3291) kern_synch.c (3308)
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.5 1994/09/25 19:33:44 phk Exp $
39 * $Id: kern_synch.c,v 1.6 1994/10/02 04:45:50 davidg 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>
48#include <sys/resourcevar.h>
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>
48#include <sys/resourcevar.h>
49#include <sys/vmmeter.h>
49#include <sys/signalvar.h>
50#include <vm/vm.h>
50#ifdef KTRACE
51#include <sys/ktrace.h>
52#endif
53
54#include <machine/cpu.h>
55
56u_char curpriority; /* usrpri of curproc */
57int lbolt; /* once a second sleep address */

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

415{
416 register struct proc *p = curproc;
417 register struct slpque *qp;
418 register s;
419 extern int cold;
420
421#ifdef DIAGNOSTIC
422 if (priority > PZERO) {
51#ifdef KTRACE
52#include <sys/ktrace.h>
53#endif
54
55#include <machine/cpu.h>
56
57u_char curpriority; /* usrpri of curproc */
58int lbolt; /* once a second sleep address */

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

416{
417 register struct proc *p = curproc;
418 register struct slpque *qp;
419 register s;
420 extern int cold;
421
422#ifdef DIAGNOSTIC
423 if (priority > PZERO) {
423 printf("sleep called with priority %d > PZERO, wchan: %x\n",
424 printf("sleep called with priority %d > PZERO, wchan: %p\n",
424 priority, ident);
425 panic("old sleep");
426 }
427#endif
428 s = splhigh();
429 if (cold || panicstr) {
430 /*
431 * After a panic, or during autoconfiguration,

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

499{
500 register struct slpque *qp;
501 register struct proc *p, **q;
502 int s;
503
504 s = splhigh();
505 qp = &slpque[LOOKUP(ident)];
506restart:
425 priority, ident);
426 panic("old sleep");
427 }
428#endif
429 s = splhigh();
430 if (cold || panicstr) {
431 /*
432 * After a panic, or during autoconfiguration,

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

500{
501 register struct slpque *qp;
502 register struct proc *p, **q;
503 int s;
504
505 s = splhigh();
506 qp = &slpque[LOOKUP(ident)];
507restart:
507 for (q = &qp->sq_head; p = *q; ) {
508 for (q = &qp->sq_head; *q; ) {
509 p = *q;
508#ifdef DIAGNOSTIC
510#ifdef DIAGNOSTIC
509 if (p->p_back || p->p_stat != SSLEEP && p->p_stat != SSTOP)
511 if (p->p_back || (p->p_stat != SSLEEP && p->p_stat != SSTOP))
510 panic("wakeup");
511#endif
512 if (p->p_wchan == ident) {
513 p->p_wchan = 0;
514 *q = p->p_forw;
515 if (qp->sq_tailp == &p->p_forw)
516 qp->sq_tailp = q;
517 if (p->p_stat == SSLEEP) {

--- 158 unchanged lines hidden ---
512 panic("wakeup");
513#endif
514 if (p->p_wchan == ident) {
515 p->p_wchan = 0;
516 *q = p->p_forw;
517 if (qp->sq_tailp == &p->p_forw)
518 qp->sq_tailp = q;
519 if (p->p_stat == SSLEEP) {

--- 158 unchanged lines hidden ---