Zephyr Project API
3.7.0
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
16
extern
"C"
{
17
#endif
18
69
enum
shared_multi_heap_attr
{
71
SMH_REG_ATTR_CACHEABLE
,
72
74
SMH_REG_ATTR_NON_CACHEABLE
,
75
77
SMH_REG_ATTR_NUM
,
78
};
79
81
#define MAX_SHARED_MULTI_HEAP_ATTR SMH_REG_ATTR_NUM
82
89
struct
shared_multi_heap_region
{
91
uint32_t
attr
;
92
94
uintptr_t
addr
;
95
97
size_t
size
;
98
};
99
114
int
shared_multi_heap_pool_init
(
void
);
115
129
void
*
shared_multi_heap_alloc
(
enum
shared_multi_heap_attr
attr,
size_t
bytes);
130
145
void
*
shared_multi_heap_aligned_alloc
(
enum
shared_multi_heap_attr
attr,
146
size_t
align,
size_t
bytes);
147
159
void
shared_multi_heap_free
(
void
*
block
);
160
174
int
shared_multi_heap_add
(
struct
shared_multi_heap_region
*region,
void
*
user_data
);
175
180
#ifdef __cplusplus
181
}
182
#endif
183
184
#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_attr
shared_multi_heap_attr
SMH region attributes enumeration type.
Definition
shared_multi_heap.h:69
shared_multi_heap_aligned_alloc
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.
shared_multi_heap_pool_init
int shared_multi_heap_pool_init(void)
Init the pool.
shared_multi_heap_alloc
void * shared_multi_heap_alloc(enum shared_multi_heap_attr 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_NUM
@ SMH_REG_ATTR_NUM
must be the last item
Definition
shared_multi_heap.h:77
SMH_REG_ATTR_NON_CACHEABLE
@ SMH_REG_ATTR_NON_CACHEABLE
non-cacheable
Definition
shared_multi_heap.h:74
SMH_REG_ATTR_CACHEABLE
@ SMH_REG_ATTR_CACHEABLE
cacheable
Definition
shared_multi_heap.h:71
uint32_t
__UINT32_TYPE__ uint32_t
Definition
stdint.h:90
uintptr_t
__UINTPTR_TYPE__ uintptr_t
Definition
stdint.h:105
shared_multi_heap_region
SMH region struct.
Definition
shared_multi_heap.h:89
shared_multi_heap_region::size
size_t size
Memory heap size in bytes.
Definition
shared_multi_heap.h:97
shared_multi_heap_region::attr
uint32_t attr
Memory heap attribute.
Definition
shared_multi_heap.h:91
shared_multi_heap_region::addr
uintptr_t addr
Memory heap starting virtual address.
Definition
shared_multi_heap.h:94
block
void * block
Definition
test_threads_cancel_abort.c:109
user_data
static const intptr_t user_data[5]
Definition
main.c:588
include
zephyr
multi_heap
shared_multi_heap.h
Generated on Sun Sep 15 2024 17:01:30 for Zephyr Project API by
1.9.8