Zephyr API Documentation
3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
arm_mpu.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 Linaro Limited.
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_MPU_ARM_MPU_H_
7
#define ZEPHYR_INCLUDE_ARCH_ARM_MPU_ARM_MPU_H_
8
9
#if defined(CONFIG_CPU_CORTEX_M0PLUS) || \
10
defined(CONFIG_CPU_CORTEX_M3) || \
11
defined(CONFIG_CPU_CORTEX_M4) || \
12
defined(CONFIG_CPU_CORTEX_M7) || \
13
defined(CONFIG_ARMV7_R)
14
#include <
zephyr/arch/arm/mpu/arm_mpu_v7m.h
>
15
#elif defined(CONFIG_CPU_CORTEX_M23) || \
16
defined(CONFIG_CPU_CORTEX_M33) || \
17
defined(CONFIG_CPU_CORTEX_M55) || \
18
defined(CONFIG_AARCH32_ARMV8_R)
19
#include <
zephyr/arch/arm/mpu/arm_mpu_v8.h
>
20
#else
21
#error "Unsupported ARM CPU"
22
#endif
23
24
#ifndef _ASMLANGUAGE
25
26
/* Region definition data structure */
27
struct
arm_mpu_region
{
28
/* Region Base Address */
29
uint32_t
base
;
30
/* Region Name */
31
const
char
*
name
;
32
#if defined(CONFIG_CPU_AARCH32_CORTEX_R)
33
/* Region Size */
34
uint32_t
size;
35
#endif
36
/* Region Attributes */
37
arm_mpu_region_attr_t
attr
;
38
};
39
40
/* MPU configuration data structure */
41
struct
arm_mpu_config
{
42
/* Number of regions */
43
uint32_t
num_regions
;
44
/* Regions */
45
const
struct
arm_mpu_region
*
mpu_regions
;
46
};
47
48
#if defined(CONFIG_ARMV7_R)
49
#define MPU_REGION_ENTRY(_name, _base, _size, _attr) \
50
{\
51
.name = _name, \
52
.base = _base, \
53
.size = _size, \
54
.attr = _attr, \
55
}
56
#else
57
#define MPU_REGION_ENTRY(_name, _base, _attr) \
58
{\
59
.name = _name, \
60
.base = _base, \
61
.attr = _attr, \
62
}
63
#endif
64
65
/* Reference to the MPU configuration.
66
*
67
* This struct is defined and populated for each SoC (in the SoC definition),
68
* and holds the build-time configuration information for the fixed MPU
69
* regions enabled during kernel initialization. Dynamic MPU regions (e.g.
70
* for Thread Stack, Stack Guards, etc.) are programmed during runtime, thus,
71
* not kept here.
72
*/
73
extern
const
struct
arm_mpu_config
mpu_config
;
74
75
#endif
/* _ASMLANGUAGE */
76
77
#endif
/* ZEPHYR_INCLUDE_ARCH_ARM_MPU_ARM_MPU_H_ */
arm_mpu_v7m.h
arm_mpu_v8.h
mpu_config
const struct arm_mpu_config mpu_config
uint32_t
__UINT32_TYPE__ uint32_t
Definition:
stdint.h:90
arm_mpu_config
Definition:
arm_mpu.h:41
arm_mpu_config::num_regions
uint32_t num_regions
Definition:
arm_mpu.h:43
arm_mpu_config::mpu_regions
const struct arm_mpu_region * mpu_regions
Definition:
arm_mpu.h:45
arm_mpu_region_attr
Definition:
arm_mpu_v7m.h:152
arm_mpu_region
Definition:
arm_mpu.h:27
arm_mpu_region::base
uint32_t base
Definition:
arm_mpu.h:29
arm_mpu_region::name
const char * name
Definition:
arm_mpu.h:31
arm_mpu_region::attr
arm_mpu_region_attr_t attr
Definition:
arm_mpu.h:37
zephyr
arch
arm
mpu
arm_mpu.h
Generated on Thu Sep 26 2024 10:47:05 for Zephyr API Documentation by
1.9.6