Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
mem_attr.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Carlo Caione <[email protected]>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_MEM_ATTR_H_
8#define ZEPHYR_INCLUDE_MEM_ATTR_H_
9
17#include <stddef.h>
18#include <zephyr/types.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
27#define __MEM_ATTR zephyr_memory_attr
28
29#define _FILTER(node_id, fn) \
30 COND_CODE_1(DT_NODE_HAS_PROP(node_id, __MEM_ATTR), \
31 (fn(node_id)), \
32 ())
33
47#define DT_MEMORY_ATTR_FOREACH_STATUS_OKAY_NODE(fn) \
48 DT_FOREACH_STATUS_OKAY_NODE_VARGS(_FILTER, fn)
49
58 const char *dt_name;
62 size_t dt_size;
65};
66
77size_t mem_attr_get_regions(const struct mem_attr_region_t **region);
78
106int mem_attr_check_buf(void *addr, size_t size, uint32_t attr);
107
108#ifdef __cplusplus
109}
110#endif
111
114#endif /* ZEPHYR_INCLUDE_MEM_ATTR_H_ */
int mem_attr_check_buf(void *addr, size_t size, uint32_t attr)
Check if a buffer has correct size and attributes.
size_t mem_attr_get_regions(const struct mem_attr_region_t **region)
Get the list of memory regions.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINTPTR_TYPE__ uintptr_t
Definition: stdint.h:105
memory-attr region structure.
Definition: mem_attr.h:56
uintptr_t dt_addr
Memory region physical address.
Definition: mem_attr.h:60
size_t dt_size
Memory region size.
Definition: mem_attr.h:62
const char * dt_name
Memory node full name.
Definition: mem_attr.h:58
uint32_t dt_attr
Memory region attributes.
Definition: mem_attr.h:64