patch-2.4.15 linux/include/asm-cris/timex.h
Next file: linux/include/asm-cris/uaccess.h
Previous file: linux/include/asm-cris/system.h
Back to the patch index
Back to the overall index
- Lines: 20
- Date:
Fri Nov 9 14:11:15 2001
- Orig file:
v2.4.14/linux/include/asm-cris/timex.h
- Orig date:
Tue May 1 16:05:00 2001
diff -u --recursive --new-file v2.4.14/linux/include/asm-cris/timex.h linux/include/asm-cris/timex.h
@@ -8,6 +8,19 @@
#define CLOCK_TICK_RATE 19200 /* Underlying frequency of the HZ timer */
+/* The timer0 values gives ~52.1us resolution (1/19200) but interrupts at HZ*/
+#define TIMER0_FREQ (CLOCK_TICK_RATE)
+#define TIMER0_CLKSEL c19k2Hz
+#define TIMER0_DIV (TIMER0_FREQ/(HZ))
+/* This is the slow one: */
+/*
+#define GET_JIFFIES_USEC() \
+ ( (*R_TIMER0_DATA - TIMER0_DIV) * (1000000/HZ)/TIMER0_DIV )
+*/
+/* This is the fast version: */
+extern unsigned short cris_timer0_value_us[TIMER0_DIV+1]; /* in kernel/time.c */
+#define GET_JIFFIES_USEC() (cris_timer0_value_us[*R_TIMER0_DATA])
+
/*
* We don't have a cycle-counter.. but we do not support SMP anyway where this is
* used so it does not matter.
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)