Ignore:
Timestamp:
Jun 25, 2015, 11:48:00 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
270ccc59
Parents:
0b268b8
git-author:
Sebastian Huber <sebastian.huber@…> (06/25/15 11:48:00)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/25/15 11:55:34)
Message:

score: Simplify <rtems/score/thread.h>

Avoid Thread_Control typedef in <rtems/score/percpu.h>. This helps to
get rid of the <rtems/score/percpu.h> include in <rtems/score/thread.h>
which exposes a lot of implementation details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/percpu.h

    r0b268b8 rbd67d7d2  
    5252#if !defined( ASM )
    5353
    54 #ifndef __THREAD_CONTROL_DEFINED__
    55 #define __THREAD_CONTROL_DEFINED__
    56 typedef struct Thread_Control_struct Thread_Control;
    57 #endif
     54struct Thread_Control;
    5855
    5956struct Scheduler_Context;
     
    277274   * a thread context is executing on a processor.
    278275   */
    279   Thread_Control *executing;
     276  struct Thread_Control *executing;
    280277
    281278  /**
     
    291288   * @see _Thread_Get_heir_and_make_it_executing().
    292289   */
    293   Thread_Control *heir;
     290  struct Thread_Control *heir;
    294291
    295292  /**
     
    596593  _Per_CPU_Get()->time_of_last_context_switch
    597594
     595/**
     596 * @brief Returns the thread control block of the executing thread.
     597 *
     598 * This function can be called in any context.  On SMP configurations
     599 * interrupts are disabled to ensure that the processor index is used
     600 * consistently.
     601 *
     602 * @return The thread control block of the executing thread.
     603 */
     604RTEMS_INLINE_ROUTINE struct Thread_Control *_Thread_Get_executing( void )
     605{
     606  struct Thread_Control *executing;
     607
     608  #if defined( RTEMS_SMP )
     609    ISR_Level level;
     610
     611    _ISR_Disable_without_giant( level );
     612  #endif
     613
     614  executing = _Thread_Executing;
     615
     616  #if defined( RTEMS_SMP )
     617    _ISR_Enable_without_giant( level );
     618  #endif
     619
     620  return executing;
     621}
     622
    598623/**@}*/
    599624
Note: See TracChangeset for help on using the changeset viewer.