49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * CDDL HEADER START
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * The contents of this file are subject to the terms of the
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * Common Development and Distribution License (the "License").
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * You may not use this file except in compliance with the License.
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * See the License for the specific language governing permissions
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * and limitations under the License.
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * When distributing Covered Code, include this CDDL HEADER in each
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * If applicable, add the following below this CDDL HEADER, with the
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * fields enclosed by brackets "[]" replaced with your own identifying
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * information: Portions Copyright [yyyy] [name of copyright owner]
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * CDDL HEADER END
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * Use is subject to license terms.
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Loweuint_t cpu_tick_freq = 0; /* deprecated, tune sys_tick_freq instead */
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * Hardware watchdog parameters and knobs
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Loweint watchdog_available = 0; /* system has a watchdog */
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Loweint watchdog_activated = 0; /* the watchdog is armed */
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Loweuint_t watchdog_timeout_seconds = CLK_WATCHDOG_DEFAULT;
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * tod module name and operations
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * Now is a good time to activate hardware watchdog (if one exists).
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe ret = tod_ops.tod_set_watchdog_timer(watchdog_timeout_seconds);
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * preset the delay constant for drv_usecwait(). This is done for early
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * use of the le or scsi drivers in the kernel. The default contant
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * might be too high early on. We can get a pretty good approximation
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * of this by setting it as:
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * sys_clock_mhz = (sys_tick_freq + 500000) / 1000000
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * setcpudelay is called twice during the boot process. The first time
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * is before the TOD driver is loaded so cpu_init_tick_freq cannot
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * calibrate sys_tick_freq but can only set it to the prom value. The
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * first call is also before /etc/system is read.
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * Only call cpu_init_tick_freq the second time around if sys_tick_freq
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * has not been tuned via /etc/system.
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * We want to allow cpu_tick_freq to be tunable; we'll only set it
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe * if it hasn't been explicitly tuned.
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe cmn_err(CE_WARN, "cpu_tick_freq is no longer a kernel "
49d3bc91e27cd871b950d56c01398fa2f2e12ab4Richard Lowe "tunable, use sys_tick_freq instead");
* See the comments in clock.h for a full description of
if (sys_clock_mhz <= 0) {
return (ts);
ushort_t s;
CLOCK_LOCK(&s);
CLOCK_UNLOCK(s);