RTEMS CPU Kit with SuperCore  4.11.3
regionimpl.h
Go to the documentation of this file.
1 
9 /* COPYRIGHT (c) 1989-2008.
10  * On-Line Applications Research Corporation (OAR).
11  *
12  * The license and distribution terms for this file may be
13  * found in the file LICENSE in this distribution or at
14  * http://www.rtems.org/license/LICENSE.
15  */
16 
17 #ifndef _RTEMS_RTEMS_REGIONIMPL_H
18 #define _RTEMS_RTEMS_REGIONIMPL_H
19 
20 #include <rtems/rtems/region.h>
21 #include <rtems/score/heapimpl.h>
22 #include <rtems/score/objectimpl.h>
24 #include <rtems/debug.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
48 #ifndef RTEMS_REGION_EXTERN
49 #define RTEMS_REGION_EXTERN extern
50 #endif
51 
57 
66 
74 {
75  return (Region_Control *) _Objects_Allocate( &_Region_Information );
76 }
77 
85  Region_Control *the_region
86 )
87 {
88  _Thread_queue_Destroy( &the_region->Wait_queue );
89  _Objects_Free( &_Region_Information, &the_region->Object );
90 }
91 
102  Objects_Id id,
103  Objects_Locations *location
104 )
105 {
106  return (Region_Control *)
107  _Objects_Get_no_protection( &_Region_Information, id, location );
108 }
109 
118  Region_Control *the_region,
119  uintptr_t size
120 )
121 {
122  return _Heap_Allocate( &the_region->Memory, size );
123 }
124 
131  Region_Control *the_region,
132  void *the_segment
133 )
134 {
135  return _Heap_Free( &the_region->Memory, the_segment );
136 }
137 
147 extern void _Region_Process_queue(Region_Control *the_region);
148 
155 #ifdef RTEMS_DEBUG
156 
157 #define _Region_Debug_Walk( _the_region, _source ) \
158  do { \
159  if ( rtems_debug_is_enabled( RTEMS_DEBUG_REGION ) ) \
160  _Heap_Walk( &(_the_region)->Memory, _source, false ); \
161  } while ( 0 )
162 
163 #else
164 
165 #define _Region_Debug_Walk( _the_region, _source )
166 
167 #endif
168 
171 #ifdef __cplusplus
172 }
173 #endif
174 
175 #if defined(RTEMS_MULTIPROCESSING)
176 #include <rtems/rtems/regionmp.h>
177 #endif
178 
179 #endif
180 /* end of include file */
RTEMS_INLINE_ROUTINE Region_Control * _Region_Get(Objects_Id id, Objects_Locations *location)
Region_Get.
Definition: regionimpl.h:101
void _Objects_Free(Objects_Information *information, Objects_Control *the_object)
Frees an object.
Definition: objectfree.c:25
Objects_Control * _Objects_Allocate(Objects_Information *information)
Allocates an object.
Definition: objectallocate.c:101
void _Region_Process_queue(Region_Control *the_region)
Process Region Queue.
Definition: regionprocessqueue.c:25
#define RTEMS_INLINE_ROUTINE
The following (in conjunction with compiler arguments) are used to choose between the use of static i...
Definition: basedefs.h:135
RTEMS_REGION_EXTERN Objects_Information _Region_Information
The following defines the information control block used to manage this class of objects.
Definition: regionimpl.h:56
Heap Handler Implementation.
Objects_Control * _Objects_Get_no_protection(Objects_Information *information, Objects_Id id, Objects_Locations *location)
Maps object ids to object control blocks.
Definition: objectgetnoprotection.c:23
The following records define the control block used to manage each region.
Definition: region.h:59
RTEMS_INLINE_ROUTINE Region_Control * _Region_Allocate(void)
Region_Allocate.
Definition: regionimpl.h:73
RTEMS_INLINE_ROUTINE void * _Heap_Allocate(Heap_Control *heap, uintptr_t size)
See _Heap_Allocate_aligned_with_boundary() with alignment and boundary equals zero.
Definition: heapimpl.h:135
void _Region_Manager_initialization(void)
_Region_Manager_initialization
Definition: region.c:40
RTEMS_INLINE_ROUTINE bool _Region_Free_segment(Region_Control *the_region, void *the_segment)
Region_Free_segment.
Definition: regionimpl.h:130
Constants and Structures Associated with the Manipulation of Objects.
The following defines the structure for the information used to manage each class of objects...
Definition: objectimpl.h:136
Information Related to the Debug Support Within RTEMS.
RTEMS_INLINE_ROUTINE void _Region_Free(Region_Control *the_region)
Region_Free.
Definition: regionimpl.h:84
Objects_Locations
This enumerated type lists the locations which may be returned by _Objects_Get.
Definition: objectimpl.h:117
#define RTEMS_REGION_EXTERN
Instantiate RTEMS Region Data.
Definition: regionimpl.h:49
RTEMS_INLINE_ROUTINE void * _Region_Allocate_segment(Region_Control *the_region, uintptr_t size)
Region_Allocate_segment.
Definition: regionimpl.h:117
Inlined Routines in the Object Handler.
uint32_t Objects_Id
The following type defines the control block used to manage object IDs.
Definition: object.h:122
bool _Heap_Free(Heap_Control *heap, void *addr)
Frees the allocated memory area starting at addr in the heap heap.
Definition: heapfree.c:99