Lines Matching +full:block +full:- +full:count

4  * SPDX-License-Identifier: Apache-2.0
63 * This is a user-provided functions whose responsibility is selecting
70 * allocation to fail and a -EINVAL reported to the calling code.
73 * @param cfg An opaque user-provided value. It may be interpreted in
87 uint8_t blk_sz_shift; /* Bit shift for block size */
97 /* Memory block buffer */
104 /* Spinlock guarding access to memory block internals */
120 * @brief Create a memory block object with a providing backing buffer.
122 * @param name Name of the memory block object.
123 * @param blk_sz Size of each memory block (in bytes, power of 2).
126 * @param mbmod Modifier to the memory block struct
142 * @brief Create a memory block object with a new backing buffer.
144 * @param name Name of the memory block object.
145 * @param blk_sz Size of each memory block (in bytes, power of 2).
147 * @param balign Alignment of the memory block buffer (power of 2).
148 * @param mbmod Modifier to the memory block struct
163 * @brief Create a memory block object with a new backing buffer.
165 * @param name Name of the memory block object.
166 * @param blk_sz Size of each memory block (in bytes).
168 * @param buf_align Alignment of the memory block buffer (power of 2).
174 * @brief Create a static memory block object with a new backing buffer.
176 * @param name Name of the memory block object.
177 * @param blk_sz Size of each memory block (in bytes).
179 * @param buf_align Alignment of the memory block buffer (power of 2).
186 * @brief Create a memory block object with a providing backing buffer.
188 * @param name Name of the memory block object.
189 * @param blk_sz Size of each memory block (in bytes).
197 * @brief Create a static memory block object with a providing backing buffer.
199 * @param name Name of the memory block object.
200 * @param blk_sz Size of each memory block (in bytes).
213 * @param[in] mem_block Pointer to memory block object.
214 * @param[in] count Number of blocks to allocate.
217 * @p count elements.
220 * @retval -EINVAL Invalid argument supplied.
221 * @retval -ENOMEM Not enough blocks for allocation.
223 int sys_mem_blocks_alloc(sys_mem_blocks_t *mem_block, size_t count,
232 * @param[in] mem_block Pointer to memory block object.
233 * @param[in] count Number of blocks to allocate.
234 * @param[out] out_block Output pointer to the start of the allocated block set
237 * @retval -EINVAL Invalid argument supplied.
238 * @retval -ENOMEM Not enough contiguous blocks for allocation.
240 int sys_mem_blocks_alloc_contiguous(sys_mem_blocks_t *mem_block, size_t count,
244 * @brief Force allocation of a specified blocks in a memory block object
246 * Allocate a specified blocks in a memory block object.
251 * @param[in] mem_block Pointer to memory block object.
252 * @param[in] in_block Address of the first required block to allocate
253 * @param[in] count Number of blocks to allocate.
256 * @retval -EINVAL Invalid argument supplied.
257 * @retval -ENOMEM Some of blocks are taken and cannot be allocated
259 int sys_mem_blocks_get(sys_mem_blocks_t *mem_block, void *in_block, size_t count);
264 * @param[in] mem_block Pointer to memory block object.
265 * @param[in] in_block Address of the first block to check
266 * @param[in] count Number of blocks to check.
271 int sys_mem_blocks_is_region_free(sys_mem_blocks_t *mem_block, void *in_block, size_t count);
277 * block pointers.
279 * @param[in] mem_block Pointer to memory block object.
280 * @param[in] count Number of blocks to free.
284 * @retval -EINVAL Invalid argument supplied.
285 * @retval -EFAULT Invalid pointers supplied.
287 int sys_mem_blocks_free(sys_mem_blocks_t *mem_block, size_t count,
295 * @param[in] mem_block Pointer to memory block object.
296 * @param[in] block Pointer to the first memory block
297 * @param[in] count Number of blocks to free.
300 * @retval -EINVAL Invalid argument supplied.
301 * @retval -EFAULT Invalid pointer supplied.
303 int sys_mem_blocks_free_contiguous(sys_mem_blocks_t *mem_block, void *block, size_t count);
307 * @brief Get the runtime statistics of a memory block
309 * This function retrieves the runtime stats for the specified memory block
312 * @param mem_block Pointer to system memory block
315 * @return -EINVAL if NULL pointer was passed, otherwise 0
321 * @brief Reset the maximum memory block usage
324 * block @a mem_block to match that block's current memory usage.
326 * @param mem_block Pointer to system memory block
328 * @return -EINVAL if NULL pointer was passed, otherwise 0
369 * @param[in] count Number of blocks to allocate
372 * @p count elements.
373 * @param[out] blk_size If not NULL, output the block size of
377 * @retval -EINVAL Invalid argument supplied, or no allocator chosen.
378 * @retval -ENOMEM Not enough blocks for allocation.
381 void *cfg, size_t count,
393 * @param[in] count Number of blocks to free.
397 * @retval -EINVAL Invalid argument supplied, or no allocator chosen.
398 * @retval -EFAULT Invalid pointer(s) supplied.
401 size_t count, void **in_blocks);