[rtems commit] sapi: Create extension implementation header

Sebastian Huber sebh at rtems.org
Tue Jul 23 13:09:29 UTC 2013


Module:    rtems
Branch:    master
Commit:    ac252bdce027a45a3e7094e92508a9d8f9525720
Changeset: http://git.rtems.org/rtems/commit/?id=ac252bdce027a45a3e7094e92508a9d8f9525720

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Jul 23 10:04:19 2013 +0200

sapi: Create extension implementation header

Move implementation specific parts of extension.h and extension.inl into
new header file extensionimpl.h.  The extension.h contains now only the
application visible API.

---

 cpukit/libcsupport/src/resource_snapshot.c         |    2 +
 cpukit/libmisc/monitor/mon-object.c                |    1 +
 cpukit/sapi/Makefile.am                            |    3 +-
 cpukit/sapi/include/rtems/extension.h              |   17 ------------
 .../rtems/extensionimpl.h}                         |   27 ++++++++++++++++++-
 cpukit/sapi/preinstall.am                          |    8 +++---
 cpukit/sapi/src/exinit.c                           |    2 +-
 cpukit/sapi/src/extension.c                        |    2 +-
 cpukit/sapi/src/extensioncreate.c                  |    2 +-
 cpukit/sapi/src/extensiondata.c                    |    4 +--
 cpukit/sapi/src/extensiondelete.c                  |    2 +-
 cpukit/sapi/src/extensionident.c                   |    2 +-
 testsuites/sptests/spsize/size.c                   |    4 +-
 13 files changed, 41 insertions(+), 35 deletions(-)

diff --git a/cpukit/libcsupport/src/resource_snapshot.c b/cpukit/libcsupport/src/resource_snapshot.c
index 3318d38..917da8a 100644
--- a/cpukit/libcsupport/src/resource_snapshot.c
+++ b/cpukit/libcsupport/src/resource_snapshot.c
@@ -25,6 +25,8 @@
 #include <rtems/score/wkspace.h>
 #include <rtems/score/protectedheap.h>
 
+#include <rtems/extensionimpl.h>
+
 #include <rtems/rtems/barrierimpl.h>
 #include <rtems/rtems/messageimpl.h>
 #include <rtems/rtems/semimpl.h>
diff --git a/cpukit/libmisc/monitor/mon-object.c b/cpukit/libmisc/monitor/mon-object.c
index 6cdf597..3ef9276 100644
--- a/cpukit/libmisc/monitor/mon-object.c
+++ b/cpukit/libmisc/monitor/mon-object.c
@@ -20,6 +20,7 @@
 #define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
 #include <rtems.h>
 #include <rtems/monitor.h>
+#include <rtems/extensionimpl.h>
 #include <rtems/rtems/messageimpl.h>
 #include <rtems/rtems/semimpl.h>
 #if defined(RTEMS_POSIX_API)
diff --git a/cpukit/sapi/Makefile.am b/cpukit/sapi/Makefile.am
index ca96203..43f5de8 100644
--- a/cpukit/sapi/Makefile.am
+++ b/cpukit/sapi/Makefile.am
@@ -7,6 +7,7 @@ include_rtems_HEADERS = include/confdefs.h
 include_rtems_HEADERS += include/rtems/chain.h
 include_rtems_HEADERS += include/rtems/config.h
 include_rtems_HEADERS += include/rtems/extension.h
+include_rtems_HEADERS += include/rtems/extensionimpl.h
 include_rtems_HEADERS += include/rtems/fatal.h
 include_rtems_HEADERS += include/rtems/init.h
 include_rtems_HEADERS += include/rtems/io.h
@@ -19,8 +20,6 @@ include_rtems_HEADERS += include/rtems/timespec.h
 
 EXTRA_DIST = include/rtems/README
 
-include_rtems_HEADERS += inline/rtems/extension.inl
-
 ## src
 AM_CPPFLAGS += -D__RTEMS_INSIDE__
 
diff --git a/cpukit/sapi/include/rtems/extension.h b/cpukit/sapi/include/rtems/extension.h
index d4f7fde..7b2bfbd 100644
--- a/cpukit/sapi/include/rtems/extension.h
+++ b/cpukit/sapi/include/rtems/extension.h
@@ -16,10 +16,6 @@
 #ifndef _RTEMS_EXTENSION_H
 #define _RTEMS_EXTENSION_H
 
-#ifndef SAPI_EXT_EXTERN
-#define SAPI_EXT_EXTERN extern
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -29,20 +25,11 @@ extern "C" {
 #include <rtems/rtems/status.h>
 #include <rtems/rtems/types.h>
 
-SAPI_EXT_EXTERN Objects_Information  _Extension_Information;
-
 typedef struct {
   Objects_Control          Object;
   User_extensions_Control  Extension;
 }   Extension_Control;
 
-/**
- *  @brief Initialize extension manager.
- *
- *  This routine initializes all extension manager related data structures.
- */
-void _Extension_Manager_initialization(void);
-
 typedef User_extensions_routine
   rtems_extension RTEMS_COMPILER_DEPRECATED_ATTRIBUTE;
 
@@ -251,10 +238,6 @@ rtems_status_code rtems_extension_delete(
 
 /** @} */
 
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/extension.inl>
-#endif
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/cpukit/sapi/inline/rtems/extension.inl b/cpukit/sapi/include/rtems/extensionimpl.h
similarity index 68%
rename from cpukit/sapi/inline/rtems/extension.inl
rename to cpukit/sapi/include/rtems/extensionimpl.h
index 0d0cfc2..1b80fdf 100644
--- a/cpukit/sapi/inline/rtems/extension.inl
+++ b/cpukit/sapi/include/rtems/extensionimpl.h
@@ -15,8 +15,27 @@
  *  http://www.rtems.com/license/LICENSE.
  */
 
-#ifndef __EXTENSION_MANAGER_inl
-#define __EXTENSION_MANAGER_inl
+#ifndef _RTEMS_EXTENSIONIMPL_H
+#define _RTEMS_EXTENSIONIMPL_H
+
+#include <rtems/extension.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef SAPI_EXT_EXTERN
+#define SAPI_EXT_EXTERN extern
+#endif
+
+SAPI_EXT_EXTERN Objects_Information  _Extension_Information;
+
+/**
+ *  @brief Initialize extension manager.
+ *
+ *  This routine initializes all extension manager related data structures.
+ */
+void _Extension_Manager_initialization(void);
 
 RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Allocate( void )
 {
@@ -46,5 +65,9 @@ RTEMS_INLINE_ROUTINE bool _Extension_Is_null (
   return ( the_extension == NULL );
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 /* end of include file */
diff --git a/cpukit/sapi/preinstall.am b/cpukit/sapi/preinstall.am
index 873ab71..2b247bc 100644
--- a/cpukit/sapi/preinstall.am
+++ b/cpukit/sapi/preinstall.am
@@ -44,6 +44,10 @@ $(PROJECT_INCLUDE)/rtems/extension.h: include/rtems/extension.h $(PROJECT_INCLUD
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/extension.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/extension.h
 
+$(PROJECT_INCLUDE)/rtems/extensionimpl.h: include/rtems/extensionimpl.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/extensionimpl.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/extensionimpl.h
+
 $(PROJECT_INCLUDE)/rtems/fatal.h: include/rtems/fatal.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/fatal.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/fatal.h
@@ -80,10 +84,6 @@ $(PROJECT_INCLUDE)/rtems/timespec.h: include/rtems/timespec.h $(PROJECT_INCLUDE)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/timespec.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/timespec.h
 
-$(PROJECT_INCLUDE)/rtems/extension.inl: inline/rtems/extension.inl $(PROJECT_INCLUDE)/rtems/$(dirstamp)
-	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/extension.inl
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/extension.inl
-
 $(PROJECT_LIB)/libsapi.a: libsapi.a $(PROJECT_LIB)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_LIB)/libsapi.a
 TMPINSTALL_FILES += $(PROJECT_LIB)/libsapi.a
diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c
index f83bf30..d235d59 100644
--- a/cpukit/sapi/src/exinit.c
+++ b/cpukit/sapi/src/exinit.c
@@ -32,7 +32,7 @@
 #include <rtems/system.h>
 #include <rtems/config.h>
 #include <rtems/debug.h>
-#include <rtems/extension.h>
+#include <rtems/extensionimpl.h>
 #include <rtems/fatal.h>
 #include <rtems/init.h>
 #include <rtems/io.h>
diff --git a/cpukit/sapi/src/extension.c b/cpukit/sapi/src/extension.c
index 29ceebc..ffa0dce 100644
--- a/cpukit/sapi/src/extension.c
+++ b/cpukit/sapi/src/extension.c
@@ -26,7 +26,7 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/object.h>
 #include <rtems/score/thread.h>
-#include <rtems/extension.h>
+#include <rtems/extensionimpl.h>
 
 void _Extension_Manager_initialization(void)
 {
diff --git a/cpukit/sapi/src/extensioncreate.c b/cpukit/sapi/src/extensioncreate.c
index f963e0a..0590a13 100644
--- a/cpukit/sapi/src/extensioncreate.c
+++ b/cpukit/sapi/src/extensioncreate.c
@@ -24,7 +24,7 @@
 #include <rtems/score/object.h>
 #include <rtems/score/thread.h>
 #include <rtems/score/userextimpl.h>
-#include <rtems/extension.h>
+#include <rtems/extensionimpl.h>
 
 rtems_status_code rtems_extension_create(
   rtems_name                    name,
diff --git a/cpukit/sapi/src/extensiondata.c b/cpukit/sapi/src/extensiondata.c
index b604274..8e77f1d 100644
--- a/cpukit/sapi/src/extensiondata.c
+++ b/cpukit/sapi/src/extensiondata.c
@@ -22,6 +22,4 @@
 /* instantiate extension data */
 #define SAPI_EXT_EXTERN
 
-#include <rtems/system.h>
-#include <rtems/extension.h>
-
+#include <rtems/extensionimpl.h>
diff --git a/cpukit/sapi/src/extensiondelete.c b/cpukit/sapi/src/extensiondelete.c
index 7e4957e..0c013f3 100644
--- a/cpukit/sapi/src/extensiondelete.c
+++ b/cpukit/sapi/src/extensiondelete.c
@@ -19,7 +19,7 @@
 #include "config.h"
 #endif
 
-#include <rtems/extension.h>
+#include <rtems/extensionimpl.h>
 #include <rtems/score/object.h>
 #include <rtems/score/thread.h>
 #include <rtems/score/userextimpl.h>
diff --git a/cpukit/sapi/src/extensionident.c b/cpukit/sapi/src/extensionident.c
index 3e19326..7fa56e9 100644
--- a/cpukit/sapi/src/extensionident.c
+++ b/cpukit/sapi/src/extensionident.c
@@ -23,7 +23,7 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/object.h>
 #include <rtems/score/thread.h>
-#include <rtems/extension.h>
+#include <rtems/extensionimpl.h>
 
 rtems_status_code rtems_extension_ident(
   rtems_name    name,
diff --git a/testsuites/sptests/spsize/size.c b/testsuites/sptests/spsize/size.c
index 6f3f4c9..2754ce8 100644
--- a/testsuites/sptests/spsize/size.c
+++ b/testsuites/sptests/spsize/size.c
@@ -22,7 +22,7 @@
 #include <rtems/rtems/tasks.h>
 #include <rtems/rtems/dpmem.h>
 #include <rtems/rtems/event.h>
-#include <rtems/extension.h>
+#include <rtems/extensionimpl.h>
 #include <rtems/fatal.h>
 #include <rtems/init.h>
 #include <rtems/score/isr.h>
@@ -277,7 +277,7 @@ uninitialized =
 
 /*eventset.h*/  0                                         +
 
-/*extension.h*/ (sizeof _Extension_Information)           +
+/*extensionimpl.h*/ (sizeof _Extension_Information)       +
 
 /*fatal.h*/     0                                         +
 




More information about the vc mailing list