RTEMS 5.2
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
38#define REGION_OF_THREAD_QUEUE_QUEUE( queue ) \
39 RTEMS_CONTAINER_OF( queue, Region_Control, Wait_queue.Queue )
40
48{
50}
51
59 Region_Control *the_region
60)
61{
62 _Thread_queue_Destroy( &the_region->Wait_queue );
63 _Objects_Free( &_Region_Information, &the_region->Object );
64}
65
66RTEMS_INLINE_ROUTINE Region_Control *_Region_Get_and_lock( Objects_Id id )
67{
68 Region_Control *the_region;
69
70 _RTEMS_Lock_allocator();
71
72 the_region = (Region_Control *)
74
75 if ( the_region != NULL ) {
76 /* Keep allocator lock */
77 return the_region;
78 }
79
80 _RTEMS_Unlock_allocator();
81 return NULL;
82}
83
84RTEMS_INLINE_ROUTINE void _Region_Unlock( Region_Control *the_region )
85{
86 (void) the_region;
87 _RTEMS_Unlock_allocator();
88}
89
98 Region_Control *the_region,
99 uintptr_t size
100)
101{
102 return _Heap_Allocate( &the_region->Memory, size );
103}
104
111 Region_Control *the_region,
112 void *the_segment
113)
114{
115 return _Heap_Free( &the_region->Memory, the_segment );
116}
117
127extern void _Region_Process_queue(Region_Control *the_region);
128
131#ifdef __cplusplus
132}
133#endif
134
135#endif
136/* end of include file */
API Mutex Handler API.
#define NULL
Requests a GPIO pin group configuration.
Definition: bestcomm_api.h:77
RTEMS_INLINE_ROUTINE void _Region_Free(Region_Control *the_region)
Region_Free.
Definition: regionimpl.h:58
RTEMS_INLINE_ROUTINE void * _Region_Allocate_segment(Region_Control *the_region, uintptr_t size)
Region_Allocate_segment.
Definition: regionimpl.h:97
void _Region_Process_queue(Region_Control *the_region)
Process Region Queue.
Definition: regionprocessqueue.c:25
Objects_Information _Region_Information
The Classic Region objects information.
RTEMS_INLINE_ROUTINE Region_Control * _Region_Allocate(void)
Region_Allocate.
Definition: regionimpl.h:47
RTEMS_INLINE_ROUTINE bool _Region_Free_segment(Region_Control *the_region, void *the_segment)
Region_Free_segment.
Definition: regionimpl.h:110
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
RTEMS_INLINE_ROUTINE void * _Heap_Allocate(Heap_Control *heap, uintptr_t size)
Allocates a memory area.
Definition: heapimpl.h:160
bool _Heap_Free(Heap_Control *heap, void *addr)
Frees the allocated memory area.
Definition: heapfree.c:99
RTEMS_INLINE_ROUTINE void _Objects_Free(Objects_Information *information, Objects_Control *the_object)
Frees an object.
Definition: objectimpl.h:930
Objects_Control * _Objects_Allocate(Objects_Information *information)
Allocates an object.
Definition: objectallocate.c:42
uint32_t Objects_Id
Definition: object.h:80
Objects_Control * _Objects_Get_no_protection(Objects_Id id, const Objects_Information *information)
Maps object ids to object control blocks.
Definition: objectgetnoprotection.c:23
RTEMS_INLINE_ROUTINE void _Thread_queue_Destroy(Thread_queue_Control *the_thread_queue)
Destroys the thread queue.
Definition: threadqimpl.h:1378
Heap Handler Implementation.
Inlined Routines in the Object Handler.
Classic Region Manager Data Structures.
Definition: regiondata.h:40
unsigned size
Definition: tte.h:1
Constants and Structures Associated with the Manipulation of Objects.