diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-12-21 14:36:52 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-02-02 15:01:20 +0100 |
commit | 9480815a222be61214b176836ef2b4ae4155ce84 (patch) | |
tree | 63c96f9a0fb79ead01e6b73d12baaa5ac8cb8378 /cpukit/posix | |
parent | score: Rename _Watchdog_Realtime_from_*() (diff) | |
download | rtems-9480815a222be61214b176836ef2b4ae4155ce84.tar.bz2 |
score: Introduce new monotonic clock
Rename PER_CPU_WATCHDOG_MONOTONIC to PER_CPU_WATCHDOG_TICKS. Add new
PER_CPU_WATCHDOG_MONOTONIC which is based on the system uptime (measured
by timecounter).
Close #3264.
Diffstat (limited to 'cpukit/posix')
-rw-r--r-- | cpukit/posix/src/alarm.c | 4 | ||||
-rw-r--r-- | cpukit/posix/src/nanosleep.c | 6 | ||||
-rw-r--r-- | cpukit/posix/src/pthread.c | 4 | ||||
-rw-r--r-- | cpukit/posix/src/pthreadsetschedparam.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/sigtimedwait.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/timerdelete.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/timersettime.c | 4 | ||||
-rw-r--r-- | cpukit/posix/src/ualarm.c | 4 |
8 files changed, 14 insertions, 14 deletions
diff --git a/cpukit/posix/src/alarm.c b/cpukit/posix/src/alarm.c index fcf8c1569a..bbfc96d31d 100644 --- a/cpukit/posix/src/alarm.c +++ b/cpukit/posix/src/alarm.c @@ -77,14 +77,14 @@ unsigned int alarm( now = cpu->Watchdog.ticks; remaining = (unsigned long) _Watchdog_Cancel( - &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ], + &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ], the_watchdog, now ); if ( ticks != 0 ) { _Watchdog_Insert( - &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ], + &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ], the_watchdog, now + ticks ); diff --git a/cpukit/posix/src/nanosleep.c b/cpukit/posix/src/nanosleep.c index 5bd1b00aa9..7613df92d1 100644 --- a/cpukit/posix/src/nanosleep.c +++ b/cpukit/posix/src/nanosleep.c @@ -25,7 +25,7 @@ #include <rtems/score/threadimpl.h> #include <rtems/score/threadqimpl.h> #include <rtems/score/timespec.h> -#include <rtems/score/todimpl.h> +#include <rtems/score/timecounter.h> #include <rtems/score/watchdogimpl.h> #include <rtems/posix/posixapi.h> #include <rtems/seterr.h> @@ -93,7 +93,7 @@ int clock_nanosleep( ); } } else { - _TOD_Get_zero_based_uptime_as_timespec( &uptime ); + _Timecounter_Nanouptime( &uptime ); end = _Watchdog_Future_timespec( &uptime, rqtp ); _Thread_queue_Context_set_enqueue_timeout_monotonic_timespec( &queue_context, @@ -119,7 +119,7 @@ int clock_nanosleep( if ( eno == EINTR ) { struct timespec actual_end; - _TOD_Get_zero_based_uptime_as_timespec( &actual_end ); + _Timecounter_Nanouptime( &actual_end ); if ( _Timespec_Less_than( &actual_end, end ) ) { _Timespec_Subtract( &actual_end, end, rmtp ); diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c index 43ed140b11..e05d4f3d19 100644 --- a/cpukit/posix/src/pthread.c +++ b/cpukit/posix/src/pthread.c @@ -69,7 +69,7 @@ void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog ) _Priority_Node_set_inactive( &api->Sporadic.Low_priority ); } - _Watchdog_Per_CPU_remove_monotonic( &api->Sporadic.Timer ); + _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer ); _POSIX_Threads_Sporadic_timer_insert( the_thread, api ); _Thread_Wait_release( the_thread, &queue_context ); @@ -141,7 +141,7 @@ static void _POSIX_Threads_Terminate_extension( Thread_Control *executing ) api = executing->API_Extensions[ THREAD_API_POSIX ]; _Thread_State_acquire( executing, &lock_context ); - _Watchdog_Per_CPU_remove_monotonic( &api->Sporadic.Timer ); + _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer ); _Thread_State_release( executing, &lock_context ); } diff --git a/cpukit/posix/src/pthreadsetschedparam.c b/cpukit/posix/src/pthreadsetschedparam.c index 77e0ecaf48..b6854a080c 100644 --- a/cpukit/posix/src/pthreadsetschedparam.c +++ b/cpukit/posix/src/pthreadsetschedparam.c @@ -69,7 +69,7 @@ static int _POSIX_Set_sched_param( api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - _Watchdog_Per_CPU_remove_monotonic( &api->Sporadic.Timer ); + _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer ); _Priority_Node_set_priority( &the_thread->Real_priority, core_normal_prio ); diff --git a/cpukit/posix/src/sigtimedwait.c b/cpukit/posix/src/sigtimedwait.c index 72f4919be9..351edf0a1e 100644 --- a/cpukit/posix/src/sigtimedwait.c +++ b/cpukit/posix/src/sigtimedwait.c @@ -95,7 +95,7 @@ int sigtimedwait( if ( timeout != NULL ) { const struct timespec *end; - _TOD_Get_zero_based_uptime_as_timespec( &uptime ); + _Timecounter_Nanouptime( &uptime ); end = _Watchdog_Future_timespec( &uptime, timeout ); _Thread_queue_Context_set_enqueue_timeout_monotonic_timespec( &queue_context, diff --git a/cpukit/posix/src/timerdelete.c b/cpukit/posix/src/timerdelete.c index 5c21e1e80d..7670838ac2 100644 --- a/cpukit/posix/src/timerdelete.c +++ b/cpukit/posix/src/timerdelete.c @@ -56,7 +56,7 @@ int timer_delete( cpu = _POSIX_Timer_Acquire_critical( ptimer, &lock_context ); ptimer->state = POSIX_TIMER_STATE_FREE; _Watchdog_Remove( - &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ], + &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ], &ptimer->Timer ); _POSIX_Timer_Release( cpu, &lock_context ); diff --git a/cpukit/posix/src/timersettime.c b/cpukit/posix/src/timersettime.c index 381e5002ce..9212e49740 100644 --- a/cpukit/posix/src/timersettime.c +++ b/cpukit/posix/src/timersettime.c @@ -42,7 +42,7 @@ static void _POSIX_Timer_Insert( _TOD_Get( &ptimer->time ); _Watchdog_Insert( - &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ], + &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ], &ptimer->Timer, cpu->Watchdog.ticks + ticks ); @@ -152,7 +152,7 @@ int timer_settime( /* Stop the timer */ _Watchdog_Remove( - &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ], + &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ], &ptimer->Timer ); diff --git a/cpukit/posix/src/ualarm.c b/cpukit/posix/src/ualarm.c index ead14d4469..371a961c94 100644 --- a/cpukit/posix/src/ualarm.c +++ b/cpukit/posix/src/ualarm.c @@ -107,7 +107,7 @@ useconds_t ualarm( now = cpu->Watchdog.ticks; remaining = (useconds_t) _Watchdog_Cancel( - &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ], + &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ], the_watchdog, now ); @@ -118,7 +118,7 @@ useconds_t ualarm( cpu = _Per_CPU_Get(); _Watchdog_Set_CPU( the_watchdog, cpu ); _Watchdog_Insert( - &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ], + &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ], the_watchdog, now + ticks_initial ); |