Annotation of sys/arch/sh/include/clock.h, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: clock.h,v 1.1.1.1 2006/10/06 21:02:55 miod Exp $ */
2: /* $NetBSD: clock.h,v 1.2 2002/04/28 17:10:33 uch Exp $ */
3:
4: /*-
5: * Copyright (c) 2002 The NetBSD Foundation, Inc.
6: * All rights reserved.
7: *
8: * This code is derived from software contributed to The NetBSD Foundation
9: * by UCHIYAMA Yasushi.
10: *
11: * Redistribution and use in source and binary forms, with or without
12: * modification, are permitted provided that the following conditions
13: * are met:
14: * 1. Redistributions of source code must retain the above copyright
15: * notice, this list of conditions and the following disclaimer.
16: * 2. Redistributions in binary form must reproduce the above copyright
17: * notice, this list of conditions and the following disclaimer in the
18: * documentation and/or other materials provided with the distribution.
19: * 3. All advertising materials mentioning features or use of this software
20: * must display the following acknowledgement:
21: * This product includes software developed by the NetBSD
22: * Foundation, Inc. and its contributors.
23: * 4. Neither the name of The NetBSD Foundation nor the names of its
24: * contributors may be used to endorse or promote products derived
25: * from this software without specific prior written permission.
26: *
27: * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28: * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29: * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31: * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37: * POSSIBILITY OF SUCH DAMAGE.
38: */
39:
40: /*
41: * void sh_clock_init(int flags, struct rtc_ops *):
42: * flags:
43: * SH_CLOCK_NORTC ... If SH RTC module is disabled, set this.
44: * internal module don't use RTCCLK.
45: * SH_CLOCK_NOINITTODR ... Don't initialize RTC time.
46: * rtc_ops:
47: * Machine dependent RTC ops pointer. If NULL is specified, use SH
48: * internal RTC.
49: *
50: * void machine_clock_init(void):
51: * Implement machine specific part of clock routines.
52: * must call sh_clock_init() at exit.
53: *
54: * int sh_clock_get_cpuclock(void):
55: * returns CPU clock estimated by sh_clock_init().
56: *
57: * int sh_clock_get_pclock(void):
58: * returns PCLOCK. when PCLOCK is not specified by kernel configuration
59: * file, this value is estimated by sh_clock_init().
60: *
61: */
62: struct rtc_ops;
63: struct clock_ymdhms;
64:
65: void sh_clock_init(int, struct rtc_ops *);
66: #define SH_CLOCK_NORTC 0x00000001
67: #define SH_CLOCK_NOINITTODR 0x00000002
68: void machine_clock_init(void);
69:
70: int sh_clock_get_cpuclock(void);
71: int sh_clock_get_pclock(void);
72:
73: /*
74: * SH RTC module interface.
75: */
76: void sh_rtc_init(void *);
77: void sh_rtc_get(void *, time_t, struct clock_ymdhms *);
78: void sh_rtc_set(void *, struct clock_ymdhms *);
79:
80: /*
81: * machine specific RTC ops
82: */
83: struct clock_ymdhms;
84: struct rtc_ops {
85: void *_cookie;
86: void (*init)(void *);
87: void (*get)(void *, time_t, struct clock_ymdhms *);
88: void (*set)(void *, struct clock_ymdhms *);
89: };
90:
CVSweb