summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/semcreate.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-11-22 19:14:51 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-12-14 07:03:29 +0100
commit21275b58a5a69c3c838082ffc8a7a3641f32ea9a (patch)
treed331e17c15d71f107d0f14581a93ddf768b05813 /cpukit/rtems/src/semcreate.c
parentrtems: Use object information to get config max (diff)
downloadrtems-21275b58a5a69c3c838082ffc8a7a3641f32ea9a.tar.bz2
score: Static Objects_Information initialization
Statically allocate the objects information together with the initial set of objects either via <rtems/confdefs.h>. Provide default object informations with zero objects via librtemscpu.a. This greatly simplifies the workspace size estimate. RTEMS applications which do not use the unlimited objects option are easier to debug since all objects reside now in statically allocated objects of the right types. Close #3621.
Diffstat (limited to 'cpukit/rtems/src/semcreate.c')
-rw-r--r--cpukit/rtems/src/semcreate.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/cpukit/rtems/src/semcreate.c b/cpukit/rtems/src/semcreate.c
index fd266f8cd5..dc4e02cd97 100644
--- a/cpukit/rtems/src/semcreate.c
+++ b/cpukit/rtems/src/semcreate.c
@@ -25,6 +25,7 @@
#include <rtems/rtems/tasksimpl.h>
#include <rtems/score/schedulerimpl.h>
#include <rtems/score/sysstate.h>
+#include <rtems/sysinit.h>
#define SEMAPHORE_KIND_MASK ( RTEMS_SEMAPHORE_CLASS | RTEMS_INHERIT_PRIORITY \
| RTEMS_PRIORITY_CEILING | RTEMS_MULTIPROCESSOR_RESOURCE_SHARING )
@@ -254,3 +255,21 @@ rtems_status_code rtems_semaphore_create(
_Objects_Allocator_unlock();
return RTEMS_SUCCESSFUL;
}
+
+static void _Semaphore_Manager_initialization(void)
+{
+ _Objects_Initialize_information( &_Semaphore_Information );
+
+#if defined(RTEMS_MULTIPROCESSING)
+ _MPCI_Register_packet_processor(
+ MP_PACKET_SEMAPHORE,
+ _Semaphore_MP_Process_packet
+ );
+#endif
+}
+
+RTEMS_SYSINIT_ITEM(
+ _Semaphore_Manager_initialization,
+ RTEMS_SYSINIT_CLASSIC_SEMAPHORE,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);