source: rtems/cpukit/posix/src/ptimer.c @ f22ebf0

4.104.114.84.95
Last change on this file since f22ebf0 was f42b726, checked in by Joel Sherrill <joel.sherrill@…>, on 01/24/01 at 14:17:28

2001-01-24 Ralf Corsepius <corsepiu@…>

  • configure.in: Add src/config.h
  • src/Makefile.am: Add INCLUDES += -I. to pickup config.h
  • src/.cvsignore: Add config.h and stamp-h
  • src/*.c: Add config.h support.
  • Property mode set to 100644
File size: 2.3 KB
Line 
1/*
2 *  ptimer.c,v 1.1 1996/06/03 16:29:58 joel Exp
3 */
4
5#if HAVE_CONFIG_H
6#include "config.h"
7#endif
8 
9#include <assert.h>
10#include <time.h>
11#include <errno.h>
12
13#include <rtems/system.h>
14#include <rtems/score/isr.h>
15#include <rtems/score/thread.h>
16#include <rtems/score/tod.h>
17
18#include <rtems/posix/time.h>
19
20/************************************/
21/* These includes are now necessary */
22/************************************/
23
24#include <sys/features.h>
25#include <rtems/rtems/status.h>
26#include <rtems/rtems/types.h>
27#include <rtems/rtems/timer.h>
28#include <rtems/rtems/clock.h>
29#include <rtems/posix/psignal.h>
30#include <rtems/score/wkspace.h>
31#include <pthread.h>
32#include <stdio.h>
33#include <signal.h>
34
35/*****************************/
36/* End of necessary includes */
37/*****************************/
38
39#include <rtems/posix/timer.h>
40
41/* ***************************************************************************
42 * TIMER_INITIALIZE_S
43 *
44 *  Description: Initialize the data of a timer
45 * ***************************************************************************/
46
47void TIMER_INITIALIZE_S ( int timer_pos )
48{
49
50   /*
51    * Indicates that the position in the table is free
52    */
53
54    timer_struct[timer_pos].state = STATE_FREE_C;
55
56   /*
57    * The initial data of timing are set with null value
58    */
59
60    timer_struct[timer_pos].timer_data.it_value.tv_sec     = 0;
61    timer_struct[timer_pos].timer_data.it_value.tv_nsec    = 0;
62    timer_struct[timer_pos].timer_data.it_interval.tv_sec  = 0;
63    timer_struct[timer_pos].timer_data.it_interval.tv_nsec = 0;
64
65   /*
66    * The count of expirations is 0
67    */
68
69    timer_struct[timer_pos].overrun = 0;
70
71}
72
73/* ***************************************************************************
74 * _POSIX_Timer_Manager_initialization
75 *
76 *  Description: Initialize the internal structure in which the data of all
77 *               the timers are stored
78 * ***************************************************************************/
79
80int timer_max;
81POSIX_Timer_Control *timer_struct;
82
83
84void _POSIX_Timer_Manager_initialization ( int max_timers )
85{
86   int index;
87
88   timer_struct = _Workspace_Allocate_or_fatal_error(
89      max_timers * sizeof(POSIX_Timer_Control) );
90
91   /*
92    *  Initialize all the timers
93    */
94
95   timer_max = max_timers;
96
97   for (index=0; index<max_timers; index++)
98     TIMER_INITIALIZE_S( index );
99
100   timer_max = max_timers;
101}
102
Note: See TracBrowser for help on using the repository browser.