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)
15#elif defined(CONFIG_CPU_CORTEX_M23) || \
16 defined(CONFIG_CPU_CORTEX_M33) || \
17 defined(CONFIG_CPU_CORTEX_M55)
19#else
20#error "Unsupported ARM CPU"
21#endif
22
23#ifndef _ASMLANGUAGE
24
25/* Region definition data structure */
27 /* Region Base Address */
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 */
37};
38
39/* MPU configuration data structure */
41 /* Number of regions */
43 /* 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 */
72extern const struct arm_mpu_config mpu_config;
73
74#endif /* _ASMLANGUAGE */
75
76#endif /* ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_MPU_ARM_MPU_H_ */
const struct arm_mpu_config mpu_config
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
Definition: arm_mpu.h:40
uint32_t num_regions
Definition: arm_mpu.h:42
const struct arm_mpu_region * mpu_regions
Definition: arm_mpu.h:44
Definition: arm_mpu_v7m.h:141
Definition: arm_mpu.h:26
uint32_t base
Definition: arm_mpu.h:28
const char * name
Definition: arm_mpu.h:30
arm_mpu_region_attr_t attr
Definition: arm_mpu.h:36