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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [posix/] [include/] [rtems/] [posix/] [timer.h] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  $Id: timer.h,v 1.2 2001-09-27 11:59:14 chris 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
  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
} timer_alive_t;
47
 
48
/*
49
 * Array of Timers
50
 */
51
 
52
extern int timer_max;
53
extern timer_alive_t *timer_struct;
54
 
55
#endif
56
/* end of include file */
57
 

powered by: WebSVN 2.1.0

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