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