Changeset 939e29d in rtems


Ignore:
Timestamp:
Aug 15, 2000, 1:19:57 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
02fe6ab
Parents:
ea56c0a8
Message:

2000-08-15 Joel Sherrill <joel@…>

  • 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.
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/posix/ChangeLog

    rea56c0a8 r939e29d  
    112000-08-15      Joel Sherrill <joel@OARcorp.com>
    22
    3         * posix/src/ptimer1.c: Switched to using set_errno_and_return_minus_one()
     3        * src/ptimer1.c: Removed unused routine PRINT_ERRNO_S.
     4        * src/ptimer1.c: Removed unnecessary routine COPY_ITIMERSPEC_S
     5        and used structure copy instead.
     6        * src/ptimer1.c: Renamed timer_alive_t to POSIX_Timer_Control.
     7        * include/rtems/posix/timer.h: Ditto.
     8
     92000-08-15      Joel Sherrill <joel@OARcorp.com>
     10
     11        * src/ptimer1.c: Switched to using set_errno_and_return_minus_one()
    412        to ensure that errno was always set.
    513
    6142000-08-15      Joel Sherrill <joel@OARcorp.com>
    715
    8         * posix/src/ptimer1.c (timer_settime): Converted use of rtems_clock_get
     16        * src/ptimer1.c (timer_settime): Converted use of rtems_clock_get
    917        to use SuperCore _TOD_Current variable.
    1018
  • c/src/exec/posix/include/rtems/posix/timer.h

    rea56c0a8 r939e29d  
    4444  unsigned32        overrun;    /* Number of expirations of the timer    */
    4545  rtems_time_of_day time;       /* Time in which the timer was started   */
    46 } timer_alive_t;
     46} POSIX_Timer_Control;
    4747
    4848/*
     
    5151
    5252extern int timer_max;
    53 extern timer_alive_t *timer_struct;
     53extern POSIX_Timer_Control *timer_struct;
    5454
    5555#endif
  • c/src/exec/posix/src/ptimer.c

    rea56c0a8 r939e29d  
    7575
    7676int timer_max;
    77 timer_alive_t *timer_struct;
     77POSIX_Timer_Control *timer_struct;
    7878
    7979
     
    8383
    8484   timer_struct = _Workspace_Allocate_or_fatal_error(
    85       max_timers * sizeof(timer_alive_t) );
     85      max_timers * sizeof(POSIX_Timer_Control) );
    8686
    8787   /*
  • c/src/exec/posix/src/ptimer1.c

    rea56c0a8 r939e29d  
    7171}
    7272
    73 /* ***************************************************************************
    74  * PRINT_ERRNO_S
    75  *
    76  *  Description: Print the value of the global variable errno in the display
    77  * ***************************************************************************/
    78 
    79 static void PRINT_ERRNO_S ()
    80 {
    81 #ifdef DEBUG_MESSAGES
    82   switch (errno)
    83   {
    84      case EINVAL:
    85        PRINT_MSG_S ( "errno EINVAL"); break;
    86      case EPERM:
    87        PRINT_MSG_S ( "errno EPERM"); break;
    88      case ESRCH:
    89        PRINT_MSG_S ( "errno ESRCH"); break;
    90      case EAGAIN:
    91        PRINT_MSG_S ( "errno EAGAIN"); break;
    92      default :
    93        printf ("errno: %d\n", errno);
    94        break;
    95   }
    96 #endif
    97 }
    98  
    9973/* ***************************************************************************
    10074 * TIMER_INITIALIZE_S
     
    318292
    319293 /*
    320   * The data of the structure evp are checked in order to verify if they
    321   * are coherent.
     294  *  The data of the structure evp are checked in order to verify if they
     295  *  are coherent.
    322296  */
    323297
    324298  if (evp != NULL) {
    325      /* The structure has data */
    326 
    327      if ( ( evp->sigev_notify != SIGEV_NONE ) &&
    328           ( evp->sigev_notify != SIGEV_SIGNAL ) ) {
     299    /* The structure has data */
     300    if ( ( evp->sigev_notify != SIGEV_NONE ) &&
     301         ( evp->sigev_notify != SIGEV_SIGNAL ) ) {
    329302       /* The value of the field sigev_notify is not valid */
    330 
    331303       set_errno_and_return_minus_one( EINVAL );
    332 
    333304     }
    334305  }
    335306 
    336307 /*
    337   * A timer is created using the primitive rtems_timer_create
     308  *  A timer is created using the primitive rtems_timer_create
    338309  */
    339310
     
    525496
    526497      if ( ovalue )
    527         COPY_ITIMERSPEC_S ( &timer_struct[timer_pos].timer_data, ovalue );
     498        *ovalue = timer_struct[timer_pos].timer_data;
    528499
    529500      /* The new data are set */
    530501
    531       COPY_ITIMERSPEC_S ( value, &timer_struct[timer_pos].timer_data );
     502      timer_struct[timer_pos].timer_data = *value;
    532503
    533504      /* Indicates that the timer is created and stopped */
     
    583554
    584555              if ( ovalue )
    585                 COPY_ITIMERSPEC_S ( &timer_struct[timer_pos].timer_data, ovalue );
    586 
    587               COPY_ITIMERSPEC_S ( value, &timer_struct[timer_pos].timer_data );
     556                *ovalue = timer_struct[timer_pos].timer_data;
     557
     558              timer_struct[timer_pos].timer_data = *value;
    588559 
    589560              /* It indicates that the time is running */
     
    657628
    658629              if ( ovalue )
    659                 COPY_ITIMERSPEC_S ( &timer_struct[timer_pos].timer_data, ovalue );
    660 
    661               COPY_ITIMERSPEC_S ( value, &timer_struct[timer_pos].timer_data );
     630                *ovalue = timer_struct[timer_pos].timer_data;
     631
     632              timer_struct[timer_pos].timer_data = *value;
    662633 
    663634              /* It indicates that the time is running */
  • cpukit/posix/ChangeLog

    rea56c0a8 r939e29d  
    112000-08-15      Joel Sherrill <joel@OARcorp.com>
    22
    3         * posix/src/ptimer1.c: Switched to using set_errno_and_return_minus_one()
     3        * src/ptimer1.c: Removed unused routine PRINT_ERRNO_S.
     4        * src/ptimer1.c: Removed unnecessary routine COPY_ITIMERSPEC_S
     5        and used structure copy instead.
     6        * src/ptimer1.c: Renamed timer_alive_t to POSIX_Timer_Control.
     7        * include/rtems/posix/timer.h: Ditto.
     8
     92000-08-15      Joel Sherrill <joel@OARcorp.com>
     10
     11        * src/ptimer1.c: Switched to using set_errno_and_return_minus_one()
    412        to ensure that errno was always set.
    513
    6142000-08-15      Joel Sherrill <joel@OARcorp.com>
    715
    8         * posix/src/ptimer1.c (timer_settime): Converted use of rtems_clock_get
     16        * src/ptimer1.c (timer_settime): Converted use of rtems_clock_get
    917        to use SuperCore _TOD_Current variable.
    1018
  • cpukit/posix/include/rtems/posix/timer.h

    rea56c0a8 r939e29d  
    4444  unsigned32        overrun;    /* Number of expirations of the timer    */
    4545  rtems_time_of_day time;       /* Time in which the timer was started   */
    46 } timer_alive_t;
     46} POSIX_Timer_Control;
    4747
    4848/*
     
    5151
    5252extern int timer_max;
    53 extern timer_alive_t *timer_struct;
     53extern POSIX_Timer_Control *timer_struct;
    5454
    5555#endif
  • cpukit/posix/src/ptimer.c

    rea56c0a8 r939e29d  
    7575
    7676int timer_max;
    77 timer_alive_t *timer_struct;
     77POSIX_Timer_Control *timer_struct;
    7878
    7979
     
    8383
    8484   timer_struct = _Workspace_Allocate_or_fatal_error(
    85       max_timers * sizeof(timer_alive_t) );
     85      max_timers * sizeof(POSIX_Timer_Control) );
    8686
    8787   /*
  • cpukit/posix/src/ptimer1.c

    rea56c0a8 r939e29d  
    7171}
    7272
    73 /* ***************************************************************************
    74  * PRINT_ERRNO_S
    75  *
    76  *  Description: Print the value of the global variable errno in the display
    77  * ***************************************************************************/
    78 
    79 static void PRINT_ERRNO_S ()
    80 {
    81 #ifdef DEBUG_MESSAGES
    82   switch (errno)
    83   {
    84      case EINVAL:
    85        PRINT_MSG_S ( "errno EINVAL"); break;
    86      case EPERM:
    87        PRINT_MSG_S ( "errno EPERM"); break;
    88      case ESRCH:
    89        PRINT_MSG_S ( "errno ESRCH"); break;
    90      case EAGAIN:
    91        PRINT_MSG_S ( "errno EAGAIN"); break;
    92      default :
    93        printf ("errno: %d\n", errno);
    94        break;
    95   }
    96 #endif
    97 }
    98  
    9973/* ***************************************************************************
    10074 * TIMER_INITIALIZE_S
     
    318292
    319293 /*
    320   * The data of the structure evp are checked in order to verify if they
    321   * are coherent.
     294  *  The data of the structure evp are checked in order to verify if they
     295  *  are coherent.
    322296  */
    323297
    324298  if (evp != NULL) {
    325      /* The structure has data */
    326 
    327      if ( ( evp->sigev_notify != SIGEV_NONE ) &&
    328           ( evp->sigev_notify != SIGEV_SIGNAL ) ) {
     299    /* The structure has data */
     300    if ( ( evp->sigev_notify != SIGEV_NONE ) &&
     301         ( evp->sigev_notify != SIGEV_SIGNAL ) ) {
    329302       /* The value of the field sigev_notify is not valid */
    330 
    331303       set_errno_and_return_minus_one( EINVAL );
    332 
    333304     }
    334305  }
    335306 
    336307 /*
    337   * A timer is created using the primitive rtems_timer_create
     308  *  A timer is created using the primitive rtems_timer_create
    338309  */
    339310
     
    525496
    526497      if ( ovalue )
    527         COPY_ITIMERSPEC_S ( &timer_struct[timer_pos].timer_data, ovalue );
     498        *ovalue = timer_struct[timer_pos].timer_data;
    528499
    529500      /* The new data are set */
    530501
    531       COPY_ITIMERSPEC_S ( value, &timer_struct[timer_pos].timer_data );
     502      timer_struct[timer_pos].timer_data = *value;
    532503
    533504      /* Indicates that the timer is created and stopped */
     
    583554
    584555              if ( ovalue )
    585                 COPY_ITIMERSPEC_S ( &timer_struct[timer_pos].timer_data, ovalue );
    586 
    587               COPY_ITIMERSPEC_S ( value, &timer_struct[timer_pos].timer_data );
     556                *ovalue = timer_struct[timer_pos].timer_data;
     557
     558              timer_struct[timer_pos].timer_data = *value;
    588559 
    589560              /* It indicates that the time is running */
     
    657628
    658629              if ( ovalue )
    659                 COPY_ITIMERSPEC_S ( &timer_struct[timer_pos].timer_data, ovalue );
    660 
    661               COPY_ITIMERSPEC_S ( value, &timer_struct[timer_pos].timer_data );
     630                *ovalue = timer_struct[timer_pos].timer_data;
     631
     632              timer_struct[timer_pos].timer_data = *value;
    662633 
    663634              /* It indicates that the time is running */
Note: See TracChangeset for help on using the changeset viewer.