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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sat Jul  6 15:47:35 2013 +0200

copperplate: move clockobj_get_tsc() out of line

---

 include/copperplate/clockobj.h |   16 ++--------------
 lib/copperplate/clockobj.c     |   14 ++++++++++++++
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/include/copperplate/clockobj.h b/include/copperplate/clockobj.h
index 2619bb1..965523d 100644
--- a/include/copperplate/clockobj.h
+++ b/include/copperplate/clockobj.h
@@ -128,6 +128,8 @@ void clockobj_get_date(struct clockobj *clkobj, ticks_t 
*pticks);
 void clockobj_get_time(struct clockobj *clkobj,
                       ticks_t *pticks, ticks_t *ptsc);
 
+ticks_t clockobj_get_tsc(void);
+
 void clockobj_caltime_to_timeout(struct clockobj *clkobj, const struct tm *tm,
                                 unsigned long rticks, struct timespec *ts);
 
@@ -159,13 +161,6 @@ int clockobj_destroy(struct clockobj *clkobj);
 #ifdef CONFIG_XENO_COBALT
 
 #include <cobalt/ticks.h>
-#include <asm/xenomai/tsc.h>
-
-static inline ticks_t clockobj_get_tsc(void)
-{
-       /* Guaranteed to be the source of CLOCK_COPPERPLATE. */
-       return __xn_rdtsc();
-}
 
 static inline sticks_t clockobj_ns_to_tsc(sticks_t ns)
 {
@@ -188,13 +183,6 @@ void clockobj_ns_to_timespec(ticks_t ns, struct timespec 
*ts)
 
 #else /* CONFIG_XENO_MERCURY */
 
-static inline ticks_t clockobj_get_tsc(void)
-{
-       struct timespec now;
-       __RT(clock_gettime(CLOCK_COPPERPLATE, &now));
-       return (ticks_t)now.tv_sec * 1000000000ULL + now.tv_nsec;
-}
-
 static inline sticks_t clockobj_ns_to_tsc(sticks_t ns)
 {
        return ns;
diff --git a/lib/copperplate/clockobj.c b/lib/copperplate/clockobj.c
index 05a14db..183a27a 100644
--- a/lib/copperplate/clockobj.c
+++ b/lib/copperplate/clockobj.c
@@ -283,6 +283,13 @@ int clockobj_set_resolution(struct clockobj *clkobj, 
unsigned int resolution_ns)
 #ifdef CONFIG_XENO_COBALT
 
 #include <cobalt/arith.h>
+#include <asm/xenomai/tsc.h>
+
+ticks_t clockobj_get_tsc(void)
+{
+       /* Guaranteed to be the source of CLOCK_COPPERPLATE. */
+       return __xn_rdtsc();
+}
 
 #ifndef CONFIG_XENO_LORES_CLOCK_DISABLED
 
@@ -328,6 +335,13 @@ void clockobj_get_date(struct clockobj *clkobj, ticks_t 
*pticks)
 
 #else /* CONFIG_XENO_MERCURY */
 
+ticks_t clockobj_get_tsc(void)
+{
+       struct timespec now;
+       __RT(clock_gettime(CLOCK_COPPERPLATE, &now));
+       return (ticks_t)now.tv_sec * 1000000000ULL + now.tv_nsec;
+}
+
 #ifndef CONFIG_XENO_LORES_CLOCK_DISABLED
 
 sticks_t clockobj_ns_to_ticks(struct clockobj *clkobj, sticks_t ns)


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

Reply via email to