RTEMS 6.1-rc1
regionimpl.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/* COPYRIGHT (c) 1989-2008.
13 * On-Line Applications Research Corporation (OAR).
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _RTEMS_RTEMS_REGIONIMPL_H
38#define _RTEMS_RTEMS_REGIONIMPL_H
39
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
60#define REGION_OF_THREAD_QUEUE_QUEUE( queue ) \
61 RTEMS_CONTAINER_OF( queue, Region_Control, Wait_queue.Queue )
62
69static inline Region_Control *_Region_Allocate( void )
70{
72}
73
80static inline void _Region_Free (
81 Region_Control *the_region
82)
83{
84 _Thread_queue_Destroy( &the_region->Wait_queue );
85 _Objects_Free( &_Region_Information, &the_region->Object );
86}
87
88static inline Region_Control *_Region_Get_and_lock( Objects_Id id )
89{
90 Region_Control *the_region;
91
92 _RTEMS_Lock_allocator();
93
94 the_region = (Region_Control *)
96
97 if ( the_region != NULL ) {
98 /* Keep allocator lock */
99 return the_region;
100 }
101
102 _RTEMS_Unlock_allocator();
103 return NULL;
104}
105
106static inline void _Region_Unlock( Region_Control *the_region )
107{
108 (void) the_region;
109 _RTEMS_Unlock_allocator();
110}
111
119static inline void *_Region_Allocate_segment (
120 Region_Control *the_region,
121 uintptr_t size
122)
123{
124 return _Heap_Allocate( &the_region->Memory, size );
125}
126
132static inline bool _Region_Free_segment (
133 Region_Control *the_region,
134 void *the_segment
135)
136{
137 return _Heap_Free( &the_region->Memory, the_segment );
138}
139
149extern void _Region_Process_queue(Region_Control *the_region);
150
153#ifdef __cplusplus
154}
155#endif
156
157#endif
158/* end of include file */
This header file provides the interfaces of the API Mutex Handler.
void _Region_Process_queue(Region_Control *the_region)
Process Region Queue.
Definition: regionprocessqueue.c:46
Objects_Information _Region_Information
The Classic Region objects information.
bool _Heap_Free(Heap_Control *heap, void *addr)
Frees the allocated memory area.
Definition: heapfree.c:119
Objects_Control * _Objects_Allocate(Objects_Information *information)
Allocates an object.
Definition: objectallocate.c:43
uint32_t Objects_Id
Definition: object.h:101
Objects_Control * _Objects_Get_no_protection(Objects_Id id, const Objects_Information *information)
Maps object ids to object control blocks.
Definition: objectgetnoprotection.c:44
#define NULL
Requests a GPIO pin group configuration.
Definition: xil_types.h:54
This header file provides interfaces of the Barrier Handler which are only used by the implementation...
This header file provides data structures used by the implementation and the Application Configuratio...
This header file provides interfaces of the Object Handler which are only used by the implementation.
Definition: regiondata.h:60
unsigned size
Definition: tte.h:1
This header file provides interfaces of the Thread Queue Handler which are only used by the implement...