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

5
Last change on this file since bbd6d27a was 7cd2484, checked in by Alexander Krutwig <alexander.krutwig@…>, on 05/12/15 at 12:32:47

timecounter: Use in RTEMS

Replace timestamp implementation with FreeBSD bintime and timecounters.

New test sptests/sptimecounter02.

Update #2271.

  • Property mode set to 100644
File size: 1.0 KB
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/threaddispatch.h>
22#include <rtems/score/todimpl.h>
23
24void _TOD_Adjust(
25  const Timestamp_Control delta
26)
27{
28  Timestamp_Control 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  /*
39   * This prevents context switches while we are adjusting the TOD
40   */
41  _Thread_Disable_dispatch();
42
43    _TOD_Get( &tod );
44
45    _Timestamp_Add_to( &tod, &delta );
46
47    _TOD_Set_with_timestamp( &tod );
48
49  _Thread_Enable_dispatch();
50}
Note: See TracBrowser for help on using the repository browser.