From 6f48a61527f4fad2244d7d8bfa67795d042c7fef Mon Sep 17 00:00:00 2001 From: Jennifer Averett Date: Tue, 17 Jun 2014 12:03:25 -0500 Subject: Add remainder of schedulers and cluster scheduler support. --- schedsim/shell/schedsim_cluster02/Makefile.am | 61 +++++++++++++++++++++++++++ schedsim/shell/schedsim_cluster02/config.c | 49 +++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 schedsim/shell/schedsim_cluster02/Makefile.am create mode 100644 schedsim/shell/schedsim_cluster02/config.c (limited to 'schedsim/shell/schedsim_cluster02') diff --git a/schedsim/shell/schedsim_cluster02/Makefile.am b/schedsim/shell/schedsim_cluster02/Makefile.am new file mode 100644 index 0000000..3038a35 --- /dev/null +++ b/schedsim/shell/schedsim_cluster02/Makefile.am @@ -0,0 +1,61 @@ +bin_PROGRAMS = schedsim_cluster02 + +SOURCES = config.c +SOURCES += $(srcdir)/../schedsim_smpsimple/add_commands.c +SOURCES += $(srcdir)/../schedsim_smpsimple/main_dump_ready_tasks.c +schedsim_cluster02_SOURCES = $(SOURCES) + +cpukitdir=@rtems_srcdir@/cpukit +schedsim_cluster02_CPPFLAGS = -I$(top_builddir)/score/include +schedsim_cluster02_CPPFLAGS += -I$(srcdir)/sched_cpu +schedsim_cluster02_CPPFLAGS += -I$(srcdir)/../../rtems +schedsim_cluster02_CPPFLAGS += -I$(cpukitdir)/include +schedsim_cluster02_CPPFLAGS += -I$(cpukitdir)/score/include +schedsim_cluster02_CPPFLAGS += -I$(cpukitdir)/score/inline +schedsim_cluster02_CPPFLAGS += -I$(cpukitdir)/rtems/include +schedsim_cluster02_CPPFLAGS += -I$(cpukitdir)/rtems/inline +schedsim_cluster02_CPPFLAGS += -I$(cpukitdir)/sapi/include +schedsim_cluster02_CPPFLAGS += -I$(cpukitdir)/sapi/inline +schedsim_cluster02_CPPFLAGS += -I$(cpukitdir)/libcsupport/include +schedsim_cluster02_CPPFLAGS += -I$(cpukitdir)/libmisc/stringto +schedsim_cluster02_CPPFLAGS += -I$(srcdir)/../../rtems/sched_cpu +schedsim_cluster02_CPPFLAGS += -I$(srcdir)/../shared/include +schedsim_cluster02_CPPFLAGS += -I$(srcdir)/../shared +if HAS_PTHREADS +schedsim_cluster02_CPPFLAGS += -I$(cpukitdir)/posix/include +schedsim_cluster02_CPPFLAGS += -I$(cpukitdir)/posix/inline +endif +## Ensure all linker provided symbols are available +schedsim_cluster02_LDFLAGS = +schedsim_cluster02_LDFLAGS += -Wl,--defsym=_TLS_Data_begin=0 +schedsim_cluster02_LDFLAGS += -Wl,--defsym=_TLS_BSS_end=0 +schedsim_cluster02_LDFLAGS += -Wl,--defsym=_TLS_Alignment=4 + +## Wrap _Thread_Dispatch so we can see context switches +schedsim_cluster02_LDFLAGS +=-Wl,--wrap=_Thread_Dispatch + +## schedsim_cluster02_LDADD +=-Wl,--start-group +schedsim_cluster02_LDADD = ../shared/libschedsim.a +schedsim_cluster02_LDADD += ../../rtems/librtems.a +schedsim_cluster02_LDADD += ../shared/libschedsim.a +## schedsim_cluster02_LDADD +=-Wl,--end-group + +check-local: + @echo Running tests from SMP Priority Affinity + $(srcdir)/../run_scenarios \ + -s $(builddir)/schedsim_cluster02 \ + -S $(srcdir) \ + -A + @echo Running tests from SMP Simple Priority + $(srcdir)/../run_scenarios \ + -s $(builddir)/schedsim_cluster02 \ + -S $(srcdir)/../schedsim_smpsimple \ + -A + @echo Running tests from Uniprocessor Deterministic Priority + $(srcdir)/../run_scenarios \ + -s $(builddir)/schedsim_cluster02 \ + -S $(srcdir)/../schedsim_priority \ + script02.scen script04.scen script05.scen script06.scen + + +include $(top_srcdir)/../automake/host.am diff --git a/schedsim/shell/schedsim_cluster02/config.c b/schedsim/shell/schedsim_cluster02/config.c new file mode 100644 index 0000000..67f62c0 --- /dev/null +++ b/schedsim/shell/schedsim_cluster02/config.c @@ -0,0 +1,49 @@ +/** + * @file + * + * Configuration file for Scheduler Simulator using Priority SMP + */ + +#include + +#define CONFIGURE_INIT +#define CONFIGURE_MAXIMUM_TASKS 1000 +#define CONFIGURE_MAXIMUM_SEMAPHORES 1000 + +#define CONFIGURE_MAXIMUM_PRIORITY 255 + +#define CONFIGURE_SMP_APPLICATION +#define CONFIGURE_SMP_MAXIMUM_PROCESSORS 4 +#define CONFIGURE_SCHEDULER_PRIORITY +// #define CONFIGURE_SCHEDULER_PRIORITY_SMP +#define CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP + +#include + +#include + +shell_scheduler_name shell_scheduler_list[] = { +"Priority Scheduler", +"Priority Affinity SMP Scheduler", +"" +}; + +RTEMS_SCHEDULER_CONTEXT_PRIORITY(a, CONFIGURE_MAXIMUM_PRIORITY + 1); +RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP( + b, + CONFIGURE_MAXIMUM_PRIORITY + 1 +); + +#define CONFIGURE_SCHEDULER_CONTROLS \ + RTEMS_SCHEDULER_CONTROL_PRIORITY(a, SCHED_NAME(0)), \ + RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP(b, SCHED_NAME(1)) + +#define CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS \ + RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \ + RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \ + RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \ + RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL) + + +#define CONFIGURE_DISABLE_BSP_SETTINGS +#include -- cgit v1.2.3