mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
sched/clock: Remove CLOCK_MONOTONIC option from Kconfig
here is the reason: 1.clock_systime_timespec(core function) always exist regardless the setting 2.CLOCK_MONOTONIC is a foundamental clock type required by many places Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
@@ -182,7 +182,7 @@
|
||||
#define TICK2SEC(tick) (((tick)+(TICK_PER_SEC/2))/TICK_PER_SEC) /* Rounds */
|
||||
|
||||
#if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_SYSTEM_TIME64) && \
|
||||
defined(CONFIG_CLOCK_MONOTONIC) && !defined(CONFIG_SCHED_TICKLESS)
|
||||
!defined(CONFIG_SCHED_TICKLESS)
|
||||
/* Initial system timer ticks value close to maximum 32-bit value, to test
|
||||
* 64-bit system-timer after going over 32-bit value. This is to make errors
|
||||
* of casting 64-bit system-timer to 32-bit variables more visible.
|
||||
|
||||
@@ -204,11 +204,7 @@ static inline uint64_t touch_get_time(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
#ifdef CONFIG_CLOCK_MONOTONIC
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
#else
|
||||
clock_gettime(CLOCK_REALTIME, &ts);
|
||||
#endif
|
||||
return 1000000ull * ts.tv_sec + ts.tv_nsec / 1000;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,12 +44,7 @@ static inline uint64_t lirc_get_timestamp(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
#ifdef CONFIG_CLOCK_MONOTONIC
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
#else
|
||||
clock_gettime(CLOCK_REALTIME, &ts);
|
||||
#endif
|
||||
|
||||
return 1000000000ull * ts.tv_sec + ts.tv_nsec;
|
||||
}
|
||||
|
||||
|
||||
@@ -283,12 +283,7 @@ static inline uint64_t sensor_get_timestamp(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
#ifdef CONFIG_CLOCK_MONOTONIC
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
#else
|
||||
clock_gettime(CLOCK_REALTIME, &ts);
|
||||
#endif
|
||||
|
||||
return 1000000ull * ts.tv_sec + ts.tv_nsec / 1000;
|
||||
}
|
||||
|
||||
|
||||
+2
-6
@@ -71,15 +71,11 @@
|
||||
* system time-of-day clock.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_CLOCK_MONOTONIC
|
||||
# define CLOCK_MONOTONIC 1
|
||||
#endif
|
||||
#define CLOCK_MONOTONIC 1
|
||||
|
||||
/* Monotonic system-wide clock that includes time spent in suspension. */
|
||||
|
||||
#ifdef CONFIG_CLOCK_MONOTONIC
|
||||
# define CLOCK_BOOTTIME 2
|
||||
#endif
|
||||
#define CLOCK_BOOTTIME 2
|
||||
|
||||
/* This is a flag that may be passed to the timer_settime() and
|
||||
* clock_nanosleep() functions.
|
||||
|
||||
Reference in New Issue
Block a user