Changeset 9480815a in rtems for cpukit/posix


Ignore:
Timestamp:
Dec 21, 2017, 1:36:52 PM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
8fa4549
Parents:
3a4e044
git-author:
Sebastian Huber <sebastian.huber@…> (12/21/17 13:36:52)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/02/18 14:01:20)
Message:

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.

Location:
cpukit/posix/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/alarm.c

    r3a4e044 r9480815a  
    7878
    7979  remaining = (unsigned long) _Watchdog_Cancel(
    80     &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ],
     80    &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ],
    8181    the_watchdog,
    8282    now
     
    8585  if ( ticks != 0 ) {
    8686    _Watchdog_Insert(
    87       &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ],
     87      &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ],
    8888      the_watchdog,
    8989      now + ticks
  • cpukit/posix/src/nanosleep.c

    r3a4e044 r9480815a  
    2626#include <rtems/score/threadqimpl.h>
    2727#include <rtems/score/timespec.h>
    28 #include <rtems/score/todimpl.h>
     28#include <rtems/score/timecounter.h>
    2929#include <rtems/score/watchdogimpl.h>
    3030#include <rtems/posix/posixapi.h>
     
    9494    }
    9595  } else {
    96     _TOD_Get_zero_based_uptime_as_timespec( &uptime );
     96    _Timecounter_Nanouptime( &uptime );
    9797    end = _Watchdog_Future_timespec( &uptime, rqtp );
    9898    _Thread_queue_Context_set_enqueue_timeout_monotonic_timespec(
     
    120120      struct timespec actual_end;
    121121
    122       _TOD_Get_zero_based_uptime_as_timespec( &actual_end );
     122      _Timecounter_Nanouptime( &actual_end );
    123123
    124124      if ( _Timespec_Less_than( &actual_end, end ) ) {
  • cpukit/posix/src/pthread.c

    r3a4e044 r9480815a  
    7070  }
    7171
    72   _Watchdog_Per_CPU_remove_monotonic( &api->Sporadic.Timer );
     72  _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer );
    7373  _POSIX_Threads_Sporadic_timer_insert( the_thread, api );
    7474
     
    142142
    143143  _Thread_State_acquire( executing, &lock_context );
    144   _Watchdog_Per_CPU_remove_monotonic( &api->Sporadic.Timer );
     144  _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer );
    145145  _Thread_State_release( executing, &lock_context );
    146146}
  • cpukit/posix/src/pthreadsetschedparam.c

    r3a4e044 r9480815a  
    7070  api = the_thread->API_Extensions[ THREAD_API_POSIX ];
    7171
    72   _Watchdog_Per_CPU_remove_monotonic( &api->Sporadic.Timer );
     72  _Watchdog_Per_CPU_remove_ticks( &api->Sporadic.Timer );
    7373
    7474  _Priority_Node_set_priority( &the_thread->Real_priority, core_normal_prio );
  • cpukit/posix/src/sigtimedwait.c

    r3a4e044 r9480815a  
    9696    const struct timespec *end;
    9797
    98     _TOD_Get_zero_based_uptime_as_timespec( &uptime );
     98    _Timecounter_Nanouptime( &uptime );
    9999    end = _Watchdog_Future_timespec( &uptime, timeout );
    100100    _Thread_queue_Context_set_enqueue_timeout_monotonic_timespec(
  • cpukit/posix/src/timerdelete.c

    r3a4e044 r9480815a  
    5757    ptimer->state = POSIX_TIMER_STATE_FREE;
    5858    _Watchdog_Remove(
    59       &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ],
     59      &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ],
    6060      &ptimer->Timer
    6161    );
  • cpukit/posix/src/timersettime.c

    r3a4e044 r9480815a  
    4343
    4444  _Watchdog_Insert(
    45     &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ],
     45    &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ],
    4646    &ptimer->Timer,
    4747    cpu->Watchdog.ticks + ticks
     
    153153    /* Stop the timer */
    154154    _Watchdog_Remove(
    155       &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ],
     155      &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ],
    156156      &ptimer->Timer
    157157    );
  • cpukit/posix/src/ualarm.c

    r3a4e044 r9480815a  
    108108
    109109  remaining = (useconds_t) _Watchdog_Cancel(
    110     &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ],
     110    &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ],
    111111    the_watchdog,
    112112    now
     
    119119    _Watchdog_Set_CPU( the_watchdog, cpu );
    120120    _Watchdog_Insert(
    121       &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ],
     121      &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ],
    122122      the_watchdog,
    123123      now + ticks_initial
Note: See TracChangeset for help on using the changeset viewer.