v5 is sent
On 18.12.15 11:13, Savolainen, Petri (Nokia - FI/Espoo) wrote:
For APIs changes are OK otherwise but, wait functions could have warning that
the thread potentially busy loop the entire wait time.
Don’t break function prototypes into multiple lines. See under.
-----Original Message-----
From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT
Ivan Khoronzhuk
Sent: Thursday, December 17, 2015 6:31 PM
To: lng-odp@lists.linaro.org
Subject: [lng-odp] [API-NEXT PATCH v4 1/6] api: time: add resolution and
wait API calls
This patch adds odp_time_local_res() and odp_time_wait_until(),
odp_time_wait_ns() APIs.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronz...@linaro.org>
---
include/odp/api/time.h | 21 ++++++++
platform/linux-generic/odp_time.c | 100 ++++++++++++++++++++++++++++++---
-----
2 files changed, 101 insertions(+), 20 deletions(-)
diff --git a/include/odp/api/time.h b/include/odp/api/time.h
index 9865d81..3319c27 100644
--- a/include/odp/api/time.h
+++ b/include/odp/api/time.h
@@ -101,6 +101,27 @@ odp_time_t odp_time_local_from_ns(uint64_t ns);
int odp_time_cmp(odp_time_t t2, odp_time_t t1);
/**
+ * Local time resolution in hertz
+ *
+ * @return Local time resolution in hertz
+ */
+uint64_t odp_time_local_res(void);
+
+/**
+ * Wait until the specified (wall clock) time has been reached
+ *
+ * @param time Time to reach before continue
+ */
+void odp_time_wait_until(odp_time_t time);
+
+/**
+ * Wait the specified number of nanoseconds
+ *
+ * @param ns Time in nanoseconds to wait
+ */
+void odp_time_wait_ns(uint64_t ns);
+
+/**
* Get printable value for an odp_time_t
*
* @param time time to be printed
diff --git a/platform/linux-generic/odp_time.c b/platform/linux-
generic/odp_time.c
index 9b64b37..d86f5ed 100644
--- a/platform/linux-generic/odp_time.c
+++ b/platform/linux-generic/odp_time.c
@@ -45,7 +45,8 @@ odp_time_t time_diff(odp_time_t t2, odp_time_t t1)
return time;
}
-odp_time_t odp_time_local(void)
+static inline
+odp_time_t time_local(void)
{
int ret;
_odp_time_t time;
@@ -57,17 +58,36 @@ odp_time_t odp_time_local(void)
return time_diff(time.ex, start_time);
}
-odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1)
+static inline
+int time_cmp(odp_time_t t2, odp_time_t t1)
"static inline" should be on the same line. If 80 char limit is the problem,
break parameters into next line(s).
Not all of our static inlines are on the same line, but ~95% are and I think
all of those should be.
-Petri
--
Regards,
Ivan Khoronzhuk
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp