kern_synch.c (35029) | kern_synch.c (36119) |
---|---|
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.9 (Berkeley) 5/19/95 | 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.9 (Berkeley) 5/19/95 |
39 * $Id: kern_synch.c,v 1.53 1998/03/28 18:16:29 dufault Exp $ | 39 * $Id: kern_synch.c,v 1.54 1998/04/04 13:25:20 phk Exp $ |
40 */ 41 42#include "opt_ktrace.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/proc.h> 47#include <sys/kernel.h> --- 568 unchanged lines hidden (view full) --- 616#ifdef SIMPLELOCK_DEBUG 617 if (p->p_simple_locks) 618 printf("sleep: holding simple lock\n"); 619#endif 620 /* 621 * Compute the amount of time during which the current 622 * process was running, and add that to its total so far. 623 */ | 40 */ 41 42#include "opt_ktrace.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/proc.h> 47#include <sys/kernel.h> --- 568 unchanged lines hidden (view full) --- 616#ifdef SIMPLELOCK_DEBUG 617 if (p->p_simple_locks) 618 printf("sleep: holding simple lock\n"); 619#endif 620 /* 621 * Compute the amount of time during which the current 622 * process was running, and add that to its total so far. 623 */ |
624 microruntime(&tv); | 624 microuptime(&tv); |
625 u = p->p_rtime.tv_usec + (tv.tv_usec - p->p_runtime.tv_usec); 626 s = p->p_rtime.tv_sec + (tv.tv_sec - p->p_runtime.tv_sec); 627 if (u < 0) { 628 u += 1000000; 629 s--; 630 } else if (u >= 1000000) { 631 u -= 1000000; 632 s++; --- 22 unchanged lines hidden (view full) --- 655 } 656 } 657 658 /* 659 * Pick a new current process and record its start time. 660 */ 661 cnt.v_swtch++; 662 cpu_switch(p); | 625 u = p->p_rtime.tv_usec + (tv.tv_usec - p->p_runtime.tv_usec); 626 s = p->p_rtime.tv_sec + (tv.tv_sec - p->p_runtime.tv_sec); 627 if (u < 0) { 628 u += 1000000; 629 s--; 630 } else if (u >= 1000000) { 631 u -= 1000000; 632 s++; --- 22 unchanged lines hidden (view full) --- 655 } 656 } 657 658 /* 659 * Pick a new current process and record its start time. 660 */ 661 cnt.v_swtch++; 662 cpu_switch(p); |
663 microruntime(&p->p_runtime); | 663 microuptime(&p->p_runtime); |
664 splx(x); 665} 666 667/* 668 * Initialize the (doubly-linked) run queues 669 * to be empty. 670 */ 671/* ARGSUSED*/ --- 85 unchanged lines hidden --- | 664 splx(x); 665} 666 667/* 668 * Initialize the (doubly-linked) run queues 669 * to be empty. 670 */ 671/* ARGSUSED*/ --- 85 unchanged lines hidden --- |