kern_synch.c (8876) | kern_synch.c (10358) |
---|---|
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.10 1995/03/16 18:12:36 bde Exp $ | 39 * $Id: kern_synch.c,v 1.11 1995/05/30 08:05:44 rgrimes 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> 49#include <sys/signalvar.h> 50#include <vm/vm.h> 51#ifdef KTRACE 52#include <sys/ktrace.h> 53#endif 54 55#include <machine/cpu.h> 56 | 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/signalvar.h> 50#include <vm/vm.h> 51#ifdef KTRACE 52#include <sys/ktrace.h> 53#endif 54 55#include <machine/cpu.h> 56 |
57 58/* 59 * System initialization 60 */ 61 62static void rqinit __P((caddr_t)); 63SYSINIT(runqueue, SI_SUB_RUN_QUEUE, SI_ORDER_FIRST, rqinit, NULL) 64 65 66 |
|
57u_char curpriority; /* usrpri of curproc */ 58int lbolt; /* once a second sleep address */ 59 60void endtsleep __P((void *)); 61 62/* 63 * Force switch among equal priority processes every 100ms. 64 */ --- 532 unchanged lines hidden (view full) --- 597 cpu_switch(p); 598 microtime(&runtime); 599} 600 601/* 602 * Initialize the (doubly-linked) run queues 603 * to be empty. 604 */ | 67u_char curpriority; /* usrpri of curproc */ 68int lbolt; /* once a second sleep address */ 69 70void endtsleep __P((void *)); 71 72/* 73 * Force switch among equal priority processes every 100ms. 74 */ --- 532 unchanged lines hidden (view full) --- 607 cpu_switch(p); 608 microtime(&runtime); 609} 610 611/* 612 * Initialize the (doubly-linked) run queues 613 * to be empty. 614 */ |
605void 606rqinit() | 615/* ARGSUSED*/ 616static void 617rqinit( udata) 618caddr_t udata; /* not used*/ |
607{ 608 register int i; 609 610 for (i = 0; i < NQS; i++) { 611 qs[i].ph_link = qs[i].ph_rlink = (struct proc *)&qs[i]; 612 rtqs[i].ph_link = rtqs[i].ph_rlink = (struct proc *)&rtqs[i]; 613 idqs[i].ph_link = idqs[i].ph_rlink = (struct proc *)&idqs[i]; 614 } --- 62 unchanged lines hidden --- | 619{ 620 register int i; 621 622 for (i = 0; i < NQS; i++) { 623 qs[i].ph_link = qs[i].ph_rlink = (struct proc *)&qs[i]; 624 rtqs[i].ph_link = rtqs[i].ph_rlink = (struct proc *)&rtqs[i]; 625 idqs[i].ph_link = idqs[i].ph_rlink = (struct proc *)&idqs[i]; 626 } --- 62 unchanged lines hidden --- |