[PATCH 05/22] ARM: mmu32: introduce new mmu_addr_t type
Ahmad Fatoum
a.fatoum at pengutronix.de
Wed Aug 6 05:36:57 PDT 2025
The ARM 32-bit and 64-bit MMU code makes heavy use of uint32_t and
uint64_t respectively.
We can't use ulong for common code between them as u32 is an unsigned long
and u64 is a unsigned long long and pointers to them can not be implicitly
converted. As we don't want to rewrite all MMU code to use ullong, let's
just define a new mmu_addr_t, which can be used in code that should be
callable from either ISA.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
arch/arm/cpu/mmu_32.h | 2 ++
arch/arm/cpu/mmu_64.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/arch/arm/cpu/mmu_32.h b/arch/arm/cpu/mmu_32.h
index 607d9e8608b2..7a58a819f08a 100644
--- a/arch/arm/cpu/mmu_32.h
+++ b/arch/arm/cpu/mmu_32.h
@@ -9,6 +9,8 @@
#include "mmu-common.h"
+typedef u32 mmu_addr_t;
+
#define PGDIR_SHIFT 20
#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
diff --git a/arch/arm/cpu/mmu_64.h b/arch/arm/cpu/mmu_64.h
index d3c39dabb507..ad7c1bde5631 100644
--- a/arch/arm/cpu/mmu_64.h
+++ b/arch/arm/cpu/mmu_64.h
@@ -2,6 +2,8 @@
#include "mmu-common.h"
+typedef u64 mmu_addr_t;
+
#define CACHED_MEM (PTE_BLOCK_MEMTYPE(MT_NORMAL) | \
PTE_BLOCK_OUTER_SHARE | \
PTE_BLOCK_AF)
--
2.39.5
More information about the barebox
mailing list