forked from Imagelibrary/rtems
2000-08-15 Joel Sherrill <joel@OARcorp.com>
* src/ptimer1.c: Removed unused routine PRINT_ERRNO_S. * src/ptimer1.c: Removed unnecessary routine COPY_ITIMERSPEC_S and used structure copy instead. * src/ptimer1.c: Renamed timer_alive_t to POSIX_Timer_Control. * include/rtems/posix/timer.h: Ditto.
This commit is contained in:
@@ -1,11 +1,19 @@
|
|||||||
2000-08-15 Joel Sherrill <joel@OARcorp.com>
|
2000-08-15 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
* posix/src/ptimer1.c: Switched to using set_errno_and_return_minus_one()
|
* src/ptimer1.c: Removed unused routine PRINT_ERRNO_S.
|
||||||
|
* src/ptimer1.c: Removed unnecessary routine COPY_ITIMERSPEC_S
|
||||||
|
and used structure copy instead.
|
||||||
|
* src/ptimer1.c: Renamed timer_alive_t to POSIX_Timer_Control.
|
||||||
|
* include/rtems/posix/timer.h: Ditto.
|
||||||
|
|
||||||
|
2000-08-15 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
|
* src/ptimer1.c: Switched to using set_errno_and_return_minus_one()
|
||||||
to ensure that errno was always set.
|
to ensure that errno was always set.
|
||||||
|
|
||||||
2000-08-15 Joel Sherrill <joel@OARcorp.com>
|
2000-08-15 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
* posix/src/ptimer1.c (timer_settime): Converted use of rtems_clock_get
|
* src/ptimer1.c (timer_settime): Converted use of rtems_clock_get
|
||||||
to use SuperCore _TOD_Current variable.
|
to use SuperCore _TOD_Current variable.
|
||||||
|
|
||||||
2000-08-10 Joel Sherrill <joel@OARcorp.com>
|
2000-08-10 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|||||||
@@ -43,14 +43,14 @@ typedef struct {
|
|||||||
unsigned32 ticks; /* Number of ticks of the initialization */
|
unsigned32 ticks; /* Number of ticks of the initialization */
|
||||||
unsigned32 overrun; /* Number of expirations of the timer */
|
unsigned32 overrun; /* Number of expirations of the timer */
|
||||||
rtems_time_of_day time; /* Time in which the timer was started */
|
rtems_time_of_day time; /* Time in which the timer was started */
|
||||||
} timer_alive_t;
|
} POSIX_Timer_Control;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Array of Timers
|
* Array of Timers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern int timer_max;
|
extern int timer_max;
|
||||||
extern timer_alive_t *timer_struct;
|
extern POSIX_Timer_Control *timer_struct;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/* end of include file */
|
/* end of include file */
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ void TIMER_INITIALIZE_S ( int timer_pos )
|
|||||||
* ***************************************************************************/
|
* ***************************************************************************/
|
||||||
|
|
||||||
int timer_max;
|
int timer_max;
|
||||||
timer_alive_t *timer_struct;
|
POSIX_Timer_Control *timer_struct;
|
||||||
|
|
||||||
|
|
||||||
void _POSIX_Timer_Manager_initialization ( int max_timers )
|
void _POSIX_Timer_Manager_initialization ( int max_timers )
|
||||||
@@ -82,7 +82,7 @@ void _POSIX_Timer_Manager_initialization ( int max_timers )
|
|||||||
int index;
|
int index;
|
||||||
|
|
||||||
timer_struct = _Workspace_Allocate_or_fatal_error(
|
timer_struct = _Workspace_Allocate_or_fatal_error(
|
||||||
max_timers * sizeof(timer_alive_t) );
|
max_timers * sizeof(POSIX_Timer_Control) );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize all the timers
|
* Initialize all the timers
|
||||||
|
|||||||
@@ -70,32 +70,6 @@ static void PRINT_MSG_S ( char *msg )
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ***************************************************************************
|
|
||||||
* PRINT_ERRNO_S
|
|
||||||
*
|
|
||||||
* Description: Print the value of the global variable errno in the display
|
|
||||||
* ***************************************************************************/
|
|
||||||
|
|
||||||
static void PRINT_ERRNO_S ()
|
|
||||||
{
|
|
||||||
#ifdef DEBUG_MESSAGES
|
|
||||||
switch (errno)
|
|
||||||
{
|
|
||||||
case EINVAL:
|
|
||||||
PRINT_MSG_S ( "errno EINVAL"); break;
|
|
||||||
case EPERM:
|
|
||||||
PRINT_MSG_S ( "errno EPERM"); break;
|
|
||||||
case ESRCH:
|
|
||||||
PRINT_MSG_S ( "errno ESRCH"); break;
|
|
||||||
case EAGAIN:
|
|
||||||
PRINT_MSG_S ( "errno EAGAIN"); break;
|
|
||||||
default :
|
|
||||||
printf ("errno: %d\n", errno);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ***************************************************************************
|
/* ***************************************************************************
|
||||||
* TIMER_INITIALIZE_S
|
* TIMER_INITIALIZE_S
|
||||||
*
|
*
|
||||||
@@ -323,13 +297,10 @@ int timer_create(
|
|||||||
|
|
||||||
if (evp != NULL) {
|
if (evp != NULL) {
|
||||||
/* The structure has data */
|
/* The structure has data */
|
||||||
|
|
||||||
if ( ( evp->sigev_notify != SIGEV_NONE ) &&
|
if ( ( evp->sigev_notify != SIGEV_NONE ) &&
|
||||||
( evp->sigev_notify != SIGEV_SIGNAL ) ) {
|
( evp->sigev_notify != SIGEV_SIGNAL ) ) {
|
||||||
/* The value of the field sigev_notify is not valid */
|
/* The value of the field sigev_notify is not valid */
|
||||||
|
|
||||||
set_errno_and_return_minus_one( EINVAL );
|
set_errno_and_return_minus_one( EINVAL );
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,11 +495,11 @@ int timer_settime(
|
|||||||
/* The old data of the timer are returned */
|
/* The old data of the timer are returned */
|
||||||
|
|
||||||
if ( ovalue )
|
if ( ovalue )
|
||||||
COPY_ITIMERSPEC_S ( &timer_struct[timer_pos].timer_data, ovalue );
|
*ovalue = timer_struct[timer_pos].timer_data;
|
||||||
|
|
||||||
/* The new data are set */
|
/* The new data are set */
|
||||||
|
|
||||||
COPY_ITIMERSPEC_S ( value, &timer_struct[timer_pos].timer_data );
|
timer_struct[timer_pos].timer_data = *value;
|
||||||
|
|
||||||
/* Indicates that the timer is created and stopped */
|
/* Indicates that the timer is created and stopped */
|
||||||
|
|
||||||
@@ -582,9 +553,9 @@ int timer_settime(
|
|||||||
* returns the old ones in "ovalue" */
|
* returns the old ones in "ovalue" */
|
||||||
|
|
||||||
if ( ovalue )
|
if ( ovalue )
|
||||||
COPY_ITIMERSPEC_S ( &timer_struct[timer_pos].timer_data, ovalue );
|
*ovalue = timer_struct[timer_pos].timer_data;
|
||||||
|
|
||||||
COPY_ITIMERSPEC_S ( value, &timer_struct[timer_pos].timer_data );
|
timer_struct[timer_pos].timer_data = *value;
|
||||||
|
|
||||||
/* It indicates that the time is running */
|
/* It indicates that the time is running */
|
||||||
|
|
||||||
@@ -656,9 +627,9 @@ int timer_settime(
|
|||||||
* returns the old ones in "ovalue" */
|
* returns the old ones in "ovalue" */
|
||||||
|
|
||||||
if ( ovalue )
|
if ( ovalue )
|
||||||
COPY_ITIMERSPEC_S ( &timer_struct[timer_pos].timer_data, ovalue );
|
*ovalue = timer_struct[timer_pos].timer_data;
|
||||||
|
|
||||||
COPY_ITIMERSPEC_S ( value, &timer_struct[timer_pos].timer_data );
|
timer_struct[timer_pos].timer_data = *value;
|
||||||
|
|
||||||
/* It indicates that the time is running */
|
/* It indicates that the time is running */
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
2000-08-15 Joel Sherrill <joel@OARcorp.com>
|
2000-08-15 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
* posix/src/ptimer1.c: Switched to using set_errno_and_return_minus_one()
|
* src/ptimer1.c: Removed unused routine PRINT_ERRNO_S.
|
||||||
|
* src/ptimer1.c: Removed unnecessary routine COPY_ITIMERSPEC_S
|
||||||
|
and used structure copy instead.
|
||||||
|
* src/ptimer1.c: Renamed timer_alive_t to POSIX_Timer_Control.
|
||||||
|
* include/rtems/posix/timer.h: Ditto.
|
||||||
|
|
||||||
|
2000-08-15 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
|
* src/ptimer1.c: Switched to using set_errno_and_return_minus_one()
|
||||||
to ensure that errno was always set.
|
to ensure that errno was always set.
|
||||||
|
|
||||||
2000-08-15 Joel Sherrill <joel@OARcorp.com>
|
2000-08-15 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
* posix/src/ptimer1.c (timer_settime): Converted use of rtems_clock_get
|
* src/ptimer1.c (timer_settime): Converted use of rtems_clock_get
|
||||||
to use SuperCore _TOD_Current variable.
|
to use SuperCore _TOD_Current variable.
|
||||||
|
|
||||||
2000-08-10 Joel Sherrill <joel@OARcorp.com>
|
2000-08-10 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|||||||
@@ -43,14 +43,14 @@ typedef struct {
|
|||||||
unsigned32 ticks; /* Number of ticks of the initialization */
|
unsigned32 ticks; /* Number of ticks of the initialization */
|
||||||
unsigned32 overrun; /* Number of expirations of the timer */
|
unsigned32 overrun; /* Number of expirations of the timer */
|
||||||
rtems_time_of_day time; /* Time in which the timer was started */
|
rtems_time_of_day time; /* Time in which the timer was started */
|
||||||
} timer_alive_t;
|
} POSIX_Timer_Control;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Array of Timers
|
* Array of Timers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern int timer_max;
|
extern int timer_max;
|
||||||
extern timer_alive_t *timer_struct;
|
extern POSIX_Timer_Control *timer_struct;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/* end of include file */
|
/* end of include file */
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ void TIMER_INITIALIZE_S ( int timer_pos )
|
|||||||
* ***************************************************************************/
|
* ***************************************************************************/
|
||||||
|
|
||||||
int timer_max;
|
int timer_max;
|
||||||
timer_alive_t *timer_struct;
|
POSIX_Timer_Control *timer_struct;
|
||||||
|
|
||||||
|
|
||||||
void _POSIX_Timer_Manager_initialization ( int max_timers )
|
void _POSIX_Timer_Manager_initialization ( int max_timers )
|
||||||
@@ -82,7 +82,7 @@ void _POSIX_Timer_Manager_initialization ( int max_timers )
|
|||||||
int index;
|
int index;
|
||||||
|
|
||||||
timer_struct = _Workspace_Allocate_or_fatal_error(
|
timer_struct = _Workspace_Allocate_or_fatal_error(
|
||||||
max_timers * sizeof(timer_alive_t) );
|
max_timers * sizeof(POSIX_Timer_Control) );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize all the timers
|
* Initialize all the timers
|
||||||
|
|||||||
@@ -70,32 +70,6 @@ static void PRINT_MSG_S ( char *msg )
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ***************************************************************************
|
|
||||||
* PRINT_ERRNO_S
|
|
||||||
*
|
|
||||||
* Description: Print the value of the global variable errno in the display
|
|
||||||
* ***************************************************************************/
|
|
||||||
|
|
||||||
static void PRINT_ERRNO_S ()
|
|
||||||
{
|
|
||||||
#ifdef DEBUG_MESSAGES
|
|
||||||
switch (errno)
|
|
||||||
{
|
|
||||||
case EINVAL:
|
|
||||||
PRINT_MSG_S ( "errno EINVAL"); break;
|
|
||||||
case EPERM:
|
|
||||||
PRINT_MSG_S ( "errno EPERM"); break;
|
|
||||||
case ESRCH:
|
|
||||||
PRINT_MSG_S ( "errno ESRCH"); break;
|
|
||||||
case EAGAIN:
|
|
||||||
PRINT_MSG_S ( "errno EAGAIN"); break;
|
|
||||||
default :
|
|
||||||
printf ("errno: %d\n", errno);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ***************************************************************************
|
/* ***************************************************************************
|
||||||
* TIMER_INITIALIZE_S
|
* TIMER_INITIALIZE_S
|
||||||
*
|
*
|
||||||
@@ -323,13 +297,10 @@ int timer_create(
|
|||||||
|
|
||||||
if (evp != NULL) {
|
if (evp != NULL) {
|
||||||
/* The structure has data */
|
/* The structure has data */
|
||||||
|
|
||||||
if ( ( evp->sigev_notify != SIGEV_NONE ) &&
|
if ( ( evp->sigev_notify != SIGEV_NONE ) &&
|
||||||
( evp->sigev_notify != SIGEV_SIGNAL ) ) {
|
( evp->sigev_notify != SIGEV_SIGNAL ) ) {
|
||||||
/* The value of the field sigev_notify is not valid */
|
/* The value of the field sigev_notify is not valid */
|
||||||
|
|
||||||
set_errno_and_return_minus_one( EINVAL );
|
set_errno_and_return_minus_one( EINVAL );
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,11 +495,11 @@ int timer_settime(
|
|||||||
/* The old data of the timer are returned */
|
/* The old data of the timer are returned */
|
||||||
|
|
||||||
if ( ovalue )
|
if ( ovalue )
|
||||||
COPY_ITIMERSPEC_S ( &timer_struct[timer_pos].timer_data, ovalue );
|
*ovalue = timer_struct[timer_pos].timer_data;
|
||||||
|
|
||||||
/* The new data are set */
|
/* The new data are set */
|
||||||
|
|
||||||
COPY_ITIMERSPEC_S ( value, &timer_struct[timer_pos].timer_data );
|
timer_struct[timer_pos].timer_data = *value;
|
||||||
|
|
||||||
/* Indicates that the timer is created and stopped */
|
/* Indicates that the timer is created and stopped */
|
||||||
|
|
||||||
@@ -582,9 +553,9 @@ int timer_settime(
|
|||||||
* returns the old ones in "ovalue" */
|
* returns the old ones in "ovalue" */
|
||||||
|
|
||||||
if ( ovalue )
|
if ( ovalue )
|
||||||
COPY_ITIMERSPEC_S ( &timer_struct[timer_pos].timer_data, ovalue );
|
*ovalue = timer_struct[timer_pos].timer_data;
|
||||||
|
|
||||||
COPY_ITIMERSPEC_S ( value, &timer_struct[timer_pos].timer_data );
|
timer_struct[timer_pos].timer_data = *value;
|
||||||
|
|
||||||
/* It indicates that the time is running */
|
/* It indicates that the time is running */
|
||||||
|
|
||||||
@@ -656,9 +627,9 @@ int timer_settime(
|
|||||||
* returns the old ones in "ovalue" */
|
* returns the old ones in "ovalue" */
|
||||||
|
|
||||||
if ( ovalue )
|
if ( ovalue )
|
||||||
COPY_ITIMERSPEC_S ( &timer_struct[timer_pos].timer_data, ovalue );
|
*ovalue = timer_struct[timer_pos].timer_data;
|
||||||
|
|
||||||
COPY_ITIMERSPEC_S ( value, &timer_struct[timer_pos].timer_data );
|
timer_struct[timer_pos].timer_data = *value;
|
||||||
|
|
||||||
/* It indicates that the time is running */
|
/* It indicates that the time is running */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user