Skip to content

Commit

Permalink
sched/clock/: Don't call up_timer_gettime in clock_gettime and clock_…
Browse files Browse the repository at this point in the history
…systimer to ensure the return value from them consistent with clock_systimespec
  • Loading branch information
xiaoxiang781216 authored and gregory-nutt committed Nov 12, 2018
1 parent 46bd879 commit f0c5c75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
9 changes: 0 additions & 9 deletions sched/clock/clock_gettime.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp)
* reset.
*/

#if defined(CONFIG_SCHED_TICKLESS)
ret = up_timer_gettime(tp);
#else
ret = clock_systimespec(tp);
#endif
}
else
#endif
Expand All @@ -118,13 +114,8 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp)

#if defined(CONFIG_CLOCK_TIMEKEEPING)
ret = clock_timekeeping_get_wall_time(tp);
#elif defined(CONFIG_SCHED_TICKLESS)
ret = up_timer_gettime(&ts);
#else
ret = clock_systimespec(&ts);
#endif

#ifndef CONFIG_CLOCK_TIMEKEEPING
if (ret == OK)
{
irqstate_t flags;
Expand Down
4 changes: 2 additions & 2 deletions sched/clock/clock_systimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ clock_t clock_systimer(void)

/* Get the time from the platform specific hardware */

(void)up_timer_gettime(&ts);
(void)clock_systimespec(&ts);

/* Convert to a 64-bit value in microseconds, then in clock tick units */

Expand All @@ -110,7 +110,7 @@ clock_t clock_systimer(void)

/* Get the time from the platform specific hardware */

(void)up_timer_gettime(&ts);
(void)clock_systimespec(&ts);

/* Convert to a 64- then a 32-bit value */

Expand Down

0 comments on commit f0c5c75

Please sign in to comment.