Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
 4.1.99
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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) || defined(CONFIG_CPU_CORTEX_M3) || \
10 defined(CONFIG_CPU_CORTEX_M4) || defined(CONFIG_CPU_CORTEX_M7) || defined(CONFIG_ARMV7_R)
12#elif defined(CONFIG_CPU_CORTEX_M23) || defined(CONFIG_CPU_CORTEX_M33) || \
13 defined(CONFIG_CPU_CORTEX_M55) || defined(CONFIG_CPU_CORTEX_M85) || \
14 defined(CONFIG_AARCH32_ARMV8_R)
16#else
17#error "Unsupported ARM CPU"
18#endif
19
20#ifndef _ASMLANGUAGE
21
22/* Region definition data structure */
24 /* Region Base Address */
26 /* Region Name */
27 const char *name;
28#if defined(CONFIG_CPU_AARCH32_CORTEX_R)
29 /* Region Size */
30 uint32_t size;
31#endif
32 /* Region Attributes */
34};
35
36/* MPU configuration data structure */
38 /* Number of regions */
40 /* Regions */
42};
43
44#if defined(CONFIG_ARMV7_R)
45#define MPU_REGION_ENTRY(_name, _base, _size, _attr) \
46 { \
47 .name = _name, \
48 .base = _base, \
49 .size = _size, \
50 .attr = _attr, \
51 }
52#else
53#define MPU_REGION_ENTRY(_name, _base, _attr) \
54 { \
55 .name = _name, \
56 .base = _base, \
57 .attr = _attr, \
58 }
59#endif
60
61/* Reference to the MPU configuration.
62 *
63 * This struct is defined and populated for each SoC (in the SoC definition),
64 * and holds the build-time configuration information for the fixed MPU
65 * regions enabled during kernel initialization. Dynamic MPU regions (e.g.
66 * for Thread Stack, Stack Guards, etc.) are programmed during runtime, thus,
67 * not kept here.
68 */
69extern const struct arm_mpu_config mpu_config;
70
71#endif /* _ASMLANGUAGE */
72
73#endif /* ZEPHYR_INCLUDE_ARCH_ARM_MPU_ARM_MPU_H_ */
const struct arm_mpu_config mpu_config
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Definition arm_mpu.h:37
uint32_t num_regions
Definition arm_mpu.h:39
const struct arm_mpu_region * mpu_regions
Definition arm_mpu.h:41
Definition arm_mpu_v7m.h:135
Definition arm_mpu.h:23
uint32_t base
Definition arm_mpu.h:25
const char * name
Definition arm_mpu.h:27
arm_mpu_region_attr_t attr
Definition arm_mpu.h:33