diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2019-01-17 16:38:26 -0800 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-01-21 10:34:06 +0100 |
commit | 3e0c800c9b38b6e1eece0e4730919d1f8af09f36 (patch) | |
tree | b74510ffc6c27f9b5cc6d803fdf72b57d73a45f8 /arch/arm/cpu | |
parent | 7aeebcb3ba069bf9c8bb699630928ee84ba60bc4 (diff) | |
download | barebox-3e0c800c9b38b6e1eece0e4730919d1f8af09f36.tar.gz barebox-3e0c800c9b38b6e1eece0e4730919d1f8af09f36.tar.xz |
ARM: mmu: Share code for arm_mmu_not_initialized_error()
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r-- | arch/arm/cpu/mmu-common.h | 11 | ||||
-rw-r--r-- | arch/arm/cpu/mmu.c | 11 | ||||
-rw-r--r-- | arch/arm/cpu/mmu_64.c | 11 |
3 files changed, 11 insertions, 22 deletions
diff --git a/arch/arm/cpu/mmu-common.h b/arch/arm/cpu/mmu-common.h index 37eef3ef28..679799c3c5 100644 --- a/arch/arm/cpu/mmu-common.h +++ b/arch/arm/cpu/mmu-common.h @@ -5,4 +5,15 @@ void dma_inv_range(void *ptr, size_t size); void *dma_alloc_map(size_t size, dma_addr_t *dma_handle, unsigned flags); void __mmu_init(bool mmu_on); +static inline void arm_mmu_not_initialized_error(void) +{ + /* + * This means: + * - one of the MMU functions like dma_alloc_coherent + * or remap_range is called too early, before the MMU is initialized + * - Or the MMU initialization has failed earlier + */ + panic("MMU not initialized\n"); +} + #endif
\ No newline at end of file diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c index ba1c3e007d..9e261a0bed 100644 --- a/arch/arm/cpu/mmu.c +++ b/arch/arm/cpu/mmu.c @@ -75,17 +75,6 @@ static uint32_t pgd_flags_wc; #define PTE_MASK ((1 << 12) - 1) -static void arm_mmu_not_initialized_error(void) -{ - /* - * This means: - * - one of the MMU functions like dma_alloc_coherent - * or remap_range is called too early, before the MMU is initialized - * - Or the MMU initialization has failed earlier - */ - panic("MMU not initialized\n"); -} - static bool pgd_type_table(u32 pgd) { return (pgd & PMD_TYPE_MASK) == PMD_TYPE_TABLE; diff --git a/arch/arm/cpu/mmu_64.c b/arch/arm/cpu/mmu_64.c index 7f8a8f249b..a3074b10d0 100644 --- a/arch/arm/cpu/mmu_64.c +++ b/arch/arm/cpu/mmu_64.c @@ -37,17 +37,6 @@ static uint64_t *ttb; -static void arm_mmu_not_initialized_error(void) -{ - /* - * This means: - * - one of the MMU functions like dma_alloc_coherent - * or remap_range is called too early, before the MMU is initialized - * - Or the MMU initialization has failed earlier - */ - panic("MMU not initialized\n"); -} - static void set_table(uint64_t *pt, uint64_t *table_addr) { uint64_t val; |