summaryrefslogtreecommitdiffstats
path: root/cpukit/sapi/src
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/sapi/src
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/sapi/src')
-rw-r--r--cpukit/sapi/src/extension.c60
-rw-r--r--cpukit/sapi/src/extensioncreate.c16
2 files changed, 43 insertions, 33 deletions
diff --git a/cpukit/sapi/src/extension.c b/cpukit/sapi/src/extension.c
index 8e73030d29..028dccd4e0 100644
--- a/cpukit/sapi/src/extension.c
+++ b/cpukit/sapi/src/extension.c
@@ -1,47 +1,47 @@
/**
* @file
*
- * @brief Initialize Extension Manager
- *
* @ingroup ClassicUserExtensions
+ *
+ * @brief Extension Manager Information with Zero Objects
*/
/*
- * Extension Manager
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018 embedded brains GmbH
*
- * COPYRIGHT (c) 1989-2008.
- * On-Line Applications Research Corporation (OAR).
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
-#include <rtems/extensionimpl.h>
-#include <rtems/config.h>
-#include <rtems/sysinit.h>
-
-Objects_Information _Extension_Information;
-
-static void _Extension_Manager_initialization(void)
-{
- _Objects_Initialize_information(
- &_Extension_Information,
- OBJECTS_CLASSIC_API, /* object API */
- OBJECTS_RTEMS_EXTENSIONS,
- Configuration.maximum_extensions,
- sizeof( Extension_Control ),
- OBJECTS_NO_STRING_NAME, /* maximum length of an object name */
- NULL /* Proxy extraction support callout */
- );
-}
+#include <rtems/extensiondata.h>
-RTEMS_SYSINIT_ITEM(
- _Extension_Manager_initialization,
- RTEMS_SYSINIT_USER_EXTENSIONS,
- RTEMS_SYSINIT_ORDER_MIDDLE
+OBJECTS_INFORMATION_DEFINE_ZERO(
+ _Extension,
+ OBJECTS_CLASSIC_API,
+ OBJECTS_RTEMS_EXTENSIONS,
+ OBJECTS_NO_STRING_NAME
);
diff --git a/cpukit/sapi/src/extensioncreate.c b/cpukit/sapi/src/extensioncreate.c
index e3439b6a0e..d3ab0f6983 100644
--- a/cpukit/sapi/src/extensioncreate.c
+++ b/cpukit/sapi/src/extensioncreate.c
@@ -19,11 +19,10 @@
#include "config.h"
#endif
-#include <rtems/system.h>
+#include <rtems/extensionimpl.h>
#include <rtems/rtems/support.h>
-#include <rtems/score/thread.h>
#include <rtems/score/userextimpl.h>
-#include <rtems/extensionimpl.h>
+#include <rtems/sysinit.h>
rtems_status_code rtems_extension_create(
rtems_name name,
@@ -58,3 +57,14 @@ rtems_status_code rtems_extension_create(
_Objects_Allocator_unlock();
return RTEMS_SUCCESSFUL;
}
+
+static void _Extension_Manager_initialization( void )
+{
+ _Objects_Initialize_information( &_Extension_Information);
+}
+
+RTEMS_SYSINIT_ITEM(
+ _Extension_Manager_initialization,
+ RTEMS_SYSINIT_USER_EXTENSIONS,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);