diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-10 13:48:27 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-10 13:48:27 +0000 |
commit | eb02f47b126b56091ffaeaad470a48e2ac6d57b5 (patch) | |
tree | d52c66ad2d1a1b60d4eecd873949aa07477f8b87 /cpukit/itron/src/rot_rdq.c | |
parent | Added support for ITRON tests. (diff) | |
download | rtems-eb02f47b126b56091ffaeaad470a48e2ac6d57b5.tar.bz2 |
Committed modifications from ITRON Task and Task Dependendent Synchronization
Working Group. Included are tests.
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; } |