summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-03-29 10:53:51 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-03-30 09:05:53 +0200
commitab602be03a7e2e1e0ffbc723f96716ccce60d2c5 (patch)
treecfd305b12af06174f105d1b4897a54529d3c66c2
parentspec: Use individual names for ident tests (diff)
downloadrtems-central-ab602be03a7e2e1e0ffbc723f96716ccce60d2c5.tar.bz2
spec: Clarify scheduler of created task
-rw-r--r--spec/rtems/task/if/create.yml7
-rw-r--r--spec/rtems/task/req/construct-home-scheduler.yml17
-rw-r--r--spec/rtems/task/req/create-home-scheduler.yml16
-rw-r--r--spec/rtems/task/val/smp.yml74
-rw-r--r--spec/rtems/task/val/task.yml45
5 files changed, 154 insertions, 5 deletions
diff --git a/spec/rtems/task/if/create.yml b/spec/rtems/task/if/create.yml
index 4d49ac74..41ee9188 100644
--- a/spec/rtems/task/if/create.yml
+++ b/spec/rtems/task/if/create.yml
@@ -24,9 +24,10 @@ description: |
used to access the task with other task related directives.
The **initial priority** of the task is specified in ${.:/params[1]/name}.
- The scheduler of the created task is the scheduler of the calling task at
- some point during the task creation. The initial task priority specified in
- ${.:/params[1]/name} shall be valid for this scheduler.
+ The ${/glossary/scheduler-home:/term} of the created task is the home
+ scheduler of the calling task at some time point during the task creation.
+ The initial task priority specified in ${.:/params[1]/name} shall be valid
+ for this scheduler.
The **stack size** of the task is specified in ${.:/params[2]/name}. If the
requested stack size is less than the configured minimum stack size, then
diff --git a/spec/rtems/task/req/construct-home-scheduler.yml b/spec/rtems/task/req/construct-home-scheduler.yml
new file mode 100644
index 00000000..505972f8
--- /dev/null
+++ b/spec/rtems/task/req/construct-home-scheduler.yml
@@ -0,0 +1,17 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+links:
+- role: interface-function
+ uid: ../if/construct
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+ When a task is constructed, the ${/glossary/scheduler-home:/term} of the
+ constructed task shall be set to the home scheduler of the task calling the
+ ${../if/construct:/name} directive at some time point during the directive
+ call.
+type: requirement
diff --git a/spec/rtems/task/req/create-home-scheduler.yml b/spec/rtems/task/req/create-home-scheduler.yml
new file mode 100644
index 00000000..b457b3f6
--- /dev/null
+++ b/spec/rtems/task/req/create-home-scheduler.yml
@@ -0,0 +1,16 @@
+SPDX-License-Identifier: CC-BY-SA-4.0
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: true
+links:
+- role: interface-function
+ uid: ../if/create
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+ When a task is created, the ${/glossary/scheduler-home:/term} of the created
+ task shall be set to the home scheduler of the task calling the
+ ${../if/create:/name} directive at some time point during the directive call.
+type: requirement
diff --git a/spec/rtems/task/val/smp.yml b/spec/rtems/task/val/smp.yml
new file mode 100644
index 00000000..8c5ac6fd
--- /dev/null
+++ b/spec/rtems/task/val/smp.yml
@@ -0,0 +1,74 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2022 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links: []
+test-actions:
+- action-brief: |
+ Validate the home scheduler of tasks created by ${../if/create:/name} and
+ constructed by ${../if/construct:/name} on scheduler B.
+ action-code: |
+ rtems_status_code sc;
+ rtems_status_code id;
+ checks:
+ - brief: |
+ Move runner from scheduler A to B.
+ code: |
+ T_step_eq_u32( ${step}, GetSelfScheduler(), SCHEDULER_A_ID );
+ SetSelfScheduler( SCHEDULER_B_ID, 1 );
+ links: []
+ - brief: |
+ Create a task. Check that the home scheduler of the created task is
+ scheduler B.
+ code: |
+ sc = rtems_task_create(
+ OBJECT_NAME,
+ 1,
+ TEST_MINIMUM_STACK_SIZE,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ T_step_rsc_success( ${step}, sc );
+
+ T_step_eq_u32( ${step}, GetScheduler( id ), SCHEDULER_B_ID );
+ DeleteTask( id );
+ links:
+ - role: validation
+ uid: ../req/create-home-scheduler
+ - brief: |
+ Construct a task. Check that the home scheduler of the constructed task
+ is scheduler B.
+ code: |
+ sc = rtems_task_construct( &DefaultTaskConfig, &id );
+ T_step_rsc_success( ${step}, sc );
+
+ T_step_eq_u32( ${step}, GetScheduler( id ), SCHEDULER_B_ID );
+ DeleteTask( id );
+ links:
+ - role: validation
+ uid: ../req/construct-home-scheduler
+ - brief: |
+ Restore runner scheduler.
+ code: |
+ RestoreRunnerScheduler();
+ links: []
+ links: []
+test-brief: |
+ This test case collection provides SMP-specific validation test cases for
+ requirements of the ${../if/group:/name}.
+test-context: []
+test-context-support: null
+test-description: null
+test-header: null
+test-includes:
+- rtems.h
+test-local-includes:
+- ts-config.h
+- tx-support.h
+test-setup: null
+test-stop: null
+test-support: null
+test-target: testsuites/validation/tc-task-smp.c
+test-teardown: null
+type: test-case
diff --git a/spec/rtems/task/val/task.yml b/spec/rtems/task/val/task.yml
index 437eccb0..97bdebf5 100644
--- a/spec/rtems/task/val/task.yml
+++ b/spec/rtems/task/val/task.yml
@@ -1,6 +1,6 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
copyrights:
-- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+- Copyright (C) 2021, 2022 embedded brains GmbH (http://www.embedded-brains.de)
enabled-by: true
links: []
test-actions:
@@ -161,6 +161,45 @@ test-actions:
- role: validation
uid: ../req/self-define
links: []
+- action-brief: |
+ Validate the home scheduler of tasks created by ${../if/create:/name} and
+ constructed by ${../if/construct:/name}.
+ action-code: |
+ rtems_status_code sc;
+ rtems_status_code id;
+ checks:
+ - brief: |
+ Create a task. Check that the home scheduler of the created task is
+ scheduler A.
+ code: |
+ sc = rtems_task_create(
+ OBJECT_NAME,
+ 1,
+ TEST_MINIMUM_STACK_SIZE,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ T_step_rsc_success( ${step}, sc );
+
+ T_step_eq_u32( ${step}, GetScheduler( id ), SCHEDULER_A_ID );
+ DeleteTask( id );
+ links:
+ - role: validation
+ uid: ../req/create-home-scheduler
+ - brief: |
+ Construct a task. Check that the home scheduler of the constructed task
+ is scheduler A.
+ code: |
+ sc = rtems_task_construct( &DefaultTaskConfig, &id );
+ T_step_rsc_success( ${step}, sc );
+
+ T_step_eq_u32( ${step}, GetScheduler( id ), SCHEDULER_A_ID );
+ DeleteTask( id );
+ links:
+ - role: validation
+ uid: ../req/construct-home-scheduler
+ links: []
test-brief: |
This test case collection provides validation test cases for requirements of
the ${../if/group:/name}.
@@ -172,7 +211,9 @@ test-includes:
- rtems.h
- string.h
- rtems/score/apimutex.h
-test-local-includes: []
+test-local-includes:
+- ts-config.h
+- tx-support.h
test-setup: null
test-stop: null
test-support: |