<div dir="ltr">Thanks,<div><br></div><div>But I still can't find the code that links the 'Ready' in this </div><div><br></div><div><span style="color:rgb(80,0,80)">>> #define RTEMS_SCHEDULER_EDF_SMP( name ) \</span><br style="color:rgb(80,0,80)"><span style="color:rgb(80,0,80)">>> static struct { \</span><br style="color:rgb(80,0,80)"><span style="color:rgb(80,0,80)">>> Scheduler_EDF_SMP_Context Base; \</span><br style="color:rgb(80,0,80)"><span style="color:rgb(80,0,80)">>> Scheduler_EDF_SMP_Ready_queue Ready[ CONFIGURE_MAXIMUM_PROCESSORS</span><br style="color:rgb(80,0,80)"><span style="color:rgb(80,0,80)">>> + 1 ]; \</span><br></div><div><br></div><div>to the 'Ready' in scheduleredfsmp.h:</div><div><br></div><div>typedef struct {<br> Scheduler_SMP_Context Base;<br><br> /**<br> * @brief Current generation for LIFO (index 0) and FIFO (index 1) ordering.<br> */<br> int64_t generations[ 2 ];<br><br> /**<br> * @brief Chain of ready queues with affine threads to determine the highest<br> * priority ready thread.<br> */<br> Chain_Control Affine_queues;<br><br> /**<br> * @brief A table with ready queues.<br> *<br> * The index zero queue is used for threads with a one-to-all processor<br> * affinity. Index one corresponds to processor index zero, and so on.<br> */<br> Scheduler_EDF_SMP_Ready_queue Ready[ RTEMS_ZERO_LENGTH_ARRAY ];<br>} Scheduler_EDF_SMP_Context;<br></div><div><br></div><div>If I figure this out, everything else would make sense too. Please help me out.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 13, 2020 at 8:47 PM Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Aug 13, 2020 at 8:34 AM Richi Dubey <<a href="mailto:richidubey@gmail.com" target="_blank">richidubey@gmail.com</a>> wrote:<br>
><br>
> Thanks,<br>
> I am assuming this is the code that allocates space:<br>
><br>
>> #define RTEMS_SCHEDULER_EDF_SMP( name ) \<br>
>> static struct { \<br>
>> Scheduler_EDF_SMP_Context Base; \<br>
>> Scheduler_EDF_SMP_Ready_queue Ready[ CONFIGURE_MAXIMUM_PROCESSORS<br>
>> + 1 ]; \<br>
>> } SCHEDULER_EDF_SMP_CONTEXT_NAME( name )<br>
><br>
This is declaring a structure type that will have a particular format<br>
of the struct name.<br>
<br>
><br>
> How do we use or refer to this 'Base'? How do we link this 'Ready' to the 'Ready' inside the EDF_SMP_Context?<br>
><br>
<br>
This stuff gets set up during confdefs step. Eventually the scheduler<br>
contexts are instantiated in the scheduler table.<br>
<br>
confdefs/scheduler.h:<br>
#define CONFIGURE_SCHEDULER RTEMS_SCHEDULER_EDF_SMP( dflt )<br>
<br>
#define CONFIGURE_SCHEDULER_TABLE_ENTRIES \<br>
RTEMS_SCHEDULER_TABLE_EDF_SMP( dflt, CONFIGURE_SCHEDULER_NAME )<br>
....<br>
const Scheduler_Control _Scheduler_Table[] = {<br>
CONFIGURE_SCHEDULER_TABLE_ENTRIES<br>
};<br>
<br>
This is where the space actually gets allocated, based on how<br>
CONFIGURE_SCHEDULER_TABLE_ENTRIES gets defined up to here from the CPP<br>
macros.<br>
<br>
<br>
<br>
> On Thu, Aug 13, 2020 at 6:17 PM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>> wrote:<br>
> ><br>
> > On 13/08/2020 14:42, Richi Dubey wrote:<br>
> ><br>
> > > I want to use arrays with size _CONFIGURE_MAXIMUM_PROCESSORS. Is it<br>
> > > okay if I define the arrays with this size while writing the scheduler<br>
> > > strong APA header file? I am asking this because the value of this<br>
> > > header gets defined at the time the test case runs while the scheduler<br>
> > > gets linked to the test case at the time of linking. So how would it<br>
> > > work?<br>
> ><br>
> > Do NOT use _CONFIGURE_MAXIMUM_PROCESSORS.<br>
> ><br>
> > In <rtems/scheduler.h> please use something similar to the EDF scheduler<br>
> > instantiation:<br>
> ><br>
> > #ifdef CONFIGURE_SCHEDULER_EDF_SMP<br>
> > #include <rtems/score/scheduleredfsmp.h><br>
> ><br>
> > #ifndef CONFIGURE_MAXIMUM_PROCESSORS<br>
> > #error "CONFIGURE_MAXIMUM_PROCESSORS must be defined to configure<br>
> > the EDF SMP scheduler"<br>
> > #endif<br>
> ><br>
> > #define SCHEDULER_EDF_SMP_CONTEXT_NAME( name ) \<br>
> > SCHEDULER_CONTEXT_NAME( EDF_SMP_ ## name )<br>
> ><br>
> > #define RTEMS_SCHEDULER_EDF_SMP( name ) \<br>
> > static struct { \<br>
> > Scheduler_EDF_SMP_Context Base; \<br>
> > Scheduler_EDF_SMP_Ready_queue Ready[ CONFIGURE_MAXIMUM_PROCESSORS<br>
> > + 1 ]; \<br>
> > } SCHEDULER_EDF_SMP_CONTEXT_NAME( name )<br>
> ><br>
> > #define RTEMS_SCHEDULER_TABLE_EDF_SMP( name, obj_name ) \<br>
> > { \<br>
> > &SCHEDULER_EDF_SMP_CONTEXT_NAME( name ).Base.Base.Base, \<br>
> > SCHEDULER_EDF_SMP_ENTRY_POINTS, \<br>
> > SCHEDULER_EDF_MAXIMUM_PRIORITY, \<br>
> > ( obj_name ) \<br>
> > SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( false ) \<br>
> > }<br>
> ><br>
> > /* Provided for backward compatibility */<br>
> ><br>
> > #define RTEMS_SCHEDULER_CONTEXT_EDF_SMP( name, max_cpu_count ) \<br>
> > RTEMS_SCHEDULER_EDF_SMP( name )<br>
> ><br>
> > #define RTEMS_SCHEDULER_CONTROL_EDF_SMP( name, obj_name ) \<br>
> > RTEMS_SCHEDULER_TABLE_EDF_SMP( name, obj_name )<br>
> > #endif<br>
> ><br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>