summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-08-15 13:19:57 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-08-15 13:19:57 +0000
commit939e29dc4d68ed7bd8c89b70d262bb72c0ff66c3 (patch)
tree340464e30b63b201f4f1ddfad83ae55f59e3b3ef /cpukit
parent2000-08-15 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-939e29dc4d68ed7bd8c89b70d262bb72c0ff66c3.tar.bz2
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.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/posix/ChangeLog12
-rw-r--r--cpukit/posix/include/rtems/posix/timer.h4
-rw-r--r--cpukit/posix/src/ptimer.c4
-rw-r--r--cpukit/posix/src/ptimer1.c53
4 files changed, 26 insertions, 47 deletions
diff --git a/cpukit/posix/ChangeLog b/cpukit/posix/ChangeLog
index d64221a09d..e4e262c0e1 100644
--- a/cpukit/posix/ChangeLog
+++ b/cpukit/posix/ChangeLog
@@ -1,11 +1,19 @@
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.
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.
2000-08-10 Joel Sherrill <joel@OARcorp.com>
diff --git a/cpukit/posix/include/rtems/posix/timer.h b/cpukit/posix/include/rtems/posix/timer.h
index f8cbe48b73..8b11a18e65 100644
--- a/cpukit/posix/include/rtems/posix/timer.h
+++ b/cpukit/posix/include/rtems/posix/timer.h
@@ -43,14 +43,14 @@ typedef struct {
unsigned32 ticks; /* Number of ticks of the initialization */
unsigned32 overrun; /* Number of expirations of the timer */
rtems_time_of_day time; /* Time in which the timer was started */
-} timer_alive_t;
+} POSIX_Timer_Control;
/*
* Array of Timers
*/
extern int timer_max;
-extern timer_alive_t *timer_struct;
+extern POSIX_Timer_Control *timer_struct;
#endif
/* end of include file */
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 */