Changeset bd67d7d2 in rtems


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.

Location:
cpukit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/include/rtems/posix/psignalimpl.h

    r0b268b8 rbd67d7d2  
    3434#include <rtems/score/apiext.h>
    3535#include <rtems/score/isrlock.h>
     36#include <rtems/score/percpu.h>
    3637#include <rtems/score/threadqimpl.h>
    3738
  • cpukit/rtems/include/rtems/rtems/signalimpl.h

    r0b268b8 rbd67d7d2  
    1919
    2020#include <rtems/rtems/signal.h>
     21#include <rtems/score/percpu.h>
    2122#include <rtems/score/thread.h>
    2223
  • 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
  • cpukit/score/include/rtems/score/thread.h

    r0b268b8 rbd67d7d2  
    2929#include <rtems/score/isrlock.h>
    3030#include <rtems/score/object.h>
    31 #include <rtems/score/percpu.h>
    3231#include <rtems/score/priority.h>
    3332#include <rtems/score/resource.h>
     
    4039  #include <rtems/score/cpuset.h>
    4140#endif
     41
     42struct Per_CPU_Control;
    4243
    4344struct Scheduler_Control;
     
    454455 */
    455456typedef void ( *Thread_Action_handler )(
    456   Thread_Control  *thread,
    457   Thread_Action   *action,
    458   Per_CPU_Control *cpu,
    459   ISR_Level        level
     457  Thread_Control         *thread,
     458  Thread_Action          *action,
     459  struct Per_CPU_Control *cpu,
     460  ISR_Level               level
    460461);
    461462
     
    612613   * @brief The processor assigned by the current scheduler.
    613614   */
    614   Per_CPU_Control *cpu;
     615  struct Per_CPU_Control *cpu;
    615616
    616617#if defined(RTEMS_DEBUG)
     
    619620   * executing.
    620621   */
    621   Per_CPU_Control *debug_real_cpu;
     622  struct Per_CPU_Control *debug_real_cpu;
    622623#endif
    623624#endif
     
    668669 *  This structure defines the Thread Control Block (TCB).
    669670 */
    670 struct Thread_Control_struct {
     671struct Thread_Control {
    671672  /** This field is the object management structure for each thread. */
    672673  Objects_Control          Object;
     
    852853
    853854/**
    854  * @brief Returns the thread control block of the executing thread.
    855  *
    856  * This function can be called in any context.  On SMP configurations
    857  * interrupts are disabled to ensure that the processor index is used
    858  * consistently.
    859  *
    860  * @return The thread control block of the executing thread.
    861  */
    862 RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Get_executing( void )
    863 {
    864   Thread_Control *executing;
    865 
    866   #if defined( RTEMS_SMP )
    867     ISR_Level level;
    868 
    869     _ISR_Disable_without_giant( level );
    870   #endif
    871 
    872   executing = _Thread_Executing;
    873 
    874   #if defined( RTEMS_SMP )
    875     _ISR_Enable_without_giant( level );
    876   #endif
    877 
    878   return executing;
    879 }
    880 
    881 /**
    882855 * @brief Thread control add-on.
    883856 */
  • cpukit/score/include/rtems/score/threadq.h

    r0b268b8 rbd67d7d2  
    2222#include <rtems/score/chain.h>
    2323#include <rtems/score/isrlock.h>
    24 #include <rtems/score/percpu.h>
    2524#include <rtems/score/priority.h>
    2625#include <rtems/score/rbtree.h>
    27 #include <rtems/score/states.h>
    2826
    2927#ifdef __cplusplus
     
    4139 */
    4240/**@{*/
     41
     42typedef struct Thread_Control Thread_Control;
    4343
    4444typedef struct Thread_queue_Control Thread_queue_Control;
Note: See TracChangeset for help on using the changeset viewer.