RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
cpukit
include
rtems
rtems
regionimpl.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
11
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
40
#include <
rtems/rtems/regiondata.h
>
41
#include <
rtems/score/apimutex.h
>
42
#include <
rtems/score/heapimpl.h
>
43
#include <
rtems/score/objectimpl.h
>
44
#include <
rtems/score/threadqimpl.h
>
45
46
#ifdef __cplusplus
47
extern
"C"
{
48
#endif
49
59
60
#define REGION_OF_THREAD_QUEUE_QUEUE( queue ) \
61
RTEMS_CONTAINER_OF( queue, Region_Control, Wait_queue.Queue )
62
69
static
inline
Region_Control
*_Region_Allocate(
void
)
70
{
71
return
(
Region_Control
*)
_Objects_Allocate
( &
_Region_Information
);
72
}
73
80
static
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
88
static
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
*)
95
_Objects_Get_no_protection
(
id
, &
_Region_Information
);
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
106
static
inline
void
_Region_Unlock(
Region_Control
*the_region )
107
{
108
(void) the_region;
109
_RTEMS_Unlock_allocator();
110
}
111
119
static
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
132
static
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
149
extern
void
_Region_Process_queue
(
Region_Control
*the_region);
150
152
153
#ifdef __cplusplus
154
}
155
#endif
156
157
#endif
158
/* end of include file */
apimutex.h
This header file provides the interfaces of the API Mutex Handler.
_Region_Process_queue
void _Region_Process_queue(Region_Control *the_region)
Process Region Queue.
Definition
regionprocessqueue.c:46
_Region_Information
Objects_Information _Region_Information
The Classic Region objects information.
_Heap_Free
bool _Heap_Free(Heap_Control *heap, void *addr)
Frees the allocated memory area.
Definition
heapfree.c:119
_Objects_Allocate
Objects_Control * _Objects_Allocate(Objects_Information *information)
Allocates an object.
Definition
objectallocate.c:43
Objects_Id
uint32_t Objects_Id
Definition
object.h:101
_Objects_Get_no_protection
Objects_Control * _Objects_Get_no_protection(Objects_Id id, const Objects_Information *information)
Maps object ids to object control blocks.
Definition
objectgetnoprotection.c:44
heapimpl.h
This header file provides interfaces of the Barrier Handler which are only used by the implementation...
regiondata.h
This header file provides data structures used by the implementation and the Application Configuratio...
objectimpl.h
This header file provides interfaces of the Object Handler which are only used by the implementation.
Region_Control
Definition
regiondata.h:60
threadqimpl.h
This header file provides interfaces of the Thread Queue Handler which are only used by the implement...
Generated by
1.18.0