gemini_timervar.h revision 1.2 1 1.2 cliff /* $NetBSD: gemini_timervar.h,v 1.2 2008/11/09 08:56:47 cliff Exp $ */
2 1.1 matt
3 1.1 matt
4 1.1 matt /*
5 1.1 matt * adapted from:
6 1.1 matt * NetBSD: omap2_mputmrvar.h,v 1.2 2008/04/27 18:58:45 matt Exp
7 1.1 matt */
8 1.1 matt
9 1.1 matt /*
10 1.1 matt * Copyright (c) 2007 Microsoft
11 1.1 matt * All rights reserved.
12 1.1 matt *
13 1.1 matt * Redistribution and use in source and binary forms, with or without
14 1.1 matt * modification, are permitted provided that the following conditions
15 1.1 matt * are met:
16 1.1 matt * 1. Redistributions of source code must retain the above copyright
17 1.1 matt * notice, this list of conditions and the following disclaimer.
18 1.1 matt * 2. Redistributions in binary form must reproduce the above copyright
19 1.1 matt * notice, this list of conditions and the following disclaimer in the
20 1.1 matt * documentation and/or other materials provided with the distribution.
21 1.1 matt * 3. All advertising materials mentioning features or use of this software
22 1.1 matt * must display the following acknowledgement:
23 1.1 matt * This product includes software developed by Microsoft
24 1.1 matt *
25 1.1 matt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
26 1.1 matt * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
27 1.1 matt * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28 1.1 matt * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTERS BE LIABLE FOR ANY DIRECT,
29 1.1 matt * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 1.1 matt * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31 1.1 matt * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 1.1 matt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 1.1 matt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 1.1 matt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 1.1 matt * SUCH DAMAGE.
36 1.1 matt */
37 1.1 matt #ifndef _GEMINI_TIMER_H
38 1.1 matt #define _GEMINI_TIMER_H
39 1.1 matt
40 1.1 matt #ifndef STATHZ
41 1.2 cliff # define STATHZ HZ
42 1.1 matt #endif
43 1.1 matt
44 1.1 matt typedef struct timer_factors {
45 1.1 matt uint32_t tf_counts_per_usec;
46 1.1 matt uint32_t tf_tmcr;
47 1.1 matt uint32_t tf_counter;
48 1.1 matt uint32_t tf_reload;
49 1.1 matt uint32_t tf_match1;
50 1.1 matt uint32_t tf_match2;
51 1.1 matt } timer_factors_t;
52 1.1 matt
53 1.1 matt typedef struct geminitmr_softc {
54 1.1 matt struct device sc_dev;
55 1.1 matt uint sc_timerno;
56 1.1 matt bus_space_tag_t sc_iot;
57 1.1 matt bus_space_handle_t sc_ioh;
58 1.1 matt bus_addr_t sc_addr;
59 1.1 matt size_t sc_size;
60 1.1 matt int sc_intr;
61 1.1 matt timer_factors_t sc_tf;
62 1.1 matt } geminitmr_softc_t;
63 1.1 matt
64 1.1 matt
65 1.1 matt
66 1.1 matt extern uint32_t hardref;
67 1.1 matt extern struct timeval hardtime;
68 1.1 matt extern struct geminitmr_softc *clock_sc;
69 1.1 matt extern struct geminitmr_softc *stat_sc;
70 1.1 matt extern struct geminitmr_softc *ref_sc;
71 1.1 matt
72 1.1 matt extern void gemini_microtime_init(void);
73 1.1 matt
74 1.1 matt extern int clockintr(void *);
75 1.1 matt extern int statintr(void *);
76 1.1 matt extern void rtcinit(void);
77 1.1 matt
78 1.1 matt #endif /* _GEMINI_TIMER_H */
79