RTEMS CPU Kit with SuperCore  4.11.3
timerimpl.h
Go to the documentation of this file.
1 
10 /*
11  * COPYRIGHT (c) 1989-2013.
12  * On-Line Applications Research Corporation (OAR).
13  *
14  * The license and distribution terms for this file may be
15  * found in the file LICENSE in this distribution or at
16  * http://www.rtems.org/license/LICENSE.
17  */
18 
19 #ifndef _RTEMS_POSIX_TIMERIMPL_H
20 #define _RTEMS_POSIX_TIMERIMPL_H
21 
22 #include <rtems/posix/timer.h>
23 #include <rtems/score/objectimpl.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
30 #define POSIX_TIMER_STATE_FREE 0x01
31 
33 #define POSIX_TIMER_STATE_CREATE_NEW 0x02
34 
36 #define POSIX_TIMER_STATE_CREATE_RUN 0x03
37 
39 #define POSIX_TIMER_STATE_CREATE_STOP 0x04
40 
42 #define POSIX_TIMER_RELATIVE 0
43 
44 /*
45  * POSIX defines TIMER_ABSTIME but no constant for relative. So
46  * we have one internally but we need to be careful it has a different
47  * value.
48  */
49 #if (POSIX_TIMER_RELATIVE == TIMER_ABSTIME)
50 #error "POSIX_TIMER_RELATIVE == TIMER_ABSTIME"
51 #endif
52 
59 
65 void _POSIX_Timer_TSR(Objects_Id timer, void *data);
66 
71  Watchdog_Control *timer,
72  Watchdog_Interval ticks,
73  Objects_Id id,
75  void *arg
76 );
77 
83 
91 {
92  return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information );
93 }
94 
102  POSIX_Timer_Control *the_timer
103 )
104 {
105  _Objects_Free( &_POSIX_Timer_Information, &the_timer->Object );
106 }
107 
118  timer_t id,
119  Objects_Locations *location
120 )
121 {
122  return (POSIX_Timer_Control *)
123  _Objects_Get( &_POSIX_Timer_Information, (Objects_Id) id, location );
124 }
125 
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 #endif
131 /* end of include file */
void _Objects_Free(Objects_Information *information, Objects_Control *the_object)
Frees an object.
Definition: objectfree.c:25
RTEMS_INLINE_ROUTINE POSIX_Timer_Control * _POSIX_Timer_Get(timer_t id, Objects_Locations *location)
POSIX Timer Get.
Definition: timerimpl.h:117
Objects_Control * _Objects_Allocate(Objects_Information *information)
Allocates an object.
Definition: objectallocate.c:101
#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
RTEMS_INLINE_ROUTINE POSIX_Timer_Control * _POSIX_Timer_Allocate(void)
POSIX Timer Allocate.
Definition: timerimpl.h:90
POSIX_EXTERN Objects_Information _POSIX_Timer_Information
The following defines the information control block used to manage this class of objects.
Definition: timerimpl.h:82
The control block used to manage each watchdog timer.
Definition: watchdog.h:98
bool _POSIX_Timer_Insert_helper(Watchdog_Control *timer, Watchdog_Interval ticks, Objects_Id id, Watchdog_Service_routine_entry TSR, void *arg)
POSIX Timer Watchdog Insertion Helper.
Definition: timerinserthelper.c:32
POSIX Timers Internal Support.
Objects_Control * _Objects_Get(Objects_Information *information, Objects_Id id, Objects_Locations *location)
Maps object ids to object control blocks.
Definition: objectget.c:23
RTEMS_INLINE_ROUTINE void _POSIX_Timer_Free(POSIX_Timer_Control *the_timer)
POSIX Timer Free.
Definition: timerimpl.h:101
The following defines the structure for the information used to manage each class of objects...
Definition: objectimpl.h:136
uint32_t Watchdog_Interval
Type is used to specify the length of intervals.
Definition: watchdog.h:47
Objects_Locations
This enumerated type lists the locations which may be returned by _Objects_Get.
Definition: objectimpl.h:117
Watchdog_Service_routine(* Watchdog_Service_routine_entry)(Objects_Id, void *)
Pointer to a watchdog service routine.
Definition: watchdog.h:61
Inlined Routines in the Object Handler.
void _POSIX_Timer_TSR(Objects_Id timer, void *data)
POSIX Timer Manager Timer Service Routine Helper.
Definition: timertsr.c:35
Definition: timer.h:41
uint32_t Objects_Id
The following type defines the control block used to manage object IDs.
Definition: object.h:122
void _POSIX_Timer_Manager_initialization(void)
POSIX Timer Manager Initialization.
Definition: ptimer.c:57
#define POSIX_EXTERN
The following ensures that all data is declared in the space of the initialization routine for either...
Definition: basedefs.h:123