source: rtems/cpukit/posix/include/rtems/posix/timer.h @ 6c2675d

4.104.114.84.95
Last change on this file since 6c2675d was 6c2675d, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/21/04 at 06:27:15

Add doxygen preamble.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/**
2 * @file rtems/posix/timer.h
3 */
4
5/*
6 *  $Id$
7 */
8
9#ifndef __RTEMS_POSIX_TIMERS_h
10#define __RTEMS_POSIX_TIMERS_h
11
12/* ************
13 * Constants
14 * ************/
15
16#define STATE_FREE_C        0x01 /* Free position of the table of timers   */
17#define STATE_CREATE_NEW_C  0x02 /* Created timer but not running          */
18#define STATE_CREATE_RUN_C  0x03 /* Created timer and running              */
19#define STATE_CREATE_STOP_C 0x04 /* Created, ran and stopped timer         */
20/* Maximum number of nsec allowed         */
21#define MAX_NSEC_C    (uint32_t  )1000000000
22#define MIN_NSEC_C             0 /* Minimum number of nsec allowew         */
23#define TIMER_RELATIVE_C       0 /* Indicates that the fire time is
24                                  * relative to the current one            */
25#define SEC_TO_TICKS_C _TOD_Ticks_per_second /* Number of ticks in a second*/
26/* Nanoseconds in a second               */
27#define NSEC_PER_SEC_C (uint32_t  )1000000000
28
29#define NO_MORE_TIMERS_C      11 /* There is not available timers          */
30#define BAD_TIMER_C           11 /* The timer does not exist in the table  */
31
32#define SECONDS_PER_YEAR_C    (uint32_t  )(360 * 24) * (uint32_t  )(60 * 60)
33#define SECONDS_PER_MONTH_C   (uint32_t  )( 30 * 24) * (uint32_t  )(60 * 60)
34#define SECONDS_PER_DAY_C     (uint32_t  )( 24 * 60) * (uint32_t  )(60)
35#define SECONDS_PER_HOUR_C               (uint32_t  )( 60 * 60 )
36#define SECONDS_PER_MINUTE_C                  (uint32_t  )( 60 )
37
38
39/*
40 * Data for a timer
41 */
42
43typedef struct {
44  Objects_Control   Object;
45  Watchdog_Control  Ticker;
46
47  pthread_t         thread_id;  /* Thread identifier                     */
48  char              state;      /* State of the timer                    */
49  struct sigevent   inf;        /* Information associated to the timer   */
50  timer_t           timer_id;   /* Created timer identifier              */
51  struct itimerspec timer_data; /* Timing data of the timer              */
52  uint32_t          ticks;      /* Number of ticks of the initialization */
53  uint32_t          overrun;    /* Number of expirations of the timer    */
54  rtems_time_of_day time;       /* Time in which the timer was started   */
55} POSIX_Timer_Control;
56
57/*
58 * Array of Timers
59 */
60
61extern int timer_max;
62extern POSIX_Timer_Control *timer_struct;
63
64/*
65 *  The following defines the information control block used to manage
66 *  this class of objects.
67 */
68
69RTEMS_EXTERN Objects_Information  _POSIX_Timer_Information;
70
71#ifndef __RTEMS_APPLICATION__
72#include <rtems/posix/timer.inl>
73#endif
74
75#endif
76/* end of include file */
Note: See TracBrowser for help on using the repository browser.