Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
shared_multi_heap.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Carlo Caione, <ccaione@baylibre.com>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12#ifndef ZEPHYR_INCLUDE_MULTI_HEAP_MANAGER_SMH_H_
13#define ZEPHYR_INCLUDE_MULTI_HEAP_MANAGER_SMH_H_
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
82
84#define MAX_SHARED_MULTI_HEAP_ATTR SMH_REG_ATTR_NUM
85
102
118
132void *shared_multi_heap_alloc(enum shared_multi_heap_attr attr, size_t bytes);
133
149 size_t align, size_t bytes);
150
162void shared_multi_heap_free(void *block);
163
177int shared_multi_heap_add(struct shared_multi_heap_region *region, void *user_data);
178
183#ifdef __cplusplus
184}
185#endif
186
187#endif /* ZEPHYR_INCLUDE_MULTI_HEAP_MANAGER_SMH_H_ */
int shared_multi_heap_add(struct shared_multi_heap_region *region, void *user_data)
Add an heap region to the shared multi-heap pool.
shared_multi_heap_attr
SMH region attributes enumeration type.
Definition shared_multi_heap.h:69
void * shared_multi_heap_aligned_alloc(enum shared_multi_heap_attr attr, size_t align, size_t bytes)
Allocate aligned memory from the memory shared multi-heap pool.
int shared_multi_heap_pool_init(void)
Init the pool.
void * shared_multi_heap_alloc(enum shared_multi_heap_attr attr, size_t bytes)
Allocate memory from the memory shared multi-heap pool.
void shared_multi_heap_free(void *block)
Free memory from the shared multi-heap pool.
@ SMH_REG_ATTR_NUM
must be the last item
Definition shared_multi_heap.h:80
@ SMH_REG_ATTR_NON_CACHEABLE
non-cacheable
Definition shared_multi_heap.h:74
@ SMH_REG_ATTR_EXTERNAL
external Memory
Definition shared_multi_heap.h:77
@ SMH_REG_ATTR_CACHEABLE
cacheable
Definition shared_multi_heap.h:71
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105
SMH region struct.
Definition shared_multi_heap.h:92
size_t size
Memory heap size in bytes.
Definition shared_multi_heap.h:100
uint32_t attr
Memory heap attribute.
Definition shared_multi_heap.h:94
uintptr_t addr
Memory heap starting virtual address.
Definition shared_multi_heap.h:97