source: rtems/cpukit/score/src/schedulerpriorityyield.c @ f068384e

4.115
Last change on this file since f068384e was f068384e, checked in by Sebastian Huber <sebastian.huber@…>, on 07/24/13 at 10:03:31

score: Create schedulerpriority impl header

Move implementation specific parts of schedulerpriority.h and
schedulerpriority.inl into new header file schedulerpriorityimpl.h. The
schedulerpriority.h contains now only the application visible API.

Add missing includes. Remove superfluous includes.

Move declaration of _Priority_Bit_map to prioritybitmap.inl since this
variable is used only here.

Remove second declaration of _Priority_Major_bit_map.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief Scheduler Priority Yield
5 *  @ingroup ScoreScheduler
6 */
7
8/*
9 *  Copyright (C) 2010 Gedare Bloom.
10 *  Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/score/schedulerpriorityimpl.h>
22#include <rtems/score/isr.h>
23
24void _Scheduler_priority_Yield( Thread_Control *thread )
25{
26  Scheduler_priority_Per_thread *sched_info;
27  ISR_Level                      level;
28  Chain_Control                 *ready;
29
30  sched_info = (Scheduler_priority_Per_thread *) thread->scheduler_info;
31  ready      = sched_info->ready_chain;
32  _ISR_Disable( level );
33    if ( !_Chain_Has_only_one_node( ready ) ) {
34      _Chain_Extract_unprotected( &thread->Object.Node );
35      _Chain_Append_unprotected( ready, &thread->Object.Node );
36
37      _ISR_Flash( level );
38
39      if ( _Thread_Is_heir( thread ) )
40        _Thread_Heir = (Thread_Control *) _Chain_First( ready );
41      _Thread_Dispatch_necessary = true;
42    }
43    else if ( !_Thread_Is_heir( thread ) )
44      _Thread_Dispatch_necessary = true;
45
46  _ISR_Enable( level );
47}
Note: See TracBrowser for help on using the repository browser.