Module: xenomai-gch
Branch: for-2.4
Commit: 3471050a53565aebb509cff059f8b49bd2f17d25
URL:    
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=3471050a53565aebb509cff059f8b49bd2f17d25

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Thu Aug 27 15:39:06 2009 +0200

timeconv: fix xnarch_ns_to_tsc when using llmulshft

---

 include/asm-generic/bits/timeconv.h |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/asm-generic/bits/timeconv.h 
b/include/asm-generic/bits/timeconv.h
index 9a89fe9..9687207 100644
--- a/include/asm-generic/bits/timeconv.h
+++ b/include/asm-generic/bits/timeconv.h
@@ -37,6 +37,10 @@ long long xnarch_tsc_to_ns_rounded(long long ticks)
        unsigned int shift = tsc_shift - 1;
        return (xnarch_llmulshft(ticks, tsc_scale, shift) + 1) / 2;
 }
+long long xnarch_ns_to_tsc(long long ns)
+{
+       return xnarch_llimd(ns, 1 << tsc_shift, tsc_scale);
+}
 #else  /* !XNARCH_HAVE_LLMULSHFT */
 long long xnarch_tsc_to_ns(long long ticks)
 {
@@ -46,12 +50,11 @@ long long xnarch_tsc_to_ns_rounded(long long ticks)
 {
        return (xnarch_llimd(ticks, 1000000000, cpufreq/2) + 1) / 2;
 }
-#endif /* !XNARCH_HAVE_LLMULSHFT */
-
 long long xnarch_ns_to_tsc(long long ns)
 {
        return xnarch_llimd(ns, cpufreq, 1000000000);
 }
+#endif /* !XNARCH_HAVE_LLMULSHFT */
 
 static inline void xnarch_init_timeconv(unsigned long long freq)
 {


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to