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

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sun Sep  2 22:42:12 2012 +0200

hal/x86: avoid crashes on CPU without a TSC

When compiled with CONFIG_X86_TSC on a pre I-pipe core kernel and the CPU
has no TSC, refuse to start.

---

 ksrc/arch/x86/hal_32.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/ksrc/arch/x86/hal_32.c b/ksrc/arch/x86/hal_32.c
index 69ab99d..01c5439 100644
--- a/ksrc/arch/x86/hal_32.c
+++ b/ksrc/arch/x86/hal_32.c
@@ -360,6 +360,15 @@ int rthal_arch_init(void)
        old_mksound = kd_mksound;
        kd_mksound = &dummy_mksound;
 #endif /* !CONFIG_X86_LOCAL_APIC && Linux < 2.6 && !CONFIG_X86_TSC && 
CONFIG_VT */
+#ifdef CONFIG_X86_TSC
+       if (!cpu_has_tsc) {
+               printk("Xenomai: compiled for TSC, but CPU has no TSC\n"
+                      "         Recompile the kernel selecting a CPU without "
+                      "TSC\n");
+               rthal_smi_restore();
+               return -ENODEV;
+       }
+#endif /* X86_TSC */
 #endif /* !I-pipe core */
 
        if (rthal_cpufreq_arg == 0)


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

Reply via email to