diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-07 12:06:01 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-11 09:05:07 +0100 |
commit | 4686554260a89ab1127d0583d5636df4174bc813 (patch) | |
tree | a4abd059baddd1bd17b30d30dda15e2b7d579617 /cpukit/include/rtems/rtems | |
parent | rtems: Optimize semaphore control block (diff) | |
download | rtems-4686554260a89ab1127d0583d5636df4174bc813.tar.bz2 |
rtems: Simplify semaphore configuration
The MrsP semaphore implementation predates the addition of
self-contained synchronization objects. At this time, the potential
memory reduction was justified considering the more complex
configuration and additional use of the workspace. With the
availability of self-contained synchronization options, e.g. POSIX
mutexes, this is no longer justified. Memory constrained applications
should use the self-contained synchronization objects. Remove the
CONFIGURE_MAXIMUM_MRSP_SEMAPHORES configuration option. This has only an
impact on applications which use SMP and a large number of scheduler
instances.
Update #3833.
Diffstat (limited to 'cpukit/include/rtems/rtems')
-rw-r--r-- | cpukit/include/rtems/rtems/semdata.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/cpukit/include/rtems/rtems/semdata.h b/cpukit/include/rtems/rtems/semdata.h index f5a8afcc87..497f786dfb 100644 --- a/cpukit/include/rtems/rtems/semdata.h +++ b/cpukit/include/rtems/rtems/semdata.h @@ -108,9 +108,32 @@ void _Semaphore_MP_Send_extract_proxy ( * This macro should only be used by <rtems/confdefs.h>. * * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag - * may be set). + * may be set). + * @param scheduler_count The configured scheduler count (only used in SMP + * configurations). */ -#define SEMAPHORE_INFORMATION_DEFINE( max ) \ +#if defined(RTEMS_SMP) +#define SEMAPHORE_INFORMATION_DEFINE( max, scheduler_count ) \ + typedef union { \ + Objects_Control Object; \ + Semaphore_Control Semaphore; \ + struct { \ + Objects_Control Object; \ + MRSP_Control Control; \ + Priority_Control ceiling_priorities[ scheduler_count ]; \ + } MRSP; \ + } Semaphore_Configured_control; \ + OBJECTS_INFORMATION_DEFINE( \ + _Semaphore, \ + OBJECTS_CLASSIC_API, \ + OBJECTS_RTEMS_SEMAPHORES, \ + Semaphore_Configured_control, \ + max, \ + OBJECTS_NO_STRING_NAME, \ + _Semaphore_MP_Send_extract_proxy \ + ) +#else +#define SEMAPHORE_INFORMATION_DEFINE( max, scheduler_count ) \ OBJECTS_INFORMATION_DEFINE( \ _Semaphore, \ OBJECTS_CLASSIC_API, \ @@ -120,6 +143,7 @@ void _Semaphore_MP_Send_extract_proxy ( OBJECTS_NO_STRING_NAME, \ _Semaphore_MP_Send_extract_proxy \ ) +#endif /** @} */ |