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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Sep  9 10:44:33 2014 +0200

cobalt/kernel: drop superfluous xntime_t

A Cobalt/POSIX time value is a count of ticks with each tick
representing a nanosecond, so xnticks_t can and should be used. We
don't deal with hardware time stamp counters at this level, so there
is no ambiguity.

---

 include/cobalt/kernel/sched-sporadic.h |    4 ++--
 include/cobalt/kernel/schedparam.h     |    4 ++--
 include/cobalt/uapi/kernel/types.h     |    4 ----
 kernel/cobalt/posix/clock.h            |    8 ++++----
 4 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/include/cobalt/kernel/sched-sporadic.h 
b/include/cobalt/kernel/sched-sporadic.h
index a4b4434..0eade47 100644
--- a/include/cobalt/kernel/sched-sporadic.h
+++ b/include/cobalt/kernel/sched-sporadic.h
@@ -38,8 +38,8 @@
 extern struct xnsched_class xnsched_class_sporadic;
 
 struct xnsched_sporadic_repl {
-       xntime_t date;
-       xntime_t amount;
+       xnticks_t date;
+       xnticks_t amount;
 };
 
 struct xnsched_sporadic_data {
diff --git a/include/cobalt/kernel/schedparam.h 
b/include/cobalt/kernel/schedparam.h
index 1fe9c31..9da95aa 100644
--- a/include/cobalt/kernel/schedparam.h
+++ b/include/cobalt/kernel/schedparam.h
@@ -42,8 +42,8 @@ struct xnsched_tp_param {
 };
 
 struct xnsched_sporadic_param {
-       xntime_t init_budget;
-       xntime_t repl_period;
+       xnticks_t init_budget;
+       xnticks_t repl_period;
        int max_repl;
        int low_prio;
        int normal_prio;
diff --git a/include/cobalt/uapi/kernel/types.h 
b/include/cobalt/uapi/kernel/types.h
index d2e5067..0c86a62 100644
--- a/include/cobalt/uapi/kernel/types.h
+++ b/include/cobalt/uapi/kernel/types.h
@@ -25,10 +25,6 @@ typedef __u64 xnticks_t;
 
 typedef __s64 xnsticks_t;
 
-typedef __u64 xntime_t; /* ns */
-
-typedef __s64 xnstime_t;
-
 typedef __u32 xnhandle_t;
 
 #define XN_NO_HANDLE ((xnhandle_t)0)
diff --git a/kernel/cobalt/posix/clock.h b/kernel/cobalt/posix/clock.h
index 8a601f9..75ff9f4 100644
--- a/kernel/cobalt/posix/clock.h
+++ b/kernel/cobalt/posix/clock.h
@@ -32,20 +32,20 @@ static inline void ns2ts(struct timespec *ts, xnticks_t 
nsecs)
 
 static inline xnticks_t ts2ns(const struct timespec *ts)
 {
-       xntime_t nsecs = ts->tv_nsec;
+       xnticks_t nsecs = ts->tv_nsec;
 
        if (ts->tv_sec)
-               nsecs += (xntime_t)ts->tv_sec * ONE_BILLION;
+               nsecs += (xnticks_t)ts->tv_sec * ONE_BILLION;
 
        return nsecs;
 }
 
 static inline xnticks_t tv2ns(const struct timeval *tv)
 {
-       xntime_t nsecs = tv->tv_usec * 1000;
+       xnticks_t nsecs = tv->tv_usec * 1000;
 
        if (tv->tv_sec)
-               nsecs += (xntime_t)tv->tv_sec * ONE_BILLION;
+               nsecs += (xnticks_t)tv->tv_sec * ONE_BILLION;
 
        return nsecs;
 }


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

Reply via email to