From 712748b8a28cb50192a63f9cae406e5adfa9d69e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 17 Sep 2020 17:45:44 +0200 Subject: spec: Use rtems_task_construct() --- spec/rtems/event/req/send-receive.yml | 39 ++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'spec/rtems/event/req/send-receive.yml') 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 ) -- cgit v1.2.3