Zephyr Project API
3.1.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
16
extern
"C"
{
17
#endif
18
61
enum
smh_reg_attr
{
63
SMH_REG_ATTR_CACHEABLE
,
64
66
SMH_REG_ATTR_NON_CACHEABLE
,
67
69
SMH_REG_ATTR_NUM
,
70
};
71
73
#define MAX_SHARED_MULTI_HEAP_ATTR SMH_REG_ATTR_NUM
74
81
struct
shared_multi_heap_region
{
83
unsigned
int
attr
;
84
86
uintptr_t
addr
;
87
89
size_t
size
;
90
};
91
106
int
shared_multi_heap_pool_init
(
void
);
107
121
void
*
shared_multi_heap_alloc
(
unsigned
int
attr,
size_t
bytes);
122
137
void
*
shared_multi_heap_aligned_alloc
(
unsigned
int
attr,
size_t
align,
size_t
bytes);
138
150
void
shared_multi_heap_free
(
void
*
block
);
151
165
int
shared_multi_heap_add
(
struct
shared_multi_heap_region
*region,
void
*
user_data
);
166
171
#ifdef __cplusplus
172
}
173
#endif
174
175
#endif
/* ZEPHYR_INCLUDE_MULTI_HEAP_MANAGER_SMH_H_ */
shared_multi_heap_add
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_pool_init
int shared_multi_heap_pool_init(void)
Init the pool.
shared_multi_heap_aligned_alloc
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.
shared_multi_heap_alloc
void * shared_multi_heap_alloc(unsigned int attr, size_t bytes)
Allocate memory from the memory shared multi-heap pool.
shared_multi_heap_free
void shared_multi_heap_free(void *block)
Free memory from the shared multi-heap pool.
smh_reg_attr
smh_reg_attr
SMH region attributes enumeration type.
Definition:
shared_multi_heap.h:61
SMH_REG_ATTR_NUM
@ SMH_REG_ATTR_NUM
Definition:
shared_multi_heap.h:69
SMH_REG_ATTR_NON_CACHEABLE
@ SMH_REG_ATTR_NON_CACHEABLE
Definition:
shared_multi_heap.h:66
SMH_REG_ATTR_CACHEABLE
@ SMH_REG_ATTR_CACHEABLE
Definition:
shared_multi_heap.h:63
uintptr_t
__UINTPTR_TYPE__ uintptr_t
Definition:
stdint.h:105
shared_multi_heap_region
SMH region struct.
Definition:
shared_multi_heap.h:81
shared_multi_heap_region::attr
unsigned int attr
Definition:
shared_multi_heap.h:83
shared_multi_heap_region::size
size_t size
Definition:
shared_multi_heap.h:89
shared_multi_heap_region::addr
uintptr_t addr
Definition:
shared_multi_heap.h:86
block
void * block
Definition:
test_threads_cancel_abort.c:108
user_data
static const intptr_t user_data[5]
Definition:
main.c:590
include
zephyr
multi_heap
shared_multi_heap.h
Generated on Fri Oct 14 2022 07:25:58 for Zephyr Project API by
1.9.2