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)
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)
20#else
21#error "Unsupported ARM CPU"
22#endif
23
24#ifndef _ASMLANGUAGE
25
26/* Region definition data structure */
28 /* Region Base Address */
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 */
38};
39
40/* MPU configuration data structure */
42 /* Number of regions */
44 /* 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 */
73extern const struct arm_mpu_config mpu_config;
74
75#endif /* _ASMLANGUAGE */
76
77#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:41
uint32_t num_regions
Definition: arm_mpu.h:43
const struct arm_mpu_region * mpu_regions
Definition: arm_mpu.h:45
Definition: arm_mpu_v7m.h:152
Definition: arm_mpu.h:27
uint32_t base
Definition: arm_mpu.h:29
const char * name
Definition: arm_mpu.h:31
arm_mpu_region_attr_t attr
Definition: arm_mpu.h:37