<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi,</div><div><br></div><div>I was going through the deterministic scheduler for uniprocessor and noticed in the code:</div><div>------------------------------------------------------------------------------------------------</div><div> "cpukit/include/rtems/score/schedulerpriority.h" :<br></div><div><br></div><div>typedef struct {</div><div>  /**</div><div>   * @brief Basic scheduler context.</div><div>   */</div><div>  Scheduler_Context Base;</div><div><br></div><div>  /**</div><div>   * @brief Bit map to indicate non-empty ready queues.</div><div>   */</div><div>  Priority_bit_map_Control Bit_map;</div><div><br></div><div>  /**</div><div>   * @brief One ready queue per priority level.</div><div>   */</div><div>  Chain_Control Ready[ 0 ];</div><div>} Scheduler_priority_Context;</div><div>-----------------------------------------------------------------------------------</div><div><br></div><div>Where Scheduler_Context is defined as:</div><div><br></div><div>-----------------------------------------------------------------------------</div><div><br></div><div>From "cpukit/include/rtems/score/scheduler.h":</div><div><br></div><div><div>typedef struct Scheduler_Context {</div><div>  /**</div><div>   * @brief Lock to protect this scheduler instance.</div><div>   */</div><div>  ISR_LOCK_MEMBER( Lock )</div><div><br></div><div>#if defined(RTEMS_SMP)</div><div>  /**</div><div>   * @brief The set of processors owned by this scheduler instance.</div><div>   */</div><div>  Processor_mask Processors;</div><div>#endif</div><div>} Scheduler_Context;</div></div><div><br></div><div>-------------------------------------------------------------------------------------------------</div><div><br></div><div>and ISR_LOCK is defined as:</div><div><br></div><div>------------------------------------------------------------------------------------------------------</div><div><br></div><div>"cpukit/include/rtems/score/isrlock.h"<br></div><div><br></div><div><div>/**</div><div> * @brief Defines an ISR lock member.</div><div> *</div><div> * Do not add a ';' after this macro.</div><div> *</div><div> * @param _designator The designator for the interrupt lock.</div><div> */</div><div>#if defined( RTEMS_SMP )</div><div>  #define ISR_LOCK_MEMBER( _designator ) ISR_lock_Control _designator;</div><div>#else</div><div>  #define ISR_LOCK_MEMBER( _designator )</div><div>#endif</div></div><div>"cpukit/include/rtems/score/isrlock.h"<br></div><div>--------------------------------------------------------------------------------------------</div><div>Since we left the preprocessor directive as empty for the else case, it means that for a non smp system, we don't use the ISR_LOCK as well as the processor mask.</div><div><br></div><div>Then could someone please help me understand why we would include Scheduler_Context Base in the Scheduler_priority_Context since this scheduler is for a uniprocessor system and Scheduler_Context has nothing? </div><div><br></div><div>Thanks,</div><div>Richi.</div><div><br></div></div></div></div></div></div></div></div></div></div>