Final tuning required to drop out POSIX timers.

This commit is contained in:
Joel Sherrill
1999-11-02 19:11:16 +00:00
parent 6800397962
commit 07e07437c4
7 changed files with 117 additions and 93 deletions

View File

@@ -10,7 +10,7 @@ MP_H_PIECES = $(MP_H_PIECES_$(HAS_MP)_V)
H_PIECES = cancel.h cond.h config.h key.h mqueue.h mutex.h posixapi.h \
priority.h psignal.h pthread.h ptimer.h semaphore.h seterr.h threadsup.h \
time.h $(MP_H_PIECES)
time.h timer.h $(MP_H_PIECES)
#H_PIECES= intr.h threadsup.h time.h
noinst_HEADERS = $(H_PIECES)

View File

@@ -5,6 +5,31 @@
#ifndef __RTEMS_POSIX_TIMERS_h
#define __RTEMS_POSIX_TIMERS_h
/* ************
* Constants
* ************/
#define STATE_FREE_C 0x01 /* Free position of the table of timers */
#define STATE_CREATE_NEW_C 0x02 /* Created timer but not running */
#define STATE_CREATE_RUN_C 0x03 /* Created timer and running */
#define STATE_CREATE_STOP_C 0x04 /* Created, ran and stopped timer */
#define MAX_NSEC_C 1000000000 /* Maximum number of nsec allowed */
#define MIN_NSEC_C 0 /* Minimum number of nsec allowew */
#define TIMER_RELATIVE_C 0 /* Indicates that the fire time is
* relative to the current one */
#define SEC_TO_TICKS_C _TOD_Ticks_per_second /* Number of ticks in a second*/
#define NSEC_PER_SEC_C 1000000000 /* Nanoseconds in a second */
#define NO_MORE_TIMERS_C 11 /* There is not available timers */
#define BAD_TIMER_C 11 /* The timer does not exist in the table */
#define SECONDS_PER_YEAR_C ( 360 * 24 * 60 * 60 )
#define SECONDS_PER_MONTH_C ( 30 * 24 * 60 * 60 )
#define SECONDS_PER_DAY_C ( 24 * 60 * 60 )
#define SECONDS_PER_HOUR_C ( 60 * 60 )
#define SECONDS_PER_MINUTE_C ( 60 )
/*
* Data for a timer
*/

View File

@@ -34,6 +34,38 @@
#include <rtems/posix/timer.h>
/* ***************************************************************************
* TIMER_INITIALIZE_S
*
* Description: Initialize the data of a timer
* ***************************************************************************/
void TIMER_INITIALIZE_S ( int timer_pos )
{
/*
* Indicates that the position in the table is free
*/
timer_struct[timer_pos].state = STATE_FREE_C;
/*
* The initial data of timing are set with null value
*/
timer_struct[timer_pos].timer_data.it_value.tv_sec = 0;
timer_struct[timer_pos].timer_data.it_value.tv_nsec = 0;
timer_struct[timer_pos].timer_data.it_interval.tv_sec = 0;
timer_struct[timer_pos].timer_data.it_interval.tv_nsec = 0;
/*
* The count of expirations is 0
*/
timer_struct[timer_pos].overrun = 0;
}
/* ***************************************************************************
* _POSIX_Timer_Manager_initialization
*
@@ -41,7 +73,6 @@
* the timers are stored
* ***************************************************************************/
extern void TIMER_INITIALIZE_S( int );
int timer_max;
timer_alive_t *timer_struct;

View File

@@ -38,26 +38,6 @@
* Constants
* ************/
#define STATE_FREE_C 0x01 /* Free position of the table of timers */
#define STATE_CREATE_NEW_C 0x02 /* Created timer but not running */
#define STATE_CREATE_RUN_C 0x03 /* Created timer and running */
#define STATE_CREATE_STOP_C 0x04 /* Created, ran and stopped timer */
#define MAX_NSEC_C 1000000000 /* Maximum number of nsec allowed */
#define MIN_NSEC_C 0 /* Minimum number of nsec allowew */
#define TIMER_RELATIVE_C 0 /* Indicates that the fire time is
* relative to the current one */
#define SEC_TO_TICKS_C _TOD_Ticks_per_second /* Number of ticks in a second*/
#define NSEC_PER_SEC_C 1000000000 /* Nanoseconds in a second */
#define NO_MORE_TIMERS_C 11 /* There is not available timers */
#define BAD_TIMER_C 11 /* The timer does not exist in the table */
#define SECONDS_PER_YEAR_C ( 360 * 24 * 60 * 60 )
#define SECONDS_PER_MONTH_C ( 30 * 24 * 60 * 60 )
#define SECONDS_PER_DAY_C ( 24 * 60 * 60 )
#define SECONDS_PER_HOUR_C ( 60 * 60 )
#define SECONDS_PER_MINUTE_C ( 60 )
/*
#define DEBUG_MESSAGES
*/
@@ -121,31 +101,7 @@ static void PRINT_ERRNO_S ()
* Description: Initialize the data of a timer
* ***************************************************************************/
void TIMER_INITIALIZE_S ( int timer_pos )
{
/*
* Indicates that the position in the table is free
*/
timer_struct[timer_pos].state = STATE_FREE_C;
/*
* The initial data of timing are set with null value
*/
timer_struct[timer_pos].timer_data.it_value.tv_sec = 0;
timer_struct[timer_pos].timer_data.it_value.tv_nsec = 0;
timer_struct[timer_pos].timer_data.it_interval.tv_sec = 0;
timer_struct[timer_pos].timer_data.it_interval.tv_nsec = 0;
/*
* The count of expirations is 0
*/
timer_struct[timer_pos].overrun = 0;
}
extern void TIMER_INITIALIZE_S ( int timer_pos );
/* ***************************************************************************
* _POSIX_Timer_Manager_initialization

View File

@@ -5,6 +5,31 @@
#ifndef __RTEMS_POSIX_TIMERS_h
#define __RTEMS_POSIX_TIMERS_h
/* ************
* Constants
* ************/
#define STATE_FREE_C 0x01 /* Free position of the table of timers */
#define STATE_CREATE_NEW_C 0x02 /* Created timer but not running */
#define STATE_CREATE_RUN_C 0x03 /* Created timer and running */
#define STATE_CREATE_STOP_C 0x04 /* Created, ran and stopped timer */
#define MAX_NSEC_C 1000000000 /* Maximum number of nsec allowed */
#define MIN_NSEC_C 0 /* Minimum number of nsec allowew */
#define TIMER_RELATIVE_C 0 /* Indicates that the fire time is
* relative to the current one */
#define SEC_TO_TICKS_C _TOD_Ticks_per_second /* Number of ticks in a second*/
#define NSEC_PER_SEC_C 1000000000 /* Nanoseconds in a second */
#define NO_MORE_TIMERS_C 11 /* There is not available timers */
#define BAD_TIMER_C 11 /* The timer does not exist in the table */
#define SECONDS_PER_YEAR_C ( 360 * 24 * 60 * 60 )
#define SECONDS_PER_MONTH_C ( 30 * 24 * 60 * 60 )
#define SECONDS_PER_DAY_C ( 24 * 60 * 60 )
#define SECONDS_PER_HOUR_C ( 60 * 60 )
#define SECONDS_PER_MINUTE_C ( 60 )
/*
* Data for a timer
*/

View File

@@ -34,6 +34,38 @@
#include <rtems/posix/timer.h>
/* ***************************************************************************
* TIMER_INITIALIZE_S
*
* Description: Initialize the data of a timer
* ***************************************************************************/
void TIMER_INITIALIZE_S ( int timer_pos )
{
/*
* Indicates that the position in the table is free
*/
timer_struct[timer_pos].state = STATE_FREE_C;
/*
* The initial data of timing are set with null value
*/
timer_struct[timer_pos].timer_data.it_value.tv_sec = 0;
timer_struct[timer_pos].timer_data.it_value.tv_nsec = 0;
timer_struct[timer_pos].timer_data.it_interval.tv_sec = 0;
timer_struct[timer_pos].timer_data.it_interval.tv_nsec = 0;
/*
* The count of expirations is 0
*/
timer_struct[timer_pos].overrun = 0;
}
/* ***************************************************************************
* _POSIX_Timer_Manager_initialization
*
@@ -41,7 +73,6 @@
* the timers are stored
* ***************************************************************************/
extern void TIMER_INITIALIZE_S( int );
int timer_max;
timer_alive_t *timer_struct;

View File

@@ -38,26 +38,6 @@
* Constants
* ************/
#define STATE_FREE_C 0x01 /* Free position of the table of timers */
#define STATE_CREATE_NEW_C 0x02 /* Created timer but not running */
#define STATE_CREATE_RUN_C 0x03 /* Created timer and running */
#define STATE_CREATE_STOP_C 0x04 /* Created, ran and stopped timer */
#define MAX_NSEC_C 1000000000 /* Maximum number of nsec allowed */
#define MIN_NSEC_C 0 /* Minimum number of nsec allowew */
#define TIMER_RELATIVE_C 0 /* Indicates that the fire time is
* relative to the current one */
#define SEC_TO_TICKS_C _TOD_Ticks_per_second /* Number of ticks in a second*/
#define NSEC_PER_SEC_C 1000000000 /* Nanoseconds in a second */
#define NO_MORE_TIMERS_C 11 /* There is not available timers */
#define BAD_TIMER_C 11 /* The timer does not exist in the table */
#define SECONDS_PER_YEAR_C ( 360 * 24 * 60 * 60 )
#define SECONDS_PER_MONTH_C ( 30 * 24 * 60 * 60 )
#define SECONDS_PER_DAY_C ( 24 * 60 * 60 )
#define SECONDS_PER_HOUR_C ( 60 * 60 )
#define SECONDS_PER_MINUTE_C ( 60 )
/*
#define DEBUG_MESSAGES
*/
@@ -121,31 +101,7 @@ static void PRINT_ERRNO_S ()
* Description: Initialize the data of a timer
* ***************************************************************************/
void TIMER_INITIALIZE_S ( int timer_pos )
{
/*
* Indicates that the position in the table is free
*/
timer_struct[timer_pos].state = STATE_FREE_C;
/*
* The initial data of timing are set with null value
*/
timer_struct[timer_pos].timer_data.it_value.tv_sec = 0;
timer_struct[timer_pos].timer_data.it_value.tv_nsec = 0;
timer_struct[timer_pos].timer_data.it_interval.tv_sec = 0;
timer_struct[timer_pos].timer_data.it_interval.tv_nsec = 0;
/*
* The count of expirations is 0
*/
timer_struct[timer_pos].overrun = 0;
}
extern void TIMER_INITIALIZE_S ( int timer_pos );
/* ***************************************************************************
* _POSIX_Timer_Manager_initialization