diff options
Diffstat (limited to 'testsuites/validation/tc-sem-obtain.c')
-rw-r--r-- | testsuites/validation/tc-sem-obtain.c | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/testsuites/validation/tc-sem-obtain.c b/testsuites/validation/tc-sem-obtain.c index b07421f186..10c4475d8c 100644 --- a/testsuites/validation/tc-sem-obtain.c +++ b/testsuites/validation/tc-sem-obtain.c @@ -3,11 +3,11 @@ /** * @file * - * @ingroup RTEMSTestCaseRtemsSemReqObtain + * @ingroup RtemsSemReqObtain */ /* - * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2021 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -65,9 +65,9 @@ #include <rtems/test.h> /** - * @defgroup RTEMSTestCaseRtemsSemReqObtain spec:/rtems/sem/req/obtain + * @defgroup RtemsSemReqObtain spec:/rtems/sem/req/obtain * - * @ingroup RTEMSTestSuiteTestsuitesValidationNoClock0 + * @ingroup TestsuitesValidationNoClock0 * * @{ */ @@ -390,7 +390,7 @@ static void RtemsSemReqObtain_Post_Action_Check( case RtemsSemReqObtain_Post_Action_SemSeizeTry: { /* * The calling task shall try to seize the semaphore as specified by - * /score/sem/req/seize-try. + * spec:/score/sem/req/seize-try. */ ctx->tq_sem_ctx.get_count = TQSemGetCountClassic; ctx->tq_sem_ctx.set_count = TQSemSetCountClassic; @@ -401,7 +401,7 @@ static void RtemsSemReqObtain_Post_Action_Check( case RtemsSemReqObtain_Post_Action_SemSeizeWait: { /* * The calling task shall wait to seize the semaphore as specified by - * /score/sem/req/seize-wait. + * spec:/score/sem/req/seize-wait. */ ctx->tq_sem_ctx.get_count = TQSemGetCountClassic; ctx->tq_sem_ctx.set_count = TQSemSetCountClassic; @@ -412,8 +412,8 @@ static void RtemsSemReqObtain_Post_Action_Check( case RtemsSemReqObtain_Post_Action_MtxSeizeTry: { /* * The calling task shall try to seize the mutex as specified by - * /score/mtx/req/seize-try where an enqueue blocks, a recursive seize is - * allowed, and no locking protocol is used. + * spec:/score/mtx/req/seize-try where an enqueue blocks, a recursive + * seize is allowed, and no locking protocol is used. */ ctx->tq_mtx_ctx.base.enqueue_variant = TQ_ENQUEUE_BLOCKS; ctx->tq_mtx_ctx.protocol = TQ_MTX_NO_PROTOCOL; @@ -426,8 +426,8 @@ static void RtemsSemReqObtain_Post_Action_Check( case RtemsSemReqObtain_Post_Action_MtxSeizeWait: { /* * The calling task shall wait to seize the mutex as specified by - * /score/mtx/req/seize-wait where an enqueue blocks, a recursive seize - * is allowed, and no locking protocol is used. + * spec:/score/mtx/req/seize-wait where an enqueue blocks, a recursive + * seize is allowed, and no locking protocol is used. */ ctx->tq_mtx_ctx.base.enqueue_variant = TQ_ENQUEUE_BLOCKS; ctx->tq_mtx_ctx.protocol = TQ_MTX_NO_PROTOCOL; @@ -440,8 +440,8 @@ static void RtemsSemReqObtain_Post_Action_Check( case RtemsSemReqObtain_Post_Action_InheritMtxSeizeTry: { /* * The calling task shall try to seize the mutex as specified by - * /score/mtx/req/seize-try where an enqueue blocks, a recursive seize is - * allowed, and a priority inheritance protocol is used. + * spec:/score/mtx/req/seize-try where an enqueue blocks, a recursive + * seize is allowed, and a priority inheritance protocol is used. */ ctx->tq_mtx_ctx.base.enqueue_variant = TQ_ENQUEUE_BLOCKS; ctx->tq_mtx_ctx.protocol = TQ_MTX_NO_PROTOCOL; @@ -454,8 +454,8 @@ static void RtemsSemReqObtain_Post_Action_Check( case RtemsSemReqObtain_Post_Action_InheritMtxSeizeWait: { /* * The calling task shall wait to seize the mutex as specified by - * /score/mtx/req/seize-wait where an enqueue blocks, a recursive seize - * is allowed, and a priority inheritance protocol is used. + * spec:/score/mtx/req/seize-wait where an enqueue blocks, a recursive + * seize is allowed, and a priority inheritance protocol is used. */ ctx->tq_mtx_ctx.base.enqueue_variant = TQ_ENQUEUE_BLOCKS; ctx->tq_mtx_ctx.protocol = TQ_MTX_NO_PROTOCOL; @@ -468,8 +468,8 @@ static void RtemsSemReqObtain_Post_Action_Check( case RtemsSemReqObtain_Post_Action_CeilingMtxSeizeTry: { /* * The calling task shall try to seize the mutex as specified by - * /score/mtx/req/seize-try where an enqueue blocks, a recursive seize is - * allowed, and a priority ceiling is used. + * spec:/score/mtx/req/seize-try where an enqueue blocks, a recursive + * seize is allowed, and a priority ceiling is used. */ ctx->tq_mtx_ctx.base.enqueue_variant = TQ_ENQUEUE_BLOCKS; ctx->tq_mtx_ctx.protocol = TQ_MTX_PRIORITY_CEILING; @@ -482,8 +482,8 @@ static void RtemsSemReqObtain_Post_Action_Check( case RtemsSemReqObtain_Post_Action_CeilingMtxSeizeWait: { /* * The calling task shall wait to seize the mutex as specified by - * /score/mtx/req/seize-wait where an enqueue blocks, a recursive seize - * is allowed, and a priority ceiling is used. + * spec:/score/mtx/req/seize-wait where an enqueue blocks, a recursive + * seize is allowed, and a priority ceiling is used. */ ctx->tq_mtx_ctx.base.enqueue_variant = TQ_ENQUEUE_BLOCKS; ctx->tq_mtx_ctx.protocol = TQ_MTX_PRIORITY_CEILING; @@ -496,28 +496,36 @@ static void RtemsSemReqObtain_Post_Action_Check( case RtemsSemReqObtain_Post_Action_MrsPMtxSeizeTry: { /* * The calling task shall try to seize the mutex as specified by - * /score/mtx/req/seize-try where an enqueue is sticky, a recursive seize - * returns an error status, and a priority ceiling is used. + * spec:/score/mtx/req/seize-try where an enqueue is sticky, a recursive + * seize returns an error status, and a priority ceiling is used. */ + #if defined(RTEMS_SMP) ctx->tq_mtx_ctx.base.enqueue_variant = TQ_ENQUEUE_STICKY; ctx->tq_mtx_ctx.protocol = TQ_MTX_MRSP; ctx->tq_mtx_ctx.recursive = TQ_MTX_RECURSIVE_DEADLOCK; ctx->tq_mtx_ctx.priority_ceiling = PRIO_VERY_HIGH; ScoreMtxReqSeizeTry_Run( &ctx->tq_mtx_ctx ); + #else + T_unreachable(); + #endif break; } case RtemsSemReqObtain_Post_Action_MrsPMtxSeizeWait: { /* * The calling task shall wait to seize the mutex as specified by - * /score/mtx/req/seize-wait where an enqueue is sticky, a recursive + * spec:/score/mtx/req/seize-wait where an enqueue is sticky, a recursive * seize returns an error status, and a priority ceiling is used. */ + #if defined(RTEMS_SMP) ctx->tq_mtx_ctx.base.enqueue_variant = TQ_ENQUEUE_STICKY; ctx->tq_mtx_ctx.protocol = TQ_MTX_MRSP; ctx->tq_mtx_ctx.recursive = TQ_MTX_RECURSIVE_DEADLOCK; ctx->tq_mtx_ctx.priority_ceiling = PRIO_VERY_HIGH; ScoreMtxReqSeizeWait_Run( &ctx->tq_mtx_ctx ); + #else + T_unreachable(); + #endif break; } @@ -580,6 +588,7 @@ static void RtemsSemReqObtain_Action( RtemsSemReqObtain_Context *ctx ) ); T_rsc_success( sc ); + #if defined(RTEMS_SMP) if ( ( ctx->attribute_set & RTEMS_MULTIPROCESSOR_RESOURCE_SHARING ) != 0 ) { rtems_task_priority prio; @@ -591,6 +600,7 @@ static void RtemsSemReqObtain_Action( RtemsSemReqObtain_Context *ctx ) ); T_rsc_success( sc ); } + #endif } static void RtemsSemReqObtain_Cleanup( RtemsSemReqObtain_Context *ctx ) @@ -606,33 +616,28 @@ RtemsSemReqObtain_Entries[] = { { 0, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_SemSeizeWait }, { 0, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_SemSeizeTry }, { 0, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_MtxSeizeWait }, -#if defined(RTEMS_SMP) - { 0, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_InvId }, -#else - { 1, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_NA }, -#endif { 0, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_MtxSeizeTry }, { 0, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_CeilingMtxSeizeWait }, { 0, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_InheritMtxSeizeWait }, #if defined(RTEMS_SMP) { 0, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_MrsPMtxSeizeWait }, #else - { 1, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_NA }, + { 0, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_CeilingMtxSeizeWait }, #endif { 0, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_CeilingMtxSeizeTry }, { 0, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_InheritMtxSeizeTry }, #if defined(RTEMS_SMP) { 0, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_MrsPMtxSeizeTry } #else - { 1, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_NA } + { 0, 0, 0, 0, 0, RtemsSemReqObtain_Post_Action_CeilingMtxSeizeTry } #endif }; static const uint8_t RtemsSemReqObtain_Map[] = { - 3, 2, 2, 0, 0, 0, 3, 2, 2, 0, 0, 0, 3, 2, 2, 0, 0, 0, 3, 2, 2, 0, 0, 0, 6, 4, - 4, 0, 0, 0, 6, 4, 4, 0, 0, 0, 1, 1, 1, 1, 1, 1, 10, 7, 7, 0, 0, 0, 1, 1, 1, - 1, 1, 1, 11, 8, 8, 0, 0, 0, 1, 1, 1, 1, 1, 1, 12, 9, 9, 5, 5, 5 + 3, 2, 2, 0, 0, 0, 3, 2, 2, 0, 0, 0, 3, 2, 2, 0, 0, 0, 3, 2, 2, 0, 0, 0, 5, 4, + 4, 0, 0, 0, 5, 4, 4, 0, 0, 0, 1, 1, 1, 1, 1, 1, 9, 6, 6, 0, 0, 0, 1, 1, 1, 1, + 1, 1, 10, 7, 7, 0, 0, 0, 1, 1, 1, 1, 1, 1, 11, 8, 8, 0, 0, 0 }; static size_t RtemsSemReqObtain_Scope( void *arg, char *buf, size_t n ) |