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