diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-23 14:38:19 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-23 15:12:55 +0200 |
commit | f6c7c57d86b58e12d372495a23e331cb81ea59ff (patch) | |
tree | 6406542e0324f94964bbce0e41d2f86c637d5f1f | |
parent | rtems: Include <rtems/debug.h> in <rtems.h> (diff) | |
download | rtems-f6c7c57d86b58e12d372495a23e331cb81ea59ff.tar.bz2 |
rtems: Create region implementation header
Move implementation specific parts of region.h and region.inl into new
header file regionimpl.h. The region.h contains now only the
application visible API.
23 files changed, 119 insertions, 118 deletions
diff --git a/cpukit/libcsupport/src/resource_snapshot.c b/cpukit/libcsupport/src/resource_snapshot.c index 0fd20aeedb..b71b198cf3 100644 --- a/cpukit/libcsupport/src/resource_snapshot.c +++ b/cpukit/libcsupport/src/resource_snapshot.c @@ -32,6 +32,7 @@ #include <rtems/rtems/messageimpl.h> #include <rtems/rtems/partimpl.h> #include <rtems/rtems/ratemonimpl.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/rtems/semimpl.h> #include <rtems/rtems/timerimpl.h> diff --git a/cpukit/libmisc/monitor/mon-object.c b/cpukit/libmisc/monitor/mon-object.c index cb0ffa1de3..54ae2074b8 100644 --- a/cpukit/libmisc/monitor/mon-object.c +++ b/cpukit/libmisc/monitor/mon-object.c @@ -23,6 +23,7 @@ #include <rtems/extensionimpl.h> #include <rtems/rtems/messageimpl.h> #include <rtems/rtems/partimpl.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/rtems/semimpl.h> #if defined(RTEMS_POSIX_API) #include <rtems/posix/pthreadimpl.h> diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am index 7e810af561..7633932896 100644 --- a/cpukit/rtems/Makefile.am +++ b/cpukit/rtems/Makefile.am @@ -40,6 +40,7 @@ include_rtems_rtems_HEADERS += include/rtems/rtems/partimpl.h include_rtems_rtems_HEADERS += include/rtems/rtems/ratemon.h include_rtems_rtems_HEADERS += include/rtems/rtems/ratemonimpl.h include_rtems_rtems_HEADERS += include/rtems/rtems/region.h +include_rtems_rtems_HEADERS += include/rtems/rtems/regionimpl.h include_rtems_rtems_HEADERS += include/rtems/rtems/rtemsapi.h include_rtems_rtems_HEADERS += include/rtems/rtems/sem.h include_rtems_rtems_HEADERS += include/rtems/rtems/semimpl.h @@ -69,7 +70,6 @@ include_rtems_rtems_HEADERS += include/rtems/rtems/signalmp.h include_rtems_rtems_HEADERS += include/rtems/rtems/taskmp.h endif -include_rtems_rtems_HEADERS += inline/rtems/rtems/region.inl include_rtems_rtems_HEADERS += inline/rtems/rtems/tasks.inl ## src diff --git a/cpukit/rtems/include/rtems/rtems/region.h b/cpukit/rtems/include/rtems/rtems/region.h index a99a497b8d..ce471b8169 100644 --- a/cpukit/rtems/include/rtems/rtems/region.h +++ b/cpukit/rtems/include/rtems/rtems/region.h @@ -30,15 +30,16 @@ #ifndef _RTEMS_RTEMS_REGION_H #define _RTEMS_RTEMS_REGION_H -#include <rtems/score/object.h> -#include <rtems/score/threadq.h> -#include <rtems/score/heap.h> -#include <rtems/debug.h> #include <rtems/rtems/attr.h> #include <rtems/rtems/options.h> #include <rtems/rtems/status.h> -#include <rtems/rtems/support.h> #include <rtems/rtems/types.h> +#include <rtems/score/heap.h> +#include <rtems/score/tqdata.h> + +#ifdef __cplusplus +extern "C" { +#endif /** * @defgroup ClassicRegion Regions @@ -50,24 +51,6 @@ /**@{*/ /** - * @brief Instantiate RTEMS Region Data - * - * Region Manager -- Instantiate Data - * - * This constant is defined to extern most of the time when using - * this header file. However by defining it to nothing, the data - * declared in this header file can be instantiated. This is done - * in a single per manager file. - */ -#ifndef RTEMS_REGION_EXTERN -#define RTEMS_REGION_EXTERN extern -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** * The following records define the control block used to manage * each region. */ @@ -85,21 +68,6 @@ typedef struct { } Region_Control; /** - * The following defines the information control block used to - * manage this class of objects. - */ -RTEMS_REGION_EXTERN Objects_Information _Region_Information; - -/** - * @brief _Region_Manager_initialization - * - * Region Manager - * - * This routine performs the initialization necessary for this manager. - */ -void _Region_Manager_initialization(void); - -/** * @brief rtems_region_create * * Region Manager @@ -322,50 +290,11 @@ rtems_status_code rtems_region_resize_segment( uintptr_t *old_size ); -#ifndef __RTEMS_APPLICATION__ -#include <rtems/rtems/region.inl> -/** - * @brief Process Region Queue - * - * This is a helper routine which is invoked any time memory is - * freed. It looks at the set of waiting tasks and attempts to - * satisfy all outstanding requests. - * - * @param[in] the_region is the the region - */ -extern void _Region_Process_queue(Region_Control *the_region); - -#endif - -#if defined(RTEMS_MULTIPROCESSING) -#include <rtems/rtems/regionmp.h> -#endif - -/** - * @brief _Region_Debug_Walk - * - * This routine is invoked to verify the integrity of a heap associated - * with the_region. - */ -#ifdef RTEMS_DEBUG - -#define _Region_Debug_Walk( _the_region, _source ) \ - do { \ - if ( rtems_debug_is_enabled( RTEMS_DEBUG_REGION ) ) \ - _Heap_Walk( &(_the_region)->Memory, _source, false ); \ - } while ( 0 ) - -#else - -#define _Region_Debug_Walk( _the_region, _source ) - -#endif +/**@}*/ #ifdef __cplusplus } #endif -/**@}*/ - #endif /* end of include file */ diff --git a/cpukit/rtems/inline/rtems/rtems/region.inl b/cpukit/rtems/include/rtems/rtems/regionimpl.h index 30e482cdc0..ad2cacb5f2 100644 --- a/cpukit/rtems/inline/rtems/rtems/region.inl +++ b/cpukit/rtems/include/rtems/rtems/regionimpl.h @@ -1,13 +1,9 @@ /** - * @file rtems/rtems/region.inl + * @file * - * @addtogroup ClassicRegion + * @ingroup ClassicRegionImpl * - * @ingroup ClassicRTEMS - * @brief Macro Implementation from Region Manager - * - * This file contains the macro implementation of the inlined - * routines from the Region Manager. + * @brief Classic Region Manager Implementation */ /* COPYRIGHT (c) 1989-2008. @@ -18,17 +14,52 @@ * http://www.rtems.com/license/LICENSE. */ -#ifndef _RTEMS_RTEMS_REGION_H -# error "Never use <rtems/rtems/region.inl> directly; include <rtems/rtems/region.h> instead." +#ifndef _RTEMS_RTEMS_REGIONIMPL_H +#define _RTEMS_RTEMS_REGIONIMPL_H + +#include <rtems/rtems/region.h> +#include <rtems/debug.h> + +#ifdef __cplusplus +extern "C" { #endif -#ifndef _RTEMS_RTEMS_REGION_INL -#define _RTEMS_RTEMS_REGION_INL +/** + * @defgroup ClassicRegionImpl Classic Region Manager Implementation + * + * @ingroup ClassicRegion + * + * @{ + */ /** - * @addtogroup ClassicRegion - * @{ + * @brief Instantiate RTEMS Region Data + * + * Region Manager -- Instantiate Data + * + * This constant is defined to extern most of the time when using + * this header file. However by defining it to nothing, the data + * declared in this header file can be instantiated. This is done + * in a single per manager file. */ +#ifndef RTEMS_REGION_EXTERN +#define RTEMS_REGION_EXTERN extern +#endif + +/** + * The following defines the information control block used to + * manage this class of objects. + */ +RTEMS_REGION_EXTERN Objects_Information _Region_Information; + +/** + * @brief _Region_Manager_initialization + * + * Region Manager + * + * This routine performs the initialization necessary for this manager. + */ +void _Region_Manager_initialization(void); /** * @brief Region_Allocate @@ -112,7 +143,46 @@ RTEMS_INLINE_ROUTINE bool _Region_Is_null ( return ( the_region == NULL ); } +/** + * @brief Process Region Queue + * + * This is a helper routine which is invoked any time memory is + * freed. It looks at the set of waiting tasks and attempts to + * satisfy all outstanding requests. + * + * @param[in] the_region is the the region + */ +extern void _Region_Process_queue(Region_Control *the_region); + +/** + * @brief _Region_Debug_Walk + * + * This routine is invoked to verify the integrity of a heap associated + * with the_region. + */ +#ifdef RTEMS_DEBUG + +#define _Region_Debug_Walk( _the_region, _source ) \ + do { \ + if ( rtems_debug_is_enabled( RTEMS_DEBUG_REGION ) ) \ + _Heap_Walk( &(_the_region)->Memory, _source, false ); \ + } while ( 0 ) + +#else + +#define _Region_Debug_Walk( _the_region, _source ) + +#endif + /**@}*/ +#ifdef __cplusplus +} +#endif + +#if defined(RTEMS_MULTIPROCESSING) +#include <rtems/rtems/regionmp.h> +#endif + #endif /* end of include file */ diff --git a/cpukit/rtems/include/rtems/rtems/regionmp.h b/cpukit/rtems/include/rtems/rtems/regionmp.h index 4ec1eb10c8..972f1ba882 100644 --- a/cpukit/rtems/include/rtems/rtems/regionmp.h +++ b/cpukit/rtems/include/rtems/rtems/regionmp.h @@ -21,16 +21,17 @@ #ifndef _RTEMS_RTEMS_REGIONMP_H #define _RTEMS_RTEMS_REGIONMP_H -#ifdef __cplusplus -extern "C" { +#ifndef _RTEMS_RTEMS_REGIONIMPL_H +# error "Never use <rtems/rtems/regionmp.h> directly; include <rtems/rtems/regionimpl.h> instead." #endif #include <rtems/score/mppkt.h> #include <rtems/score/object.h> #include <rtems/score/thread.h> -#include <rtems/rtems/options.h> -#include <rtems/rtems/region.h> +#ifdef __cplusplus +extern "C" { +#endif /** * @defgroup ClassicRegionMP Region MP Support diff --git a/cpukit/rtems/preinstall.am b/cpukit/rtems/preinstall.am index f98fd1466b..6ba32afcc1 100644 --- a/cpukit/rtems/preinstall.am +++ b/cpukit/rtems/preinstall.am @@ -131,6 +131,10 @@ $(PROJECT_INCLUDE)/rtems/rtems/region.h: include/rtems/rtems/region.h $(PROJECT_ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/region.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/region.h +$(PROJECT_INCLUDE)/rtems/rtems/regionimpl.h: include/rtems/rtems/regionimpl.h $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/regionimpl.h +PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/regionimpl.h + $(PROJECT_INCLUDE)/rtems/rtems/rtemsapi.h: include/rtems/rtems/rtemsapi.h $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/rtemsapi.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/rtemsapi.h @@ -221,10 +225,6 @@ $(PROJECT_INCLUDE)/rtems/rtems/taskmp.h: include/rtems/rtems/taskmp.h $(PROJECT_ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/taskmp.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/taskmp.h endif -$(PROJECT_INCLUDE)/rtems/rtems/region.inl: inline/rtems/rtems/region.inl $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/region.inl -PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/region.inl - $(PROJECT_INCLUDE)/rtems/rtems/tasks.inl: inline/rtems/rtems/tasks.inl $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp) $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/tasks.inl PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/tasks.inl diff --git a/cpukit/rtems/src/region.c b/cpukit/rtems/src/region.c index 309b3c6c00..66cb3c4df6 100644 --- a/cpukit/rtems/src/region.c +++ b/cpukit/rtems/src/region.c @@ -24,7 +24,7 @@ #include <rtems/rtems/support.h> #include <rtems/score/object.h> #include <rtems/rtems/options.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/score/states.h> #include <rtems/score/thread.h> #include <rtems/score/apimutex.h> diff --git a/cpukit/rtems/src/regioncreate.c b/cpukit/rtems/src/regioncreate.c index cd1739325e..163ba99daf 100644 --- a/cpukit/rtems/src/regioncreate.c +++ b/cpukit/rtems/src/regioncreate.c @@ -24,7 +24,7 @@ #include <rtems/rtems/support.h> #include <rtems/score/object.h> #include <rtems/rtems/options.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/score/states.h> #include <rtems/score/thread.h> #include <rtems/score/apimutex.h> diff --git a/cpukit/rtems/src/regiondata.c b/cpukit/rtems/src/regiondata.c index 97fdc112f1..da075fba0c 100644 --- a/cpukit/rtems/src/regiondata.c +++ b/cpukit/rtems/src/regiondata.c @@ -21,5 +21,4 @@ /* instantiate RTEMS Region data */ #define RTEMS_REGION_EXTERN -#include <rtems/system.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> diff --git a/cpukit/rtems/src/regiondelete.c b/cpukit/rtems/src/regiondelete.c index 8ad5085553..c057545c1b 100644 --- a/cpukit/rtems/src/regiondelete.c +++ b/cpukit/rtems/src/regiondelete.c @@ -23,7 +23,7 @@ #include <rtems/rtems/support.h> #include <rtems/score/object.h> #include <rtems/rtems/options.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/score/states.h> #include <rtems/score/thread.h> #include <rtems/score/apimutex.h> diff --git a/cpukit/rtems/src/regionextend.c b/cpukit/rtems/src/regionextend.c index d5e3cd645e..1c31ea29b5 100644 --- a/cpukit/rtems/src/regionextend.c +++ b/cpukit/rtems/src/regionextend.c @@ -23,7 +23,7 @@ #include <rtems/rtems/support.h> #include <rtems/score/object.h> #include <rtems/rtems/options.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/score/states.h> #include <rtems/score/thread.h> #include <rtems/score/apimutex.h> diff --git a/cpukit/rtems/src/regiongetfreeinfo.c b/cpukit/rtems/src/regiongetfreeinfo.c index bd16b0ed4b..830a888661 100644 --- a/cpukit/rtems/src/regiongetfreeinfo.c +++ b/cpukit/rtems/src/regiongetfreeinfo.c @@ -23,7 +23,7 @@ #include <rtems/rtems/support.h> #include <rtems/score/object.h> #include <rtems/rtems/options.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/score/states.h> #include <rtems/score/apimutex.h> #include <rtems/score/thread.h> diff --git a/cpukit/rtems/src/regiongetinfo.c b/cpukit/rtems/src/regiongetinfo.c index fef9f500f7..0b60f9d179 100644 --- a/cpukit/rtems/src/regiongetinfo.c +++ b/cpukit/rtems/src/regiongetinfo.c @@ -23,7 +23,7 @@ #include <rtems/rtems/support.h> #include <rtems/score/object.h> #include <rtems/rtems/options.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/score/states.h> #include <rtems/score/apimutex.h> #include <rtems/score/thread.h> diff --git a/cpukit/rtems/src/regiongetsegment.c b/cpukit/rtems/src/regiongetsegment.c index 645618a748..aac68bdda2 100644 --- a/cpukit/rtems/src/regiongetsegment.c +++ b/cpukit/rtems/src/regiongetsegment.c @@ -23,7 +23,7 @@ #include <rtems/rtems/support.h> #include <rtems/score/object.h> #include <rtems/rtems/optionsimpl.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/score/states.h> #include <rtems/score/thread.h> #include <rtems/score/apimutex.h> diff --git a/cpukit/rtems/src/regiongetsegmentsize.c b/cpukit/rtems/src/regiongetsegmentsize.c index 94a66866f1..9dd793f9b7 100644 --- a/cpukit/rtems/src/regiongetsegmentsize.c +++ b/cpukit/rtems/src/regiongetsegmentsize.c @@ -23,7 +23,7 @@ #include <rtems/rtems/support.h> #include <rtems/score/object.h> #include <rtems/rtems/options.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/score/states.h> #include <rtems/score/apimutex.h> diff --git a/cpukit/rtems/src/regionident.c b/cpukit/rtems/src/regionident.c index 8d6e088a45..6ab8719622 100644 --- a/cpukit/rtems/src/regionident.c +++ b/cpukit/rtems/src/regionident.c @@ -23,7 +23,7 @@ #include <rtems/rtems/support.h> #include <rtems/score/object.h> #include <rtems/rtems/options.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/score/states.h> #include <rtems/score/thread.h> #include <rtems/score/apimutex.h> diff --git a/cpukit/rtems/src/regionmp.c b/cpukit/rtems/src/regionmp.c index e77e0d47a7..6828fbb451 100644 --- a/cpukit/rtems/src/regionmp.c +++ b/cpukit/rtems/src/regionmp.c @@ -24,7 +24,7 @@ #include <rtems/score/mppkt.h> #include <rtems/score/object.h> #include <rtems/rtems/optionsimpl.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/score/thread.h> #include <rtems/rtems/support.h> diff --git a/cpukit/rtems/src/regionprocessqueue.c b/cpukit/rtems/src/regionprocessqueue.c index d7fc555049..bd6b2f023f 100644 --- a/cpukit/rtems/src/regionprocessqueue.c +++ b/cpukit/rtems/src/regionprocessqueue.c @@ -23,7 +23,7 @@ #include <rtems/rtems/support.h> #include <rtems/score/object.h> #include <rtems/rtems/options.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/score/states.h> #include <rtems/score/thread.h> #include <rtems/score/apimutex.h> diff --git a/cpukit/rtems/src/regionresizesegment.c b/cpukit/rtems/src/regionresizesegment.c index 3d8aeb646b..20fea987e1 100644 --- a/cpukit/rtems/src/regionresizesegment.c +++ b/cpukit/rtems/src/regionresizesegment.c @@ -23,7 +23,7 @@ #include <rtems/rtems/support.h> #include <rtems/score/object.h> #include <rtems/rtems/options.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/score/states.h> #include <rtems/score/thread.h> #include <rtems/score/apimutex.h> diff --git a/cpukit/rtems/src/regionreturnsegment.c b/cpukit/rtems/src/regionreturnsegment.c index 56783a7411..46fda06992 100644 --- a/cpukit/rtems/src/regionreturnsegment.c +++ b/cpukit/rtems/src/regionreturnsegment.c @@ -31,7 +31,7 @@ #include <rtems/rtems/support.h> #include <rtems/score/object.h> #include <rtems/rtems/options.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/score/states.h> #include <rtems/score/thread.h> #include <rtems/score/apimutex.h> diff --git a/cpukit/sapi/src/rtemsapi.c b/cpukit/sapi/src/rtemsapi.c index 8814e8755c..11530129ef 100644 --- a/cpukit/sapi/src/rtemsapi.c +++ b/cpukit/sapi/src/rtemsapi.c @@ -37,7 +37,7 @@ #endif #include <rtems/rtems/partimpl.h> #include <rtems/rtems/ratemonimpl.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/rtems/semimpl.h> #include <rtems/rtems/signal.h> #include <rtems/rtems/timerimpl.h> diff --git a/testsuites/sptests/spsize/size.c b/testsuites/sptests/spsize/size.c index 25df94ff47..74818bdcf8 100644 --- a/testsuites/sptests/spsize/size.c +++ b/testsuites/sptests/spsize/size.c @@ -36,7 +36,7 @@ #include <rtems/rtems/partimpl.h> #include <rtems/score/priority.h> #include <rtems/rtems/ratemonimpl.h> -#include <rtems/rtems/region.h> +#include <rtems/rtems/regionimpl.h> #include <rtems/rtems/semimpl.h> #include <rtems/rtems/signal.h> #include <rtems/score/scheduler.h> @@ -344,7 +344,7 @@ uninitialized = /*ratemonimpl.h*/ (sizeof _Rate_monotonic_Information) + -/*region.h*/ (sizeof _Region_Information) + +/*regionimpl.h*/ (sizeof _Region_Information) + #if defined(RTEMS_MULTIPROCESSING) /*regionmp.h*/ 0 + |