summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-02-02 14:23:52 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-02-03 05:57:06 +0100
commit8a95e6f820f066451e1325592c9c0f18fa205c17 (patch)
treeef684ed217a4af5ac6e20eaf7e578b83d6afb50c /cpukit/rtems
parentscore: Define _Assert() for static analysis runs (diff)
downloadrtems-8a95e6f820f066451e1325592c9c0f18fa205c17.tar.bz2
rtems: Rework object services API
Add a "Constraints" paragraph to the documentation. Provide prototypes for programming language bindings. Use the macro implementation to implement the corresponding functions. Update #3993.
Diffstat (limited to 'cpukit/rtems')
-rw-r--r--cpukit/rtems/src/rtemsbuildid.c19
-rw-r--r--cpukit/rtems/src/rtemsbuildname.c33
-rw-r--r--cpukit/rtems/src/rtemsobjectidapimaximum.c17
-rw-r--r--cpukit/rtems/src/rtemsobjectidapiminimum.c17
-rw-r--r--cpukit/rtems/src/rtemsobjectidgetapi.c21
-rw-r--r--cpukit/rtems/src/rtemsobjectidgetclass.c21
-rw-r--r--cpukit/rtems/src/rtemsobjectidgetindex.c21
-rw-r--r--cpukit/rtems/src/rtemsobjectidgetnode.c21
8 files changed, 72 insertions, 98 deletions
diff --git a/cpukit/rtems/src/rtemsbuildid.c b/cpukit/rtems/src/rtemsbuildid.c
index ec3a715473..069812a3d5 100644
--- a/cpukit/rtems/src/rtemsbuildid.c
+++ b/cpukit/rtems/src/rtemsbuildid.c
@@ -20,25 +20,26 @@
#include "config.h"
#endif
-#include <rtems/score/objectimpl.h>
+#include <rtems/rtems/object.h>
-/*
- * This is implemented as a macro. This body is provided to support
- * bindings from non-C based languages.
- */
-Objects_Id rtems_build_id(
+static rtems_id _RTEMS_Build_id(
uint32_t api,
uint32_t class,
uint32_t node,
uint32_t index
-);
+)
+{
+ return rtems_build_id( api, class, node, index );
+}
+
+#undef rtems_build_id
-Objects_Id rtems_build_id(
+rtems_id rtems_build_id(
uint32_t api,
uint32_t class,
uint32_t node,
uint32_t index
)
{
- return _Objects_Build_id( api, class, node, index );
+ return _RTEMS_Build_id( api, class, node, index );
}
diff --git a/cpukit/rtems/src/rtemsbuildname.c b/cpukit/rtems/src/rtemsbuildname.c
index 42c8c46fd3..300c3638f9 100644
--- a/cpukit/rtems/src/rtemsbuildname.c
+++ b/cpukit/rtems/src/rtemsbuildname.c
@@ -20,33 +20,16 @@
#include "config.h"
#endif
-#include <rtems/rtems/types.h>
+#include <rtems/rtems/object.h>
-/*
- * Undefine since this is normally a macro and we want a real body in
- * the library for other language bindings.
- */
-#undef rtems_build_name
+static rtems_name _RTEMS_Build_name( char c1, char c2, char c3, char c4 )
+{
+ return rtems_build_name( c1, c2, c3, c4 );
+}
-/*
- * Prototype it to avoid warnings
- */
-rtems_name rtems_build_name(
- char C1,
- char C2,
- char C3,
- char C4
-);
+#undef rtems_build_name
-/*
- * Now define a real body
- */
-rtems_name rtems_build_name(
- char C1,
- char C2,
- char C3,
- char C4
-)
+rtems_id rtems_build_name( char c1, char c2, char c3, char c4 )
{
- return _Objects_Build_name( C1, C2, C3, C4 );
+ return _RTEMS_Build_name( c1, c2, c3, c4 );
}
diff --git a/cpukit/rtems/src/rtemsobjectidapimaximum.c b/cpukit/rtems/src/rtemsobjectidapimaximum.c
index 3d624b0b5a..d432647bd3 100644
--- a/cpukit/rtems/src/rtemsobjectidapimaximum.c
+++ b/cpukit/rtems/src/rtemsobjectidapimaximum.c
@@ -20,15 +20,16 @@
#include "config.h"
#endif
-#include <rtems/score/objectimpl.h>
+#include <rtems/rtems/object.h>
-/*
- * This is implemented as a macro. This body is provided to support
- * bindings from non-C based languages.
- */
-int rtems_object_id_api_maximum(void);
+static int _RTEMS_Object_id_api_maximum( void )
+{
+ return rtems_object_id_api_maximum();
+}
+
+#undef rtems_object_id_api_maximum
-int rtems_object_id_api_maximum(void)
+int rtems_object_id_api_maximum( void )
{
- return OBJECTS_APIS_LAST;
+ return _RTEMS_Object_id_api_maximum();
}
diff --git a/cpukit/rtems/src/rtemsobjectidapiminimum.c b/cpukit/rtems/src/rtemsobjectidapiminimum.c
index f9af3914a6..55bb014136 100644
--- a/cpukit/rtems/src/rtemsobjectidapiminimum.c
+++ b/cpukit/rtems/src/rtemsobjectidapiminimum.c
@@ -20,15 +20,16 @@
#include "config.h"
#endif
-#include <rtems/score/objectimpl.h>
+#include <rtems/rtems/object.h>
-/*
- * This is implemented as a macro. This body is provided to support
- * bindings from non-C based languages.
- */
-int rtems_object_id_api_minimum(void);
+static int _RTEMS_Object_id_api_minimum( void )
+{
+ return rtems_object_id_api_minimum();
+}
+
+#undef rtems_object_id_api_minimum
-int rtems_object_id_api_minimum(void)
+int rtems_object_id_api_minimum( void )
{
- return OBJECTS_INTERNAL_API;
+ return _RTEMS_Object_id_api_minimum();
}
diff --git a/cpukit/rtems/src/rtemsobjectidgetapi.c b/cpukit/rtems/src/rtemsobjectidgetapi.c
index 087402a911..a5efeb3290 100644
--- a/cpukit/rtems/src/rtemsobjectidgetapi.c
+++ b/cpukit/rtems/src/rtemsobjectidgetapi.c
@@ -20,19 +20,16 @@
#include "config.h"
#endif
-#include <rtems/score/objectimpl.h>
+#include <rtems/rtems/object.h>
-/*
- * This is implemented as a macro. This body is provided to support
- * bindings from non-C based languages.
- */
-int rtems_object_id_get_api(
- Objects_Id id
-);
+static int _RTEMS_Object_id_get_api( rtems_id id )
+{
+ return rtems_object_id_get_api( id );
+}
+
+#undef rtems_object_id_get_api
-int rtems_object_id_get_api(
- Objects_Id id
-)
+int rtems_object_id_get_api( rtems_id id )
{
- return _Objects_Get_API( id );
+ return _RTEMS_Object_id_get_api( id );
}
diff --git a/cpukit/rtems/src/rtemsobjectidgetclass.c b/cpukit/rtems/src/rtemsobjectidgetclass.c
index bc2d11a5ea..6b817e55fe 100644
--- a/cpukit/rtems/src/rtemsobjectidgetclass.c
+++ b/cpukit/rtems/src/rtemsobjectidgetclass.c
@@ -20,19 +20,16 @@
#include "config.h"
#endif
-#include <rtems/score/objectimpl.h>
+#include <rtems/rtems/object.h>
-/*
- * This is implemented as a macro. This body is provided to support
- * bindings from non-C based languages.
- */
-int rtems_object_id_get_class(
- Objects_Id id
-);
+static int _RTEMS_Object_id_get_class( rtems_id id )
+{
+ return rtems_object_id_get_class( id );
+}
+
+#undef rtems_object_id_get_class
-int rtems_object_id_get_class(
- Objects_Id id
-)
+int rtems_object_id_get_class( rtems_id id )
{
- return _Objects_Get_class( id );
+ return _RTEMS_Object_id_get_class( id );
}
diff --git a/cpukit/rtems/src/rtemsobjectidgetindex.c b/cpukit/rtems/src/rtemsobjectidgetindex.c
index cdcbd2f609..48e2f5ad95 100644
--- a/cpukit/rtems/src/rtemsobjectidgetindex.c
+++ b/cpukit/rtems/src/rtemsobjectidgetindex.c
@@ -20,19 +20,16 @@
#include "config.h"
#endif
-#include <rtems/score/objectimpl.h>
+#include <rtems/rtems/object.h>
-/*
- * This is implemented as a macro. This body is provided to support
- * bindings from non-C based languages.
- */
-int rtems_object_id_get_index(
- Objects_Id id
-);
+static int _RTEMS_Object_id_get_index( rtems_id id )
+{
+ return rtems_object_id_get_index( id );
+}
+
+#undef rtems_object_id_get_index
-int rtems_object_id_get_index(
- Objects_Id id
-)
+int rtems_object_id_get_index( rtems_id id )
{
- return _Objects_Get_index( id );
+ return _RTEMS_Object_id_get_index( id );
}
diff --git a/cpukit/rtems/src/rtemsobjectidgetnode.c b/cpukit/rtems/src/rtemsobjectidgetnode.c
index 4d8a4288d1..6d26f4caea 100644
--- a/cpukit/rtems/src/rtemsobjectidgetnode.c
+++ b/cpukit/rtems/src/rtemsobjectidgetnode.c
@@ -20,19 +20,16 @@
#include "config.h"
#endif
-#include <rtems/score/objectimpl.h>
+#include <rtems/rtems/object.h>
-/*
- * This is implemented as a macro. This body is provided to support
- * bindings from non-C based languages.
- */
-int rtems_object_id_get_node(
- Objects_Id id
-);
+static int _RTEMS_Object_id_get_node( rtems_id id )
+{
+ return rtems_object_id_get_node( id );
+}
+
+#undef rtems_object_id_get_node
-int rtems_object_id_get_node(
- Objects_Id id
-)
+int rtems_object_id_get_node( rtems_id id )
{
- return _Objects_Get_node( id );
+ return _RTEMS_Object_id_get_node( id );
}