Changeset 2183b65 in rtems


Ignore:
Timestamp:
11/12/99 21:13:52 (24 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
c257429f
Parents:
ea6bfcb
Message:

+ Modified correct return path to call _ITRON_return_errorno( E_OK ) instead

of enabling dispatching and returning E_OK.

+ Changed validation of the_thread to validation of location.
+ Set correct error code when dormant state.
+ Fixed comment.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/itron/src/chg_pri.c

    rea6bfcb r2183b65  
    3131
    3232  the_thread = _ITRON_Task_Get( tskid, &location );
    33   if (!the_thread)
    34     _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) );
    35 
    36   if (_States_Is_dormant( the_thread->current_state ))
    37     return -1;
    38 
    39   if (( tskpri <= 0 ) || ( tskpri >= 256 ))
    40     _ITRON_return_errorno( E_PAR );
    41 
    4233  switch ( location ) {
    4334    case OBJECTS_REMOTE:
     
    4637
    4738    case OBJECTS_LOCAL:
     39      if (_States_Is_dormant( the_thread->current_state ))
     40        _ITRON_return_errorno( E_OBJ );
     41
     42      if (( tskpri <= 0 ) || ( tskpri >= 256 ))
     43        _ITRON_return_errorno( E_PAR );
     44
    4845      new_priority = _ITRON_Task_Priority_to_Core( tskpri );
    4946      the_thread->real_priority = new_priority;
    5047
    5148      /*
    52        * XXX This is from the rtems side and I'm not sure what this is for.
    53        * XXX Is this check right or should change priority be called
    54        *     regardless?
     49       * The priority should not be changed until later if priority
     50       * inheratance has occured.
    5551       */
    5652
     
    5955        _Thread_Change_priority( the_thread, new_priority, FALSE );
    6056
    61       _Thread_Enable_dispatch();
    62       return E_OK;
     57       _ITRON_return_errorno( E_OK );
    6358  }
    6459
    65   return E_OBJ;  /* XXX - Should never get here */
     60  _ITRON_return_errorno( E_OBJ );  /* XXX - Should never get here */
    6661}
    6762
  • cpukit/itron/src/chg_pri.c

    rea6bfcb r2183b65  
    3131
    3232  the_thread = _ITRON_Task_Get( tskid, &location );
    33   if (!the_thread)
    34     _ITRON_return_errorno( _ITRON_Task_Clarify_get_id_error( tskid ) );
    35 
    36   if (_States_Is_dormant( the_thread->current_state ))
    37     return -1;
    38 
    39   if (( tskpri <= 0 ) || ( tskpri >= 256 ))
    40     _ITRON_return_errorno( E_PAR );
    41 
    4233  switch ( location ) {
    4334    case OBJECTS_REMOTE:
     
    4637
    4738    case OBJECTS_LOCAL:
     39      if (_States_Is_dormant( the_thread->current_state ))
     40        _ITRON_return_errorno( E_OBJ );
     41
     42      if (( tskpri <= 0 ) || ( tskpri >= 256 ))
     43        _ITRON_return_errorno( E_PAR );
     44
    4845      new_priority = _ITRON_Task_Priority_to_Core( tskpri );
    4946      the_thread->real_priority = new_priority;
    5047
    5148      /*
    52        * XXX This is from the rtems side and I'm not sure what this is for.
    53        * XXX Is this check right or should change priority be called
    54        *     regardless?
     49       * The priority should not be changed until later if priority
     50       * inheratance has occured.
    5551       */
    5652
     
    5955        _Thread_Change_priority( the_thread, new_priority, FALSE );
    6056
    61       _Thread_Enable_dispatch();
    62       return E_OK;
     57       _ITRON_return_errorno( E_OK );
    6358  }
    6459
    65   return E_OBJ;  /* XXX - Should never get here */
     60  _ITRON_return_errorno( E_OBJ );  /* XXX - Should never get here */
    6661}
    6762
Note: See TracChangeset for help on using the changeset viewer.