summaryrefslogtreecommitdiffstats
path: root/testsuites/smptests/smpmulticast01/init.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-18 06:47:01 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-05-20 08:49:39 +0200
commit658700449de9d67d8571b707eec50c06fdfb9455 (patch)
tree3c2c502dab87383f390f185ca7aeb920e0563b7d /testsuites/smptests/smpmulticast01/init.c
parent9f52acb5e543b5f28abde72203ea4692120fd046 (diff)
downloadrtems-658700449de9d67d8571b707eec50c06fdfb9455.tar.bz2
score: Add _SMP_Broadcast_action()
Diffstat (limited to 'testsuites/smptests/smpmulticast01/init.c')
-rw-r--r--testsuites/smptests/smpmulticast01/init.c40
1 files changed, 32 insertions, 8 deletions
diff --git a/testsuites/smptests/smpmulticast01/init.c b/testsuites/smptests/smpmulticast01/init.c
index a5ed85c3ef..7b2556d5e9 100644
--- a/testsuites/smptests/smpmulticast01/init.c
+++ b/testsuites/smptests/smpmulticast01/init.c
@@ -85,6 +85,30 @@ static void multicast_action_dispatch_disabled(
_Thread_Dispatch_enable(cpu_self);
}
+static void broadcast_action_irq_disabled(
+ SMP_Action_handler handler,
+ void *arg
+)
+{
+ rtems_interrupt_level level;
+
+ rtems_interrupt_local_disable(level);
+ _SMP_Broadcast_action(handler, arg);
+ rtems_interrupt_local_enable(level);
+}
+
+static void broadcast_action_dispatch_disabled(
+ SMP_Action_handler handler,
+ void *arg
+)
+{
+ Per_CPU_Control *cpu_self;
+
+ cpu_self = _Thread_Dispatch_disable();
+ _SMP_Broadcast_action(handler, arg);
+ _Thread_Dispatch_enable(cpu_self);
+}
+
static void action(void *arg)
{
Atomic_Uint *id;
@@ -147,7 +171,7 @@ static void test_unicast(
static void test_broadcast(
test_context *ctx,
- void (*multicast_action)(const Processor_mask *, SMP_Action_handler, void *)
+ void (*broadcast_action)(SMP_Action_handler, void *)
)
{
uint32_t step;
@@ -163,7 +187,7 @@ static void test_broadcast(
clear_ids_by_worker(ctx, 0);
- (*multicast_action)(NULL, action, &ctx->id[0][0]);
+ (*broadcast_action)(action, &ctx->id[0][0]);
for (j = 0; j < n; ++j) {
unsigned id;
@@ -255,15 +279,15 @@ static void test_before_multitasking(void)
T_case_end();
T_case_begin("BroadcastBeforeMultitasking", NULL);
- test_broadcast(ctx, _SMP_Multicast_action);
+ test_broadcast(ctx, _SMP_Broadcast_action);
T_case_end();
T_case_begin("BroadcastBeforeMultitaskingIRQDisabled", NULL);
- test_broadcast(ctx, multicast_action_irq_disabled);
+ test_broadcast(ctx, broadcast_action_irq_disabled);
T_case_end();
T_case_begin("BroadcastBeforeMultitaskingDispatchDisabled", NULL);
- test_broadcast(ctx, multicast_action_dispatch_disabled);
+ test_broadcast(ctx, broadcast_action_dispatch_disabled);
T_case_end();
}
@@ -340,17 +364,17 @@ T_TEST_CASE(UnicastDuringMultitaskingDispatchDisabled)
T_TEST_CASE(BroadcastDuringMultitasking)
{
- test_broadcast(&test_instance, _SMP_Multicast_action);
+ test_broadcast(&test_instance, _SMP_Broadcast_action);
}
T_TEST_CASE(BroadcastDuringMultitaskingIRQDisabled)
{
- test_broadcast(&test_instance, multicast_action_irq_disabled);
+ test_broadcast(&test_instance, broadcast_action_irq_disabled);
}
T_TEST_CASE(BroadcastDuringMultitaskingDispatchDisabled)
{
- test_broadcast(&test_instance, multicast_action_dispatch_disabled);
+ test_broadcast(&test_instance, broadcast_action_dispatch_disabled);
}
static void Init(rtems_task_argument arg)