rtems: Allow RTEMS_PRIORITY for MrsP semaphores

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
RTEMS_PRIORITY.

Close #4347.
This commit is contained in:
Sebastian Huber
2021-03-16 14:59:20 +01:00
parent 645dbc5fcc
commit 3a66586c9e
2 changed files with 6 additions and 7 deletions

View File

@@ -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

View File

@@ -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