[rtems commit] smptests/smpwakeafter01: Add scheduler config
Sebastian Huber
sebh at rtems.org
Wed Feb 17 10:54:31 UTC 2016
Module: rtems
Branch: master
Commit: 10f28914f8bac5b8676ce1b9cc7efeccb2b33bb3
Changeset: http://git.rtems.org/rtems/commit/?id=10f28914f8bac5b8676ce1b9cc7efeccb2b33bb3
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed Feb 17 11:33:27 2016 +0100
smptests/smpwakeafter01: Add scheduler config
Update #2554.
---
testsuites/smptests/smpwakeafter01/init.c | 64 ++++++++++++++++++++++
.../smptests/smpwakeafter01/smpwakeafter01.doc | 3 +
2 files changed, 67 insertions(+)
diff --git a/testsuites/smptests/smpwakeafter01/init.c b/testsuites/smptests/smpwakeafter01/init.c
index 8c6795e..e5e0305 100644
--- a/testsuites/smptests/smpwakeafter01/init.c
+++ b/testsuites/smptests/smpwakeafter01/init.c
@@ -30,6 +30,10 @@ const char rtems_test_name[] = "SMPWAKEAFTER 1";
#define INTERVAL_COUNT 8
+#define SCHED_A rtems_build_name(' ', ' ', ' ', 'A')
+
+#define SCHED_B rtems_build_name(' ', ' ', ' ', 'B')
+
static rtems_id task_ids[CPU_COUNT][INTERVAL_COUNT];
static const rtems_interval intervals[INTERVAL_COUNT] =
@@ -75,8 +79,17 @@ static void test(void)
uint32_t i;
for (i = 0; i < cpu_count; ++i) {
+ rtems_id scheduler_id;
uint32_t j;
+ if (i != 1) {
+ sc = rtems_scheduler_ident(SCHED_A, &scheduler_id);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+ } else {
+ sc = rtems_scheduler_ident(SCHED_B, &scheduler_id);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+ }
+
for (j = 0; j < INTERVAL_COUNT; ++j) {
sc = rtems_task_create(
rtems_build_name('T', 'A', 'S', 'K'),
@@ -88,6 +101,9 @@ static void test(void)
);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+ sc = rtems_task_set_scheduler(task_ids[i][j], scheduler_id);
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+
sc = rtems_task_start(task_ids[i][j], task, make_arg(i, j));
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
}
@@ -142,6 +158,54 @@ static void Init(rtems_task_argument arg)
#define CONFIGURE_SMP_MAXIMUM_PROCESSORS CPU_COUNT
+#define CONFIGURE_MAXIMUM_PRIORITY 255
+
+#define CONFIGURE_SCHEDULER_PRIORITY_SMP
+
+#include <rtems/scheduler.h>
+
+RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP(a, CONFIGURE_MAXIMUM_PRIORITY + 1);
+
+RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP(b, CONFIGURE_MAXIMUM_PRIORITY + 1);
+
+#define CONFIGURE_SCHEDULER_CONTROLS \
+ RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP(a, SCHED_A), \
+ RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP(b, SCHED_B)
+
+#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(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
+ RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL)
+
#define CONFIGURE_MAXIMUM_TASKS (1 + CPU_COUNT * INTERVAL_COUNT)
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
diff --git a/testsuites/smptests/smpwakeafter01/smpwakeafter01.doc b/testsuites/smptests/smpwakeafter01/smpwakeafter01.doc
index 64ee40c..b02a926 100644
--- a/testsuites/smptests/smpwakeafter01/smpwakeafter01.doc
+++ b/testsuites/smptests/smpwakeafter01/smpwakeafter01.doc
@@ -10,3 +10,6 @@ concepts:
- Ensure that rtems_task_wake_after() works on multiple processors with some
tasks using different intervals.
+ - Use a scheduler partition for processor 1, assign all remaining processors
+ to a cluster. This highlights dependencies on the scheduler instance lock
+ in case this test is run with profiling enabled.
More information about the vc
mailing list