From 2256946e9c0bc452004521d7aeeb68b72f680f42 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 6 Oct 2017 15:30:47 +0200 Subject: score: Use struct timespec for TOD Use the timestamps only for uptime based values. Use struct timespec for the absolute time values (TOD). Update #2740. --- cpukit/score/src/coretodabsolutetimeout.c | 2 +- cpukit/score/src/coretodadjust.c | 8 ++++---- cpukit/score/src/coretodset.c | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'cpukit/score/src') diff --git a/cpukit/score/src/coretodabsolutetimeout.c b/cpukit/score/src/coretodabsolutetimeout.c index fe74a6bbf2..d67b7c33c7 100644 --- a/cpukit/score/src/coretodabsolutetimeout.c +++ b/cpukit/score/src/coretodabsolutetimeout.c @@ -47,7 +47,7 @@ TOD_Absolute_timeout_conversion_results _TOD_Absolute_timeout_to_ticks( * Is the absolute time in the past? */ if ( clock == CLOCK_REALTIME ) { - _TOD_Get_as_timespec( ¤t_time ); + _TOD_Get( ¤t_time ); } else { _Assert( clock == CLOCK_MONOTONIC ); _TOD_Get_zero_based_uptime_as_timespec( ¤t_time ); diff --git a/cpukit/score/src/coretodadjust.c b/cpukit/score/src/coretodadjust.c index 5996565e5c..f493a40b9d 100644 --- a/cpukit/score/src/coretodadjust.c +++ b/cpukit/score/src/coretodadjust.c @@ -21,11 +21,11 @@ #include void _TOD_Adjust( - const Timestamp_Control *delta + const struct timespec *delta ) { - Timestamp_Control tod; - ISR_lock_Context lock_context; + ISR_lock_Context lock_context; + struct timespec tod; /* * Currently, RTEMS does the adjustment in one movement. @@ -38,7 +38,7 @@ void _TOD_Adjust( _TOD_Lock(); _TOD_Acquire( &lock_context ); _TOD_Get( &tod ); - _Timestamp_Add_to( &tod, delta ); + _Timespec_Add_to( &tod, delta ); _TOD_Set( &tod, &lock_context ); _TOD_Unlock(); } diff --git a/cpukit/score/src/coretodset.c b/cpukit/score/src/coretodset.c index f1d2e36eb0..80b0b762bd 100644 --- a/cpukit/score/src/coretodset.c +++ b/cpukit/score/src/coretodset.c @@ -23,21 +23,21 @@ #include void _TOD_Set( - const Timestamp_Control *tod_as_timestamp, - ISR_lock_Context *lock_context + const struct timespec *tod, + ISR_lock_Context *lock_context ) { - struct timespec tod_as_timespec; + struct bintime tod_as_bintime; uint64_t tod_as_ticks; uint32_t cpu_count; uint32_t cpu_index; _Assert( _API_Mutex_Is_owner( _Once_Mutex ) ); - _Timecounter_Set_clock( tod_as_timestamp, lock_context ); + timespec2bintime( tod, &tod_as_bintime ); + _Timecounter_Set_clock( &tod_as_bintime, lock_context ); - _Timestamp_To_timespec( tod_as_timestamp, &tod_as_timespec ); - tod_as_ticks = _Watchdog_Ticks_from_timespec( &tod_as_timespec ); + tod_as_ticks = _Watchdog_Ticks_from_timespec( tod ); cpu_count = _SMP_Get_processor_count(); for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) { -- cgit v1.2.3