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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Jun 26 15:53:42 2014 +0200

lib/cobalt: rename __xn_rdtsc() to cobalt_read_tsc()

Reading the hardware time stamp counter is part of libcobalt's public
interface, so let's change the cryptic name for a clear one.

---

 lib/cobalt/arch/arm/include/asm/xenomai/tsc.h     |    2 +-
 lib/cobalt/arch/arm/tsc.c                         |    2 +-
 lib/cobalt/arch/nios2/include/asm/xenomai/tsc.h   |    2 +-
 lib/cobalt/arch/powerpc/include/asm/xenomai/tsc.h |    2 +-
 lib/cobalt/arch/sh/include/asm/xenomai/tsc.h      |    2 +-
 lib/cobalt/arch/x86/include/asm/xenomai/tsc.h     |    2 +-
 lib/cobalt/clock.c                                |    6 +++---
 lib/copperplate/clockobj.c                        |    6 +++---
 8 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/lib/cobalt/arch/arm/include/asm/xenomai/tsc.h 
b/lib/cobalt/arch/arm/include/asm/xenomai/tsc.h
index 39e3997..7885ad2 100644
--- a/lib/cobalt/arch/arm/include/asm/xenomai/tsc.h
+++ b/lib/cobalt/arch/arm/include/asm/xenomai/tsc.h
@@ -43,7 +43,7 @@ struct __xn_full_tscinfo {
 };
 extern struct __xn_full_tscinfo __xn_tscinfo;
 
-static inline unsigned long long __xn_rdtsc(void)
+static inline unsigned long long cobalt_read_tsc(void)
 {
 #if CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_KUSER
        return __xn_tscinfo.kuser_tsc_get(__xn_tscinfo.kinfo.counter);
diff --git a/lib/cobalt/arch/arm/tsc.c b/lib/cobalt/arch/arm/tsc.c
index 702487b..c063396 100644
--- a/lib/cobalt/arch/arm/tsc.c
+++ b/lib/cobalt/arch/arm/tsc.c
@@ -25,7 +25,7 @@
 #include <asm/xenomai/tsc.h>
 #include <asm/xenomai/features.h>
 
-unsigned long long __xn_rdtsc(void)
+unsigned long long cobalt_read_tsc(void)
 {
 #if CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_KUSER
        return __xn_tscinfo.kuser_tsc_get(__xn_tscinfo.kinfo.counter);
diff --git a/lib/cobalt/arch/nios2/include/asm/xenomai/tsc.h 
b/lib/cobalt/arch/nios2/include/asm/xenomai/tsc.h
index f2a4599..54e51dc 100644
--- a/lib/cobalt/arch/nios2/include/asm/xenomai/tsc.h
+++ b/lib/cobalt/arch/nios2/include/asm/xenomai/tsc.h
@@ -20,7 +20,7 @@
 
 extern volatile void *__cobalt_nios2_hrclock;
 
-static inline unsigned long long __xn_rdtsc(void)
+static inline unsigned long long cobalt_read_tsc(void)
 {
        volatile unsigned short *hrclock;
        int64_t t0, t1;
diff --git a/lib/cobalt/arch/powerpc/include/asm/xenomai/tsc.h 
b/lib/cobalt/arch/powerpc/include/asm/xenomai/tsc.h
index 596fa6b..3aeebf0 100644
--- a/lib/cobalt/arch/powerpc/include/asm/xenomai/tsc.h
+++ b/lib/cobalt/arch/powerpc/include/asm/xenomai/tsc.h
@@ -18,7 +18,7 @@
 #ifndef _LIB_COBALT_POWERPC_TSC_H
 #define _LIB_COBALT_POWERPC_TSC_H
 
-static inline unsigned long long __xn_rdtsc(void)
+static inline unsigned long long cobalt_read_tsc(void)
 {
 #if defined(__powerpc64__)
        unsigned long long t;
diff --git a/lib/cobalt/arch/sh/include/asm/xenomai/tsc.h 
b/lib/cobalt/arch/sh/include/asm/xenomai/tsc.h
index 2470d5f..3e5d51d 100644
--- a/lib/cobalt/arch/sh/include/asm/xenomai/tsc.h
+++ b/lib/cobalt/arch/sh/include/asm/xenomai/tsc.h
@@ -37,7 +37,7 @@ extern volatile struct xnarch_tsc_area *__cobalt_sh_tsc;
 
 extern volatile unsigned long *__cobalt_sh_tcnt;
 
-static inline unsigned long long __xn_rdtsc(void)
+static inline unsigned long long cobalt_read_tsc(void)
 {
        unsigned long long tsc;
        unsigned long low;
diff --git a/lib/cobalt/arch/x86/include/asm/xenomai/tsc.h 
b/lib/cobalt/arch/x86/include/asm/xenomai/tsc.h
index 9ff159e..6f3f5c4 100644
--- a/lib/cobalt/arch/x86/include/asm/xenomai/tsc.h
+++ b/lib/cobalt/arch/x86/include/asm/xenomai/tsc.h
@@ -19,7 +19,7 @@
 #ifndef _LIB_COBALT_X86_TSC_H
 #define _LIB_COBALT_X86_TSC_H
 
-static inline unsigned long long __xn_rdtsc(void)
+static inline unsigned long long cobalt_read_tsc(void)
 {
 #ifdef __i386__
        unsigned long long t;
diff --git a/lib/cobalt/clock.c b/lib/cobalt/clock.c
index 01593d9..f75f6ac 100644
--- a/lib/cobalt/clock.c
+++ b/lib/cobalt/clock.c
@@ -129,7 +129,7 @@ static int __do_clock_host_realtime(struct timespec *ts)
         * mechanism in the kernel.
         */
        unsynced_read_block(&tmp, &hostrt_data->lock) {
-               now = __xn_rdtsc();
+               now = cobalt_read_tsc();
                base = hostrt_data->cycle_last;
                mask = hostrt_data->mask;
                mult = hostrt_data->mult;
@@ -187,12 +187,12 @@ COBALT_IMPL(int, clock_gettime, (clockid_t clock_id, 
struct timespec *tp))
                break;
        case CLOCK_MONOTONIC:
        case CLOCK_MONOTONIC_RAW:
-               ns = cobalt_ticks_to_ns(__xn_rdtsc());
+               ns = cobalt_ticks_to_ns(cobalt_read_tsc());
                tp->tv_sec = cobalt_divrem_billion(ns, &rem);
                tp->tv_nsec = rem;
                return 0;
        case CLOCK_REALTIME:
-               ns = cobalt_ticks_to_ns(__xn_rdtsc());
+               ns = cobalt_ticks_to_ns(cobalt_read_tsc());
                ns += vdso->wallclock_offset;
                tp->tv_sec = cobalt_divrem_billion(ns, &rem);
                tp->tv_nsec = rem;
diff --git a/lib/copperplate/clockobj.c b/lib/copperplate/clockobj.c
index 36f9556..3ad568d 100644
--- a/lib/copperplate/clockobj.c
+++ b/lib/copperplate/clockobj.c
@@ -234,7 +234,7 @@ int clockobj_set_resolution(struct clockobj *clkobj, 
unsigned int resolution_ns)
 ticks_t clockobj_get_tsc(void)
 {
        /* Guaranteed to be the source of CLOCK_COPPERPLATE. */
-       return __xn_rdtsc();
+       return cobalt_read_tsc();
 }
 
 #ifndef CONFIG_XENO_LORES_CLOCK_DISABLED
@@ -252,7 +252,7 @@ void clockobj_get_time(struct clockobj *clkobj,
 {
        unsigned long long ns, tsc;
 
-       tsc = __xn_rdtsc();
+       tsc = cobalt_read_tsc();
        ns = cobalt_ticks_to_ns(tsc);
        if (clockobj_get_resolution(clkobj) > 1)
                ns /= clockobj_get_resolution(clkobj);
@@ -268,7 +268,7 @@ void clockobj_get_date(struct clockobj *clkobj, ticks_t 
*pticks)
 
        read_lock_nocancel(&clkobj->lock);
 
-       ns = cobalt_ticks_to_ns(__xn_rdtsc());
+       ns = cobalt_ticks_to_ns(cobalt_read_tsc());
        /* Add offset to epoch. */
        ns += (unsigned long long)clkobj->offset.tv_sec * 1000000000ULL;
        ns += clkobj->offset.tv_nsec;


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

Reply via email to