From ac252bdce027a45a3e7094e92508a9d8f9525720 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 23 Jul 2013 10:04:19 +0200 Subject: 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 ------- cpukit/sapi/include/rtems/extensionimpl.h | 73 ++++++++++++++++++++++++++++++ cpukit/sapi/inline/rtems/extension.inl | 50 -------------------- 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 +- 14 files changed, 89 insertions(+), 83 deletions(-) create mode 100644 cpukit/sapi/include/rtems/extensionimpl.h delete mode 100644 cpukit/sapi/inline/rtems/extension.inl diff --git a/cpukit/libcsupport/src/resource_snapshot.c b/cpukit/libcsupport/src/resource_snapshot.c index 3318d38ddd..917da8a2ee 100644 --- a/cpukit/libcsupport/src/resource_snapshot.c +++ b/cpukit/libcsupport/src/resource_snapshot.c @@ -25,6 +25,8 @@ #include #include +#include + #include #include #include diff --git a/cpukit/libmisc/monitor/mon-object.c b/cpukit/libmisc/monitor/mon-object.c index 6cdf59761a..3ef9276c9a 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 #include +#include #include #include #if defined(RTEMS_POSIX_API) diff --git a/cpukit/sapi/Makefile.am b/cpukit/sapi/Makefile.am index ca96203b76..43f5de84c4 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 d4f7fde532..7b2bfbd7ea 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 #include -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 -#endif - #ifdef __cplusplus } #endif diff --git a/cpukit/sapi/include/rtems/extensionimpl.h b/cpukit/sapi/include/rtems/extensionimpl.h new file mode 100644 index 0000000000..1b80fdfff7 --- /dev/null +++ b/cpukit/sapi/include/rtems/extensionimpl.h @@ -0,0 +1,73 @@ +/** + * @file + * + * @ingroup ClassicUserExtensions + * + * @brief User Extensions API + */ + +/* + * COPYRIGHT (c) 1989-1999. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + +#ifndef _RTEMS_EXTENSIONIMPL_H +#define _RTEMS_EXTENSIONIMPL_H + +#include + +#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 ) +{ + return (Extension_Control *) _Objects_Allocate( &_Extension_Information ); +} + +RTEMS_INLINE_ROUTINE void _Extension_Free ( + Extension_Control *the_extension +) +{ + _Objects_Free( &_Extension_Information, &the_extension->Object ); +} + +RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get ( + Objects_Id id, + Objects_Locations *location +) +{ + return (Extension_Control *) + _Objects_Get( &_Extension_Information, id, location ); +} + +RTEMS_INLINE_ROUTINE bool _Extension_Is_null ( + Extension_Control *the_extension +) +{ + return ( the_extension == NULL ); +} + +#ifdef __cplusplus +} +#endif + +#endif +/* end of include file */ diff --git a/cpukit/sapi/inline/rtems/extension.inl b/cpukit/sapi/inline/rtems/extension.inl deleted file mode 100644 index 0d0cfc2320..0000000000 --- a/cpukit/sapi/inline/rtems/extension.inl +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @file - * - * @ingroup ClassicUserExtensions - * - * @brief User Extensions API - */ - -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - */ - -#ifndef __EXTENSION_MANAGER_inl -#define __EXTENSION_MANAGER_inl - -RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Allocate( void ) -{ - return (Extension_Control *) _Objects_Allocate( &_Extension_Information ); -} - -RTEMS_INLINE_ROUTINE void _Extension_Free ( - Extension_Control *the_extension -) -{ - _Objects_Free( &_Extension_Information, &the_extension->Object ); -} - -RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get ( - Objects_Id id, - Objects_Locations *location -) -{ - return (Extension_Control *) - _Objects_Get( &_Extension_Information, id, location ); -} - -RTEMS_INLINE_ROUTINE bool _Extension_Is_null ( - Extension_Control *the_extension -) -{ - return ( the_extension == NULL ); -} - -#endif -/* end of include file */ diff --git a/cpukit/sapi/preinstall.am b/cpukit/sapi/preinstall.am index 873ab71c1d..2b247bce58 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 f83bf30c61..d235d59bd9 100644 --- a/cpukit/sapi/src/exinit.c +++ b/cpukit/sapi/src/exinit.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpukit/sapi/src/extension.c b/cpukit/sapi/src/extension.c index 29ceebcec5..ffa0dcecc5 100644 --- a/cpukit/sapi/src/extension.c +++ b/cpukit/sapi/src/extension.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include void _Extension_Manager_initialization(void) { diff --git a/cpukit/sapi/src/extensioncreate.c b/cpukit/sapi/src/extensioncreate.c index f963e0a421..0590a1374c 100644 --- a/cpukit/sapi/src/extensioncreate.c +++ b/cpukit/sapi/src/extensioncreate.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include rtems_status_code rtems_extension_create( rtems_name name, diff --git a/cpukit/sapi/src/extensiondata.c b/cpukit/sapi/src/extensiondata.c index b604274a87..8e77f1d00f 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 -#include - +#include diff --git a/cpukit/sapi/src/extensiondelete.c b/cpukit/sapi/src/extensiondelete.c index 7e4957eafc..0c013f32ad 100644 --- a/cpukit/sapi/src/extensiondelete.c +++ b/cpukit/sapi/src/extensiondelete.c @@ -19,7 +19,7 @@ #include "config.h" #endif -#include +#include #include #include #include diff --git a/cpukit/sapi/src/extensionident.c b/cpukit/sapi/src/extensionident.c index 3e19326124..7fa56e97be 100644 --- a/cpukit/sapi/src/extensionident.c +++ b/cpukit/sapi/src/extensionident.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include rtems_status_code rtems_extension_ident( rtems_name name, diff --git a/testsuites/sptests/spsize/size.c b/testsuites/sptests/spsize/size.c index 6f3f4c99b1..2754ce86c4 100644 --- a/testsuites/sptests/spsize/size.c +++ b/testsuites/sptests/spsize/size.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -277,7 +277,7 @@ uninitialized = /*eventset.h*/ 0 + -/*extension.h*/ (sizeof _Extension_Information) + +/*extensionimpl.h*/ (sizeof _Extension_Information) + /*fatal.h*/ 0 + -- cgit v1.2.3