Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys All users of the old sleep() are now gone; nuke it.



details:   https://anonhg.NetBSD.org/src/rev/eb2028280b98
branches:  trunk
changeset: 486649:eb2028280b98
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat May 27 05:00:47 2000 +0000

description:
All users of the old sleep() are now gone; nuke it.

diffstat:

 sys/kern/kern_synch.c |  66 +--------------------------------------------------
 sys/sys/proc.h        |   3 +-
 2 files changed, 2 insertions(+), 67 deletions(-)

diffs (97 lines):

diff -r 443ff0f2b80d -r eb2028280b98 sys/kern/kern_synch.c
--- a/sys/kern/kern_synch.c     Sat May 27 04:52:27 2000 +0000
+++ b/sys/kern/kern_synch.c     Sat May 27 05:00:47 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_synch.c,v 1.74 2000/05/27 00:40:46 sommerfeld Exp $       */
+/*     $NetBSD: kern_synch.c,v 1.75 2000/05/27 05:00:48 thorpej Exp $  */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -480,70 +480,6 @@
 }
 
 /*
- * Short-term, non-interruptable sleep.
- */
-void
-sleep(ident, priority)
-       void *ident;
-       int priority;
-{
-       struct proc *p = curproc;
-       struct slpque *qp;
-       int s;
-
-#ifdef DIAGNOSTIC
-       if (priority > PZERO) {
-               printf("sleep called with priority %d > PZERO, wchan: %p\n",
-                   priority, ident);
-               panic("old sleep");
-       }
-#endif
-       s = splhigh();
-       if (cold || panicstr) {
-               /*
-                * After a panic, or during autoconfiguration,
-                * just give interrupts a chance, then just return;
-                * don't run any other procs or panic below,
-                * in case this is the idle process and already asleep.
-                */
-               splx(safepri);
-               splx(s);
-               return;
-       }
-#ifdef DIAGNOSTIC
-       if (ident == NULL || p->p_stat != SONPROC || p->p_back)
-               panic("sleep");
-#endif
-       p->p_wchan = ident;
-       p->p_wmesg = NULL;
-       p->p_slptime = 0;
-       p->p_priority = priority;
-       qp = SLPQUE(ident);
-       if (qp->sq_head == 0)
-               qp->sq_head = p;
-       else
-               *qp->sq_tailp = p;
-       *(qp->sq_tailp = &p->p_forw) = 0;
-       p->p_stat = SSLEEP;
-       p->p_stats->p_ru.ru_nvcsw++;
-#ifdef KTRACE
-       if (KTRPOINT(p, KTR_CSW))
-               ktrcsw(p, 1, 0);
-#endif
-       mi_switch(p);
-#ifdef DDB
-       /* handy breakpoint location after process "wakes" */
-       asm(".globl bpendsleep ; bpendsleep:");
-#endif
-#ifdef KTRACE
-       if (KTRPOINT(p, KTR_CSW))
-               ktrcsw(p, 0, 0);
-#endif
-       curcpu()->ci_schedstate.spc_curpriority = p->p_usrpri;
-       splx(s);
-}
-
-/*
  * Remove a process from its wait queue
  */
 void
diff -r 443ff0f2b80d -r eb2028280b98 sys/sys/proc.h
--- a/sys/sys/proc.h    Sat May 27 04:52:27 2000 +0000
+++ b/sys/sys/proc.h    Sat May 27 05:00:47 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.94 2000/05/27 00:40:48 sommerfeld Exp $     */
+/*     $NetBSD: proc.h,v 1.95 2000/05/27 05:00:47 thorpej Exp $        */
 
 /*-
  * Copyright (c) 1986, 1989, 1991, 1993
@@ -383,7 +383,6 @@
 void   resetpriority __P((struct proc *));
 void   setrunnable __P((struct proc *));
 void   setrunqueue __P((struct proc *));
-void   sleep __P((void *chan, int pri));
 int    tsleep __P((void *chan, int pri, const char *wmesg, int timo));
 void   unsleep __P((struct proc *));
 void   wakeup __P((void *chan));



Home | Main Index | Thread Index | Old Index