summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-08-12 15:26:27 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-08-13 20:27:38 +0200
commita3a103c95c9b74e611480134d61dd727c9c0b4ba (patch)
tree0406adccfa3f2d80f06e55440d92223fd2787363 /arch
parent837795895801e6c368a564f9dcbbda2c87137ea7 (diff)
downloadbarebox-a3a103c95c9b74e611480134d61dd727c9c0b4ba.tar.gz
barebox-a3a103c95c9b74e611480134d61dd727c9c0b4ba.tar.xz
ARM MMU: call __mmu_cache_* as regular C functions
Now that __mmu_cache_* restore the registers they can be called as regular C functions. Create a header file for them and use C functions rather than inline assembly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/mmu.c25
-rw-r--r--arch/arm/cpu/mmu.h8
2 files changed, 14 insertions, 19 deletions
diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index 607f3572db..dad8092e9f 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -8,6 +8,8 @@
#include <asm/system.h>
#include <memory.h>
+#include "mmu.h"
+
static unsigned long *ttb;
static void create_sections(unsigned long virt, unsigned long phys, int size_m,
@@ -21,12 +23,7 @@ static void create_sections(unsigned long virt, unsigned long phys, int size_m,
for (i = size_m; i > 0; i--, virt++, phys++)
ttb[virt] = (phys << 20) | flags;
- asm volatile (
- "bl __mmu_cache_flush;"
- :
- :
- : "r0", "r1", "r2", "r3", "r6", "r10", "r12", "lr", "cc", "memory"
- );
+ __mmu_cache_flush();
}
/*
@@ -255,12 +252,7 @@ static int mmu_init(void)
create_sections(bank->start, bank->start, bank->size >> 20,
PMD_SECT_DEF_CACHED);
- asm volatile (
- "bl __mmu_cache_on;"
- :
- :
- : "r0", "r1", "r2", "r3", "r6", "r10", "r12", "lr", "cc", "memory"
- );
+ __mmu_cache_on();
/*
* Now that we have the MMU and caches on remap sdram again using
@@ -284,13 +276,8 @@ void mmu_disable(void)
if (outer_cache.disable)
outer_cache.disable();
- asm volatile (
- "bl __mmu_cache_flush;"
- "bl __mmu_cache_off;"
- :
- :
- : "r0", "r1", "r2", "r3", "r6", "r10", "r12", "lr", "cc", "memory"
- );
+ __mmu_cache_flush();
+ __mmu_cache_off();
}
#define PAGE_ALIGN(s) ((s) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1);
diff --git a/arch/arm/cpu/mmu.h b/arch/arm/cpu/mmu.h
new file mode 100644
index 0000000000..618968bc82
--- /dev/null
+++ b/arch/arm/cpu/mmu.h
@@ -0,0 +1,8 @@
+#ifndef __ARM_MMU_H
+#define __ARM_MMU_H
+
+void __mmu_cache_on(void);
+void __mmu_cache_off(void);
+void __mmu_cache_flush(void);
+
+#endif /* __ARM_MMU_H */