Changeset b602c298 in rtems


Ignore:
Timestamp:
Aug 25, 2000, 5:15:44 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
4b9a98c
Parents:
1a3b281
Message:

2000-08-25 Joel Sherrill <joel.sherrill@…>

  • inline/rtems/posix/timer.inl, include/rtems/posix/timer.h, inline/rtems/posix/Makefile.am, src/ptimer1.c: Redid the style of src/ptimer1.c. Continued effort to make the POSIX Timer implementation match that of other managers. Added data structures required to use SuperCore? Object Handler.
Files:
2 added
7 edited

Legend:

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

    r1a3b281 rb602c298  
     12000-08-25      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * inline/rtems/posix/timer.inl, include/rtems/posix/timer.h,
     4        inline/rtems/posix/Makefile.am, src/ptimer1.c: Redid the
     5        style of src/ptimer1.c.  Continued effort to make the
     6        POSIX Timer implementation match that of other managers.
     7        Added data structures required to use SuperCore Object Handler.
     8
    192000-08-15      Joel Sherrill <joel@OARcorp.com>
    210
  • c/src/exec/posix/include/rtems/posix/timer.h

    r1a3b281 rb602c298  
    3636
    3737typedef struct {
     38  Objects_Control   Object;
     39  Watchdog_Control  Ticker;
     40
    3841  pthread_t         thread_id;  /* Thread identifier                     */
    3942  char              state;      /* State of the timer                    */
     
    5356extern POSIX_Timer_Control *timer_struct;
    5457
     58/*
     59 *  The following defines the information control block used to manage
     60 *  this class of objects.
     61 */
     62
     63RTEMS_EXTERN Objects_Information  _POSIX_Timer_Information;
     64
     65#ifndef __RTEMS_APPLICATION__
     66#include <rtems/posix/timer.inl>
     67#endif
     68
    5569#endif
    5670/* end of include file */
  • c/src/exec/posix/inline/rtems/posix/Makefile.am

    r1a3b281 rb602c298  
    77#I_FILES= intr.inl
    88I_FILES = cond.inl key.inl mqueue.inl mutex.inl pthread.inl priority.inl \
    9     semaphore.inl
     9    semaphore.inl timer.inl
    1010
    1111noinst_HEADERS = $(I_FILES)
  • c/src/exec/posix/src/ptimer1.c

    r1a3b281 rb602c298  
    4848 */
    4949
    50 struct sigaction signal_inf[SIGRTMAX];
    51 
    5250/***********************************
    5351 * Definition of Internal Functions
    5452 ***********************************/
    55 
    56 /* ***************************************************************************
    57  * PRINT_MSG_S
    58  *
    59  *  Description: This function write a message in the display.
    60  *               It is used for debugging and all the calls must be deleted
    61  *               when the tests finish
    62  * ***************************************************************************/
    63 
    64 static void PRINT_MSG_S ( char *msg )
    65 {
    66 
    67 #ifdef DEBUG_MESSAGES
    68    printf("%s\n", msg);
    69 #endif
    70 
    71 }
    7253
    7354/* ***************************************************************************
     
    216197   * expire if it has not been created or has been deleted */
    217198
    218   PRINT_MSG_S ("FIRE_TIMER_S");
    219 
    220199  timer_pos = TIMER_POSITION_F(timer);
    221200
     
    258237  if( pthread_kill ( timer_struct[timer_pos].thread_id ,
    259238                     timer_struct[timer_pos].inf.sigev_signo ) ) {
    260      PRINT_MSG_S ("ERROR_PTHREAD_KILL");
    261   } else {
    262      PRINT_MSG_S ("SUCCESS_PTHREAD_KILL");
    263   }
     239     /* XXX error handling */
     240  }
    264241
    265242  /*
     
    314291     case RTEMS_SUCCESSFUL :
    315292
    316        PRINT_MSG_S("SUCCESS: rtems create timer RTEMS_SUCCESSFUL");
    317      
    318293       /*
    319294        * The timer has been created properly
     
    360335     case RTEMS_INVALID_NAME : /* The assigned name is not valid */
    361336
    362        PRINT_MSG_S ("ERROR: rtems create timer RTEMS_INVALID_NAME");
    363337       set_errno_and_return_minus_one( EINVAL );
    364338
     
    366340
    367341       /* There has been created too much timers for the same process */
    368        PRINT_MSG_S ("ERROR: rtems create timer RTEMS_TOO_MANY ");
    369342       set_errno_and_return_minus_one( EAGAIN );
    370343     
     
    535508           case RTEMS_SUCCESSFUL:
    536509
    537               PRINT_MSG_S ("SUCCESS: timer_settime RTEMS_SUCCESSFUL");
    538 
    539510              /* The timer has been started and is running */
    540511
     
    560531           case RTEMS_INVALID_ID:
    561532
    562               PRINT_MSG_S ("ERROR: timer_settime RTEMS_INVALID_ID");
     533              /* XXX error handling */
    563534              break;
    564535
    565536           case RTEMS_NOT_DEFINED:
    566537
    567               PRINT_MSG_S ("ERROR: timer_settime RTEMS_NOT_DEFINED");
     538              /* XXX error handling */
    568539              break;
    569540
    570541           case RTEMS_INVALID_CLOCK:
    571542
    572               PRINT_MSG_S ("ERROR: timer_settime RTEMS_INVALID_CLOCK");
     543              /* XXX error handling */
    573544              break;
    574545
     
    609580           case RTEMS_SUCCESSFUL:
    610581
    611               PRINT_MSG_S ( "SUCCESS: timer_settime RTEMS_SUCCESSFUL");
    612              
    613582              /* The timer has been started and is running */
    614583
     
    635604           case RTEMS_INVALID_ID:
    636605
    637               PRINT_MSG_S ( "ERROR: timer_settime RTEMS_INVALID_ID");
    638 
    639606              /* The timer identifier is not correct. In theory, this
    640607               * situation can not occur, but the solution is easy */
     
    645612
    646613           case RTEMS_INVALID_NUMBER:
    647 
    648               PRINT_MSG_S ( "ERROR: timer_settime RTEMS_INVALID_NUMBER");
    649614
    650615              /* In this case, RTEMS fails because the values of timing
     
    669634        /* It does nothing, although it will be probably necessary to
    670635         * return an error */
    671 
    672636   }
    673637
    674638   /* To avoid problems */
    675 
    676639   return 0;
    677 
    678640}
    679641
  • cpukit/posix/ChangeLog

    r1a3b281 rb602c298  
     12000-08-25      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * inline/rtems/posix/timer.inl, include/rtems/posix/timer.h,
     4        inline/rtems/posix/Makefile.am, src/ptimer1.c: Redid the
     5        style of src/ptimer1.c.  Continued effort to make the
     6        POSIX Timer implementation match that of other managers.
     7        Added data structures required to use SuperCore Object Handler.
     8
    192000-08-15      Joel Sherrill <joel@OARcorp.com>
    210
  • cpukit/posix/include/rtems/posix/timer.h

    r1a3b281 rb602c298  
    3636
    3737typedef struct {
     38  Objects_Control   Object;
     39  Watchdog_Control  Ticker;
     40
    3841  pthread_t         thread_id;  /* Thread identifier                     */
    3942  char              state;      /* State of the timer                    */
     
    5356extern POSIX_Timer_Control *timer_struct;
    5457
     58/*
     59 *  The following defines the information control block used to manage
     60 *  this class of objects.
     61 */
     62
     63RTEMS_EXTERN Objects_Information  _POSIX_Timer_Information;
     64
     65#ifndef __RTEMS_APPLICATION__
     66#include <rtems/posix/timer.inl>
     67#endif
     68
    5569#endif
    5670/* end of include file */
  • cpukit/posix/src/ptimer1.c

    r1a3b281 rb602c298  
    4848 */
    4949
    50 struct sigaction signal_inf[SIGRTMAX];
    51 
    5250/***********************************
    5351 * Definition of Internal Functions
    5452 ***********************************/
    55 
    56 /* ***************************************************************************
    57  * PRINT_MSG_S
    58  *
    59  *  Description: This function write a message in the display.
    60  *               It is used for debugging and all the calls must be deleted
    61  *               when the tests finish
    62  * ***************************************************************************/
    63 
    64 static void PRINT_MSG_S ( char *msg )
    65 {
    66 
    67 #ifdef DEBUG_MESSAGES
    68    printf("%s\n", msg);
    69 #endif
    70 
    71 }
    7253
    7354/* ***************************************************************************
     
    216197   * expire if it has not been created or has been deleted */
    217198
    218   PRINT_MSG_S ("FIRE_TIMER_S");
    219 
    220199  timer_pos = TIMER_POSITION_F(timer);
    221200
     
    258237  if( pthread_kill ( timer_struct[timer_pos].thread_id ,
    259238                     timer_struct[timer_pos].inf.sigev_signo ) ) {
    260      PRINT_MSG_S ("ERROR_PTHREAD_KILL");
    261   } else {
    262      PRINT_MSG_S ("SUCCESS_PTHREAD_KILL");
    263   }
     239     /* XXX error handling */
     240  }
    264241
    265242  /*
     
    314291     case RTEMS_SUCCESSFUL :
    315292
    316        PRINT_MSG_S("SUCCESS: rtems create timer RTEMS_SUCCESSFUL");
    317      
    318293       /*
    319294        * The timer has been created properly
     
    360335     case RTEMS_INVALID_NAME : /* The assigned name is not valid */
    361336
    362        PRINT_MSG_S ("ERROR: rtems create timer RTEMS_INVALID_NAME");
    363337       set_errno_and_return_minus_one( EINVAL );
    364338
     
    366340
    367341       /* There has been created too much timers for the same process */
    368        PRINT_MSG_S ("ERROR: rtems create timer RTEMS_TOO_MANY ");
    369342       set_errno_and_return_minus_one( EAGAIN );
    370343     
     
    535508           case RTEMS_SUCCESSFUL:
    536509
    537               PRINT_MSG_S ("SUCCESS: timer_settime RTEMS_SUCCESSFUL");
    538 
    539510              /* The timer has been started and is running */
    540511
     
    560531           case RTEMS_INVALID_ID:
    561532
    562               PRINT_MSG_S ("ERROR: timer_settime RTEMS_INVALID_ID");
     533              /* XXX error handling */
    563534              break;
    564535
    565536           case RTEMS_NOT_DEFINED:
    566537
    567               PRINT_MSG_S ("ERROR: timer_settime RTEMS_NOT_DEFINED");
     538              /* XXX error handling */
    568539              break;
    569540
    570541           case RTEMS_INVALID_CLOCK:
    571542
    572               PRINT_MSG_S ("ERROR: timer_settime RTEMS_INVALID_CLOCK");
     543              /* XXX error handling */
    573544              break;
    574545
     
    609580           case RTEMS_SUCCESSFUL:
    610581
    611               PRINT_MSG_S ( "SUCCESS: timer_settime RTEMS_SUCCESSFUL");
    612              
    613582              /* The timer has been started and is running */
    614583
     
    635604           case RTEMS_INVALID_ID:
    636605
    637               PRINT_MSG_S ( "ERROR: timer_settime RTEMS_INVALID_ID");
    638 
    639606              /* The timer identifier is not correct. In theory, this
    640607               * situation can not occur, but the solution is easy */
     
    645612
    646613           case RTEMS_INVALID_NUMBER:
    647 
    648               PRINT_MSG_S ( "ERROR: timer_settime RTEMS_INVALID_NUMBER");
    649614
    650615              /* In this case, RTEMS fails because the values of timing
     
    669634        /* It does nothing, although it will be probably necessary to
    670635         * return an error */
    671 
    672636   }
    673637
    674638   /* To avoid problems */
    675 
    676639   return 0;
    677 
    678640}
    679641
Note: See TracChangeset for help on using the changeset viewer.