Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed through on odp_time_t

2015-12-10 Thread Ivan Khoronzhuk



On 10.12.15 08:42, Maxim Uvarov wrote:

Going to apply this patch to unblock builds in new distros. Any objections?

Maxim.


I worry about change of timespec struct can break linux-generic time API.
I believe it will not happen, but that's why I like Maxim`s approach a little 
more.
[lng-odp] [API-NEXT PATCH 2/2] linux-generic: time: use same type as returned



On 12/09/2015 19:25, Ola Liljedahl wrote:

On 9 December 2015 at 16:53, Bill Fischofer > wrote:

The linux-generic implementation of odp_time_t makes use of POSIX
APIs that are sensitive to the _POSIX_C_SOURCE level. Use an
indirection
mechanism so that these dependencies do not "bleed through" the
ODP API.
This means that ODP applications can be independent of _POSIX_C_SOURCE
level.

Yes this is the way it should be done. This is also another step in the ODP API 
becoming binary portable and run-time independent of the actual implementation.


Signed-off-by: Bill Fischofer >
---
 .../linux-generic/include/odp/plat/time_types.h|  5 +++-
 platform/linux-generic/odp_time.c  | 27
+-
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/platform/linux-generic/include/odp/plat/time_types.h
b/platform/linux-generic/include/odp/plat/time_types.h
index e5765ec..05e2b59 100644
--- a/platform/linux-generic/include/odp/plat/time_types.h
+++ b/platform/linux-generic/include/odp/plat/time_types.h
@@ -21,7 +21,10 @@ extern "C" {
  *  @{
  **/

-typedef struct timespec odp_time_t;
+typedef struct {
+   uint64_t tv_sec;
+   int64_t  tv_nsec;
+} odp_time_t;

 odp_time_t odp_time_null(void);

diff --git a/platform/linux-generic/odp_time.c
b/platform/linux-generic/odp_time.c
index 1c7c214..b5737f6 100644
--- a/platform/linux-generic/odp_time.c
+++ b/platform/linux-generic/odp_time.c
@@ -11,7 +11,12 @@
 #include 
 #include 

-static struct timespec start_time;
+typedef union {
+   odp_time_t  ex;
+   struct timespec in;
+} _odp_time_t;
+
+static odp_time_t start_time;

 static inline
 uint64_t time_to_ns(odp_time_t time)
@@ -27,7 +32,7 @@ uint64_t time_to_ns(odp_time_t time)
 static inline
 odp_time_t time_diff(odp_time_t t2, odp_time_t t1)
 {
-   struct timespec time;
+   odp_time_t time;

time.tv_sec = t2.tv_sec - t1.tv_sec;
time.tv_nsec = t2.tv_nsec - t1.tv_nsec;
@@ -43,13 +48,13 @@ odp_time_t time_diff(odp_time_t t2, odp_time_t t1)
 odp_time_t odp_time_local(void)
 {
int ret;
-   struct timespec time;
+   _odp_time_t time;

-   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
+   ret = clock_gettime(CLOCK_MONOTONIC_RAW, 
);
if (odp_unlikely(ret != 0))
ODP_ABORT("clock_gettime failed\n");

-   return time_diff(time, start_time);
+   return time_diff(time.ex, start_time);
 }

 odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1)
@@ -64,7 +69,7 @@ uint64_t odp_time_to_ns(odp_time_t time)

 odp_time_t odp_time_local_from_ns(uint64_t ns)
 {
-   struct timespec time;
+   odp_time_t time;

time.tv_sec = ns / ODP_TIME_SEC_IN_NS;
time.tv_nsec = ns - time.tv_sec * ODP_TIME_SEC_IN_NS;
@@ -85,7 +90,7 @@ int odp_time_cmp(odp_time_t t2, odp_time_t t1)

 odp_time_t odp_time_sum(odp_time_t t1, odp_time_t t2)
 {
-   struct timespec time;
+   odp_time_t time;

time.tv_sec = t2.tv_sec + t1.tv_sec;
time.tv_nsec = t2.tv_nsec + t1.tv_nsec;
@@ -115,16 +120,16 @@ uint64_t odp_time_to_u64(odp_time_t time)

 odp_time_t odp_time_null(void)
 {
-   return (struct timespec) {0, 0};
+   return (odp_time_t) {0, 0};
 }

 int odp_time_global_init(void)
 {
int ret;
-   struct timespec time;
+   _odp_time_t time;

-   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
-   start_time = ret ? odp_time_null() : time;
+   ret = clock_gettime(CLOCK_MONOTONIC_RAW, 
);
+   start_time = ret ? odp_time_null() : time.ex;

return ret;
 }
--
2.1.4

___
lng-odp mailing list
lng-odp@lists.linaro.org 
https://lists.linaro.org/mailman/listinfo/lng-odp




___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


___
lng-odp mailing list
lng-odp@lists.linaro.org

Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed through on odp_time_t

2015-12-10 Thread Savolainen, Petri (Nokia - FI/Espoo)

> Signed-off-by: Bill Fischofer 
> ---
>  .../linux-generic/include/odp/plat/time_types.h|  5 +++-
>  platform/linux-generic/odp_time.c  | 27 +
> -
>  2 files changed, 20 insertions(+), 12 deletions(-)
> 
> diff --git a/platform/linux-generic/include/odp/plat/time_types.h
> b/platform/linux-generic/include/odp/plat/time_types.h
> index e5765ec..05e2b59 100644
> --- a/platform/linux-generic/include/odp/plat/time_types.h
> +++ b/platform/linux-generic/include/odp/plat/time_types.h
> @@ -21,7 +21,10 @@ extern "C" {
>   *  @{
>   **/
> 
> -typedef struct timespec odp_time_t;
> +typedef struct {
> + uint64_t tv_sec;
> + int64_t  tv_nsec;
> +} odp_time_t;


This struct should match timespec exactly. If that’s not possible, union should 
not be used but copy data between timespec and odp_time_t.

POSIX: "The  header shall declare the structure timespec, which has at 
least the following members:"

time_t  tv_secSeconds. 
longtv_nsec   Nanoseconds. 

int64_t is not long. I think we hit that previously this week. Long may be 32 
bits on a 32 bit system.

time_t is defined in C headers.

Also POSIX spec states that there can be more members than these. That hints 
that field order/offset and struct size may vary. At least the hack should be 
well documented and build/run time checked.

-Petri


> 
>  odp_time_t odp_time_null(void);
> 
> diff --git a/platform/linux-generic/odp_time.c b/platform/linux-
> generic/odp_time.c
> index 1c7c214..b5737f6 100644
> --- a/platform/linux-generic/odp_time.c
> +++ b/platform/linux-generic/odp_time.c
> @@ -11,7 +11,12 @@
>  #include 
>  #include 
> 
> -static struct timespec start_time;
> +typedef union {
> + odp_time_t  ex;
> + struct timespec in;
> +} _odp_time_t;
> +
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed through on odp_time_t

2015-12-10 Thread Savolainen, Petri (Nokia - FI/Espoo)


From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT Ola 
Liljedahl
Sent: Wednesday, December 09, 2015 6:26 PM
To: Bill Fischofer
Cc: LNG ODP Mailman List
Subject: Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed 
through on odp_time_t

On 9 December 2015 at 16:53, Bill Fischofer 
<bill.fischo...@linaro.org<mailto:bill.fischo...@linaro.org>> wrote:
The linux-generic implementation of odp_time_t makes use of POSIX
APIs that are sensitive to the _POSIX_C_SOURCE level. Use an indirection
mechanism so that these dependencies do not "bleed through" the ODP API.
This means that ODP applications can be independent of _POSIX_C_SOURCE
level.
Yes this is the way it should be done. This is also another step in the ODP API 
becoming binary portable and run-time independent of the actual implementation.

This definition is still platform (linux-generic) specific. It just redefines 
timespec struct, so that original timespec and thus posix level is not visible 
to application.

-Petri

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed through on odp_time_t

2015-12-10 Thread Maxim Uvarov

On 12/10/2015 11:21, Savolainen, Petri (Nokia - FI/Espoo) wrote:

Signed-off-by: Bill Fischofer 
---
  .../linux-generic/include/odp/plat/time_types.h|  5 +++-
  platform/linux-generic/odp_time.c  | 27 +
-
  2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/platform/linux-generic/include/odp/plat/time_types.h
b/platform/linux-generic/include/odp/plat/time_types.h
index e5765ec..05e2b59 100644
--- a/platform/linux-generic/include/odp/plat/time_types.h
+++ b/platform/linux-generic/include/odp/plat/time_types.h
@@ -21,7 +21,10 @@ extern "C" {
   *  @{
   **/

-typedef struct timespec odp_time_t;
+typedef struct {
+   uint64_t tv_sec;
+   int64_t  tv_nsec;
+} odp_time_t;


This struct should match timespec exactly. If that’s not possible, union should 
not be used but copy data between timespec and odp_time_t.

POSIX: "The  header shall declare the structure timespec, which has at least 
the following members:"

time_t  tv_secSeconds.
longtv_nsec   Nanoseconds.

int64_t is not long. I think we hit that previously this week. Long may be 32 
bits on a 32 bit system.

time_t is defined in C headers.

Also POSIX spec states that there can be more members than these. That hints 
that field order/offset and struct size may vary. At least the hack should be 
well documented and build/run time checked.

-Petri


Yes, Petri is right. Yesterday I went thought headers but did not see 
mismatch.

Both values are signed in linux:

struct timespec
  {
__time_t tv_sec;/* Seconds.  */
__syscall_slong_t tv_nsec;/* Nanoseconds.  */
  };

/* Signed long type used in system calls.  */
__STD_TYPE __SYSCALL_SLONG_TYPE __syscall_slong_t;

#if defined __x86_64__ && defined __ILP32__
# define __SYSCALL_SLONG_TYPE__SQUAD_TYPE
# define __SYSCALL_ULONG_TYPE__UQUAD_TYPE
#else
# define __SYSCALL_SLONG_TYPE__SLONGWORD_TYPE
# define __SYSCALL_ULONG_TYPE__ULONGWORD_TYPE
#endif

# define __SQUAD_TYPElong int
#define __SLONGWORD_TYPElong int

btw, time_t is also signed value:
__STD_TYPE __TIME_T_TYPE __time_t;/* Seconds since the Epoch. */
#define __TIME_T_TYPE__SYSCALL_SLONG_TYPE

But it's reachable from 

Question - why that values are signed in linux?

Maxim.





  odp_time_t odp_time_null(void);

diff --git a/platform/linux-generic/odp_time.c b/platform/linux-
generic/odp_time.c
index 1c7c214..b5737f6 100644
--- a/platform/linux-generic/odp_time.c
+++ b/platform/linux-generic/odp_time.c
@@ -11,7 +11,12 @@
  #include 
  #include 

-static struct timespec start_time;
+typedef union {
+   odp_time_t  ex;
+   struct timespec in;
+} _odp_time_t;
+

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed through on odp_time_t

2015-12-10 Thread Savolainen, Petri (Nokia - FI/Espoo)


From: EXT Ola Liljedahl [mailto:ola.liljed...@linaro.org]
Sent: Thursday, December 10, 2015 12:40 PM
To: Savolainen, Petri (Nokia - FI/Espoo)
Cc: Bill Fischofer; LNG ODP Mailman List
Subject: Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed 
through on odp_time_t



On 10 December 2015 at 09:30, Savolainen, Petri (Nokia - FI/Espoo) 
<petri.savolai...@nokia.com<mailto:petri.savolai...@nokia.com>> wrote:


From: lng-odp 
[mailto:lng-odp-boun...@lists.linaro.org<mailto:lng-odp-boun...@lists.linaro.org>]
 On Behalf Of EXT Ola Liljedahl
Sent: Wednesday, December 09, 2015 6:26 PM
To: Bill Fischofer
Cc: LNG ODP Mailman List
Subject: Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed 
through on odp_time_t

On 9 December 2015 at 16:53, Bill Fischofer 
<bill.fischo...@linaro.org<mailto:bill.fischo...@linaro.org>> wrote:
The linux-generic implementation of odp_time_t makes use of POSIX
APIs that are sensitive to the _POSIX_C_SOURCE level. Use an indirection
mechanism so that these dependencies do not "bleed through" the ODP API.
This means that ODP applications can be independent of _POSIX_C_SOURCE
level.
Yes this is the way it should be done. This is also another step in the ODP API 
becoming binary portable and run-time independent of the actual implementation.

This definition is still platform (linux-generic) specific. It just redefines 
timespec struct, so that original timespec and thus posix level is not visible 
to application.
For now it is platform specific but now when we have a definition which is 
decoupled from the underlying implementation, we can promote this to become the 
binary interface for all ODP implementations. I didn't say we are there yet.

It’s another exercise to define every handle and other platform specific types 
for a binary compatibility mode (e.g. for ARMv8). We could define odp_time_t 
(in binary compatibility mode) as plain “uint64_t nsec”. It’s large enough for 
>500 years.

-Petri


___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed through on odp_time_t

2015-12-10 Thread Ola Liljedahl
On 10 December 2015 at 09:40, Maxim Uvarov  wrote:

> On 12/10/2015 11:21, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>
>> Signed-off-by: Bill Fischofer 
>>> ---
>>>   .../linux-generic/include/odp/plat/time_types.h|  5 +++-
>>>   platform/linux-generic/odp_time.c  | 27
>>> +
>>> -
>>>   2 files changed, 20 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/platform/linux-generic/include/odp/plat/time_types.h
>>> b/platform/linux-generic/include/odp/plat/time_types.h
>>> index e5765ec..05e2b59 100644
>>> --- a/platform/linux-generic/include/odp/plat/time_types.h
>>> +++ b/platform/linux-generic/include/odp/plat/time_types.h
>>> @@ -21,7 +21,10 @@ extern "C" {
>>>*  @{
>>>**/
>>>
>>> -typedef struct timespec odp_time_t;
>>> +typedef struct {
>>> +   uint64_t tv_sec;
>>> +   int64_t  tv_nsec;
>>> +} odp_time_t;
>>>
>>
>> This struct should match timespec exactly. If that’s not possible, union
>> should not be used but copy data between timespec and odp_time_t.
>>
>> POSIX: "The  header shall declare the structure timespec, which
>> has at least the following members:"
>>
>> time_t  tv_secSeconds.
>> longtv_nsec   Nanoseconds.
>>
>> int64_t is not long. I think we hit that previously this week. Long may
>> be 32 bits on a 32 bit system.
>>
>> time_t is defined in C headers.
>>
>> Also POSIX spec states that there can be more members than these. That
>> hints that field order/offset and struct size may vary. At least the hack
>> should be well documented and build/run time checked.
>>
>> -Petri
>>
>
> Yes, Petri is right. Yesterday I went thought headers but did not see
> mismatch.
> Both values are signed in linux:
>
> struct timespec
>   {
> __time_t tv_sec;/* Seconds.  */
> __syscall_slong_t tv_nsec;/* Nanoseconds.  */
>   };
>
> /* Signed long type used in system calls.  */
> __STD_TYPE __SYSCALL_SLONG_TYPE __syscall_slong_t;
>
> #if defined __x86_64__ && defined __ILP32__
> # define __SYSCALL_SLONG_TYPE__SQUAD_TYPE
> # define __SYSCALL_ULONG_TYPE__UQUAD_TYPE
> #else
> # define __SYSCALL_SLONG_TYPE__SLONGWORD_TYPE
> # define __SYSCALL_ULONG_TYPE__ULONGWORD_TYPE
> #endif
>
> # define __SQUAD_TYPElong int
> #define __SLONGWORD_TYPElong int
>
> btw, time_t is also signed value:
> __STD_TYPE __TIME_T_TYPE __time_t;/* Seconds since the Epoch. */
> #define __TIME_T_TYPE__SYSCALL_SLONG_TYPE
>
> But it's reachable from 
>
> Question - why that values are signed in linux?

time_t has always been signed in Unix. Probably the original Unix
implementors were more interested in that past (before 1970) than in the
future (beyond year 2038).


>
>
> Maxim.
>
>
>
>>
>>   odp_time_t odp_time_null(void);
>>>
>>> diff --git a/platform/linux-generic/odp_time.c b/platform/linux-
>>> generic/odp_time.c
>>> index 1c7c214..b5737f6 100644
>>> --- a/platform/linux-generic/odp_time.c
>>> +++ b/platform/linux-generic/odp_time.c
>>> @@ -11,7 +11,12 @@
>>>   #include 
>>>   #include 
>>>
>>> -static struct timespec start_time;
>>> +typedef union {
>>> +   odp_time_t  ex;
>>> +   struct timespec in;
>>> +} _odp_time_t;
>>> +
>>>
>> ___
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed through on odp_time_t

2015-12-10 Thread Ola Liljedahl
On 10 December 2015 at 09:30, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolai...@nokia.com> wrote:

>
>
>
>
> *From:* lng-odp [mailto:lng-odp-boun...@lists.linaro.org] *On Behalf Of *EXT
> Ola Liljedahl
> *Sent:* Wednesday, December 09, 2015 6:26 PM
> *To:* Bill Fischofer
> *Cc:* LNG ODP Mailman List
> *Subject:* Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove
> posix bleed through on odp_time_t
>
>
>
> On 9 December 2015 at 16:53, Bill Fischofer <bill.fischo...@linaro.org>
> wrote:
>
> The linux-generic implementation of odp_time_t makes use of POSIX
> APIs that are sensitive to the _POSIX_C_SOURCE level. Use an indirection
> mechanism so that these dependencies do not "bleed through" the ODP API.
> This means that ODP applications can be independent of _POSIX_C_SOURCE
> level.
>
> Yes this is the way it should be done. This is also another step in the
> ODP API becoming binary portable and run-time independent of the actual
> implementation.
>
>
>
> This definition is still platform (linux-generic) specific. It just
> redefines timespec struct, so that original timespec and thus posix level
> is not visible to application.
>
For now it is platform specific but now when we have a definition which is
decoupled from the underlying implementation, we can promote this to become
the binary interface for all ODP implementations. I didn't say we are there
yet.



>
>
> -Petri
>
>
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed through on odp_time_t

2015-12-10 Thread Bill Fischofer
On Thu, Dec 10, 2015 at 2:05 AM, Ivan Khoronzhuk  wrote:

>
>
> On 10.12.15 08:42, Maxim Uvarov wrote:
>
>> Going to apply this patch to unblock builds in new distros. Any
>> objections?
>>
>> Maxim.
>>
>
> I worry about change of timespec struct can break linux-generic time API.
> I believe it will not happen, but that's why I like Maxim`s approach a
> little more.
> [lng-odp] [API-NEXT PATCH 2/2] linux-generic: time: use same type as
> returned



In the (unlikely) event that the struct changes and that change would be
made in a non-backward compatible manner, then inn that case ODP would
simply update the implementation to  match the new internal API while
maintaining the
external definition.  This might involve changing the union to do
intermediate copies, however for now the union is more efficient, which is
why that's the technique used here.


>
>
>> On 12/09/2015 19:25, Ola Liljedahl wrote:
>>
>>> On 9 December 2015 at 16:53, Bill Fischofer >> > wrote:
>>>
>>> The linux-generic implementation of odp_time_t makes use of POSIX
>>> APIs that are sensitive to the _POSIX_C_SOURCE level. Use an
>>> indirection
>>> mechanism so that these dependencies do not "bleed through" the
>>> ODP API.
>>> This means that ODP applications can be independent of
>>> _POSIX_C_SOURCE
>>> level.
>>>
>>> Yes this is the way it should be done. This is also another step in the
>>> ODP API becoming binary portable and run-time independent of the actual
>>> implementation.
>>>
>>>
>>> Signed-off-by: Bill Fischofer >> >
>>> ---
>>>  .../linux-generic/include/odp/plat/time_types.h|  5 +++-
>>>  platform/linux-generic/odp_time.c  | 27
>>> +-
>>>  2 files changed, 20 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/platform/linux-generic/include/odp/plat/time_types.h
>>> b/platform/linux-generic/include/odp/plat/time_types.h
>>> index e5765ec..05e2b59 100644
>>> --- a/platform/linux-generic/include/odp/plat/time_types.h
>>> +++ b/platform/linux-generic/include/odp/plat/time_types.h
>>> @@ -21,7 +21,10 @@ extern "C" {
>>>   *  @{
>>>   **/
>>>
>>> -typedef struct timespec odp_time_t;
>>> +typedef struct {
>>> +   uint64_t tv_sec;
>>> +   int64_t  tv_nsec;
>>> +} odp_time_t;
>>>
>>>  odp_time_t odp_time_null(void);
>>>
>>> diff --git a/platform/linux-generic/odp_time.c
>>> b/platform/linux-generic/odp_time.c
>>> index 1c7c214..b5737f6 100644
>>> --- a/platform/linux-generic/odp_time.c
>>> +++ b/platform/linux-generic/odp_time.c
>>> @@ -11,7 +11,12 @@
>>>  #include 
>>>  #include 
>>>
>>> -static struct timespec start_time;
>>> +typedef union {
>>> +   odp_time_t  ex;
>>> +   struct timespec in;
>>> +} _odp_time_t;
>>> +
>>> +static odp_time_t start_time;
>>>
>>>  static inline
>>>  uint64_t time_to_ns(odp_time_t time)
>>> @@ -27,7 +32,7 @@ uint64_t time_to_ns(odp_time_t time)
>>>  static inline
>>>  odp_time_t time_diff(odp_time_t t2, odp_time_t t1)
>>>  {
>>> -   struct timespec time;
>>> +   odp_time_t time;
>>>
>>> time.tv_sec = t2.tv_sec - t1.tv_sec;
>>> time.tv_nsec = t2.tv_nsec - t1.tv_nsec;
>>> @@ -43,13 +48,13 @@ odp_time_t time_diff(odp_time_t t2, odp_time_t
>>> t1)
>>>  odp_time_t odp_time_local(void)
>>>  {
>>> int ret;
>>> -   struct timespec time;
>>> +   _odp_time_t time;
>>>
>>> -   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
>>> +   ret = clock_gettime(CLOCK_MONOTONIC_RAW, 
>>> );
>>> if (odp_unlikely(ret != 0))
>>> ODP_ABORT("clock_gettime failed\n");
>>>
>>> -   return time_diff(time, start_time);
>>> +   return time_diff(time.ex, start_time);
>>>  }
>>>
>>>  odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1)
>>> @@ -64,7 +69,7 @@ uint64_t odp_time_to_ns(odp_time_t time)
>>>
>>>  odp_time_t odp_time_local_from_ns(uint64_t ns)
>>>  {
>>> -   struct timespec time;
>>> +   odp_time_t time;
>>>
>>> time.tv_sec = ns / ODP_TIME_SEC_IN_NS;
>>> time.tv_nsec = ns - time.tv_sec * ODP_TIME_SEC_IN_NS;
>>> @@ -85,7 +90,7 @@ int odp_time_cmp(odp_time_t t2, odp_time_t t1)
>>>
>>>  odp_time_t odp_time_sum(odp_time_t t1, odp_time_t t2)
>>>  {
>>> -   struct timespec time;
>>> +   odp_time_t time;
>>>
>>> time.tv_sec = t2.tv_sec + t1.tv_sec;
>>> time.tv_nsec = t2.tv_nsec + t1.tv_nsec;
>>> @@ -115,16 +120,16 @@ uint64_t odp_time_to_u64(odp_time_t time)
>>>
>>>  odp_time_t odp_time_null(void)
>>>  {
>>> -   return (struct timespec) {0, 

Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed through on odp_time_t

2015-12-10 Thread Mike Holmes
Is anyone following the OFP project, they are also discussing this struct
from a user of ODPs perspctive on a couple of threads like
http://www.openfastpath.org/pipermail/openfastpath/2015-December/48.html

On 10 December 2015 at 08:07, Bill Fischofer 
wrote:

>
>
> On Thu, Dec 10, 2015 at 2:05 AM, Ivan Khoronzhuk <
> ivan.khoronz...@linaro.org> wrote:
>
>>
>>
>> On 10.12.15 08:42, Maxim Uvarov wrote:
>>
>>> Going to apply this patch to unblock builds in new distros. Any
>>> objections?
>>>
>>> Maxim.
>>>
>>
>> I worry about change of timespec struct can break linux-generic time API.
>> I believe it will not happen, but that's why I like Maxim`s approach a
>> little more.
>> [lng-odp] [API-NEXT PATCH 2/2] linux-generic: time: use same type as
>> returned
>
>
>
> In the (unlikely) event that the struct changes and that change would be
> made in a non-backward compatible manner, then inn that case ODP would
> simply update the implementation to  match the new internal API while
> maintaining the
> external definition.  This might involve changing the union to do
> intermediate copies, however for now the union is more efficient, which is
> why that's the technique used here.
>
>
>>
>>
>>> On 12/09/2015 19:25, Ola Liljedahl wrote:
>>>
 On 9 December 2015 at 16:53, Bill Fischofer > wrote:

 The linux-generic implementation of odp_time_t makes use of POSIX
 APIs that are sensitive to the _POSIX_C_SOURCE level. Use an
 indirection
 mechanism so that these dependencies do not "bleed through" the
 ODP API.
 This means that ODP applications can be independent of
 _POSIX_C_SOURCE
 level.

 Yes this is the way it should be done. This is also another step in the
 ODP API becoming binary portable and run-time independent of the actual
 implementation.


 Signed-off-by: Bill Fischofer >
 ---
  .../linux-generic/include/odp/plat/time_types.h|  5 +++-
  platform/linux-generic/odp_time.c  | 27
 +-
  2 files changed, 20 insertions(+), 12 deletions(-)

 diff --git a/platform/linux-generic/include/odp/plat/time_types.h
 b/platform/linux-generic/include/odp/plat/time_types.h
 index e5765ec..05e2b59 100644
 --- a/platform/linux-generic/include/odp/plat/time_types.h
 +++ b/platform/linux-generic/include/odp/plat/time_types.h
 @@ -21,7 +21,10 @@ extern "C" {
   *  @{
   **/

 -typedef struct timespec odp_time_t;
 +typedef struct {
 +   uint64_t tv_sec;
 +   int64_t  tv_nsec;
 +} odp_time_t;

  odp_time_t odp_time_null(void);

 diff --git a/platform/linux-generic/odp_time.c
 b/platform/linux-generic/odp_time.c
 index 1c7c214..b5737f6 100644
 --- a/platform/linux-generic/odp_time.c
 +++ b/platform/linux-generic/odp_time.c
 @@ -11,7 +11,12 @@
  #include 
  #include 

 -static struct timespec start_time;
 +typedef union {
 +   odp_time_t  ex;
 +   struct timespec in;
 +} _odp_time_t;
 +
 +static odp_time_t start_time;

  static inline
  uint64_t time_to_ns(odp_time_t time)
 @@ -27,7 +32,7 @@ uint64_t time_to_ns(odp_time_t time)
  static inline
  odp_time_t time_diff(odp_time_t t2, odp_time_t t1)
  {
 -   struct timespec time;
 +   odp_time_t time;

 time.tv_sec = t2.tv_sec - t1.tv_sec;
 time.tv_nsec = t2.tv_nsec - t1.tv_nsec;
 @@ -43,13 +48,13 @@ odp_time_t time_diff(odp_time_t t2, odp_time_t
 t1)
  odp_time_t odp_time_local(void)
  {
 int ret;
 -   struct timespec time;
 +   _odp_time_t time;

 -   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
 +   ret = clock_gettime(CLOCK_MONOTONIC_RAW, 
 );
 if (odp_unlikely(ret != 0))
 ODP_ABORT("clock_gettime failed\n");

 -   return time_diff(time, start_time);
 +   return time_diff(time.ex, start_time);
  }

  odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1)
 @@ -64,7 +69,7 @@ uint64_t odp_time_to_ns(odp_time_t time)

  odp_time_t odp_time_local_from_ns(uint64_t ns)
  {
 -   struct timespec time;
 +   odp_time_t time;

 time.tv_sec = ns / ODP_TIME_SEC_IN_NS;
 time.tv_nsec = ns - time.tv_sec * ODP_TIME_SEC_IN_NS;
 @@ -85,7 +90,7 @@ int odp_time_cmp(odp_time_t t2, odp_time_t 

Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed through on odp_time_t

2015-12-10 Thread Bill Fischofer
Thanks.  I'll pop over to that thread to take a look.  However odp_time_t
should be opaque from a user perspective--that's the purpose of having
abstract types in the first place.

On Thu, Dec 10, 2015 at 9:00 AM, Mike Holmes  wrote:

> Is anyone following the OFP project, they are also discussing this struct
> from a user of ODPs perspctive on a couple of threads like
> http://www.openfastpath.org/pipermail/openfastpath/2015-December/48.html
>
> On 10 December 2015 at 08:07, Bill Fischofer 
> wrote:
>
>>
>>
>> On Thu, Dec 10, 2015 at 2:05 AM, Ivan Khoronzhuk <
>> ivan.khoronz...@linaro.org> wrote:
>>
>>>
>>>
>>> On 10.12.15 08:42, Maxim Uvarov wrote:
>>>
 Going to apply this patch to unblock builds in new distros. Any
 objections?

 Maxim.

>>>
>>> I worry about change of timespec struct can break linux-generic time API.
>>> I believe it will not happen, but that's why I like Maxim`s approach a
>>> little more.
>>> [lng-odp] [API-NEXT PATCH 2/2] linux-generic: time: use same type as
>>> returned
>>
>>
>>
>> In the (unlikely) event that the struct changes and that change would be
>> made in a non-backward compatible manner, then inn that case ODP would
>> simply update the implementation to  match the new internal API while
>> maintaining the
>> external definition.  This might involve changing the union to do
>> intermediate copies, however for now the union is more efficient, which is
>> why that's the technique used here.
>>
>>
>>>
>>>
 On 12/09/2015 19:25, Ola Liljedahl wrote:

> On 9 December 2015 at 16:53, Bill Fischofer  > wrote:
>
> The linux-generic implementation of odp_time_t makes use of POSIX
> APIs that are sensitive to the _POSIX_C_SOURCE level. Use an
> indirection
> mechanism so that these dependencies do not "bleed through" the
> ODP API.
> This means that ODP applications can be independent of
> _POSIX_C_SOURCE
> level.
>
> Yes this is the way it should be done. This is also another step in
> the ODP API becoming binary portable and run-time independent of the 
> actual
> implementation.
>
>
> Signed-off-by: Bill Fischofer  >
> ---
>  .../linux-generic/include/odp/plat/time_types.h|  5 +++-
>  platform/linux-generic/odp_time.c  | 27
> +-
>  2 files changed, 20 insertions(+), 12 deletions(-)
>
> diff --git a/platform/linux-generic/include/odp/plat/time_types.h
> b/platform/linux-generic/include/odp/plat/time_types.h
> index e5765ec..05e2b59 100644
> --- a/platform/linux-generic/include/odp/plat/time_types.h
> +++ b/platform/linux-generic/include/odp/plat/time_types.h
> @@ -21,7 +21,10 @@ extern "C" {
>   *  @{
>   **/
>
> -typedef struct timespec odp_time_t;
> +typedef struct {
> +   uint64_t tv_sec;
> +   int64_t  tv_nsec;
> +} odp_time_t;
>
>  odp_time_t odp_time_null(void);
>
> diff --git a/platform/linux-generic/odp_time.c
> b/platform/linux-generic/odp_time.c
> index 1c7c214..b5737f6 100644
> --- a/platform/linux-generic/odp_time.c
> +++ b/platform/linux-generic/odp_time.c
> @@ -11,7 +11,12 @@
>  #include 
>  #include 
>
> -static struct timespec start_time;
> +typedef union {
> +   odp_time_t  ex;
> +   struct timespec in;
> +} _odp_time_t;
> +
> +static odp_time_t start_time;
>
>  static inline
>  uint64_t time_to_ns(odp_time_t time)
> @@ -27,7 +32,7 @@ uint64_t time_to_ns(odp_time_t time)
>  static inline
>  odp_time_t time_diff(odp_time_t t2, odp_time_t t1)
>  {
> -   struct timespec time;
> +   odp_time_t time;
>
> time.tv_sec = t2.tv_sec - t1.tv_sec;
> time.tv_nsec = t2.tv_nsec - t1.tv_nsec;
> @@ -43,13 +48,13 @@ odp_time_t time_diff(odp_time_t t2, odp_time_t
> t1)
>  odp_time_t odp_time_local(void)
>  {
> int ret;
> -   struct timespec time;
> +   _odp_time_t time;
>
> -   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
> +   ret = clock_gettime(CLOCK_MONOTONIC_RAW, 
> );
> if (odp_unlikely(ret != 0))
> ODP_ABORT("clock_gettime failed\n");
>
> -   return time_diff(time, start_time);
> +   return time_diff(time.ex, start_time);
>  }
>
>  odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1)
> @@ 

Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed through on odp_time_t

2015-12-09 Thread Ola Liljedahl
On 9 December 2015 at 16:53, Bill Fischofer 
wrote:

> The linux-generic implementation of odp_time_t makes use of POSIX
> APIs that are sensitive to the _POSIX_C_SOURCE level. Use an indirection
> mechanism so that these dependencies do not "bleed through" the ODP API.
> This means that ODP applications can be independent of _POSIX_C_SOURCE
> level.
>
Yes this is the way it should be done. This is also another step in the ODP
API becoming binary portable and run-time independent of the actual
implementation.


>
> Signed-off-by: Bill Fischofer 
> ---
>  .../linux-generic/include/odp/plat/time_types.h|  5 +++-
>  platform/linux-generic/odp_time.c  | 27
> +-
>  2 files changed, 20 insertions(+), 12 deletions(-)
>
> diff --git a/platform/linux-generic/include/odp/plat/time_types.h
> b/platform/linux-generic/include/odp/plat/time_types.h
> index e5765ec..05e2b59 100644
> --- a/platform/linux-generic/include/odp/plat/time_types.h
> +++ b/platform/linux-generic/include/odp/plat/time_types.h
> @@ -21,7 +21,10 @@ extern "C" {
>   *  @{
>   **/
>
> -typedef struct timespec odp_time_t;
> +typedef struct {
> +   uint64_t tv_sec;
> +   int64_t  tv_nsec;
> +} odp_time_t;
>
>  odp_time_t odp_time_null(void);
>
> diff --git a/platform/linux-generic/odp_time.c
> b/platform/linux-generic/odp_time.c
> index 1c7c214..b5737f6 100644
> --- a/platform/linux-generic/odp_time.c
> +++ b/platform/linux-generic/odp_time.c
> @@ -11,7 +11,12 @@
>  #include 
>  #include 
>
> -static struct timespec start_time;
> +typedef union {
> +   odp_time_t  ex;
> +   struct timespec in;
> +} _odp_time_t;
> +
> +static odp_time_t start_time;
>
>  static inline
>  uint64_t time_to_ns(odp_time_t time)
> @@ -27,7 +32,7 @@ uint64_t time_to_ns(odp_time_t time)
>  static inline
>  odp_time_t time_diff(odp_time_t t2, odp_time_t t1)
>  {
> -   struct timespec time;
> +   odp_time_t time;
>
> time.tv_sec = t2.tv_sec - t1.tv_sec;
> time.tv_nsec = t2.tv_nsec - t1.tv_nsec;
> @@ -43,13 +48,13 @@ odp_time_t time_diff(odp_time_t t2, odp_time_t t1)
>  odp_time_t odp_time_local(void)
>  {
> int ret;
> -   struct timespec time;
> +   _odp_time_t time;
>
> -   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
> +   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
> if (odp_unlikely(ret != 0))
> ODP_ABORT("clock_gettime failed\n");
>
> -   return time_diff(time, start_time);
> +   return time_diff(time.ex, start_time);
>  }
>
>  odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1)
> @@ -64,7 +69,7 @@ uint64_t odp_time_to_ns(odp_time_t time)
>
>  odp_time_t odp_time_local_from_ns(uint64_t ns)
>  {
> -   struct timespec time;
> +   odp_time_t time;
>
> time.tv_sec = ns / ODP_TIME_SEC_IN_NS;
> time.tv_nsec = ns - time.tv_sec * ODP_TIME_SEC_IN_NS;
> @@ -85,7 +90,7 @@ int odp_time_cmp(odp_time_t t2, odp_time_t t1)
>
>  odp_time_t odp_time_sum(odp_time_t t1, odp_time_t t2)
>  {
> -   struct timespec time;
> +   odp_time_t time;
>
> time.tv_sec = t2.tv_sec + t1.tv_sec;
> time.tv_nsec = t2.tv_nsec + t1.tv_nsec;
> @@ -115,16 +120,16 @@ uint64_t odp_time_to_u64(odp_time_t time)
>
>  odp_time_t odp_time_null(void)
>  {
> -   return (struct timespec) {0, 0};
> +   return (odp_time_t) {0, 0};
>  }
>
>  int odp_time_global_init(void)
>  {
> int ret;
> -   struct timespec time;
> +   _odp_time_t time;
>
> -   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
> -   start_time = ret ? odp_time_null() : time;
> +   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
> +   start_time = ret ? odp_time_null() : time.ex;
>
> return ret;
>  }
> --
> 2.1.4
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed through on odp_time_t

2015-12-09 Thread Bill Fischofer
The linux-generic implementation of odp_time_t makes use of POSIX
APIs that are sensitive to the _POSIX_C_SOURCE level. Use an indirection
mechanism so that these dependencies do not "bleed through" the ODP API.
This means that ODP applications can be independent of _POSIX_C_SOURCE
level.

Signed-off-by: Bill Fischofer 
---
 .../linux-generic/include/odp/plat/time_types.h|  5 +++-
 platform/linux-generic/odp_time.c  | 27 +-
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/platform/linux-generic/include/odp/plat/time_types.h 
b/platform/linux-generic/include/odp/plat/time_types.h
index e5765ec..05e2b59 100644
--- a/platform/linux-generic/include/odp/plat/time_types.h
+++ b/platform/linux-generic/include/odp/plat/time_types.h
@@ -21,7 +21,10 @@ extern "C" {
  *  @{
  **/
 
-typedef struct timespec odp_time_t;
+typedef struct {
+   uint64_t tv_sec;
+   int64_t  tv_nsec;
+} odp_time_t;
 
 odp_time_t odp_time_null(void);
 
diff --git a/platform/linux-generic/odp_time.c 
b/platform/linux-generic/odp_time.c
index 1c7c214..b5737f6 100644
--- a/platform/linux-generic/odp_time.c
+++ b/platform/linux-generic/odp_time.c
@@ -11,7 +11,12 @@
 #include 
 #include 
 
-static struct timespec start_time;
+typedef union {
+   odp_time_t  ex;
+   struct timespec in;
+} _odp_time_t;
+
+static odp_time_t start_time;
 
 static inline
 uint64_t time_to_ns(odp_time_t time)
@@ -27,7 +32,7 @@ uint64_t time_to_ns(odp_time_t time)
 static inline
 odp_time_t time_diff(odp_time_t t2, odp_time_t t1)
 {
-   struct timespec time;
+   odp_time_t time;
 
time.tv_sec = t2.tv_sec - t1.tv_sec;
time.tv_nsec = t2.tv_nsec - t1.tv_nsec;
@@ -43,13 +48,13 @@ odp_time_t time_diff(odp_time_t t2, odp_time_t t1)
 odp_time_t odp_time_local(void)
 {
int ret;
-   struct timespec time;
+   _odp_time_t time;
 
-   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
+   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
if (odp_unlikely(ret != 0))
ODP_ABORT("clock_gettime failed\n");
 
-   return time_diff(time, start_time);
+   return time_diff(time.ex, start_time);
 }
 
 odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1)
@@ -64,7 +69,7 @@ uint64_t odp_time_to_ns(odp_time_t time)
 
 odp_time_t odp_time_local_from_ns(uint64_t ns)
 {
-   struct timespec time;
+   odp_time_t time;
 
time.tv_sec = ns / ODP_TIME_SEC_IN_NS;
time.tv_nsec = ns - time.tv_sec * ODP_TIME_SEC_IN_NS;
@@ -85,7 +90,7 @@ int odp_time_cmp(odp_time_t t2, odp_time_t t1)
 
 odp_time_t odp_time_sum(odp_time_t t1, odp_time_t t2)
 {
-   struct timespec time;
+   odp_time_t time;
 
time.tv_sec = t2.tv_sec + t1.tv_sec;
time.tv_nsec = t2.tv_nsec + t1.tv_nsec;
@@ -115,16 +120,16 @@ uint64_t odp_time_to_u64(odp_time_t time)
 
 odp_time_t odp_time_null(void)
 {
-   return (struct timespec) {0, 0};
+   return (odp_time_t) {0, 0};
 }
 
 int odp_time_global_init(void)
 {
int ret;
-   struct timespec time;
+   _odp_time_t time;
 
-   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
-   start_time = ret ? odp_time_null() : time;
+   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
+   start_time = ret ? odp_time_null() : time.ex;
 
return ret;
 }
-- 
2.1.4

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT PATCH] linux-generic: time: remove posix bleed through on odp_time_t

2015-12-09 Thread Maxim Uvarov

Going to apply this patch to unblock builds in new distros. Any objections?

Maxim.

On 12/09/2015 19:25, Ola Liljedahl wrote:
On 9 December 2015 at 16:53, Bill Fischofer > wrote:


The linux-generic implementation of odp_time_t makes use of POSIX
APIs that are sensitive to the _POSIX_C_SOURCE level. Use an
indirection
mechanism so that these dependencies do not "bleed through" the
ODP API.
This means that ODP applications can be independent of _POSIX_C_SOURCE
level.

Yes this is the way it should be done. This is also another step in 
the ODP API becoming binary portable and run-time independent of the 
actual implementation.



Signed-off-by: Bill Fischofer >
---
 .../linux-generic/include/odp/plat/time_types.h|  5 +++-
 platform/linux-generic/odp_time.c  | 27
+-
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/platform/linux-generic/include/odp/plat/time_types.h
b/platform/linux-generic/include/odp/plat/time_types.h
index e5765ec..05e2b59 100644
--- a/platform/linux-generic/include/odp/plat/time_types.h
+++ b/platform/linux-generic/include/odp/plat/time_types.h
@@ -21,7 +21,10 @@ extern "C" {
  *  @{
  **/

-typedef struct timespec odp_time_t;
+typedef struct {
+   uint64_t tv_sec;
+   int64_t  tv_nsec;
+} odp_time_t;

 odp_time_t odp_time_null(void);

diff --git a/platform/linux-generic/odp_time.c
b/platform/linux-generic/odp_time.c
index 1c7c214..b5737f6 100644
--- a/platform/linux-generic/odp_time.c
+++ b/platform/linux-generic/odp_time.c
@@ -11,7 +11,12 @@
 #include 
 #include 

-static struct timespec start_time;
+typedef union {
+   odp_time_t  ex;
+   struct timespec in;
+} _odp_time_t;
+
+static odp_time_t start_time;

 static inline
 uint64_t time_to_ns(odp_time_t time)
@@ -27,7 +32,7 @@ uint64_t time_to_ns(odp_time_t time)
 static inline
 odp_time_t time_diff(odp_time_t t2, odp_time_t t1)
 {
-   struct timespec time;
+   odp_time_t time;

time.tv_sec = t2.tv_sec - t1.tv_sec;
time.tv_nsec = t2.tv_nsec - t1.tv_nsec;
@@ -43,13 +48,13 @@ odp_time_t time_diff(odp_time_t t2, odp_time_t t1)
 odp_time_t odp_time_local(void)
 {
int ret;
-   struct timespec time;
+   _odp_time_t time;

-   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
+   ret = clock_gettime(CLOCK_MONOTONIC_RAW, 
);
if (odp_unlikely(ret != 0))
ODP_ABORT("clock_gettime failed\n");

-   return time_diff(time, start_time);
+   return time_diff(time.ex, start_time);
 }

 odp_time_t odp_time_diff(odp_time_t t2, odp_time_t t1)
@@ -64,7 +69,7 @@ uint64_t odp_time_to_ns(odp_time_t time)

 odp_time_t odp_time_local_from_ns(uint64_t ns)
 {
-   struct timespec time;
+   odp_time_t time;

time.tv_sec = ns / ODP_TIME_SEC_IN_NS;
time.tv_nsec = ns - time.tv_sec * ODP_TIME_SEC_IN_NS;
@@ -85,7 +90,7 @@ int odp_time_cmp(odp_time_t t2, odp_time_t t1)

 odp_time_t odp_time_sum(odp_time_t t1, odp_time_t t2)
 {
-   struct timespec time;
+   odp_time_t time;

time.tv_sec = t2.tv_sec + t1.tv_sec;
time.tv_nsec = t2.tv_nsec + t1.tv_nsec;
@@ -115,16 +120,16 @@ uint64_t odp_time_to_u64(odp_time_t time)

 odp_time_t odp_time_null(void)
 {
-   return (struct timespec) {0, 0};
+   return (odp_time_t) {0, 0};
 }

 int odp_time_global_init(void)
 {
int ret;
-   struct timespec time;
+   _odp_time_t time;

-   ret = clock_gettime(CLOCK_MONOTONIC_RAW, );
-   start_time = ret ? odp_time_null() : time;
+   ret = clock_gettime(CLOCK_MONOTONIC_RAW, 
);
+   start_time = ret ? odp_time_null() : time.ex;

return ret;
 }
--
2.1.4

___
lng-odp mailing list
lng-odp@lists.linaro.org 
https://lists.linaro.org/mailman/listinfo/lng-odp




___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp