2 * Copyright (C) 2001, 2002, MontaVista Software Inc.
3 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
5 * include/asm-mips/time.h
6 * header file for the new style time.c file and time services.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
16 * Please refer to Documentation/MIPS/time.README.
22 #include <linux/ptrace.h> /* for struct pt_regs */
23 #include <linux/linkage.h> /* for asmlinkage */
24 #include <linux/rtc.h> /* for struct rtc_time */
27 * RTC ops. By default, they point a no-RTC functions.
28 * rtc_get_time - mktime(year, mon, day, hour, min, sec) in seconds.
29 * rtc_set_time - reverse the above translation and set time to RTC.
31 extern unsigned long (*rtc_get_time)(void);
32 extern int (*rtc_set_time)(unsigned long);
35 * to_tm() converts system time back to (year, mon, day, hour, min, sec).
36 * It is intended to help implement rtc_set_time() functions.
37 * Copied from PPC implementation.
39 extern void to_tm(unsigned long tim, struct rtc_time * tm);
42 * do_gettimeoffset(). By default, this func pointer points to
43 * do_null_gettimeoffset(), which leads to the same resolution as HZ.
44 * Higher resolution versions are vailable, which gives ~1us resolution.
46 extern unsigned long (*do_gettimeoffset)(void);
48 extern unsigned long null_gettimeoffset(void);
49 extern unsigned long fixed_rate_gettimeoffset(void);
50 extern unsigned long calibrate_div32_gettimeoffset(void);
51 extern unsigned long calibrate_div64_gettimeoffset(void);
54 * high-level timer interrupt routines.
56 extern void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs);
59 * the corresponding low-level timer interrupt routine.
61 asmlinkage void ll_timer_interrupt(int irq, struct pt_regs *regs);
64 * profiling and process accouting is done separately in local_timer_interrupt
66 void local_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs);
67 asmlinkage void ll_local_timer_interrupt(int irq, struct pt_regs *regs);
70 * board specific routines required by time_init().
71 * board_time_init is defaulted to NULL and can remains so.
72 * board_timer_setup must be setup properly in machine setup routine.
75 extern void (*board_time_init)(void);
76 extern void (*board_timer_setup)(struct irqaction *irq);
79 * mips_counter_frequency - must be set if you intend to use
80 * counter as timer interrupt source or use fixed_rate_gettimeoffset.
82 extern unsigned int mips_counter_frequency;
84 #endif /* _ASM_TIME_H */