[PATCH] RTEMS 5.2: rtems: Allow RTEMS_PRIORITY for MrsP semaphores

Gedare Bloom gedare at rtems.org
Tue Mar 16 15:41:38 UTC 2021


On Tue, Mar 16, 2021 at 8:01 AM Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
>
> In order to improve the compatibility of RTEMS 5.2 with future version
> of RTEMS which fixed #4346 allow MrsP semaphores to be created with

minor note, this "fixed #4346" might get picked up by the Trac hook,
I'm not sure.

Otherwise I think this is ok.

> RTEMS_PRIORITY.
>
> Close #4347.
> ---
>  cpukit/rtems/src/semcreate.c       | 7 ++++++-
>  testsuites/sptests/spmrsp01/init.c | 6 ------
>  2 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/cpukit/rtems/src/semcreate.c b/cpukit/rtems/src/semcreate.c
> index b57b635d85..ea89800685 100644
> --- a/cpukit/rtems/src/semcreate.c
> +++ b/cpukit/rtems/src/semcreate.c
> @@ -92,9 +92,14 @@ rtems_status_code rtems_semaphore_create(
>    ) {
>      variant = SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING;
>    } else if (
> -    mutex_with_protocol
> +    ( mutex_with_protocol & ~RTEMS_PRIORITY )
>        == ( RTEMS_BINARY_SEMAPHORE | RTEMS_MULTIPROCESSOR_RESOURCE_SHARING )
>    ) {
> +    /*
> +     * In RTEMS 5.2 using RTEMS_FIFO and RTEMS_PRIORITY for MrsP semaphores is
> +     * allowed.  In RTEMS 6, RTEMS_PRIORITY is required for MrsP semaphores
> +     * analogous to priority ceiling semaphores.
> +     */
>  #if defined(RTEMS_SMP)
>      variant = SEMAPHORE_VARIANT_MRSP;
>  #else
> diff --git a/testsuites/sptests/spmrsp01/init.c b/testsuites/sptests/spmrsp01/init.c
> index a5f645d534..801b679ec9 100644
> --- a/testsuites/sptests/spmrsp01/init.c
> +++ b/testsuites/sptests/spmrsp01/init.c
> @@ -70,12 +70,6 @@ static void test_mrsp_create_errors(void)
>        | RTEMS_SIMPLE_BINARY_SEMAPHORE
>    );
>
> -  create_not_defined(
> -    RTEMS_MULTIPROCESSOR_RESOURCE_SHARING
> -      | RTEMS_BINARY_SEMAPHORE
> -      | RTEMS_PRIORITY
> -  );
> -
>    create_not_defined(
>      RTEMS_MULTIPROCESSOR_RESOURCE_SHARING
>        | RTEMS_INHERIT_PRIORITY
> --
> 2.26.2
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list