summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-12 12:12:01 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-12 12:12:49 +0100
commit020df4c20366a5a967093ea8b9cf6befeccb96c6 (patch)
treef7496f97eb5eab7b583b59bf49a4da44329a637b
parentmodules: Update rtems (diff)
downloadrtems-central-020df4c20366a5a967093ea8b9cf6befeccb96c6.tar.bz2
spec: Fix sporadic test errors
-rw-r--r--spec/score/sched/smp/val/smp.yml20
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/score/sched/smp/val/smp.yml b/spec/score/sched/smp/val/smp.yml
index 34da60c6..36b9c0a3 100644
--- a/spec/score/sched/smp/val/smp.yml
+++ b/spec/score/sched/smp/val/smp.yml
@@ -13,8 +13,9 @@ test-actions:
SendAndSync( ctx, WORKER_B, EVENT_OBTAIN );
SetScheduler( ctx->worker_id[ WORKER_C ], SCHEDULER_B_ID, PRIO_HIGH );
SetPriority( ctx->worker_id[ WORKER_A ], PRIO_NORMAL );
- SendAndSync( ctx, WORKER_A, EVENT_STICKY_OBTAIN );
+ SendEvents( ctx->worker_id[ WORKER_A ], EVENT_STICKY_OBTAIN );
MakeBusy( ctx, WORKER_A );
+ WaitForBusy( ctx, WORKER_A );
checks:
- brief: |
Reschedule worker A by the home scheduler while worker A is not scheduled
@@ -382,6 +383,11 @@ test-context:
member: |
volatile bool busy[ WORKER_COUNT ];
- brief: |
+ If this member is true, then the worker shall be in the busy loop.
+ description: null
+ member: |
+ volatile bool is_busy[ WORKER_COUNT ];
+- brief: |
This member contains the per-CPU jobs.
description: null
member: |
@@ -469,10 +475,18 @@ test-support: |
static void MakeBusy( Context *ctx, WorkerIndex worker )
{
+ ctx->is_busy[ worker ] = false;
ctx->busy[ worker ] = true;
SendEvents( ctx->worker_id[ worker ], EVENT_BUSY );
}
+ static void WaitForBusy( Context *ctx, WorkerIndex worker )
+ {
+ while ( !ctx->is_busy[ worker ] ) {
+ /* Wait */
+ }
+ }
+
static void StopBusy( Context *ctx, WorkerIndex worker )
{
ctx->busy[ worker ] = false;
@@ -839,9 +853,13 @@ test-support: |
}
if ( ( events & EVENT_BUSY ) != 0 ) {
+ ctx->is_busy[ worker ] = true;
+
while ( ctx->busy[ worker ] ) {
/* Wait */
}
+
+ ctx->is_busy[ worker ] = false;
}
}
}