[PATCH 10/10] powerpc: Replace calls to make_bl() with create_function_call()

Michael Ellerman michael at ellerman.id.au
Fri Jan 13 17:47:04 EST 2006


Now that we create_function_call() we can remove make_bl() in hash_utils_64.c
To make this cleaner we change create_function_call a little, we're the only
caller.

Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
---

 arch/powerpc/mm/hash_utils_64.c |   27 +++++++++------------------
 include/asm-powerpc/util.h      |    4 ++--
 2 files changed, 11 insertions(+), 20 deletions(-)

Index: linux/arch/powerpc/mm/hash_utils_64.c
===================================================================
--- linux.orig/arch/powerpc/mm/hash_utils_64.c
+++ linux/arch/powerpc/mm/hash_utils_64.c
@@ -52,6 +52,7 @@
 #include <asm/cputable.h>
 #include <asm/abs_addr.h>
 #include <asm/sections.h>
+#include <asm/util.h>
 
 #ifdef DEBUG
 #define DBG(fmt...) udbg_printf(fmt)
@@ -721,16 +722,6 @@ void flush_hash_range(unsigned long numb
 	}
 }
 
-static inline void make_bl(unsigned int *insn_addr, void *func)
-{
-	unsigned long funcp = *((unsigned long *)func);
-	int offset = funcp - (unsigned long)insn_addr;
-
-	*insn_addr = (unsigned int)(0x48000001 | (offset & 0x03fffffc));
-	flush_icache_range((unsigned long)insn_addr, 4+
-			   (unsigned long)insn_addr);
-}
-
 /*
  * low_hash_fault is called when we the low level hash code failed
  * to instert a PTE due to an hypervisor error
@@ -763,14 +754,14 @@ void __init htab_finish_init(void)
 	extern unsigned int *ht64_call_hpte_remove;
 	extern unsigned int *ht64_call_hpte_updatepp;
 
-	make_bl(ht64_call_hpte_insert1, ppc_md.hpte_insert);
-	make_bl(ht64_call_hpte_insert2, ppc_md.hpte_insert);
-	make_bl(ht64_call_hpte_remove, ppc_md.hpte_remove);
-	make_bl(ht64_call_hpte_updatepp, ppc_md.hpte_updatepp);
+	create_function_call(ht64_call_hpte_insert1, ppc_md.hpte_insert);
+	create_function_call(ht64_call_hpte_insert2, ppc_md.hpte_insert);
+	create_function_call(ht64_call_hpte_remove, ppc_md.hpte_remove);
+	create_function_call(ht64_call_hpte_updatepp, ppc_md.hpte_updatepp);
 #endif /* CONFIG_PPC_64K_PAGES */
 
-	make_bl(htab_call_hpte_insert1, ppc_md.hpte_insert);
-	make_bl(htab_call_hpte_insert2, ppc_md.hpte_insert);
-	make_bl(htab_call_hpte_remove, ppc_md.hpte_remove);
-	make_bl(htab_call_hpte_updatepp, ppc_md.hpte_updatepp);
+	create_function_call(htab_call_hpte_insert1, ppc_md.hpte_insert);
+	create_function_call(htab_call_hpte_insert2, ppc_md.hpte_insert);
+	create_function_call(htab_call_hpte_remove, ppc_md.hpte_remove);
+	create_function_call(htab_call_hpte_updatepp, ppc_md.hpte_updatepp);
 }
Index: linux/include/asm-powerpc/util.h
===================================================================
--- linux.orig/include/asm-powerpc/util.h
+++ linux/include/asm-powerpc/util.h
@@ -38,7 +38,7 @@ static inline void create_branch(unsigne
 	create_instruction(addr, instruction);
 }
 
-static inline void create_function_call(unsigned long addr, void * func)
+static inline void create_function_call(void *addr, void *func)
 {
 	unsigned long func_addr;
 
@@ -52,7 +52,7 @@ static inline void create_function_call(
 #else
 	func_addr = (unsigned long)func;
 #endif
-	create_branch(addr, func_addr, BRANCH_SET_LINK);
+	create_branch((unsigned long)addr, func_addr, BRANCH_SET_LINK);
 }
 
 #endif /* _ASM_POWERPC_UTIL_H */



More information about the Linuxppc64-dev mailing list