source: rtems/cpukit/score/src/coretodadjust.c @ 8a8b95aa

5
Last change on this file since 8a8b95aa was 4c20da4b, checked in by Sebastian Huber <sebastian.huber@…>, on 04/04/19 at 07:18:11

doxygen: Rename Score* groups in RTEMSScore*

Update #3706

  • Property mode set to 100644
File size: 958 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Adjust the Time of Time
5 * @ingroup RTEMSScoreTOD
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.