source: rtems/cpukit/include/rtems/posix/timer.h @ 21275b58

5
Last change on this file since 21275b58 was 21275b58, checked in by Sebastian Huber <sebastian.huber@…>, on 11/22/18 at 18:14:51

score: Static Objects_Information initialization

Statically allocate the objects information together with the initial
set of objects either via <rtems/confdefs.h>. Provide default object
informations with zero objects via librtemscpu.a. This greatly
simplifies the workspace size estimate. RTEMS applications which do not
use the unlimited objects option are easier to debug since all objects
reside now in statically allocated objects of the right types.

Close #3621.

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[6c2675d]1/**
[cf301c9]2 * @file
3 *
4 * @brief POSIX Timers Internal Support
[21242c2]5 *
6 * This include files defines the internal support for implementation of
7 * POSIX Timers.
[6c2675d]8 */
9
[68003979]10/*
[21242c2]11 *  COPYRIGHT (c) 1989-2011.
[feaa007]12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
[c499856]16 *  http://www.rtems.org/license/LICENSE.
[68003979]17 */
18
[5ec2f12d]19#ifndef _RTEMS_POSIX_TIMER_H
20#define _RTEMS_POSIX_TIMER_H
[68003979]21
[a6e7d5e4]22#include <rtems/score/objectdata.h>
[f17c779]23#include <rtems/score/watchdog.h>
[07e0743]24
[f17c779]25#include <pthread.h>
[cf301c9]26
[c49b7ce]27#ifdef __cplusplus
28extern "C" {
29#endif
30
[f17c779]31/**
32 * @defgroup POSIX_INTERNAL_TIMERS POSIX Timer Private Support
33 *
34 * @ingroup POSIXAPI
[68003979]35 */
[f17c779]36/**@{*/
[f6e0934]37
38/*
39 * Data for a timer
40 */
[68003979]41typedef struct {
[b602c298]42  Objects_Control   Object;
[0243b0d]43  Watchdog_Control  Timer;      /* Internal Timer                        */
[68003979]44  pthread_t         thread_id;  /* Thread identifier                     */
45  char              state;      /* State of the timer                    */
46  struct sigevent   inf;        /* Information associated to the timer   */
47  struct itimerspec timer_data; /* Timing data of the timer              */
[39cefdd]48  uint32_t          ticks;      /* Number of ticks of the initialization */
49  uint32_t          overrun;    /* Number of expirations of the timer    */
[c3925db]50  struct timespec   time;       /* Time at which the timer was started   */
[939e29d]51} POSIX_Timer_Control;
[68003979]52
[21275b58]53/**
54 * @brief The POSIX Timer objects information.
55 */
56extern Objects_Information _POSIX_Timer_Information;
57
58/**
59 * @brief Macro to define the objects information for the POSIX Timer objects.
60 *
61 * This macro should only be used by <rtems/confdefs.h>.
62 *
63 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
64 * may be set).
65 */
66#define POSIX_TIMER_INFORMATION_DEFINE( max ) \
67  OBJECTS_INFORMATION_DEFINE( \
68    _POSIX_Timer, \
69    OBJECTS_POSIX_API, \
70    OBJECTS_POSIX_TIMERS, \
71    POSIX_Timer_Control, \
72    max, \
73    OBJECTS_NO_STRING_NAME, \
74    NULL \
75  )
[e97806a]76
[cf301c9]77/** @} */
78
[c49b7ce]79#ifdef __cplusplus
80}
81#endif
[cf301c9]82
[68003979]83#endif
84/* end of include file */
Note: See TracBrowser for help on using the repository browser.