RTEMS CPU Kit with SuperCore  4.11.2
timecounter.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright (c) 2015 embedded brains GmbH. All rights reserved.
11  *
12  * embedded brains GmbH
13  * Dornierstr. 4
14  * 82178 Puchheim
15  * Germany
16  * <rtems@embedded-brains.de>
17  *
18  * The license and distribution terms for this file may be
19  * found in the file LICENSE in this distribution or at
20  * http://www.rtems.org/license/LICENSE.
21  */
22 
23 #ifndef _RTEMS_SCORE_TIMECOUNTER_H
24 #define _RTEMS_SCORE_TIMECOUNTER_H
25 
26 #include <sys/time.h>
27 #include <sys/timetc.h>
28 
29 #include <rtems/score/isrlock.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
34 
48 void _Timecounter_Bintime( struct bintime *bt );
49 
55 void _Timecounter_Nanotime( struct timespec *ts );
56 
62 void _Timecounter_Microtime( struct timeval *tv );
63 
69 void _Timecounter_Binuptime( struct bintime *bt );
70 
76 void _Timecounter_Nanouptime( struct timespec *ts );
77 
83 void _Timecounter_Microuptime( struct timeval *tv );
84 
93 void _Timecounter_Getbintime( struct bintime *bt );
94 
105 void _Timecounter_Getnanotime( struct timespec *ts );
106 
117 void _Timecounter_Getmicrotime( struct timeval *tv );
118 
127 void _Timecounter_Getbinuptime( struct bintime *bt );
128 
137 void _Timecounter_Getnanouptime( struct timespec *ts );
138 
147 void _Timecounter_Getmicrouptime( struct timeval *tv );
148 
158 void _Timecounter_Install( struct timecounter *tc );
159 
163 void _Timecounter_Tick( void );
164 
168 ISR_LOCK_DECLARE( extern, _Timecounter_Lock )
169 
170 
177 #define _Timecounter_Acquire( lock_context ) \
178  _ISR_lock_ISR_disable_and_acquire( &_Timecounter_Lock, lock_context )
179 
193  uint32_t delta,
194  uint32_t offset,
195  ISR_lock_Context *lock_context
196 );
197 
201 extern volatile time_t _Timecounter_Time_second;
202 
209 extern volatile time_t _Timecounter_Time_uptime;
210 
214 extern struct timecounter *_Timecounter;
215 
218 #ifdef __cplusplus
219 }
220 #endif /* __cplusplus */
221 
222 #endif /* _RTEMS_SCORE_TIMECOUNTER_H */
void _Timecounter_Bintime(struct bintime *bt)
Returns the wall clock time in the bintime format.
void _Timecounter_Tick(void)
Performs a timecounter tick.
void _Timecounter_Install(struct timecounter *tc)
Installs the timecounter.
void _Timecounter_Binuptime(struct bintime *bt)
Returns the uptime in the bintime format.
volatile time_t _Timecounter_Time_uptime
The uptime in seconds.
#define ISR_LOCK_DECLARE(_qualifier, _designator)
Declares an ISR lock variable.
Definition: isrlock.h:104
struct timecounter * _Timecounter
The current timecounter.
void _Timecounter_Getnanotime(struct timespec *ts)
Returns the wall clock time in the timespec format.
Definition: timetc.h:37
volatile time_t _Timecounter_Time_second
The wall clock time in seconds.
void _Timecounter_Nanouptime(struct timespec *ts)
Returns the uptime in the timespec format.
void _Timecounter_Getmicrotime(struct timeval *tv)
Returns the wall clock time in the timeval format.
void _Timecounter_Nanotime(struct timespec *ts)
Returns the wall clock time in the timespec format.
void _Timecounter_Getbintime(struct bintime *bt)
Returns the wall clock time in the bintime format.
void _Timecounter_Microtime(struct timeval *tv)
Returns the wall clock time in the timeval format.
void _Timecounter_Microuptime(struct timeval *tv)
Returns the uptime in the timeval format.
void _Timecounter_Getmicrouptime(struct timeval *tv)
Returns the uptime in the timeval format.
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
void _Timecounter_Tick_simple(uint32_t delta, uint32_t offset, ISR_lock_Context *lock_context)
Performs a simple timecounter tick.
ISR Locks.
void _Timecounter_Getnanouptime(struct timespec *ts)
Returns the uptime in the timespec format.
void _Timecounter_Getbinuptime(struct bintime *bt)
Returns the uptime in the bintime format.