From 939e29dc4d68ed7bd8c89b70d262bb72c0ff66c3 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 15 Aug 2000 13:19:57 +0000 Subject: 2000-08-15 Joel Sherrill * 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. --- cpukit/posix/src/ptimer.c | 4 ++-- cpukit/posix/src/ptimer1.c | 53 +++++++++++----------------------------------- 2 files changed, 14 insertions(+), 43 deletions(-) (limited to 'cpukit/posix/src') diff --git a/cpukit/posix/src/ptimer.c b/cpukit/posix/src/ptimer.c index d8733e8bfa..ab51dcc9bb 100644 --- a/cpukit/posix/src/ptimer.c +++ b/cpukit/posix/src/ptimer.c @@ -74,7 +74,7 @@ void TIMER_INITIALIZE_S ( int timer_pos ) * ***************************************************************************/ int timer_max; -timer_alive_t *timer_struct; +POSIX_Timer_Control *timer_struct; void _POSIX_Timer_Manager_initialization ( int max_timers ) @@ -82,7 +82,7 @@ void _POSIX_Timer_Manager_initialization ( int max_timers ) int index; timer_struct = _Workspace_Allocate_or_fatal_error( - max_timers * sizeof(timer_alive_t) ); + max_timers * sizeof(POSIX_Timer_Control) ); /* * Initialize all the timers diff --git a/cpukit/posix/src/ptimer1.c b/cpukit/posix/src/ptimer1.c index 37682fc340..397c899c14 100644 --- a/cpukit/posix/src/ptimer1.c +++ b/cpukit/posix/src/ptimer1.c @@ -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 * @@ -317,24 +291,21 @@ int timer_create( int timer_pos; /* Position in the table of timers */ /* - * The data of the structure evp are checked in order to verify if they - * are coherent. + * The data of the structure evp are checked in order to verify if they + * are coherent. */ if (evp != NULL) { - /* The structure has data */ - - if ( ( evp->sigev_notify != SIGEV_NONE ) && - ( evp->sigev_notify != SIGEV_SIGNAL ) ) { + /* The structure has data */ + if ( ( evp->sigev_notify != SIGEV_NONE ) && + ( evp->sigev_notify != SIGEV_SIGNAL ) ) { /* The value of the field sigev_notify is not valid */ - set_errno_and_return_minus_one( EINVAL ); - } } /* - * A timer is created using the primitive rtems_timer_create + * A timer is created using the primitive rtems_timer_create */ return_v = rtems_timer_create ( clock_id, &timer_id ); @@ -524,11 +495,11 @@ int timer_settime( /* The old data of the timer are returned */ if ( ovalue ) - COPY_ITIMERSPEC_S ( &timer_struct[timer_pos].timer_data, ovalue ); + *ovalue = timer_struct[timer_pos].timer_data; /* 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 */ @@ -582,9 +553,9 @@ int timer_settime( * returns the old ones in "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 */ @@ -656,9 +627,9 @@ int timer_settime( * returns the old ones in "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 */ -- cgit v1.2.3