diff options
Diffstat (limited to 'cpukit/itron/src/rot_rdq.c')
-rw-r--r-- | cpukit/itron/src/rot_rdq.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cpukit/itron/src/rot_rdq.c b/cpukit/itron/src/rot_rdq.c index b329313946..ac6d89d55f 100644 --- a/cpukit/itron/src/rot_rdq.c +++ b/cpukit/itron/src/rot_rdq.c @@ -24,6 +24,26 @@ ER rot_rdq( PRI tskpri ) { + PRI priority; + + + _Thread_Disable_dispatch(); + + /* + * Yield of processor will rotate the queue for this processor. + */ + + if (( tskpri <= 0 ) || ( tskpri >= 256 )) + _ITRON_return_errorno( E_PAR ); + + priority = _ITRON_Task_Core_to_Priority(_Thread_Executing->current_priority); + if ( priority == tskpri ) + _Thread_Yield_processor(); + else { + _Thread_Rotate_Ready_Queue( _ITRON_Task_Core_to_Priority( tskpri ) ); + } + _Thread_Enable_dispatch(); + return E_OK; } |