Module: xenomai-2.6
Branch: master
Commit: d3852bc2b12c7a5cc2b290b8da16375f23ea0070
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=d3852bc2b12c7a5cc2b290b8da16375f23ea0070

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sun Sep  2 13:57:09 2012 +0200

hal/x86: dynamic tsc detection again

A simpler use of the I-pipe core for 3.4 dynamic tsc detection feature.
When compiled with CONFIG_X86_TSC and running on a machine without a tsc,
the I-pipe core for 3.4 will automatically use the 8254 emulation and pass
Xenomai the correct value of the clock frequency. What is only left to be done
is:
- display the correct clockdev in /proc/xenomai/timer
- do not arm the tsc feature when the user-space test for compatible features.

As Xenomai was not even booting in this configuration prior to 3.4, do this
unconditionally.

When configured without CONFIG_X86_TSC and running on a system with a tsc, no
attempt is made to use the tsc whereas the I-pipe core is able to do it (this is
the difference with commit 89cb4933ec93d4e6209e2f681d1f932467d98db6).

---

 include/asm-x86/features_32.h |    6 ++++--
 include/asm-x86/hal_32.h      |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/asm-x86/features_32.h b/include/asm-x86/features_32.h
index 11fc75a..d837c0e 100644
--- a/include/asm-x86/features_32.h
+++ b/include/asm-x86/features_32.h
@@ -33,7 +33,9 @@
  */
 #define CONFIG_XENO_X86_SEP  1
 #endif /* KERNEL_VERSION >= 2.6.0 */
-#endif /* __KERNEL__ */
+#else /* !__KERNEL__ */
+#define cpu_has_tsc 1
+#endif /* !__KERNEL__ */
 
 #define __xn_feat_x86_sep 0x00000001
 #define __xn_feat_x86_tsc 0x00000002
@@ -42,7 +44,7 @@
 #define XENOMAI_ABI_REV   4UL
 
 #ifdef CONFIG_X86_TSC
-#define __xn_feat_x86_tsc_mask __xn_feat_x86_tsc
+#define __xn_feat_x86_tsc_mask (cpu_has_tsc ? __xn_feat_x86_tsc : 0)
 #define XNARCH_HAVE_NONPRIV_TSC  1
 #else
 #define __xn_feat_x86_tsc_mask   0
diff --git a/include/asm-x86/hal_32.h b/include/asm-x86/hal_32.h
index f98efc8..62dadc7 100644
--- a/include/asm-x86/hal_32.h
+++ b/include/asm-x86/hal_32.h
@@ -46,7 +46,7 @@
 # define RTHAL_TIMER_DEVICE            "pit"
 #endif
 #ifdef CONFIG_X86_TSC
-# define RTHAL_CLOCK_DEVICE            "tsc"
+# define RTHAL_CLOCK_DEVICE            (cpu_has_tsc ? "tsc" : "pit")
 #else
 # define RTHAL_CLOCK_DEVICE            "pit"
 #endif


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to