source: rtems/cpukit/score/inline/rtems/score/tod.inl @ 62181b21

4.115
Last change on this file since 62181b21 was 62181b21, checked in by Sebastian Huber <sebastian.huber@…>, on 11/16/12 at 12:59:27

score: Add and use _TOD_Get_with_nanoseconds()

Delete _TOD_Get_as_timestamp().

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/**
2 *  @file  rtems/score/tod.inl
3 *
4 *  This file contains the static inline implementation of the inlined routines
5 *  from the Time of Day Handler.
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2007.
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.com/license/LICENSE.
15 */
16
17#ifndef _RTEMS_SCORE_TOD_H
18# error "Never use <rtems/score/tod.inl> directly; include <rtems/score/tod.h> instead."
19#endif
20
21#ifndef _RTEMS_SCORE_TOD_INL
22#define _RTEMS_SCORE_TOD_INL
23
24#include <sys/time.h> /* struct timeval */
25
26#include <rtems/score/isr.h>
27
28/**
29 *  @addtogroup ScoreTOD
30 *  @{
31 */
32
33/**
34 *  This routine deactivates updating of the current time of day.
35 */
36
37RTEMS_INLINE_ROUTINE void _TOD_Deactivate( void )
38{
39  /* XXX do we need something now that we are using timespec for TOD */
40}
41
42/**
43 *  This routine activates updating of the current time of day.
44 */
45
46RTEMS_INLINE_ROUTINE void _TOD_Activate( void )
47{
48  /* XXX do we need something now that we are using timespec for TOD */
49}
50
51/**
52 *  This routine returns a timeval based upon the internal timespec format TOD.
53 */
54
55RTEMS_INLINE_ROUTINE void _TOD_Get_timeval(
56  struct timeval *time
57)
58{
59  Timestamp_Control  snapshot_as_timestamp;
60  Timestamp_Control *snapshot_as_timestamp_ptr;
61
62  snapshot_as_timestamp_ptr =
63    _TOD_Get_with_nanoseconds( &snapshot_as_timestamp, &_TOD.now );
64  _Timestamp_To_timeval( snapshot_as_timestamp_ptr, time );
65}
66
67/**@}*/
68
69#endif
70/* end of include file */
Note: See TracBrowser for help on using the repository browser.