todstarfire.c revision b5b48cc1a59a2d6962c84c49b474efdc7f303fbb
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* tod driver module for Starfire
* This module implements a soft tod since
* starfire has no tod part.
*/
#include <sys/sysmacros.h>
#include <sys/autoconf.h>
#include <sys/cpu_sgnblk_defs.h>
static timestruc_t todsf_get(void);
static void todsf_set(timestruc_t);
static uint_t todsf_clear_watchdog_timer(void);
static void todsf_set_power_alarm(timestruc_t);
static void todsf_clear_power_alarm(void);
static uint64_t todsf_get_cpufrequency(void);
/*
* Module linkage information for the kernel.
*/
&mod_miscops, "Soft tod module for Starfire %I%"
};
static struct modlinkage modlinkage = {
};
int
_init(void)
{
int ssp_time32;
char obp_string[40];
/* Set the string to pass to OBP */
(void *)&ssp_time32);
/* Get OBP to get TOD from ssp */
prom_interpret(obp_string, 0, 0, 0, 0, 0);
/*
* Flag warning if user tried to use hardware watchdog
*/
if (watchdog_enable) {
}
}
return (mod_install(&modlinkage));
}
int
_fini(void)
{
return (EBUSY);
else
return (mod_remove(&modlinkage));
}
int
{
}
/*
* Simply return hrestime value
* Must be called with tod_lock held.
*/
static timestruc_t
todsf_get(void)
{
extern cpu_sgnblk_t *cpu_sgnblkp[];
/* Update the heartbeat */
return (ts);
}
/*
* Null function for now.
* Must be called with tod_lock held.
*/
/* ARGSUSED */
static void
{
}
/*
* No watchdog function.
*/
/* ARGSUSED */
static uint_t
{
return (0);
}
/*
* No watchdog function
*/
static uint_t
{
return (0);
}
/*
* Null function.
*/
/* ARGSUSED */
static void
{
}
/*
* Null function
*/
static void
{
}
/*
* Get clock freq from the cpunode
*/
todsf_get_cpufrequency(void)
{
}