4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 2000 by Sun Microsystems, Inc.
24 * All rights reserved.
30 #pragma ident "%Z%%M% %I% %E% SMI"
37 * Serengeti TOD (time of day) driver
39 * Serengeti does not have hardware TOD chip inside chassis. SC has
40 * a hardware TOD chip and maintains virtual TOD information for
41 * each domain. Domain accesses virtual TOD through SRAM on chosen
45 #include <sys/time_impl.h>
48 * IOSRAM used by virtual TOD
50 * +-------------------------------+
52 * +-------------------------------+
54 * +-------------------------------+
56 * +-------------------------------+
58 * +-------------------------------+
60 * +-------------------------------+
62 * +-------------------------------+
63 * | tod_timeout_period |
64 * +-------------------------------+
66 * For every struct member in IOSRAM except tod_domain_skew and tod_reserved,
67 * there are only one writer and one reader.
68 * tod_reserved (was tod_set_flag) is for backwards compatibility.
70 * reader read interval writer write interval
71 * ------------------------------------------------------------------------
72 * tod_get_value Solaris 1 second SC twice per second
73 * tod_domain_skew Solaris 1 second Solaris when needed
74 * SC (see following NOTE)
75 * tod_i_am_alive SC twice per second Solaris 1 second
76 * tod_timeout_period SC twice per second Solaris when needed
78 * NOTE: SC reads tod_domain_skew twice per second, notices if it
79 * changes, and always keeps the last observed value preserved
80 * in non-volatile storage.
82 typedef struct _tod_iosram
{
83 uint32_t tod_magic
; /* magic number, always TODSG_MAGIC */
84 uint32_t tod_version
; /* version number */
85 time_t tod_get_value
; /* SC updates and Solaris reads */
86 time_t tod_domain_skew
; /* Solaris updates and read */
87 uint32_t tod_reserved
; /* Was tod_set_flag. No use */
88 uint32_t tod_i_am_alive
; /* I'm alive! a.k.a. heartbeat */
89 uint32_t tod_timeout_period
; /* time period to decide hard hang */
92 #define TODSG_MAGIC 0x54443100 /* 'T','D', '1', \0 */
93 #define TODSG_VERSION_1 1
95 extern int todsg_use_sc
;
101 #endif /* _TODSG_H */