source: rtems/cpukit/score/src/coretodadjust.c @ 1ef8e4a8

Last change on this file since 1ef8e4a8 was 1ef8e4a8, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 27, 2016 at 8:07:56 PM

score: Avoid Giant lock for set time of day

Update #2555.
Update #2630.

  • Property mode set to 100644
File size: 958 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 Timestamp_Control *delta
25)
26{
27  Timestamp_Control tod;
28  ISR_lock_Context  lock_context;
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  _Timestamp_Add_to( &tod, delta );
42  _TOD_Set( &tod, &lock_context );
43  _TOD_Unlock();
44}
Note: See TracBrowser for help on using the repository browser.