RTEMS 6.1-rc4
Loading...
Searching...
No Matches
protectedheap.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/*
13 * COPYRIGHT (c) 1989-2007.
14 * On-Line Applications Research Corporation (OAR).
15 *
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#ifndef _RTEMS_SCORE_PROTECTED_HEAP_H
39#define _RTEMS_SCORE_PROTECTED_HEAP_H
40
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
68static inline uintptr_t _Protected_heap_Initialize(
69 Heap_Control *heap,
70 void *area_begin,
71 uintptr_t area_size,
72 uintptr_t page_size
73)
74{
75 return _Heap_Initialize( heap, area_begin, area_size, page_size );
76}
77
89 Heap_Control *heap,
90 void *area_begin,
91 uintptr_t area_size
92);
93
114 Heap_Control *heap,
115 uintptr_t size,
116 uintptr_t alignment,
117 uintptr_t boundary
118);
119
134static inline void *_Protected_heap_Allocate_aligned(
135 Heap_Control *heap,
136 uintptr_t size,
137 uintptr_t alignment
138)
139{
140 return
141 _Protected_heap_Allocate_aligned_with_boundary( heap, size, alignment, 0 );
142}
143
157static inline void *_Protected_heap_Allocate(
158 Heap_Control *heap,
159 uintptr_t size
160)
161{
162 return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 );
163}
164
177bool _Protected_heap_Free( Heap_Control *heap, void *addr );
178
192bool _Protected_heap_Walk( Heap_Control *heap, int source, bool dump );
193
203 Heap_Control *heap,
205);
206
217 Heap_Control *heap,
218 Heap_Information *info
219);
220
230uintptr_t _Protected_heap_Get_size( Heap_Control *heap );
231
234#ifdef __cplusplus
235}
236#endif
237
238#endif
239/* end of include file */
This header file provides the interfaces of the API Mutex Handler.
uintptr_t _Heap_Initialize(Heap_Control *heap, void *area_begin, uintptr_t area_size, uintptr_t page_size)
Initializes the heap control block.
Definition: heap.c:227
uintptr_t _Protected_heap_Get_size(Heap_Control *heap)
Returns the size of the allocatable area in bytes.
Definition: pheapgetsize.c:44
bool _Protected_heap_Get_information(Heap_Control *heap, Heap_Information_block *info)
Returns information about used and free blocks for the heap.
Definition: pheapgetinfo.c:44
bool _Protected_heap_Get_free_information(Heap_Control *heap, Heap_Information *info)
Returns information about free blocks for the heap.
Definition: pheapgetfreeinfo.c:44
bool _Protected_heap_Walk(Heap_Control *heap, int source, bool dump)
Verifies the integrity of the heap.
Definition: pheapwalk.c:45
void * _Protected_heap_Allocate_aligned_with_boundary(Heap_Control *heap, uintptr_t size, uintptr_t alignment, uintptr_t boundary)
Allocates an aligned memory area with boundary constraint for the protected heap.
Definition: pheapallocate.c:44
bool _Protected_heap_Free(Heap_Control *heap, void *addr)
Frees the allocated memory area.
Definition: pheapfree.c:44
bool _Protected_heap_Extend(Heap_Control *heap, void *area_begin, uintptr_t area_size)
Extends the protected heap.
Definition: pheapextend.c:44
This header file provides interfaces of the Barrier Handler which are only used by the implementation...
Control block used to manage a heap.
Definition: heap.h:339
Information block returned by _Heap_Get_information().
Definition: heapinfo.h:165
Information about blocks.
Definition: heapinfo.h:145