RTEMS CPU Kit with SuperCore  4.11.3
timerimpl.h
Go to the documentation of this file.
1 
9 /*
10  * COPYRIGHT (c) 1989-2011.
11  * On-Line Applications Research Corporation (OAR).
12  *
13  * The license and distribution terms for this file may be
14  * found in the file LICENSE in this distribution or at
15  * http://www.rtems.org/license/LICENSE.
16  */
17 
18 #ifndef _RTEMS_RTEMS_TIMER_INL
19 #define _RTEMS_RTEMS_TIMER_INL
20 
21 #include <rtems/rtems/timer.h>
22 #include <rtems/score/objectimpl.h>
23 #include <rtems/score/thread.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
46 #ifndef RTEMS_TIMER_EXTERN
47 #define RTEMS_TIMER_EXTERN extern
48 #endif
49 
51 
55 typedef void (*Timer_server_Method)(
56  Timer_server_Control *timer_server,
57  Timer_Control *timer
58 );
59 
60 typedef struct {
66 
71 
77 
82  uint32_t generation;
83 
88 
95 
103 
109 
114 
119 
124 };
125 
132 
138 
145 
153 {
154  return (Timer_Control *) _Objects_Allocate( &_Timer_Information );
155 }
156 
164  Timer_Control *the_timer
165 )
166 {
167  _Objects_Free( &_Timer_Information, &the_timer->Object );
168 }
169 
180  Objects_Id id,
181  Objects_Locations *location
182 )
183 {
184  return (Timer_Control *)
185  _Objects_Get( &_Timer_Information, id, location );
186 }
187 
195  Timer_Classes the_class
196 )
197 {
198  return (the_class == TIMER_INTERVAL) || (the_class == TIMER_INTERVAL_ON_TASK);
199 }
200 
208  Timer_Classes the_class
209 )
210 {
211  return ( the_class == TIMER_TIME_OF_DAY );
212 }
213 
221  Timer_Classes the_class
222 )
223 {
224  return ( the_class == TIMER_DORMANT );
225 }
226 
227 void _Timer_Cancel( Timer_Control *the_timer );
228 
231 #ifdef __cplusplus
232 }
233 #endif
234 
235 #endif
236 /* end of include file */
RTEMS_INLINE_ROUTINE Timer_Control * _Timer_Get(Objects_Id id, Objects_Locations *location)
Timer_Get.
Definition: timerimpl.h:179
void _Objects_Free(Objects_Information *information, Objects_Control *the_object)
Frees an object.
Definition: objectfree.c:25
RTEMS_INLINE_ROUTINE bool _Timer_Is_dormant_class(Timer_Classes the_class)
Timer_Is_dormant_class.
Definition: timerimpl.h:220
void _Timer_Manager_initialization(void)
Timer Manager Initialization.
Definition: rtemstimer.c:29
Thread_Control * system_watchdog_helper
Unique identifier of the context which deals currently with the system watchdog.
Definition: timerimpl.h:76
Objects_Control * _Objects_Allocate(Objects_Information *information)
Allocates an object.
Definition: objectallocate.c:101
Watchdog_Interval last_snapshot
Last time snapshot of the timer server.
Definition: timerimpl.h:94
void(* Timer_server_Method)(Timer_server_Control *timer_server, Timer_Control *timer)
Method used for task based timers.
Definition: timerimpl.h:55
Inlined Routines in the Watchdog Handler.
#define RTEMS_INLINE_ROUTINE
The following (in conjunction with compiler arguments) are used to choose between the use of static i...
Definition: basedefs.h:135
This value indicates the timer is currently in use as an interval timer which will fire in the clock ...
Definition: timer.h:75
RTEMS_TIMER_EXTERN Objects_Information _Timer_Information
The following defines the information control block used to manage this class of objects.
Definition: timerimpl.h:137
The control block used to manage each watchdog timer.
Definition: watchdog.h:98
This value indicates the timer is currently not in use.
Definition: timer.h:98
Objects_Control Object
This field is the object management portion of a Timer instance.
Definition: timer.h:122
uint32_t generation
Each insert and tickle operation increases the generation count so that the system watchdog dealer no...
Definition: timerimpl.h:82
Watchdog_Interval current_snapshot
Current time snapshot of the timer server.
Definition: timerimpl.h:101
RTEMS_TIMER_EXTERN Timer_server_Control *volatile _Timer_server
Pointer to default timer server control block.
Definition: timerimpl.h:131
Constants and Structures Related with the Thread Control Block.
This value indicates the timer is currently in use as an interval timer which will fire in the timer ...
Definition: timer.h:81
Objects_Control * _Objects_Get(Objects_Information *information, Objects_Id id, Objects_Locations *location)
Maps object ids to object control blocks.
Definition: objectget.c:23
Watchdog_Header Header
Watchdog header managed by the timer server.
Definition: timerimpl.h:87
Watchdog_Control System_watchdog
This watchdog that will be registered in the system tick mechanic for timer server wake-up...
Definition: timerimpl.h:65
RTEMS_INLINE_ROUTINE void _Timer_Free(Timer_Control *the_timer)
Timer_Free.
Definition: timerimpl.h:163
This structure defines the Thread Control Block (TCB).
Definition: thread.h:671
Watchdog_Interval system_watchdog_delta
Remaining delta of the system watchdog.
Definition: timerimpl.h:70
Timer_Classes
The following enumerated type details the classes to which a timer may belong.
Definition: timer.h:70
#define RTEMS_TIMER_EXTERN
Instantiate RTEMS Timer Data.
Definition: timerimpl.h:47
The following defines the structure for the information used to manage each class of objects...
Definition: objectimpl.h:136
Timer_server_Method cancel
The cancel method of the timer server.
Definition: timerimpl.h:108
RTEMS_INLINE_ROUTINE bool _Timer_Is_timer_of_day_class(Timer_Classes the_class)
Timer_Is_time_of_day_class.
Definition: timerimpl.h:207
uint32_t Watchdog_Interval
Type is used to specify the length of intervals.
Definition: watchdog.h:47
Watchdog header.
Definition: watchdogimpl.h:74
This value indicates the timer is currently in use as an time of day timer which will fire in the clo...
Definition: timer.h:87
Objects_Locations
This enumerated type lists the locations which may be returned by _Objects_Get.
Definition: objectimpl.h:117
Timer_server_Method schedule_operation
The schedule operation method of the timer server.
Definition: timerimpl.h:113
Timer_server_Watchdogs TOD_watchdogs
TOD watchdogs triggered by the timer server.
Definition: timerimpl.h:123
Inlined Routines in the Object Handler.
The following records define the control block used to manage each timer.
Definition: timer.h:120
uint32_t Objects_Id
The following type defines the control block used to manage object IDs.
Definition: object.h:122
RTEMS_INLINE_ROUTINE Timer_Control * _Timer_Allocate(void)
Timer_Allocate.
Definition: timerimpl.h:152
Definition: timerimpl.h:104
Timer_server_Watchdogs Interval_watchdogs
Interval watchdogs triggered by the timer server.
Definition: timerimpl.h:118
Definition: timerimpl.h:60
RTEMS_INLINE_ROUTINE bool _Timer_Is_interval_class(Timer_Classes the_class)
Timer_Is_interval_class.
Definition: timerimpl.h:194