summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-09-17 17:45:44 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-09-17 18:10:16 +0200
commit712748b8a28cb50192a63f9cae406e5adfa9d69e (patch)
treed342e37e3915115347e984a60b8e17b27e224707 /spec
parentspec: Fix references (diff)
downloadrtems-central-712748b8a28cb50192a63f9cae406e5adfa9d69e.tar.bz2
spec: Use rtems_task_construct()
Diffstat (limited to 'spec')
-rw-r--r--spec/rtems/event/req/send-receive.yml39
-rw-r--r--spec/rtems/task/req/ident.yml36
-rw-r--r--spec/testsuites/validation/profile.yml31
3 files changed, 72 insertions, 34 deletions
diff --git a/spec/rtems/event/req/send-receive.yml b/spec/rtems/event/req/send-receive.yml
index 5723e57e..f80514a9 100644
--- a/spec/rtems/event/req/send-receive.yml
+++ b/spec/rtems/event/req/send-receive.yml
@@ -461,16 +461,6 @@ test-prepare: |
test-setup:
brief: null
code: |
- static char task_storage[ RTEMS_MINIMUM_STACK_SIZE ];
- static const rtems_task_config task_config = {
- .name = rtems_build_name( 'W', 'O', 'R', 'K' ),
- .initial_priority = PRIO_LOW,
- .storage_area = task_storage,
- .storage_size = sizeof( task_storage ),
- .initial_modes = RTEMS_DEFAULT_MODES,
- .attributes = RTEMS_DEFAULT_ATTRIBUTES
- };
-
rtems_status_code sc;
rtems_task_priority prio;
@@ -494,7 +484,7 @@ test-setup:
T_rsc_success( sc );
T_eq_u32( prio, PRIO_HIGH );
- sc = rtems_task_build( &task_config, &ctx->worker_id );
+ sc = rtems_task_construct( &WorkerConfig, &ctx->worker_id );
T_assert_rsc_success( sc );
sc = rtems_task_start( ctx->worker_id, Worker, (rtems_task_argument) ctx );
@@ -504,7 +494,28 @@ test-stop: null
test-support: |
#define INPUT_EVENTS ( RTEMS_EVENT_5 | RTEMS_EVENT_23 )
- typedef ReqRtemsEventSendReceive_Context Context;
+ #define WORKER_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES
+
+ #define MAX_TLS_SIZE RTEMS_ALIGN_UP( 64, RTEMS_TASK_STORAGE_ALIGNMENT )
+
+ typedef RtemsEventReqSendReceive_Context Context;
+
+ RTEMS_ALIGNED( RTEMS_TASK_STORAGE_ALIGNMENT ) static char WorkerStorage[
+ RTEMS_TASK_STORAGE_SIZE(
+ MAX_TLS_SIZE + RTEMS_MINIMUM_STACK_SIZE,
+ WORKER_ATTRIBUTES
+ )
+ ];
+
+ static const rtems_task_config WorkerConfig = {
+ .name = rtems_build_name( 'W', 'O', 'R', 'K' ),
+ .initial_priority = PRIO_LOW,
+ .storage_area = WorkerStorage,
+ .storage_size = sizeof( WorkerStorage ),
+ .maximum_thread_local_storage_size = MAX_TLS_SIZE,
+ .initial_modes = RTEMS_DEFAULT_MODES,
+ .attributes = WORKER_ATTRIBUTES
+ };
static rtems_id CreateWakeupSema( void )
{
@@ -677,11 +688,11 @@ test-support: |
return pending;
}
- static void ReqRtemsEventSendReceive_Cleanup( Context *ctx );
+ static void RtemsEventReqSendReceive_Cleanup( Context *ctx );
static void InterruptPrepare( void *arg )
{
- ReqRtemsEventSendReceive_Cleanup( arg );
+ RtemsEventReqSendReceive_Cleanup( arg );
}
static void InterruptAction( void *arg )
diff --git a/spec/rtems/task/req/ident.yml b/spec/rtems/task/req/ident.yml
index 2769cea7..e1276cc9 100644
--- a/spec/rtems/task/req/ident.yml
+++ b/spec/rtems/task/req/ident.yml
@@ -80,18 +80,12 @@ test-prepare: null
test-setup:
brief: null
code: |
- static char task_storage[ RTEMS_MINIMUM_STACK_SIZE ];
- static const rtems_task_config task_config = {
- .name = ClassicObjectIdentName,
- .initial_priority = 1,
- .storage_area = task_storage,
- .storage_size = sizeof( task_storage ),
- .initial_modes = RTEMS_DEFAULT_MODES,
- .attributes = RTEMS_DEFAULT_ATTRIBUTES
- };
rtems_status_code sc;
- sc = rtems_task_build( &task_config, &ctx->id_local_object );
+ sc = rtems_task_construct(
+ &ClassicTaskIdentConfig,
+ &ctx->id_local_object
+ );
T_assert_rsc_success( sc );
description: null
test-stop: null
@@ -104,6 +98,28 @@ test-support: |
{
return rtems_task_ident( name, node, id );
}
+
+ #define TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES
+
+ #define MAX_TLS_SIZE RTEMS_ALIGN_UP( 64, RTEMS_TASK_STORAGE_ALIGNMENT )
+
+ RTEMS_ALIGNED( RTEMS_TASK_STORAGE_ALIGNMENT )
+ static char ClassicTaskIdentStorage[
+ RTEMS_TASK_STORAGE_SIZE(
+ MAX_TLS_SIZE + RTEMS_MINIMUM_STACK_SIZE,
+ TASK_ATTRIBUTES
+ )
+ ];
+
+ static const rtems_task_config ClassicTaskIdentConfig = {
+ .name = ClassicObjectIdentName,
+ .initial_priority = 1,
+ .storage_area = ClassicTaskIdentStorage,
+ .storage_size = sizeof( ClassicTaskIdentStorage ),
+ .maximum_thread_local_storage_size = MAX_TLS_SIZE,
+ .initial_modes = RTEMS_DEFAULT_MODES,
+ .attributes = TASK_ATTRIBUTES
+ };
test-target: testsuites/validation/tc-task-ident.c
test-teardown: null
text: ${.:text-template}
diff --git a/spec/testsuites/validation/profile.yml b/spec/testsuites/validation/profile.yml
index 8cc3d674..ca34f5bb 100644
--- a/spec/testsuites/validation/profile.yml
+++ b/spec/testsuites/validation/profile.yml
@@ -35,7 +35,16 @@ test-code: |
rtems_fatal(RTEMS_FATAL_SOURCE_APPLICATION, 123);
}
- static char init_task_storage[RTEMS_MINIMUM_STACK_SIZE];
+ #define INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES
+
+ #define MAX_TLS_SIZE RTEMS_ALIGN_UP(64, RTEMS_TASK_STORAGE_ALIGNMENT)
+
+ RTEMS_ALIGNED(RTEMS_TASK_STORAGE_ALIGNMENT) static char init_task_storage[
+ RTEMS_TASK_STORAGE_SIZE(
+ MAX_TLS_SIZE + RTEMS_MINIMUM_STACK_SIZE,
+ INIT_TASK_ATTRIBUTES
+ )
+ ];
static char buffer[512];
@@ -70,16 +79,18 @@ test-code: |
.actions = actions
};
+ static const rtems_task_config task_config = {
+ .name = NAME,
+ .initial_priority = 1,
+ .storage_area = init_task_storage,
+ .storage_size = sizeof(init_task_storage),
+ .maximum_thread_local_storage_size = MAX_TLS_SIZE,
+ .initial_modes = RTEMS_DEFAULT_MODES,
+ .attributes = INIT_TASK_ATTRIBUTES
+ };
+
static void init_task(void)
{
- static const rtems_task_config task_config = {
- .name = NAME,
- .initial_priority = 1,
- .storage_area = init_task_storage,
- .storage_size = sizeof(init_task_storage),
- .initial_modes = RTEMS_DEFAULT_MODES,
- .attributes = RTEMS_DEFAULT_ATTRIBUTES
- };
rtems_id id;
rtems_status_code sc;
@@ -87,7 +98,7 @@ test-code: |
T_case_begin("SpaceProfileTaskBuild", NULL);
T_plan(2);
- sc = rtems_task_build(&task_config, &id);
+ sc = rtems_task_construct(&task_config, &id);
T_step_rsc_success(0, sc);
sc = rtems_task_start(id, Init, 0);