source: rtems/cpukit/posix/include/rtems/posix/timer.h @ b602c298

4.104.114.84.95
Last change on this file since b602c298 was b602c298, checked in by Joel Sherrill <joel.sherrill@…>, on 08/25/00 at 17:15:44

2000-08-25 Joel Sherrill <joel.sherrill@…>

  • inline/rtems/posix/timer.inl, include/rtems/posix/timer.h, inline/rtems/posix/Makefile.am, src/ptimer1.c: Redid the style of src/ptimer1.c. Continued effort to make the POSIX Timer implementation match that of other managers. Added data structures required to use SuperCore? Object Handler.
  • Property mode set to 100644
File size: 2.4 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  Objects_Control   Object;
39  Watchdog_Control  Ticker;
40
41  pthread_t         thread_id;  /* Thread identifier                     */
42  char              state;      /* State of the timer                    */
43  struct sigevent   inf;        /* Information associated to the timer   */
44  timer_t           timer_id;   /* Created timer identifier              */
45  struct itimerspec timer_data; /* Timing data of the timer              */
46  unsigned32        ticks;      /* Number of ticks of the initialization */
47  unsigned32        overrun;    /* Number of expirations of the timer    */
48  rtems_time_of_day time;       /* Time in which the timer was started   */
49} POSIX_Timer_Control;
50
51/*
52 * Array of Timers
53 */
54
55extern int timer_max;
56extern POSIX_Timer_Control *timer_struct;
57
58/*
59 *  The following defines the information control block used to manage
60 *  this class of objects.
61 */
62
63RTEMS_EXTERN Objects_Information  _POSIX_Timer_Information;
64
65#ifndef __RTEMS_APPLICATION__
66#include <rtems/posix/timer.inl>
67#endif
68
69#endif
70/* end of include file */
71
Note: See TracBrowser for help on using the repository browser.