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 | |
---|
37 | RTEMS_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 | |
---|
46 | RTEMS_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 | |
---|
55 | RTEMS_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 */ |
---|