Changeset 1ad83eb in rtems


Ignore:
Timestamp:
Jan 22, 2002, 7:13:10 PM (19 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
2fc6dc3
Parents:
cbc4e6fa
Message:

2001-01-22 Joel Sherrill <joel@…>

  • include/rtems/rtems/timer.h, src/timerserver.c: Add priority argument to rtems_timer_initiate_server().
Files:
6 edited

Legend:

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

    rcbc4e6fa r1ad83eb  
     12001-01-22      Joel Sherrill <joel@OARcorp.com>
     2
     3        * include/rtems/rtems/timer.h, src/timerserver.c: Add priority
     4        argument to rtems_timer_initiate_server().
     5
    162001-01-18      Joel Sherrill <joel@OARcorp.com>
    27
  • c/src/exec/rtems/include/rtems/rtems/timer.h

    rcbc4e6fa r1ad83eb  
    311311 */
    312312
     313#define RTEMS_TIMER_SERVER_DEFAULT_PRIORITY -1
     314
    313315rtems_status_code rtems_timer_initiate_server(
     316  unsigned32           priority,
    314317  unsigned32           stack_size,
    315318  rtems_attribute      attribute_set
  • c/src/exec/rtems/src/timerserver.c

    rcbc4e6fa r1ad83eb  
    148148 *
    149149 *  Input parameters:
     150 *    priority         - timer server priority
    150151 *    stack_size       - stack size in bytes
    151  *    attribute_set    - thread attributes
     152 *    attribute_set    - timer server attributes
    152153 *
    153154 *  Output parameters:
     
    158159
    159160rtems_status_code rtems_timer_initiate_server(
     161  unsigned32           priority,
    160162  unsigned32           stack_size,
    161163  rtems_attribute      attribute_set
    162164)
    163165{
    164   rtems_id          id;
    165   rtems_status_code status;
     166  rtems_id            id;
     167  rtems_status_code   status;
     168  rtems_task_priority _priority;
     169
     170  /*
     171   *  Make sure the requested priority is valid.
     172   */
     173
     174  _priority = priority;
     175  if ( priority == RTEMS_TIMER_SERVER_DEFAULT_PRIORITY )
     176    _priority = 0;
     177  else if ( !_RTEMS_tasks_Priority_is_valid( priority ) )
     178    return RTEMS_INVALID_PRIORITY;
    166179
    167180  /*
     
    177190
    178191  /*
    179    *  Create the Timer Server with the name the name of "TIME".  The priority
    180    *  is always "0" which makes it higher than any other task in the system.
    181    *  It is also always NO_PREEMPT so it looks like an interrupt to other tasks.
     192   *  Create the Timer Server with the name the name of "TIME".  The attribute
     193   *  RTEMS_SYSTEM_TASK allows us to set a priority to 0 which will makes it
     194   *  higher than any other task in the system.  It can be viewed as a low
     195   *  priority interrupt.  It is also always NO_PREEMPT so it looks like
     196   *  an interrupt to other tasks.
     197   *
     198   *  We allow the user to override the default priority because the Timer
     199   *  Server can invoke TSRs which must adhere to language run-time or
     200   *  other library rules.  For example, if using a TSR written in Ada the
     201   *  Server should run at the same priority as the priority Ada task.
     202   *  Otherwise, the priority ceiling for the mutex used to protect the
     203   *  GNAT run-time is violated.
    182204   */
    183205
    184206  status = rtems_task_create(
    185     rtems_build_name( 'T', 'I', 'M', 'E' ),
    186     1,                    /* create with priority 1 since 0 is illegal */
     207    0x4954454d,           /* "TIME" */
     208    _priority,            /* create with priority 1 since 0 is illegal */
    187209    stack_size,           /* let user specify stack size */
    188210    RTEMS_NO_PREEMPT,     /* no preempt is like an interrupt */
    189     attribute_set,        /* user may want floating point */
     211                          /* user may want floating point but we need */
     212                          /*   system task specified for 0 priority */
     213    attribute_set | RTEMS_SYSTEM_TASK,
    190214    &id                   /* get the id back */
    191215  );
     
    224248    _Objects_Get_index(id)
    225249  );
    226 
    227   /*
    228    *  A priority of 0, higher than any user task, combined with no preemption
    229    *  makes this task the highest priority in any application.  It can be
    230    *  viewed as a low priority interrupt.  The FALSE argument indicates
    231    *  that the task is to be appended (not prepended) to its priority
    232    *  chain at the end of this operation.
    233    */
    234 
    235   _Thread_Change_priority( _Timer_Server, 0, FALSE );
    236250
    237251  /*
  • cpukit/rtems/ChangeLog

    rcbc4e6fa r1ad83eb  
     12001-01-22      Joel Sherrill <joel@OARcorp.com>
     2
     3        * include/rtems/rtems/timer.h, src/timerserver.c: Add priority
     4        argument to rtems_timer_initiate_server().
     5
    162001-01-18      Joel Sherrill <joel@OARcorp.com>
    27
  • cpukit/rtems/include/rtems/rtems/timer.h

    rcbc4e6fa r1ad83eb  
    311311 */
    312312
     313#define RTEMS_TIMER_SERVER_DEFAULT_PRIORITY -1
     314
    313315rtems_status_code rtems_timer_initiate_server(
     316  unsigned32           priority,
    314317  unsigned32           stack_size,
    315318  rtems_attribute      attribute_set
  • cpukit/rtems/src/timerserver.c

    rcbc4e6fa r1ad83eb  
    148148 *
    149149 *  Input parameters:
     150 *    priority         - timer server priority
    150151 *    stack_size       - stack size in bytes
    151  *    attribute_set    - thread attributes
     152 *    attribute_set    - timer server attributes
    152153 *
    153154 *  Output parameters:
     
    158159
    159160rtems_status_code rtems_timer_initiate_server(
     161  unsigned32           priority,
    160162  unsigned32           stack_size,
    161163  rtems_attribute      attribute_set
    162164)
    163165{
    164   rtems_id          id;
    165   rtems_status_code status;
     166  rtems_id            id;
     167  rtems_status_code   status;
     168  rtems_task_priority _priority;
     169
     170  /*
     171   *  Make sure the requested priority is valid.
     172   */
     173
     174  _priority = priority;
     175  if ( priority == RTEMS_TIMER_SERVER_DEFAULT_PRIORITY )
     176    _priority = 0;
     177  else if ( !_RTEMS_tasks_Priority_is_valid( priority ) )
     178    return RTEMS_INVALID_PRIORITY;
    166179
    167180  /*
     
    177190
    178191  /*
    179    *  Create the Timer Server with the name the name of "TIME".  The priority
    180    *  is always "0" which makes it higher than any other task in the system.
    181    *  It is also always NO_PREEMPT so it looks like an interrupt to other tasks.
     192   *  Create the Timer Server with the name the name of "TIME".  The attribute
     193   *  RTEMS_SYSTEM_TASK allows us to set a priority to 0 which will makes it
     194   *  higher than any other task in the system.  It can be viewed as a low
     195   *  priority interrupt.  It is also always NO_PREEMPT so it looks like
     196   *  an interrupt to other tasks.
     197   *
     198   *  We allow the user to override the default priority because the Timer
     199   *  Server can invoke TSRs which must adhere to language run-time or
     200   *  other library rules.  For example, if using a TSR written in Ada the
     201   *  Server should run at the same priority as the priority Ada task.
     202   *  Otherwise, the priority ceiling for the mutex used to protect the
     203   *  GNAT run-time is violated.
    182204   */
    183205
    184206  status = rtems_task_create(
    185     rtems_build_name( 'T', 'I', 'M', 'E' ),
    186     1,                    /* create with priority 1 since 0 is illegal */
     207    0x4954454d,           /* "TIME" */
     208    _priority,            /* create with priority 1 since 0 is illegal */
    187209    stack_size,           /* let user specify stack size */
    188210    RTEMS_NO_PREEMPT,     /* no preempt is like an interrupt */
    189     attribute_set,        /* user may want floating point */
     211                          /* user may want floating point but we need */
     212                          /*   system task specified for 0 priority */
     213    attribute_set | RTEMS_SYSTEM_TASK,
    190214    &id                   /* get the id back */
    191215  );
     
    224248    _Objects_Get_index(id)
    225249  );
    226 
    227   /*
    228    *  A priority of 0, higher than any user task, combined with no preemption
    229    *  makes this task the highest priority in any application.  It can be
    230    *  viewed as a low priority interrupt.  The FALSE argument indicates
    231    *  that the task is to be appended (not prepended) to its priority
    232    *  chain at the end of this operation.
    233    */
    234 
    235   _Thread_Change_priority( _Timer_Server, 0, FALSE );
    236250
    237251  /*
Note: See TracChangeset for help on using the changeset viewer.