diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-09-26 09:28:57 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-09-26 09:54:57 +0200 |
commit | 4b305dda360189f2f6d070f93cea4296762c6aab (patch) | |
tree | 6df22c8f5e3b42f690649fe6ddcb49f8c4438e1b /spec | |
parent | 23af91fd8d9a53dde9ac8cade9ea7147a401f8b3 (diff) |
spec: Compatibility for other RTEMS versions
Make some performance tests compatible to other RTEMS versions which do
not allow changing the priority of a task which owns a priority
inheritance mutex.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/rtems/sem/req/perf-mtx-pi-release-one.yml | 10 | ||||
-rw-r--r-- | spec/rtems/sem/req/perf-mtx-pi-wait-forever.yml | 4 | ||||
-rw-r--r-- | spec/rtems/sem/req/perf-mtx-pi-wait-timed.yml | 4 |
3 files changed, 12 insertions, 6 deletions
diff --git a/spec/rtems/sem/req/perf-mtx-pi-release-one.yml b/spec/rtems/sem/req/perf-mtx-pi-release-one.yml index c1adce97..947178ff 100644 --- a/spec/rtems/sem/req/perf-mtx-pi-release-one.yml +++ b/spec/rtems/sem/req/perf-mtx-pi-release-one.yml @@ -16,6 +16,11 @@ test-body: brief: | Release the mutex. code: | + /* + * The release will unblock the worker task which has our priority. The + * scheduler ensures FIFO ordering for ready threads of the same priority, so + * the release will not preempt us. + */ ctx->status = rtems_semaphore_release( ctx->mutex_id ); description: null test-cleanup: null @@ -24,9 +29,10 @@ test-setup: brief: | Let one task wait on the mutex. code: | + SetSelfPriority( PRIO_HIGH ); ObtainMutex( ctx->mutex_id ); Send( ctx, EVENT_OBTAIN ); - SetPriority( ctx->worker_id, PRIO_LOW ); + Yield(); Send( ctx, EVENT_RELEASE ); description: null test-teardown: @@ -35,7 +41,7 @@ test-teardown: code: | T_quiet_rsc( ctx->status, RTEMS_SUCCESSFUL ); - SetPriority( ctx->worker_id, PRIO_HIGH ); + SetSelfPriority( PRIO_NORMAL ); return tic == toc; description: null diff --git a/spec/rtems/sem/req/perf-mtx-pi-wait-forever.yml b/spec/rtems/sem/req/perf-mtx-pi-wait-forever.yml index c0f2a472..92d591ee 100644 --- a/spec/rtems/sem/req/perf-mtx-pi-wait-forever.yml +++ b/spec/rtems/sem/req/perf-mtx-pi-wait-forever.yml @@ -30,7 +30,7 @@ test-setup: Make the mutex unavailable. code: | Send( ctx, EVENT_OBTAIN ); - SetPriority( ctx->worker_id, PRIO_LOW ); + SetSelfPriority( PRIO_VERY_HIGH ); Send( ctx, EVENT_END | EVENT_RELEASE ); description: null test-teardown: @@ -41,8 +41,8 @@ test-teardown: T_quiet_rsc( ctx->status, RTEMS_SUCCESSFUL ); *delta = ctx->end - ctx->begin; - SetPriority( ctx->worker_id, PRIO_HIGH ); ReleaseMutex( ctx->mutex_id ); + SetSelfPriority( PRIO_NORMAL ); return tic == toc; description: null diff --git a/spec/rtems/sem/req/perf-mtx-pi-wait-timed.yml b/spec/rtems/sem/req/perf-mtx-pi-wait-timed.yml index 0886bb3a..cd53d0d6 100644 --- a/spec/rtems/sem/req/perf-mtx-pi-wait-timed.yml +++ b/spec/rtems/sem/req/perf-mtx-pi-wait-timed.yml @@ -30,7 +30,7 @@ test-setup: Make the mutex unavailable. code: | Send( ctx, EVENT_OBTAIN ); - SetPriority( ctx->worker_id, PRIO_LOW ); + SetSelfPriority( PRIO_VERY_HIGH ); Send( ctx, EVENT_END | EVENT_RELEASE ); description: null test-teardown: @@ -41,8 +41,8 @@ test-teardown: T_quiet_rsc( ctx->status, RTEMS_SUCCESSFUL ); *delta = ctx->end - ctx->begin; - SetPriority( ctx->worker_id, PRIO_HIGH ); ReleaseMutex( ctx->mutex_id ); + SetSelfPriority( PRIO_NORMAL ); return tic == toc; description: null |