Lines Matching +full:shared +full:- +full:memory
4 * SPDX-License-Identifier: Apache-2.0
9 * @brief Public API for Shared Multi-Heap framework
28 * @brief Shared Multi-Heap (SMH) interface
29 * @defgroup shared_multi_heap Shared multi-heap interface
33 * The shared multi-heap manager uses the multi-heap allocator to manage a set
34 * of memory regions with different capabilities / attributes (cacheable,
35 * non-cacheable, etc...).
37 * All the different regions can be added at run-time to the shared multi-heap
39 * can be used by drivers or applications to request memory with certain
44 * - At boot time some platform code initialize the shared multi-heap
45 * framework using @ref shared_multi_heap_pool_init and add the memory
49 * - Each memory region encoded in a @ref shared_multi_heap_region structure.
50 * This structure is also carrying an opaque and user-defined integer value
54 * - When a driver or application needs some dynamic memory with a certain
56 * version) to request the memory by using the opaque parameter to select
57 * the correct set of attributes for the needed memory. The framework will
58 * take care of selecting the correct heap (thus memory region) to carve
59 * memory from, based on the opaque parameter and the runtime state of the
60 * heaps (available memory, heap state, etc...)
66 * Enumeration type for some common memory region attributes.
73 /** non-cacheable */
76 /** external Memory */
89 * This struct is carrying information about the memory region to be added in
90 * the multi-heap pool.
93 /** Memory heap attribute */
96 /** Memory heap starting virtual address */
99 /** Memory heap size in bytes */
106 * This must be the first function to be called to initialize the shared
107 * multi-heap pool. All the individual heaps must be added later with @ref
110 * @note As for the generic multi-heap allocator the expectation is that this
111 * function will be called at soc- or board-level.
114 * @retval -EALREADY when the pool was already inited.
120 * @brief Allocate memory from the memory shared multi-heap pool
122 * Allocates a block of memory of the specified size in bytes and with a
124 * by the backend to select the correct heap to allocate memory from.
126 * @param attr capability / attribute requested for the memory block.
129 * @retval ptr a valid pointer to heap memory.
130 * @retval err NULL if no memory is available.
135 * @brief Allocate aligned memory from the memory shared multi-heap pool
137 * Allocates a block of memory of the specified size in bytes and with a
141 * @param attr capability / attribute requested for the memory block.
145 * @retval ptr a valid pointer to heap memory.
146 * @retval err NULL if no memory is available.
152 * @brief Free memory from the shared multi-heap pool
154 * Used to free the passed block of memory that must be the return value of a
165 * @brief Add an heap region to the shared multi-heap pool
167 * This adds a shared multi-heap region to the multi-heap pool.
170 * @param region pointer to the memory region to be added.
173 * @retval -EINVAL when the region attribute is out-of-bound.
174 * @retval -ENOMEM when there are no more heaps available.