[rtems commit] smptests/smpmrsp01: Reduce required CPU count
Sebastian Huber
sebh at rtems.org
Wed Jun 3 08:08:18 UTC 2015
Module: rtems
Branch: master
Commit: 2c14e6734228a7ef649428dca64ce225d8f65c82
Changeset: http://git.rtems.org/rtems/commit/?id=2c14e6734228a7ef649428dca64ce225d8f65c82
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Jun 2 14:22:03 2015 +0200
smptests/smpmrsp01: Reduce required CPU count
---
testsuites/smptests/smpmrsp01/init.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/testsuites/smptests/smpmrsp01/init.c b/testsuites/smptests/smpmrsp01/init.c
index 1f07904..9b5d22b 100644
--- a/testsuites/smptests/smpmrsp01/init.c
+++ b/testsuites/smptests/smpmrsp01/init.c
@@ -16,6 +16,8 @@
#include "config.h"
#endif
+#include <sys/param.h>
+
#include <stdio.h>
#include <inttypes.h>
@@ -1836,7 +1838,7 @@ static void Init(rtems_task_argument arg)
ctx->main_task_id = rtems_task_self();
- for (cpu_index = 0; cpu_index < 2; ++cpu_index) {
+ for (cpu_index = 0; cpu_index < MIN(2, cpu_count); ++cpu_index) {
sc = rtems_scheduler_ident(cpu_index, &ctx->scheduler_ids[cpu_index]);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
}
@@ -1855,12 +1857,15 @@ static void Init(rtems_task_argument arg)
test_mrsp_unlock_order_error();
test_mrsp_deadlock_error(ctx);
test_mrsp_multiple_obtain();
- test_mrsp_various_block_and_unblock(ctx);
- test_mrsp_obtain_after_migration(ctx);
- test_mrsp_obtain_and_sleep_and_release(ctx);
- test_mrsp_obtain_and_release_with_help(ctx);
- test_mrsp_obtain_and_release(ctx);
- test_mrsp_load(ctx);
+
+ if (cpu_count > 1) {
+ test_mrsp_various_block_and_unblock(ctx);
+ test_mrsp_obtain_after_migration(ctx);
+ test_mrsp_obtain_and_sleep_and_release(ctx);
+ test_mrsp_obtain_and_release_with_help(ctx);
+ test_mrsp_obtain_and_release(ctx);
+ test_mrsp_load(ctx);
+ }
rtems_test_assert(rtems_resource_snapshot_check(&snapshot));
@@ -1925,7 +1930,7 @@ RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(16);
#define CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS \
RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
- RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
+ RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
RTEMS_SCHEDULER_ASSIGN(2, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
RTEMS_SCHEDULER_ASSIGN(2, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
RTEMS_SCHEDULER_ASSIGN(3, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
More information about the vc
mailing list