source: rtems/cpukit/posix/include/rtems/posix/timer.h @ 8eaf3bce

4.115
Last change on this file since 8eaf3bce was 8eaf3bce, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/24/11 at 15:09:54

Add missing includes.

  • Property mode set to 100644
File size: 2.7 KB
Line 
1/**
2 * @file rtems/posix/timer.h
3 */
4
5/*
6 *  COPYRIGHT (c) 1989-2008.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef _RTEMS_POSIX_TIMER_H
17#define _RTEMS_POSIX_TIMER_H
18
19#include <rtems/posix/config.h>
20#include <rtems/score/object.h>
21#include <rtems/score/watchdog.h> /* Watchdog_Control */
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/* Timer is free */
28#define POSIX_TIMER_STATE_FREE        0x01
29
30/* Created timer but not running          */
31#define POSIX_TIMER_STATE_CREATE_NEW  0x02
32
33/* Created timer and running              */
34#define POSIX_TIMER_STATE_CREATE_RUN  0x03
35
36/* Created, ran and stopped timer         */
37#define POSIX_TIMER_STATE_CREATE_STOP 0x04
38
39/* Indicates that the fire time is relative to the current one */
40#define POSIX_TIMER_RELATIVE       0
41
42/*
43 * POSIX defines TIMER_ABSTIME but no constant for relative.  So
44 * we have one internally but we need to be careful it has a different
45 * value.
46 */
47#if (POSIX_TIMER_RELATIVE == TIMER_ABSTIME)
48#error "POSIX_TIMER_RELATIVE == TIMER_ABSTIME"
49#endif
50
51
52/*
53 * Data for a timer
54 */
55typedef struct {
56  Objects_Control   Object;
57  Watchdog_Control  Timer;      /* Internal Timer                        */
58  pthread_t         thread_id;  /* Thread identifier                     */
59  char              state;      /* State of the timer                    */
60  struct sigevent   inf;        /* Information associated to the timer   */
61  struct itimerspec timer_data; /* Timing data of the timer              */
62  uint32_t          ticks;      /* Number of ticks of the initialization */
63  uint32_t          overrun;    /* Number of expirations of the timer    */
64  struct timespec   time;       /* Time at which the timer was started   */
65} POSIX_Timer_Control;
66
67/*
68 *  _POSIX_Timers_Manager_initialization
69 *
70 *  DESCRIPTION:
71 *
72 *  This routine performs the initialization necessary for this manager.
73 */
74void _POSIX_Timer_Manager_initialization(void);
75
76/*
77 *  Timer TSR
78 */
79void _POSIX_Timer_TSR(Objects_Id timer, void *data);
80
81/*
82 *  Watchdog Insert helper
83 */
84bool _POSIX_Timer_Insert_helper(
85  Watchdog_Control               *timer,
86  Watchdog_Interval               ticks,
87  Objects_Id                      id,
88  Watchdog_Service_routine_entry  TSR,
89  void                           *arg
90);
91
92/*
93 *  The following defines the information control block used to manage
94 *  this class of objects.
95 */
96POSIX_EXTERN Objects_Information  _POSIX_Timer_Information;
97
98#ifndef __RTEMS_APPLICATION__
99#include <rtems/posix/timer.inl>
100#endif
101
102#ifdef __cplusplus
103}
104#endif
105
106#endif
107/* end of include file */
Note: See TracBrowser for help on using the repository browser.