sched/clock/: Don't call up_timer_gettime in clock_gettime and clock_systimer to ensure the return value from them consistent with clock_systimespec

This commit is contained in:
Xiang Xiao
2018-11-12 06:52:56 -06:00
committed by Gregory Nutt
parent 46bd8798c5
commit f0c5c75042
2 changed files with 2 additions and 11 deletions
-9
View File
@@ -93,11 +93,7 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp)
* reset. * reset.
*/ */
#if defined(CONFIG_SCHED_TICKLESS)
ret = up_timer_gettime(tp);
#else
ret = clock_systimespec(tp); ret = clock_systimespec(tp);
#endif
} }
else else
#endif #endif
@@ -118,13 +114,8 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp)
#if defined(CONFIG_CLOCK_TIMEKEEPING) #if defined(CONFIG_CLOCK_TIMEKEEPING)
ret = clock_timekeeping_get_wall_time(tp); ret = clock_timekeeping_get_wall_time(tp);
#elif defined(CONFIG_SCHED_TICKLESS)
ret = up_timer_gettime(&ts);
#else #else
ret = clock_systimespec(&ts); ret = clock_systimespec(&ts);
#endif
#ifndef CONFIG_CLOCK_TIMEKEEPING
if (ret == OK) if (ret == OK)
{ {
irqstate_t flags; irqstate_t flags;
+2 -2
View File
@@ -97,7 +97,7 @@ clock_t clock_systimer(void)
/* Get the time from the platform specific hardware */ /* 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 */ /* Convert to a 64-bit value in microseconds, then in clock tick units */
@@ -110,7 +110,7 @@ clock_t clock_systimer(void)
/* Get the time from the platform specific hardware */ /* 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 */ /* Convert to a 64- then a 32-bit value */