/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/machsystm.h>
#include <sys/cyclic_impl.h>
static uint64_t
{
}
{
while (diff > nsec_per_sys_tick) {
}
return (unscale);
}
static int
{
return (1);
}
static int
{
return (1);
}
/*ARGSUSED*/
static void
{
}
/*ARGSUSED*/
static void
{
}
/*ARGSUSED*/
static void
{
if (time >= cbe_hrtime_max)
}
static void
{
switch (level) {
case CY_LOW_LEVEL:
break;
case CY_LOCK_LEVEL:
break;
default:
}
}
/*ARGSUSED*/
static cyc_cookie_t
{
int ipl;
switch (level) {
case CY_LOW_LEVEL:
ipl = CBE_LOW_PIL;
break;
case CY_LOCK_LEVEL:
ipl = CBE_LOCK_PIL;
break;
case CY_HIGH_LEVEL:
ipl = CBE_HIGH_PIL;
break;
default:
}
}
/*ARGSUSED*/
static void
{
}
static void
{
}
/*ARGSUSED*/
static void
{
}
/*ARGSUSED*/
static cyb_arg_t
{
/*
* The setsoftint() code will refuse to post a soft interrupt if
* one is already pending for the specified inum. Given that we
* may have disjoint soft interrupts on different CPUs posted
* simultaneously, we allocate a new set of inums for each CPU.
*/
return (new_data);
}
static void
{
}
/*ARGSUSED*/
static void
{
cbe_suspend_delta = 0;
}
/*ARGSUSED*/
static void
{
/*
* If we're actually on a CPU which has apparently had %tick zeroed,
* we want to add cbe_suspend_delta to %tick.
*/
if (cbe_suspend_delta == 0) {
/*
* We're the first CPU to be resumed. We want %tick
* to be close to %tick when we suspended the system,
* so we'll figure out the delta which needs to be
* written to the register. All subsequent resumed
* CPUs will write the same delta.
*/
}
}
}
void
cbe_hres_tick(void)
{
hres_tick();
}
void
cbe_init_pre(void)
{
/* Nothing to do on sparc */
}
void
cbe_init(void)
{
cbe_configure, /* cyb_configure */
cbe_unconfigure, /* cyb_unconfigure */
cbe_enable, /* cyb_enable */
cbe_disable, /* cyb_disable */
cbe_reprogram, /* cyb_reprogram */
cbe_softint, /* cyb_softint */
cbe_set_level, /* cyb_set_level */
cbe_restore_level, /* cyb_restore_level */
cbe_xcall, /* cyb_xcall */
cbe_suspend, /* cyb_suspend */
cbe_resume /* cyb_resume */
};
/*
* If sys_tick_freq > NANOSEC (i.e. we're on a CPU with a clock rate
* which exceeds 1 GHz), we'll specify the minimum resolution,
* 1 nanosecond.
*/
if (resolution == 0)
resolution = 1;
/*
* Initialize hrtime_base and hres_last_tick to reasonable starting
* values.
*/
hrtime_base = gethrtime();
clkstart();
}