diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-08-11 10:48:12 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-08-11 10:48:12 +0200 |
commit | c2e657b9bb348b5e98049df558d28829a52952e6 (patch) | |
tree | c3cece0fb07f8a132356e61a913a9d25898d2fcf | |
parent | spec: Improve rtems_task_wake_after() (diff) | |
download | rtems-central-c2e657b9bb348b5e98049df558d28829a52952e6.tar.bz2 |
spec: Specify thread-local storage
-rw-r--r-- | spec/constraint/tls-alignment-power-of-2.yml | 11 | ||||
-rw-r--r-- | spec/score/thread/req/tls-big-alignment.yml | 15 | ||||
-rw-r--r-- | spec/score/thread/req/tls-initialized-data.yml | 15 | ||||
-rw-r--r-- | spec/score/thread/req/tls-zero-initialized-data.yml | 15 | ||||
-rw-r--r-- | spec/score/thread/val/tls.yml | 63 | ||||
-rw-r--r-- | spec/testsuites/validation-tls-0.yml | 22 |
6 files changed, 141 insertions, 0 deletions
diff --git a/spec/constraint/tls-alignment-power-of-2.yml b/spec/constraint/tls-alignment-power-of-2.yml new file mode 100644 index 00000000..1b902131 --- /dev/null +++ b/spec/constraint/tls-alignment-power-of-2.yml @@ -0,0 +1,11 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: requirement-refinement + uid: /req/usage-constraints +rationale: null +text: | + The alignment of thread-local storage objects shall be a power of two. +type: constraint diff --git a/spec/score/thread/req/tls-big-alignment.yml b/spec/score/thread/req/tls-big-alignment.yml new file mode 100644 index 00000000..43f7acac --- /dev/null +++ b/spec/score/thread/req/tls-big-alignment.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: requirement-refinement + uid: ../if/group +functional-type: capability +rationale: null +references: [] +requirement-type: functional +text: | + The alignment of thread-local storage objects may be greater than + ${../../cpu/if/stack-alignment:/name}. +type: requirement diff --git a/spec/score/thread/req/tls-initialized-data.yml b/spec/score/thread/req/tls-initialized-data.yml new file mode 100644 index 00000000..afe17eff --- /dev/null +++ b/spec/score/thread/req/tls-initialized-data.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: requirement-refinement + uid: ../if/group +functional-type: capability +rationale: null +references: [] +requirement-type: functional +text: | + While the thread entry execution begins, the value of non-zero initialized + thread-local storage objects shall be the initialization value. +type: requirement diff --git a/spec/score/thread/req/tls-zero-initialized-data.yml b/spec/score/thread/req/tls-zero-initialized-data.yml new file mode 100644 index 00000000..91d01e83 --- /dev/null +++ b/spec/score/thread/req/tls-zero-initialized-data.yml @@ -0,0 +1,15 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: requirement-refinement + uid: ../if/group +functional-type: capability +rationale: null +references: [] +requirement-type: functional +text: | + While the thread entry execution begins, the storage space of zero + initialized thread-local storage objects shall be cleared to zero. +type: requirement diff --git a/spec/score/thread/val/tls.yml b/spec/score/thread/val/tls.yml new file mode 100644 index 00000000..35d8e8a4 --- /dev/null +++ b/spec/score/thread/val/tls.yml @@ -0,0 +1,63 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: [] +test-actions: +- action-brief: | + The test action is carried out by the thread-local objects definition. + action-code: | + /* Nothing to do */ + checks: + - brief: | + Check that the initial value of the zero initialized thread-local + object has the expected value. + code: | + T_step_eq_int( ${step}, tls_object_0, 0 ); + links: + - role: validation + uid: ../req/tls-zero-initialized-data + - brief: | + Check that the alignment of the zero initialized thread-local + object has the expected value. + code: | + T_step_eq_uptr( ${step}, ( (uintptr_t) &tls_object_0 ) % 256, 0 ); + links: + - role: validation + uid: ../req/tls-big-alignment + - brief: | + Check that the initial value of the non-zero initialized thread-local + object has the expected value. + code: | + T_step_eq_int( ${step}, tls_object_1, 123 ); + links: + - role: validation + uid: ../req/tls-initialized-data + - brief: | + Check that the alignment of the non-zero initialized thread-local object + has the expected value. + code: | + T_step_eq_uptr( ${step}, ( (uintptr_t) &tls_object_1 ) % 256, 0 ); + links: + - role: validation + uid: ../req/tls-big-alignment + links: [] +test-brief: | + Tests properties of thread-local objects. +test-context: [] +test-context-support: null +test-description: null +test-header: null +test-includes: +- rtems.h +test-local-includes: +- tx-support.h +test-setup: null +test-stop: null +test-support: | + static RTEMS_ALIGNED( 256 ) _Thread_local int volatile tls_object_0; + + static RTEMS_ALIGNED( 256 ) _Thread_local int volatile tls_object_1 = 123; +test-target: testsuites/validation/tc-score-thread-tls.c +test-teardown: null +type: test-case diff --git a/spec/testsuites/validation-tls-0.yml b/spec/testsuites/validation-tls-0.yml new file mode 100644 index 00000000..1c2e5cff --- /dev/null +++ b/spec/testsuites/validation-tls-0.yml @@ -0,0 +1,22 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) +enabled-by: true +links: +- role: requirement-refinement + uid: /req/test-suites +test-brief: | + This validation test suite contains test cases related to the thread-local + storage support. +test-code: | + const char rtems_test_name[] = "${.:/test-suite-name}"; + + #define MAX_TLS_SIZE 1024 + + #include "ts-default.h" +test-description: null +test-includes: [] +test-local-includes: [] +test-suite-name: ValidationTls0 +test-target: testsuites/validation/ts-validation-tls-0.c +type: test-suite |