2 * linux/include/asm-cris/timex.h
4 * CRIS architecture timex specifications
5 * 2002-03-04 Johan Adolfsson
6 * Use prescale timer at 25000 Hz instead of the baudrate timer at
7 * 19200 to get rid of the 64ppm to fast timer (and we get better
8 * resolution within a jiffie as well.
10 #ifndef _ASM_CRIS_TIMEX_H
11 #define _ASM_CRIS_TIMEX_H
13 /* The prescaler clock runs at 25MHz, we divide it by 1000 in the prescaler */
14 /* If you change anything here you must check time.c as well... */
15 #define PRESCALE_FREQ 25000000
16 #define PRESCALE_VALUE 1000
17 #define CLOCK_TICK_RATE 25000 /* Underlying frequency of the HZ timer */
18 /* The timer0 values gives 40us resolution (1/25000) but interrupts at HZ*/
19 #define TIMER0_FREQ (CLOCK_TICK_RATE)
20 #define TIMER0_CLKSEL flexible
21 #define TIMER0_DIV (TIMER0_FREQ/(HZ))
24 #define GET_JIFFIES_USEC() \
25 ( (TIMER0_DIV - *R_TIMER0_DATA) * (1000000/HZ)/TIMER0_DIV )
27 unsigned long get_ns_in_jiffie(void);
29 unsigned long timer_data_to_ns(unsigned long timer_data);
31 extern inline unsigned long get_us_in_jiffie_highres(void)
33 return get_ns_in_jiffie()/1000;
36 * We don't have a cycle-counter.. but we do not support SMP anyway where this is
37 * used so it does not matter.
40 typedef unsigned int cycles_t;
42 extern inline cycles_t get_cycles(void)
47 #define vxtime_lock() do {} while (0)
48 #define vxtime_unlock() do {} while (0)