OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [posix/] [include/] [rtems/] [posix/] [timer.h] - Blame information for rev 1780

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*
2
 *  timer.h,v 1.4 2000/08/25 17:15:44 joel Exp
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
 
37
typedef 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
 
55
extern int timer_max;
56
extern 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
 
63
RTEMS_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
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.