Zephyr Project API  3.2.0
A Scalable Open Source RTOS
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
71
74
77};
78
80#define MAX_SHARED_MULTI_HEAP_ATTR SMH_REG_ATTR_NUM
81
90 unsigned int attr;
91
94
96 size_t size;
97};
98
114
128void *shared_multi_heap_alloc(unsigned int attr, size_t bytes);
129
144void *shared_multi_heap_aligned_alloc(unsigned int attr, size_t align, size_t bytes);
145
158
173
178#ifdef __cplusplus
179}
180#endif
181
182#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.
int shared_multi_heap_pool_init(void)
Init the pool.
void * shared_multi_heap_aligned_alloc(unsigned int attr, size_t align, size_t bytes)
Allocate aligned memory from the memory shared multi-heap pool.
void * shared_multi_heap_alloc(unsigned int 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
SMH region attributes enumeration type.
Definition: shared_multi_heap.h:68
@ SMH_REG_ATTR_NUM
Definition: shared_multi_heap.h:76
@ SMH_REG_ATTR_NON_CACHEABLE
Definition: shared_multi_heap.h:73
@ SMH_REG_ATTR_CACHEABLE
Definition: shared_multi_heap.h:70
__UINTPTR_TYPE__ uintptr_t
Definition: stdint.h:105
SMH region struct.
Definition: shared_multi_heap.h:88
unsigned int attr
Definition: shared_multi_heap.h:90
size_t size
Definition: shared_multi_heap.h:96
uintptr_t addr
Definition: shared_multi_heap.h:93
void * block
Definition: test_threads_cancel_abort.c:108
static const intptr_t user_data[5]
Definition: main.c:588