source: rtems/cpukit/posix/include/rtems/posix/timer.h @ 39cefdd

4.104.114.84.9
Last change on this file since 39cefdd was 39cefdd, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 23, 2004 at 1:07:29 PM

2004-03-23 Ralf Corsepius <ralf_corsepius@…>

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