Skip to content

Commit

Permalink
linux: avoid using CLOCK_SGI_CYCLE, use METHOD
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Hartmann committed Jan 14, 2018
1 parent 8fdc7b7 commit c68b27d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/cycle.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ INLINE_ELAPSED(__inline)
#endif
/*----------------------------------------------------------------*/
/* SGI/Irix/Linux but not android */
#if !defined(__ANDROID__)
#if defined(HAVE_CLOCK_GETTIME) && !defined(HAVE_TICK_COUNTER)
#if !defined(__ANDROID__) && !defined(HAVE_TICK_COUNTER)
#if defined(HAVE_CLOCK_GETTIME)
#if defined(CLOCK_MONOTONIC)
#define METHOD CLOCK_MONOTONIC
#elif defined(CLOCK_REALTIME)
Expand All @@ -454,7 +454,7 @@ typedef struct timespec ticks;
static inline ticks getticks(void)
{
struct timespec t;
clock_gettime(CLOCK_SGI_CYCLE, &t);
clock_gettime(METHOD, &t);
return t;
}

Expand Down

1 comment on commit c68b27d

@SETIguy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I not sure why these would not be acceptable for android. I think you can just go with !defined(HAVE_TICK_COUNTER).

Please sign in to comment.