1 /* 2 * linux/include/asm-cris/timex.h 3 * 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. 9 */ 10 #ifndef _ASM_CRIS_TIMEX_H 11 #define _ASM_CRIS_TIMEX_H 12 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)) 22 23 24 #define GET_JIFFIES_USEC() \ 25 ( (TIMER0_DIV - *R_TIMER0_DATA) * (1000000/HZ)/TIMER0_DIV ) 26 27 unsigned long get_ns_in_jiffie(void); 28 29 unsigned long timer_data_to_ns(unsigned long timer_data); 30 get_us_in_jiffie_highres(void)31extern inline unsigned long get_us_in_jiffie_highres(void) 32 { 33 return get_ns_in_jiffie()/1000; 34 } 35 /* 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. 38 */ 39 40 typedef unsigned int cycles_t; 41 get_cycles(void)42extern inline cycles_t get_cycles(void) 43 { 44 return 0; 45 } 46 47 #define vxtime_lock() do {} while (0) 48 #define vxtime_unlock() do {} while (0) 49 50 #endif 51