]> git.sur5r.net Git - u-boot/commitdiff
ARM: cache_v7: use __weak
authorJeroen Hofstee <jeroen@myspectrum.nl>
Mon, 23 Jun 2014 20:07:04 +0000 (22:07 +0200)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Fri, 4 Jul 2014 17:57:22 +0000 (19:57 +0200)
This is not only more readable but also prevents a warning
about a missing prototype. The prototypes which are actually
missing are added.

cc: Albert Aribaud <albert.u.boot@aribaud.net>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Reviewed-by: Tom Rini <trini@ti.com>
arch/arm/cpu/armv7/cache_v7.c
arch/arm/include/asm/cache.h
arch/arm/lib/cache-cp15.c
arch/arm/lib/cache.c

index bc5fc423d6b51cf0fb1316519a150e0d40dcf484..a2c4032fed8c2c8d7719f4be0806319ac077261a 100644 (file)
@@ -354,41 +354,10 @@ void invalidate_icache_all(void)
 }
 #endif
 
-/*
- * Stub implementations for outer cache operations
- */
-void __v7_outer_cache_enable(void)
-{
-}
-void v7_outer_cache_enable(void)
-       __attribute__((weak, alias("__v7_outer_cache_enable")));
-
-void __v7_outer_cache_disable(void)
-{
-}
-void v7_outer_cache_disable(void)
-       __attribute__((weak, alias("__v7_outer_cache_disable")));
-
-void __v7_outer_cache_flush_all(void)
-{
-}
-void v7_outer_cache_flush_all(void)
-       __attribute__((weak, alias("__v7_outer_cache_flush_all")));
-
-void __v7_outer_cache_inval_all(void)
-{
-}
-void v7_outer_cache_inval_all(void)
-       __attribute__((weak, alias("__v7_outer_cache_inval_all")));
-
-void __v7_outer_cache_flush_range(u32 start, u32 end)
-{
-}
-void v7_outer_cache_flush_range(u32 start, u32 end)
-       __attribute__((weak, alias("__v7_outer_cache_flush_range")));
-
-void __v7_outer_cache_inval_range(u32 start, u32 end)
-{
-}
-void v7_outer_cache_inval_range(u32 start, u32 end)
-       __attribute__((weak, alias("__v7_outer_cache_inval_range")));
+/*  Stub implementations for outer cache operations */
+__weak void v7_outer_cache_enable(void) {}
+__weak void v7_outer_cache_disable(void) {}
+__weak void v7_outer_cache_flush_all(void) {}
+__weak void v7_outer_cache_inval_all(void) {}
+__weak void v7_outer_cache_flush_range(u32 start, u32 end) {}
+__weak void v7_outer_cache_inval_range(u32 start, u32 end) {}
index ddebbc8fcdc40c937d43b8cf08f67959b7613384..a836e9f2ab2838807d0a53c801b8c5f722eb5b76 100644 (file)
@@ -29,6 +29,9 @@ void l2_cache_enable(void);
 void l2_cache_disable(void);
 void set_section_dcache(int section, enum dcache_option option);
 
+void arm_init_before_mmu(void);
+void arm_init_domains(void);
+void cpu_cache_initialization(void);
 void dram_bank_mmu_setup(int bank);
 
 #endif
index 8642010a17500cc8675b5ec03f851e1e8ba929bb..5fdfdbfca5419cc53437d83d62d22509f70418ed 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-void __arm_init_before_mmu(void)
+__weak void arm_init_before_mmu(void)
 {
 }
-void arm_init_before_mmu(void)
-       __attribute__((weak, alias("__arm_init_before_mmu")));
 
 __weak void arm_init_domains(void)
 {
@@ -44,14 +42,11 @@ void set_section_dcache(int section, enum dcache_option option)
        page_table[section] = value;
 }
 
-void __mmu_page_table_flush(unsigned long start, unsigned long stop)
+__weak void mmu_page_table_flush(unsigned long start, unsigned long stop)
 {
        debug("%s: Warning: not implemented\n", __func__);
 }
 
-void mmu_page_table_flush(unsigned long start, unsigned long stop)
-       __attribute__((weak, alias("__mmu_page_table_flush")));
-
 void mmu_set_region_dcache_behaviour(u32 start, int size,
                                     enum dcache_option option)
 {
index 4f6b9f01cb55587bc00483693be903a7750a1a9c..4e597a4c1d16281a7efbaa2f15ca339db0109835 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <common.h>
 
-void  __flush_cache(unsigned long start, unsigned long size)
+__weak void flush_cache(unsigned long start, unsigned long size)
 {
 #if defined(CONFIG_ARM1136)
 
@@ -31,28 +31,21 @@ void  __flush_cache(unsigned long start, unsigned long size)
 #endif /* CONFIG_ARM926EJS */
        return;
 }
-void  flush_cache(unsigned long start, unsigned long size)
-       __attribute__((weak, alias("__flush_cache")));
 
 /*
  * Default implementation:
  * do a range flush for the entire range
  */
-void   __flush_dcache_all(void)
+__weak void flush_dcache_all(void)
 {
        flush_cache(0, ~0);
 }
-void   flush_dcache_all(void)
-       __attribute__((weak, alias("__flush_dcache_all")));
-
 
 /*
  * Default implementation of enable_caches()
  * Real implementation should be in platform code
  */
-void __enable_caches(void)
+__weak void enable_caches(void)
 {
        puts("WARNING: Caches not enabled\n");
 }
-void enable_caches(void)
-       __attribute__((weak, alias("__enable_caches")));