Deleted Added
full compact
1/*-
2 * Copyright (c) 1982, 1986, 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_clock.c 8.5 (Berkeley) 1/21/94
39 * $Id: kern_clock.c,v 1.4 1994/08/18 22:34:58 wollman Exp $
40 */
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/dkstat.h>
45#include <sys/callout.h>
46#include <sys/kernel.h>
47#include <sys/proc.h>
48#include <sys/resourcevar.h>
49#include <vm/vm.h>
50
51#include <machine/cpu.h>
52
53#ifdef GPROF
54#include <sys/gmon.h>
55#endif
56
57/* Does anybody else really care about these? */
58struct callout *callfree, *callout, calltodo;
59int ncallout;

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

123int ticks;
124static int psdiv, pscnt; /* prof => stat divider */
125int psratio; /* ratio: prof / stat */
126
127volatile struct timeval time;
128volatile struct timeval mono_time;
129
130/*
131 * Initialize clock frequencies and start both clocks running.
132 */
133void
134initclocks()
135{
136 register int i;
137
138 /*

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

202
203 /*
204 * If no separate statistics clock is available, run it from here.
205 */
206 if (stathz == 0)
207 statclock(frame);
208
209 /*
210 * Increment the time-of-day. The increment is just ``tick'' unless
211 * we are still adjusting the clock; see adjtime().
212 */
213 ticks++;
214 if (timedelta == 0)
215 delta = tick;
216 else {
217 delta = tick + tickdelta;
218 timedelta -= tickdelta;
219 }
220 BUMPTIME(&time, delta);
221 BUMPTIME(&mono_time, delta);
222
223 /*
224 * Process callouts at a very low cpu priority, so we don't keep the
225 * relatively high clock interrupt priority any longer than necessary.
226 */
227 if (needsoft) {
228 if (CLKF_BASEPRI(frame)) {
229 /*

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

558 * Construct clockinfo structure.
559 */
560 clkinfo.hz = hz;
561 clkinfo.tick = tick;
562 clkinfo.profhz = profhz;
563 clkinfo.stathz = stathz ? stathz : hz;
564 return (sysctl_rdstruct(where, sizep, NULL, &clkinfo, sizeof(clkinfo)));
565}