source: rtems/cpukit/score/src/coretodadjust.c @ 2256946

Last change on this file since 2256946 was 2256946, checked in by Sebastian Huber <sebastian.huber@…>, on Oct 6, 2017 at 1:30:47 PM

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.

  • Property mode set to 100644
File size: 953 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Adjust the Time of Time
5 * @ingroup ScoreTOD
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2014.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/score/todimpl.h>
22
23void _TOD_Adjust(
24  const struct timespec *delta
25)
26{
27  ISR_lock_Context lock_context;
28  struct timespec  tod;
29
30  /*
31   * Currently, RTEMS does the adjustment in one movement.
32   * Given interest, requirements, and sponsorship, a future
33   * enhancement would be to adjust the time in smaller increments
34   * at each clock tick. Until then, there is no outstanding
35   * adjustment.
36   */
37
38  _TOD_Lock();
39  _TOD_Acquire( &lock_context );
40  _TOD_Get( &tod );
41  _Timespec_Add_to( &tod, delta );
42  _TOD_Set( &tod, &lock_context );
43  _TOD_Unlock();
44}
Note: See TracBrowser for help on using the repository browser.