Changeset 9480815a in rtems


Ignore:
Timestamp:
Dec 21, 2017, 1:36:52 PM (18 months 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.

Files:
21 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/confdefs.h

    r3a4e044 r9480815a  
    31133113  const uint32_t _Watchdog_Ticks_per_second = _CONFIGURE_TICKS_PER_SECOND;
    31143114
    3115   const uint64_t _Watchdog_Monotonic_max_seconds =
    3116     UINT64_MAX / _CONFIGURE_TICKS_PER_SECOND;
    3117 
    31183115  /**
    31193116   * This is the Classic API Configuration Table.
  • cpukit/include/rtems/score/percpu.h

    r3a4e044 r9480815a  
    249249typedef enum {
    250250  /**
    251    * @brief Index for monotonic clock per-CPU watchdog header.
    252    *
    253    * The reference time point for the monotonic clock is the system start.  The
     251   * @brief Index for tick clock per-CPU watchdog header.
     252   *
     253   * The reference time point for the tick clock is the system start.  The
    254254   * clock resolution is one system clock tick.  It is used for the system
    255    * clock tick based time services and the POSIX services using
    256    * CLOCK_MONOTONIC.
    257    */
    258   PER_CPU_WATCHDOG_MONOTONIC,
     255   * clock tick based time services.
     256   */
     257  PER_CPU_WATCHDOG_TICKS,
    259258
    260259  /**
     
    266265   */
    267266  PER_CPU_WATCHDOG_REALTIME,
     267
     268  /**
     269   * @brief Index for monotonic clock per-CPU watchdog header.
     270   *
     271   * The reference time point for the monotonic clock is the system start.  The
     272   * clock resolution is one nanosecond.  It is used for the POSIX services
     273   * using CLOCK_MONOTONIC.
     274   */
     275  PER_CPU_WATCHDOG_MONOTONIC,
    268276
    269277  /**
  • cpukit/include/rtems/score/threadimpl.h

    r3a4e044 r9480815a  
    18651865{
    18661866  _ISR_lock_Initialize( &timer->Lock, "Thread Timer" );
    1867   timer->header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ];
     1867  timer->header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ];
    18681868  _Watchdog_Preinitialize( &timer->Watchdog, cpu );
    18691869}
     
    18801880
    18811881  the_thread->Timer.header =
    1882     &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ];
     1882    &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ];
    18831883  the_thread->Timer.Watchdog.routine = _Thread_Timeout;
    18841884  _Watchdog_Per_CPU_insert_ticks( &the_thread->Timer.Watchdog, cpu, ticks );
     
    18941894)
    18951895{
    1896   ISR_lock_Context lock_context;
     1896  ISR_lock_Context  lock_context;
     1897  Watchdog_Header  *header;
    18971898
    18981899  _ISR_lock_ISR_disable_and_acquire( &the_thread->Timer.Lock, &lock_context );
    18991900
    1900   the_thread->Timer.header =
    1901     &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_REALTIME ];
     1901  header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_REALTIME ];
     1902  the_thread->Timer.header = header;
    19021903  the_thread->Timer.Watchdog.routine = routine;
    1903   _Watchdog_Per_CPU_insert_realtime( &the_thread->Timer.Watchdog, cpu, expire );
     1904  _Watchdog_Per_CPU_insert( &the_thread->Timer.Watchdog, cpu, header, expire );
    19041905
    19051906  _ISR_lock_Release_and_ISR_enable( &the_thread->Timer.Lock, &lock_context );
  • cpukit/include/rtems/score/watchdog.h

    r3a4e044 r9480815a  
    148148extern const uint32_t _Watchdog_Ticks_per_second;
    149149
    150 /**
    151  * @brief The maximum number of seconds representable in the monotonic watchdog
    152  * format.
    153  *
    154  * This constant is defined by the application configuration via
    155  * <rtems/confdefs.h>.
    156  */
    157 extern const uint64_t _Watchdog_Monotonic_max_seconds;
    158 
    159150/**@}*/
    160151
  • cpukit/include/rtems/score/watchdogimpl.h

    r3a4e044 r9480815a  
    304304 * (= WATCHDOG_NANOSECONDS_PER_SECOND) nanoseconds.
    305305 *
    306  * The expiration time is an unsigned 64-bit integer.  To store absolute
     306 * The expiration time is an unsigned 64-bit integer.  To store nanoseconds
    307307 * timeouts we use 30 bits (2**30 == 1073741824) for the nanoseconds and 34
    308308 * bits for the seconds since UNIX Epoch.  This leads to a year 2514 problem.
     
    311311
    312312/**
    313  * @brief The maximum number of seconds representable in the realtime watchdog
    314  * format.
     313 * @brief The maximum number of seconds representable in the nanoseconds
     314 * watchdog format.
    315315 *
    316316 * We have 2**34 bits for the seconds part.
    317317 */
    318 #define WATCHDOG_REALTIME_MAX_SECONDS 0x3ffffffff
     318#define WATCHDOG_MAX_SECONDS 0x3ffffffff
    319319
    320320RTEMS_INLINE_ROUTINE bool _Watchdog_Is_valid_timespec(
     
    363363}
    364364
    365 RTEMS_INLINE_ROUTINE bool _Watchdog_Is_far_future_monotonic_timespec(
     365RTEMS_INLINE_ROUTINE bool _Watchdog_Is_far_future_timespec(
    366366  const struct timespec *ts
    367367)
    368368{
    369   return ts->tv_sec >= _Watchdog_Monotonic_max_seconds;
    370 }
    371 
    372 RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Monotonic_from_timespec(
     369  return ts->tv_sec > WATCHDOG_MAX_SECONDS;
     370}
     371
     372RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_seconds(
     373  uint32_t seconds
     374)
     375{
     376  uint64_t ticks = seconds;
     377
     378  ticks <<= WATCHDOG_BITS_FOR_1E9_NANOSECONDS;
     379
     380  return ticks;
     381}
     382
     383RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_timespec(
    373384  const struct timespec *ts
    374385)
     
    378389  _Assert( _Watchdog_Is_valid_timespec( ts ) );
    379390  _Assert( ts->tv_sec >= 0 );
    380   _Assert( !_Watchdog_Is_far_future_monotonic_timespec( ts ) );
    381 
    382   ticks = (uint64_t) ts->tv_sec * _Watchdog_Ticks_per_second;
    383   ticks += (unsigned long) ts->tv_nsec / _Watchdog_Nanoseconds_per_tick;
    384 
    385   return ticks;
    386 }
    387 
    388 RTEMS_INLINE_ROUTINE bool _Watchdog_Is_far_future_realtime_timespec(
    389   const struct timespec *ts
    390 )
    391 {
    392   return ts->tv_sec > WATCHDOG_REALTIME_MAX_SECONDS;
    393 }
    394 
    395 RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_seconds(
    396   uint32_t seconds
    397 )
    398 {
    399   uint64_t ticks = seconds;
    400 
    401   ticks <<= WATCHDOG_BITS_FOR_1E9_NANOSECONDS;
    402 
    403   return ticks;
    404 }
    405 
    406 RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Ticks_from_timespec(
    407   const struct timespec *ts
    408 )
    409 {
    410   uint64_t ticks;
    411 
    412   _Assert( _Watchdog_Is_valid_timespec( ts ) );
    413   _Assert( ts->tv_sec >= 0 );
    414   _Assert( !_Watchdog_Is_far_future_realtime_timespec( ts ) );
     391  _Assert( !_Watchdog_Is_far_future_timespec( ts ) );
    415392
    416393  ticks = (uint64_t) ts->tv_sec;
     
    458435  uint64_t          expire;
    459436
    460   header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ];
     437  header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ];
    461438
    462439  _Watchdog_Set_CPU( the_watchdog, cpu );
     
    469446}
    470447
    471 RTEMS_INLINE_ROUTINE bool _Watchdog_Per_CPU_lazy_insert_monotonic(
     448RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert(
    472449  Watchdog_Control *the_watchdog,
    473450  Per_CPU_Control  *cpu,
     451  Watchdog_Header  *header,
    474452  uint64_t          expire
    475453)
    476454{
    477   ISR_lock_Context  lock_context;
    478   Watchdog_Header  *header;
    479   bool              insert;
    480 
    481   header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ];
     455  ISR_lock_Context lock_context;
    482456
    483457  _Watchdog_Set_CPU( the_watchdog, cpu );
    484458
    485459  _Watchdog_Per_CPU_acquire_critical( cpu, &lock_context );
    486   insert = ( expire > cpu->Watchdog.ticks );
    487 
    488   if ( insert ) {
    489     _Watchdog_Insert(header, the_watchdog, expire);
    490   }
    491 
    492   _Watchdog_Per_CPU_release_critical( cpu, &lock_context );
    493   return insert;
    494 }
    495 
    496 RTEMS_INLINE_ROUTINE uint64_t _Watchdog_Per_CPU_insert_realtime(
    497   Watchdog_Control *the_watchdog,
    498   Per_CPU_Control  *cpu,
    499   uint64_t          expire
    500 )
    501 {
    502   ISR_lock_Context  lock_context;
    503   Watchdog_Header  *header;
    504 
    505   header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_REALTIME ];
    506 
    507   _Watchdog_Set_CPU( the_watchdog, cpu );
    508 
    509   _Watchdog_Per_CPU_acquire_critical( cpu, &lock_context );
    510   _Watchdog_Insert(header, the_watchdog, expire);
     460  _Watchdog_Insert( header, the_watchdog, expire );
    511461  _Watchdog_Per_CPU_release_critical( cpu, &lock_context );
    512462  return expire;
     
    529479}
    530480
    531 RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove_monotonic(
     481RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove_ticks(
    532482  Watchdog_Control *the_watchdog
    533483)
     
    539489    the_watchdog,
    540490    cpu,
    541     &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ]
     491    &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ]
    542492  );
    543493}
    544494
    545 RTEMS_INLINE_ROUTINE void _Watchdog_Per_CPU_remove_realtime(
    546   Watchdog_Control *the_watchdog
    547 )
    548 {
    549   Per_CPU_Control *cpu;
    550 
    551   cpu = _Watchdog_Get_CPU( the_watchdog );
    552   _Watchdog_Per_CPU_remove(
    553     the_watchdog,
    554     cpu,
    555     &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_REALTIME ]
    556   );
    557 }
    558 
    559495/** @} */
    560496
  • 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
  • cpukit/rtems/src/ratemoncancel.c

    r3a4e044 r9480815a  
    3333  _Rate_monotonic_Acquire_critical( the_period, lock_context );
    3434
    35   _Watchdog_Per_CPU_remove_monotonic( &the_period->Timer );
     35  _Watchdog_Per_CPU_remove_ticks( &the_period->Timer );
    3636  the_period->state = RATE_MONOTONIC_INACTIVE;
    3737  _Scheduler_Cancel_job(
  • cpukit/rtems/src/timercreate.c

    r3a4e044 r9480815a  
    7373    if ( _Timer_Is_interval_class( the_class ) ) {
    7474      _Watchdog_Insert(
    75         &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ],
     75        &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ],
    7676        &the_timer->Ticker,
    7777        cpu->Watchdog.ticks + interval
  • cpukit/rtems/src/timerreset.c

    r3a4e044 r9480815a  
    3838      _Timer_Cancel( cpu, the_timer );
    3939      _Watchdog_Insert(
    40         &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ],
     40        &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ],
    4141        &the_timer->Ticker,
    4242        cpu->Watchdog.ticks + the_timer->initial
  • cpukit/score/src/threadqtimeout.c

    r3a4e044 r9480815a  
    3535}
    3636
    37 static bool _Thread_queue_Lazy_insert_monotonic_timespec(
     37static void _Thread_queue_Add_timeout_timespec(
     38  Thread_queue_Queue    *queue,
    3839  Thread_Control        *the_thread,
    3940  Per_CPU_Control       *cpu_self,
    40   const struct timespec *abstime
    41 )
    42 {
    43   uint64_t         expire;
    44   ISR_lock_Context lock_context;
    45   bool             insert;
    46 
    47   if ( abstime->tv_sec < 0 ) {
    48     expire = 0;
    49   } else if ( _Watchdog_Is_far_future_monotonic_timespec( abstime ) ) {
    50     expire = WATCHDOG_MAXIMUM_TICKS;
    51   } else {
    52     expire = _Watchdog_Monotonic_from_timespec( abstime );
    53   }
    54 
    55   _ISR_lock_ISR_disable_and_acquire(
    56     &the_thread->Timer.Lock,
    57     &lock_context
    58   );
    59 
    60   the_thread->Timer.header =
    61     &cpu_self->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ];
    62   the_thread->Timer.Watchdog.routine = _Thread_Timeout;
    63   insert = _Watchdog_Per_CPU_lazy_insert_monotonic(
    64     &the_thread->Timer.Watchdog,
    65     cpu_self,
    66     expire
    67   );
    68 
    69   _ISR_lock_Release_and_ISR_enable(
    70     &the_thread->Timer.Lock,
    71     &lock_context
    72   );
    73   return insert;
    74 }
    75 
    76 void _Thread_queue_Add_timeout_monotonic_timespec(
    77   Thread_queue_Queue   *queue,
    78   Thread_Control       *the_thread,
    79   Per_CPU_Control      *cpu_self,
    80   Thread_queue_Context *queue_context
     41  Thread_queue_Context  *queue_context,
     42  Watchdog_Header       *header,
     43  const struct timespec *now
    8144)
    8245{
     
    8649
    8750  if ( _Watchdog_Is_valid_timespec( abstime ) ) {
    88     if (
    89       !_Thread_queue_Lazy_insert_monotonic_timespec(
    90         the_thread,
    91         cpu_self,
    92         abstime
    93       )
    94     ) {
    95       _Thread_Continue( the_thread, STATUS_TIMEOUT );
    96     }
    97   } else {
    98     _Thread_Continue( the_thread, STATUS_INVALID_NUMBER );
    99   }
    100 }
    101 
    102 void _Thread_queue_Add_timeout_realtime_timespec(
    103   Thread_queue_Queue   *queue,
    104   Thread_Control       *the_thread,
    105   Per_CPU_Control      *cpu_self,
    106   Thread_queue_Context *queue_context
    107 )
    108 {
    109   const struct timespec *abstime;
    110 
    111   abstime = queue_context->Timeout.arg;
    112 
    113   if ( _Watchdog_Is_valid_timespec( abstime ) ) {
    114     uint64_t        expire;
    115     struct timespec now;
     51    uint64_t expire;
    11652
    11753    if ( abstime->tv_sec < 0 ) {
    11854      expire = 0;
    119     } else if ( _Watchdog_Is_far_future_realtime_timespec( abstime ) ) {
     55    } else if ( _Watchdog_Is_far_future_timespec( abstime ) ) {
    12056      expire = WATCHDOG_MAXIMUM_TICKS;
    12157    } else {
     
    12359    }
    12460
    125     _Timecounter_Getnanotime( &now );
    126 
    127     if ( expire > _Watchdog_Ticks_from_timespec( &now ) ) {
     61    if ( expire > _Watchdog_Ticks_from_timespec( now ) ) {
    12862      ISR_lock_Context lock_context;
    12963
     
    13367      );
    13468
    135       the_thread->Timer.header =
    136         &cpu_self->Watchdog.Header[ PER_CPU_WATCHDOG_REALTIME ];
     69      the_thread->Timer.header = header;
    13770      the_thread->Timer.Watchdog.routine = _Thread_Timeout;
    138       _Watchdog_Per_CPU_insert_realtime(
     71      _Watchdog_Per_CPU_insert(
    13972        &the_thread->Timer.Watchdog,
    14073        cpu_self,
     74        header,
    14175        expire
    14276      );
     
    15387  }
    15488}
     89
     90void _Thread_queue_Add_timeout_monotonic_timespec(
     91  Thread_queue_Queue   *queue,
     92  Thread_Control       *the_thread,
     93  Per_CPU_Control      *cpu_self,
     94  Thread_queue_Context *queue_context
     95)
     96{
     97  struct timespec now;
     98
     99  _Timecounter_Getnanouptime( &now );
     100  _Thread_queue_Add_timeout_timespec(
     101    queue,
     102    the_thread,
     103    cpu_self,
     104    queue_context,
     105    &cpu_self->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ],
     106    &now
     107  );
     108}
     109
     110void _Thread_queue_Add_timeout_realtime_timespec(
     111  Thread_queue_Queue   *queue,
     112  Thread_Control       *the_thread,
     113  Per_CPU_Control      *cpu_self,
     114  Thread_queue_Context *queue_context
     115)
     116{
     117  struct timespec now;
     118
     119  _Timecounter_Getnanotime( &now );
     120  _Thread_queue_Add_timeout_timespec(
     121    queue,
     122    the_thread,
     123    cpu_self,
     124    queue_context,
     125    &cpu_self->Watchdog.Header[ PER_CPU_WATCHDOG_REALTIME ],
     126    &now
     127  );
     128}
  • cpukit/score/src/watchdogtick.c

    r3a4e044 r9480815a  
    7171  cpu->Watchdog.ticks = ticks;
    7272
    73   header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ];
     73  header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ];
    7474  first = _Watchdog_Header_first( header );
    7575
     
    7979      first,
    8080      ticks,
     81      &cpu->Watchdog.Lock,
     82      &lock_context
     83    );
     84  }
     85
     86  header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ];
     87  first = _Watchdog_Header_first( header );
     88
     89  if ( first != NULL ) {
     90    _Timecounter_Getnanouptime( &now );
     91    _Watchdog_Tickle(
     92      header,
     93      first,
     94      _Watchdog_Ticks_from_timespec( &now ),
    8195      &cpu->Watchdog.Lock,
    8296      &lock_context
  • testsuites/sptests/spintrcritical08/init.c

    r3a4e044 r9480815a  
    4646{
    4747  Per_CPU_Control *cpu = _Per_CPU_Get();
    48   Watchdog_Header *header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ];
     48  Watchdog_Header *header = &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ];
    4949  Watchdog_Control *watchdog = (Watchdog_Control *) header->first;
    5050
     
    5656    Thread_Wait_flags flags = _Thread_Wait_flags_get( thread );
    5757
    58     _Watchdog_Per_CPU_remove_monotonic( watchdog );
     58    _Watchdog_Per_CPU_remove_ticks( watchdog );
    5959
    6060    rtems_test_assert( getState() == RATE_MONOTONIC_ACTIVE );
  • testsuites/sptests/spintrcritical09/init.c

    r3a4e044 r9480815a  
    4040{
    4141  Per_CPU_Control *cpu_self = _Per_CPU_Get();
    42   Watchdog_Header *header = &cpu_self->Watchdog.Header[ PER_CPU_WATCHDOG_MONOTONIC ];
     42  Watchdog_Header *header = &cpu_self->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ];
    4343  Watchdog_Control *watchdog = (Watchdog_Control *) header->first;
    4444
  • testsuites/sptests/spwatchdog/init.c

    r3a4e044 r9480815a  
    6060  rtems_test_assert( _Watchdog_Nanoseconds_per_tick == 10000000 );
    6161  rtems_test_assert( _Watchdog_Ticks_per_second == 100 );
    62   rtems_test_assert( _Watchdog_Monotonic_max_seconds == 184467440737095516 );
    6362  rtems_test_assert( rtems_clock_get_ticks_per_second() == 100 );
    6463  #undef rtems_clock_get_ticks_per_second
Note: See TracChangeset for help on using the changeset viewer.