RTEMS: cpukit/include/rtems/score/protectedheap.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
protectedheap.h
Go to the documentation of this file.
1
9/*
10 * COPYRIGHT (c) 1989-2007.
11 * On-Line Applications Research Corporation (OAR).
12 *
13 * The license and distribution terms for this file may be
14 * found in the file LICENSE in this distribution or at
15 * http://www.rtems.org/license/LICENSE.
16 */
17
18#ifndef _RTEMS_SCORE_PROTECTED_HEAP_H
19#define _RTEMS_SCORE_PROTECTED_HEAP_H
20
21#include <rtems/score/heapimpl.h>
22#include <rtems/score/apimutex.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
48 RTEMS_INLINE_ROUTINE uintptr_t _Protected_heap_Initialize(
49 Heap_Control *heap,
50 void *area_begin,
51 uintptr_t area_size,
52 uintptr_t page_size
53)
54{
55 return _Heap_Initialize( heap, area_begin, area_size, page_size );
56}
57
68bool _Protected_heap_Extend(
69 Heap_Control *heap,
70 void *area_begin,
71 uintptr_t area_size
72);
73
93void *_Protected_heap_Allocate_aligned_with_boundary(
94 Heap_Control *heap,
95 uintptr_t size,
96 uintptr_t alignment,
97 uintptr_t boundary
98);
99
114 RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate_aligned(
115 Heap_Control *heap,
116 uintptr_t size,
117 uintptr_t alignment
118)
119{
120 return
121 _Protected_heap_Allocate_aligned_with_boundary( heap, size, alignment, 0 );
122}
123
137 RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate(
138 Heap_Control *heap,
139 uintptr_t size
140)
141{
142 return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 );
143}
144
163bool _Protected_heap_Get_block_size(
164 Heap_Control *heap,
165 void *addr,
166 uintptr_t *size
167);
168
192bool _Protected_heap_Resize_block(
193 Heap_Control *heap,
194 void *addr,
195 uintptr_t size
196);
197
210bool _Protected_heap_Free( Heap_Control *heap, void *addr );
211
225bool _Protected_heap_Walk( Heap_Control *heap, int source, bool dump );
226
237void _Protected_heap_Iterate(
238 Heap_Control *heap,
239 Heap_Block_visitor visitor,
240 void *visitor_arg
241);
242
251bool _Protected_heap_Get_information(
252 Heap_Control *heap,
253 Heap_Information_block *info
254);
255
265bool _Protected_heap_Get_free_information(
266 Heap_Control *heap,
267 Heap_Information *info
268);
269
279uintptr_t _Protected_heap_Get_size( Heap_Control *heap );
280
283#ifdef __cplusplus
284}
285#endif
286
287#endif
288/* end of include file */
apimutex.h
API Mutex Handler API.
RTEMS_INLINE_ROUTINE
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
Heap_Block_visitor
bool(* Heap_Block_visitor)(const Heap_Block *block, uintptr_t block_size, bool block_is_used, void *visitor_arg)
Heap block visitor.
Definition: heapimpl.h:204
_Heap_Initialize
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:207
_Protected_heap_Initialize
RTEMS_INLINE_ROUTINE uintptr_t _Protected_heap_Initialize(Heap_Control *heap, void *area_begin, uintptr_t area_size, uintptr_t page_size)
Initializes the protected heap.
Definition: protectedheap.h:48
_Protected_heap_Get_size
uintptr_t _Protected_heap_Get_size(Heap_Control *heap)
Returns the size of the allocatable area in bytes.
Definition: pheapgetsize.c:24
_Protected_heap_Get_information
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:24
_Protected_heap_Allocate_aligned
RTEMS_INLINE_ROUTINE void * _Protected_heap_Allocate_aligned(Heap_Control *heap, uintptr_t size, uintptr_t alignment)
Allocates an aligned memory area.
Definition: protectedheap.h:114
_Protected_heap_Resize_block
bool _Protected_heap_Resize_block(Heap_Control *heap, void *addr, uintptr_t size)
Resizes the block of the allocated memory area.
Definition: pheapresizeblock.c:24
_Protected_heap_Get_free_information
bool _Protected_heap_Get_free_information(Heap_Control *heap, Heap_Information *info)
Returns information about free blocks for the heap.
Definition: pheapgetfreeinfo.c:24
_Protected_heap_Walk
bool _Protected_heap_Walk(Heap_Control *heap, int source, bool dump)
Verifies the integrity of the heap.
Definition: pheapwalk.c:25
_Protected_heap_Get_block_size
bool _Protected_heap_Get_block_size(Heap_Control *heap, void *addr, uintptr_t *size)
Returns the size of the allocatable memory area.
Definition: pheapgetblocksize.c:24
_Protected_heap_Iterate
void _Protected_heap_Iterate(Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg)
Iterates over all blocks of the heap.
Definition: pheapiterate.c:29
_Protected_heap_Allocate_aligned_with_boundary
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:24
_Protected_heap_Free
bool _Protected_heap_Free(Heap_Control *heap, void *addr)
Frees the allocated memory area.
Definition: pheapfree.c:24
_Protected_heap_Extend
bool _Protected_heap_Extend(Heap_Control *heap, void *area_begin, uintptr_t area_size)
Extends the protected heap.
Definition: pheapextend.c:24
_Protected_heap_Allocate
RTEMS_INLINE_ROUTINE void * _Protected_heap_Allocate(Heap_Control *heap, uintptr_t size)
Allocates a memory area.
Definition: protectedheap.h:137
heapimpl.h
Heap Handler Implementation.
Heap_Control
Control block used to manage a heap.
Definition: heap.h:318
Heap_Information_block
Information block returned by _Heap_Get_information().
Definition: heapinfo.h:145
Heap_Information
Information about blocks.
Definition: heapinfo.h:125