Changeset 35047a1 in rtems-schedsim


Ignore:
Timestamp:
05/09/14 16:10:05 (10 years ago)
Author:
Jennifer Averett <jennifer.averett@…>
Branches:
master
Children:
30aa792
Parents:
b552d29
Message:

sched_cpu: add is_executing to context.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • schedsim/rtems/sched_cpu/rtems/score/cpu.h

    rb552d29 r35047a1  
    473473 */
    474474typedef struct {
    475     /** This field is a hint that a port will have a number of integer
    476      *  registers that need to be saved at a context switch.
     475    /**
     476     * This field is a hint that a port will have a number of integer
     477     * registers that need to be saved at a context switch.
    477478     */
    478479    uint32_t   some_integer_register;
    479     /** This field is a hint that a port will have a number of system
    480      *  registers that need to be saved at a context switch.
     480    /**
     481     * This field is a hint that a port will have a number of system
     482     * registers that need to be saved at a context switch.
    481483     */
    482484    uint32_t   some_system_register;
    483485
    484     /** This field is a hint that a port will have a register that
    485      *  is the stack pointer.
     486    /**
     487     * This field is a hint that a port will have a register that
     488     * is the stack pointer.
    486489     */
    487490    uint32_t   stack_pointer;
     491
     492#ifdef RTEMS_SMP
     493    /**
     494     * @brief On SMP configurations the thread context must contain a boolean
     495     * indicator if this context is executing on a processor.
     496     *
     497     * This field must be updated during a context switch.  The context switch
     498     * to the heir must wait until the heir context indicates that it is no
     499     * longer executing on a processor.
     500     */
     501    volatile bool is_executing;
     502#endif
    488503} Context_Control;
    489504
     
    499514#define _CPU_Context_Get_SP( _context ) \
    500515  (_context)->stack_pointer
     516
     517#ifdef RTEMS_SMP
     518  static inline bool _CPU_Context_Get_is_executing(
     519    const Context_Control *context
     520  )
     521  {
     522    return context->is_executing;
     523  }
     524
     525  static inline void _CPU_Context_Set_is_executing(
     526    Context_Control *context,
     527    bool is_executing
     528  )
     529  {
     530    context->is_executing = is_executing;
     531  }
     532#endif
    501533
    502534/**
Note: See TracChangeset for help on using the changeset viewer.