Need help in figuring out how a scheduler is assigned to a task
Richi Dubey
richidubey at gmail.com
Sat Jun 6 13:22:05 UTC 2020
Hii everyone,
I was going through the code testsuites/sptests/spsimplesched01/init.c
and there is only one mention of simple scheduler :
#define CONFIGURE_SCHEDULER_SIMPLE
and on checking the meaning of this preprocessor directive from
scheduler.h , The relevant code is:
#ifdef CONFIGURE_SCHEDULER_SIMPLE
#include <rtems/score/schedulersimple.h>
#define SCHEDULER_SIMPLE_CONTEXT_NAME( name ) \
SCHEDULER_CONTEXT_NAME( simple_ ## name )
#define RTEMS_SCHEDULER_SIMPLE( name ) \
static Scheduler_simple_Context \
SCHEDULER_SIMPLE_CONTEXT_NAME( name )
#define RTEMS_SCHEDULER_TABLE_SIMPLE( name, obj_name ) \
{ \
&SCHEDULER_SIMPLE_CONTEXT_NAME( name ).Base, \
SCHEDULER_SIMPLE_ENTRY_POINTS, \
SCHEDULER_SIMPLE_MAXIMUM_PRIORITY, \
( obj_name ) \
SCHEDULER_CONTROL_IS_NON_PREEMPT_MODE_SUPPORTED( true ) \
}
/* Provided for backward compatibility */
#define RTEMS_SCHEDULER_CONTEXT_SIMPLE( name ) \
RTEMS_SCHEDULER_SIMPLE( name )
#define RTEMS_SCHEDULER_CONTROL_SIMPLE( name, obj_name ) \
RTEMS_SCHEDULER_TABLE_SIMPLE( name, obj_name )
#endif
And that's it! How does the task get assigned to this scheduler when we write
status = rtems_task_create(
Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]
);
in init.c? How can we not use the _Scheduler_simple_Initialize anywhere?
Another small doubt that I had was about the linking of different .c
files corresponding to simplescheduler.
For Ex:
One of the files is src/rtems/cpukit/score/src/schedulersimpleyield.c
and other is
src/rtems/cpukit/score/src/schedulersimpleblock.c
and both of them are defining the functions listed in
include/rtems/score/schedulersimpleimpl.h but I could not find any
code anywhere linking these two files with this. Can someone please
help me find the code that links all the files related to
schedulersimple.c together?
Thanks,
Richi.
More information about the devel
mailing list