arch: arm: mpu: declare and define nxp_mpu_config as const
Declare and define nxp_mpu_config and nxp_mpu_regions structs as const, as they are not modified in run-time. Fixes #10320 Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
parent
8204ecbead
commit
d51f138703
2 changed files with 4 additions and 4 deletions
|
@ -146,7 +146,7 @@ struct nxp_mpu_config {
|
||||||
/* Number of regions */
|
/* Number of regions */
|
||||||
u32_t num_regions;
|
u32_t num_regions;
|
||||||
/* Regions */
|
/* Regions */
|
||||||
struct nxp_mpu_region *mpu_regions;
|
const struct nxp_mpu_region *mpu_regions;
|
||||||
/* SRAM Region */
|
/* SRAM Region */
|
||||||
u32_t sram_region;
|
u32_t sram_region;
|
||||||
};
|
};
|
||||||
|
@ -159,6 +159,6 @@ struct nxp_mpu_config {
|
||||||
* for Thread Stack, Stack Guards, etc.) are programmed during runtime, thus,
|
* for Thread Stack, Stack Guards, etc.) are programmed during runtime, thus,
|
||||||
* not kept here.
|
* not kept here.
|
||||||
*/
|
*/
|
||||||
extern struct nxp_mpu_config mpu_config;
|
extern const struct nxp_mpu_config mpu_config;
|
||||||
|
|
||||||
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MPU_NXP_MPU_H_ */
|
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_CORTEX_M_MPU_NXP_MPU_H_ */
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
#include <arch/arm/cortex_m/mpu/nxp_mpu.h>
|
#include <arch/arm/cortex_m/mpu/nxp_mpu.h>
|
||||||
|
|
||||||
static struct nxp_mpu_region mpu_regions[] = {
|
static const struct nxp_mpu_region mpu_regions[] = {
|
||||||
/* Region 0 */
|
/* Region 0 */
|
||||||
MPU_REGION_ENTRY("DEBUGGER_0",
|
MPU_REGION_ENTRY("DEBUGGER_0",
|
||||||
0,
|
0,
|
||||||
|
@ -48,7 +48,7 @@ static struct nxp_mpu_region mpu_regions[] = {
|
||||||
REGION_RAM_ATTR),
|
REGION_RAM_ATTR),
|
||||||
};
|
};
|
||||||
|
|
||||||
struct nxp_mpu_config mpu_config = {
|
const struct nxp_mpu_config mpu_config = {
|
||||||
.num_regions = ARRAY_SIZE(mpu_regions),
|
.num_regions = ARRAY_SIZE(mpu_regions),
|
||||||
.mpu_regions = mpu_regions,
|
.mpu_regions = mpu_regions,
|
||||||
.sram_region = 4,
|
.sram_region = 4,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue