source: rtems/c/src/exec/posix/include/rtems/posix/timer.h @ 939e29d

4.104.114.84.95
Last change on this file since 939e29d was 939e29d, checked in by Joel Sherrill <joel.sherrill@…>, on 08/15/00 at 13:19:57

2000-08-15 Joel Sherrill <joel@…>

  • src/ptimer1.c: Removed unused routine PRINT_ERRNO_S.
  • src/ptimer1.c: Removed unnecessary routine COPY_ITIMERSPEC_S and used structure copy instead.
  • src/ptimer1.c: Renamed timer_alive_t to POSIX_Timer_Control.
  • include/rtems/posix/timer.h: Ditto.
  • Property mode set to 100644
File size: 2.1 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#define MAX_NSEC_C    1000000000 /* Maximum number of nsec allowed         */
17#define MIN_NSEC_C             0 /* Minimum number of nsec allowew         */
18#define TIMER_RELATIVE_C       0 /* Indicates that the fire time is
19                                  * relative to the current one            */
20#define SEC_TO_TICKS_C _TOD_Ticks_per_second /* Number of ticks in a second*/
21#define NSEC_PER_SEC_C 1000000000 /* Nanoseconds in a second               */
22
23#define NO_MORE_TIMERS_C      11 /* There is not available timers          */
24#define BAD_TIMER_C           11 /* The timer does not exist in the table  */
25
26#define SECONDS_PER_YEAR_C    ( 360 * 24 * 60 * 60 )
27#define SECONDS_PER_MONTH_C    ( 30 * 24 * 60 * 60 )
28#define SECONDS_PER_DAY_C           ( 24 * 60 * 60 )
29#define SECONDS_PER_HOUR_C               ( 60 * 60 )
30#define SECONDS_PER_MINUTE_C                  ( 60 )
31
32
33/*
34 * Data for a timer
35 */
36
37typedef struct {
38  pthread_t         thread_id;  /* Thread identifier                     */
39  char              state;      /* State of the timer                    */
40  struct sigevent   inf;        /* Information associated to the timer   */
41  timer_t           timer_id;   /* Created timer identifier              */
42  struct itimerspec timer_data; /* Timing data of the timer              */
43  unsigned32        ticks;      /* Number of ticks of the initialization */
44  unsigned32        overrun;    /* Number of expirations of the timer    */
45  rtems_time_of_day time;       /* Time in which the timer was started   */
46} POSIX_Timer_Control;
47
48/*
49 * Array of Timers
50 */
51
52extern int timer_max;
53extern POSIX_Timer_Control *timer_struct;
54
55#endif
56/* end of include file */
57
Note: See TracBrowser for help on using the repository browser.