diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-08-17 13:42:41 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-08-18 14:39:06 +0200 |
commit | 63e1cddef2e33a56220c6d26e643419ea39163e9 (patch) | |
tree | cce421238d73584535079f69f3cdd06fdaa95325 /arch | |
parent | 66e233b8c04b82e34b26e22890c196c0b0ab1fb0 (diff) | |
download | barebox-63e1cddef2e33a56220c6d26e643419ea39163e9.tar.gz barebox-63e1cddef2e33a56220c6d26e643419ea39163e9.tar.xz |
ARM: mmu: define attrs_uncached_mem() helper
We already have a helper with the same name for ARMv8, so define it here
for reuse in the follow-up commit.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220817114244.1810531-8-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/cpu/mmu.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/cpu/mmu.h b/arch/arm/cpu/mmu.h index d48522d166..1499b70dd6 100644 --- a/arch/arm/cpu/mmu.h +++ b/arch/arm/cpu/mmu.h @@ -73,15 +73,20 @@ create_sections(uint32_t *ttb, unsigned long first, #define PMD_SECT_DEF_UNCACHED (PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT) #define PMD_SECT_DEF_CACHED (PMD_SECT_WB | PMD_SECT_DEF_UNCACHED) -static inline void create_flat_mapping(uint32_t *ttb) +static inline unsigned long attrs_uncached_mem(void) { unsigned int flags = PMD_SECT_DEF_UNCACHED; if (cpu_architecture() >= CPU_ARCH_ARMv7) flags |= PMD_SECT_XN; + return flags; +} + +static inline void create_flat_mapping(uint32_t *ttb) +{ /* create a flat mapping using 1MiB sections */ - create_sections(ttb, 0, 0xffffffff, flags); + create_sections(ttb, 0, 0xffffffff, attrs_uncached_mem()); } #endif /* __ARM_MMU_H */ |