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/sapi/include/rtems/extension.h | 17 ------- cpukit/sapi/include/rtems/extensionimpl.h | 73 +++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 17 deletions(-) create mode 100644 cpukit/sapi/include/rtems/extensionimpl.h (limited to 'cpukit/sapi/include/rtems') 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 */ -- cgit v1.2.3