summaryrefslogtreecommitdiffstats
path: root/testsuites/validation/tc-sched-smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/validation/tc-sched-smp.c')
-rw-r--r--testsuites/validation/tc-sched-smp.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/testsuites/validation/tc-sched-smp.c b/testsuites/validation/tc-sched-smp.c
index 6eb98b5360..3e8e3fe1a2 100644
--- a/testsuites/validation/tc-sched-smp.c
+++ b/testsuites/validation/tc-sched-smp.c
@@ -3,11 +3,11 @@
/**
* @file
*
- * @ingroup RTEMSTestCaseScoreSchedSmpValSmp
+ * @ingroup ScoreSchedSmpValSmp
*/
/*
- * Copyright (C) 2021, 2022 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2021, 2022 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -63,9 +63,9 @@
#include <rtems/test.h>
/**
- * @defgroup RTEMSTestCaseScoreSchedSmpValSmp spec:/score/sched/smp/val/smp
+ * @defgroup ScoreSchedSmpValSmp spec:/score/sched/smp/val/smp
*
- * @ingroup RTEMSTestSuiteTestsuitesValidationSmpOnly0
+ * @ingroup TestsuitesValidationSmpOnly0
*
* @brief Tests SMP-specific scheduler behaviour.
*
@@ -284,7 +284,7 @@ typedef struct {
/**
* @brief If this member is true, then the worker shall be in the busy loop.
*/
- volatile bool is_busy[ WORKER_COUNT ];;
+ volatile bool is_busy[ WORKER_COUNT ];
/**
* @brief This member contains the per-CPU jobs.
@@ -299,24 +299,31 @@ typedef struct {
/**
* @brief This member contains the call within ISR request.
*/
- CallWithinISRRequest request;;
+ CallWithinISRRequest request;
} ScoreSchedSmpValSmp_Context;
static ScoreSchedSmpValSmp_Context
ScoreSchedSmpValSmp_Instance;
+#define EVENT_OBTAIN RTEMS_EVENT_0
+
+#define EVENT_RELEASE RTEMS_EVENT_1
+
+#define EVENT_STICKY_OBTAIN RTEMS_EVENT_2
+
+#define EVENT_STICKY_RELEASE RTEMS_EVENT_3
+
+#define EVENT_SYNC_RUNNER RTEMS_EVENT_4
+
+#define EVENT_BUSY RTEMS_EVENT_5
+
typedef ScoreSchedSmpValSmp_Context Context;
-typedef enum {
- EVENT_OBTAIN = RTEMS_EVENT_0,
- EVENT_RELEASE = RTEMS_EVENT_1,
- EVENT_STICKY_OBTAIN = RTEMS_EVENT_2,
- EVENT_STICKY_RELEASE = RTEMS_EVENT_3,
- EVENT_SYNC_RUNNER = RTEMS_EVENT_4,
- EVENT_BUSY = RTEMS_EVENT_5
-} Event;
-
-static void SendAndSync( Context *ctx, WorkerIndex worker, Event event )
+static void SendAndSync(
+ Context *ctx,
+ WorkerIndex worker,
+ rtems_event_set event
+)
{
SendEvents( ctx->worker_id[ worker ], EVENT_SYNC_RUNNER | event );
ReceiveAllEvents( EVENT_SYNC_RUNNER );
@@ -678,6 +685,7 @@ static void PrepareOwnerScheduled( Context *ctx )
SetScheduler( ctx->worker_id[ WORKER_C ], SCHEDULER_B_ID, PRIO_HIGH );
SetPriority( ctx->worker_id[ WORKER_A ], PRIO_NORMAL );
MakeBusy( ctx, WORKER_C );
+ WaitForBusy( ctx, WORKER_C );
MakeBusy( ctx, WORKER_A );
}