source: rtems/cpukit/score/include/rtems/score/protectedheap.h @ 89f8eab5

4.115
Last change on this file since 89f8eab5 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 3.3 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ScoreProtHeap
5 *
6 * @brief Protected Heap Handler API
7 */
8
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
28/**
29 * @defgroup ScoreProtHeap Protected Heap Handler
30 *
31 * @ingroup ScoreHeap
32 *
33 * @brief Provides protected heap services.
34 *
35 * The @ref ScoreAllocatorMutex is used to protect the heap accesses.
36 *
37 */
38/**@{**/
39
40/**
41 * @brief See _Heap_Initialize().
42 */
43RTEMS_INLINE_ROUTINE uintptr_t _Protected_heap_Initialize(
44  Heap_Control *heap,
45  void *area_begin,
46  uintptr_t area_size,
47  uintptr_t page_size
48)
49{
50  return _Heap_Initialize( heap, area_begin, area_size, page_size );
51}
52
53/**
54 * @brief See _Heap_Extend().
55 *
56 * Returns @a true in case of success, and @a false otherwise.
57 */
58bool _Protected_heap_Extend(
59  Heap_Control *heap,
60  void *area_begin,
61  uintptr_t area_size
62);
63
64/**
65 * @brief See _Heap_Allocate_aligned_with_boundary().
66 */
67void *_Protected_heap_Allocate_aligned_with_boundary(
68  Heap_Control *heap,
69  uintptr_t size,
70  uintptr_t alignment,
71  uintptr_t boundary
72);
73
74/**
75 * @brief See _Heap_Allocate_aligned_with_boundary() with boundary equals zero.
76 */
77RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate_aligned(
78  Heap_Control *heap,
79  uintptr_t size,
80  uintptr_t alignment
81)
82{
83  return
84    _Protected_heap_Allocate_aligned_with_boundary( heap, size, alignment, 0 );
85}
86
87/**
88 * @brief See _Heap_Allocate_aligned_with_boundary() with alignment and
89 * boundary equals zero.
90 */
91RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate(
92  Heap_Control *heap,
93  uintptr_t size
94)
95{
96  return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 );
97}
98
99/**
100 * @brief See _Heap_Size_of_alloc_area().
101 */
102bool _Protected_heap_Get_block_size(
103  Heap_Control *heap,
104  void *addr,
105  uintptr_t *size
106);
107
108/**
109 * @brief See _Heap_Resize_block().
110 *
111 * Returns @a true in case of success, and @a false otherwise.
112 */
113bool _Protected_heap_Resize_block(
114  Heap_Control *heap,
115  void *addr,
116  uintptr_t size
117);
118
119/**
120 * @brief See _Heap_Free().
121 *
122 * Returns @a true in case of success, and @a false otherwise.
123 */
124bool _Protected_heap_Free( Heap_Control *heap, void *addr );
125
126/**
127 * @brief See _Heap_Walk().
128 */
129bool _Protected_heap_Walk( Heap_Control *heap, int source, bool dump );
130
131/**
132 * @brief See _Heap_Iterate().
133 */
134void _Protected_heap_Iterate(
135  Heap_Control *heap,
136  Heap_Block_visitor visitor,
137  void *visitor_arg
138);
139
140/**
141 * @brief See _Heap_Get_information().
142 *
143 * Returns @a true in case of success, and @a false otherwise.
144 */
145bool _Protected_heap_Get_information(
146  Heap_Control *heap,
147  Heap_Information_block *info
148);
149
150/**
151 * @brief See _Heap_Get_free_information().
152 *
153 * Returns @a true in case of success, and @a false otherwise.
154 */
155bool _Protected_heap_Get_free_information(
156  Heap_Control *heap,
157  Heap_Information *info
158);
159
160/**
161 * @brief See _Heap_Get_size().
162 */
163uintptr_t _Protected_heap_Get_size( Heap_Control *heap );
164
165/** @} */
166
167#ifdef __cplusplus
168}
169#endif
170
171#endif
172/* end of include file */
Note: See TracBrowser for help on using the repository browser.