Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
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_AARCH32_MPU_ARM_MPU_H_
7
#define ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_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_CPU_CORTEX_R)
14
#include <
arch/arm/aarch32/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
#include <
arch/arm/aarch32/mpu/arm_mpu_v8m.h
>
19
#else
20
#error "Unsupported ARM CPU"
21
#endif
22
23
#ifndef _ASMLANGUAGE
24
25
/* Region definition data structure */
26
struct
arm_mpu_region
{
27
/* Region Base Address */
28
uint32_t
base
;
29
/* Region Name */
30
const
char
*
name
;
31
#if defined(CONFIG_CPU_CORTEX_R)
32
/* Region Size */
33
uint32_t
size;
34
#endif
35
/* Region Attributes */
36
arm_mpu_region_attr_t
attr
;
37
};
38
39
/* MPU configuration data structure */
40
struct
arm_mpu_config
{
41
/* Number of regions */
42
uint32_t
num_regions
;
43
/* Regions */
44
const
struct
arm_mpu_region
*
mpu_regions
;
45
};
46
47
#if defined(CONFIG_CPU_CORTEX_R)
48
#define MPU_REGION_ENTRY(_name, _base, _size, _attr) \
49
{\
50
.name = _name, \
51
.base = _base, \
52
.size = _size, \
53
.attr = _attr, \
54
}
55
#else
56
#define MPU_REGION_ENTRY(_name, _base, _attr) \
57
{\
58
.name = _name, \
59
.base = _base, \
60
.attr = _attr, \
61
}
62
#endif
63
64
/* Reference to the MPU configuration.
65
*
66
* This struct is defined and populated for each SoC (in the SoC definition),
67
* and holds the build-time configuration information for the fixed MPU
68
* regions enabled during kernel initialization. Dynamic MPU regions (e.g.
69
* for Thread Stack, Stack Guards, etc.) are programmed during runtime, thus,
70
* not kept here.
71
*/
72
extern
const
struct
arm_mpu_config
mpu_config
;
73
74
#endif
/* _ASMLANGUAGE */
75
76
#endif
/* ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_MPU_ARM_MPU_H_ */
mpu_config
const struct arm_mpu_config mpu_config
arm_mpu_v7m.h
arm_mpu_v8m.h
uint32_t
__UINT32_TYPE__ uint32_t
Definition:
stdint.h:60
arm_mpu_config
Definition:
arm_mpu.h:40
arm_mpu_config::num_regions
uint32_t num_regions
Definition:
arm_mpu.h:42
arm_mpu_config::mpu_regions
const struct arm_mpu_region * mpu_regions
Definition:
arm_mpu.h:44
arm_mpu_region_attr
Definition:
arm_mpu_v7m.h:141
arm_mpu_region
Definition:
arm_mpu.h:26
arm_mpu_region::base
uint32_t base
Definition:
arm_mpu.h:28
arm_mpu_region::name
const char * name
Definition:
arm_mpu.h:30
arm_mpu_region::attr
arm_mpu_region_attr_t attr
Definition:
arm_mpu.h:36
include
arch
arm
aarch32
mpu
arm_mpu.h
Generated on Sun Oct 9 2022 09:21:56 for Zephyr API Documentation by
1.9.4