linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH 5/5] powerpc: Replace calls to make_bl() with create_function_call()
Date: Thu, 30 Mar 2006 17:13:15 +1100	[thread overview]
Message-ID: <20060330061315.9EE2A67B80@ozlabs.org> (raw)
In-Reply-To: <1143699173.339118.857634197021.qpush@concordia>

Use create_function_call() instead of make_bl() in htab_finish_init().

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

 arch/powerpc/mm/hash_utils_64.c |   45 ++++++++++++++++------------------------
 1 files changed, 18 insertions(+), 27 deletions(-)

Index: to-merge/arch/powerpc/mm/hash_utils_64.c
===================================================================
--- to-merge.orig/arch/powerpc/mm/hash_utils_64.c
+++ to-merge/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)
@@ -375,39 +376,29 @@ void create_section_mapping(unsigned lon
 }
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
-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);
-}
-
 static void __init htab_finish_init(void)
 {
-	extern unsigned int *htab_call_hpte_insert1;
-	extern unsigned int *htab_call_hpte_insert2;
-	extern unsigned int *htab_call_hpte_remove;
-	extern unsigned int *htab_call_hpte_updatepp;
+	extern unsigned long htab_call_hpte_insert1;
+	extern unsigned long htab_call_hpte_insert2;
+	extern unsigned long htab_call_hpte_remove;
+	extern unsigned long htab_call_hpte_updatepp;
 
 #ifdef CONFIG_PPC_64K_PAGES
-	extern unsigned int *ht64_call_hpte_insert1;
-	extern unsigned int *ht64_call_hpte_insert2;
-	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);
+	extern unsigned long ht64_call_hpte_insert1;
+	extern unsigned long ht64_call_hpte_insert2;
+	extern unsigned long ht64_call_hpte_remove;
+	extern unsigned long ht64_call_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);
 }
 
 void __init htab_initialize(void)

  parent reply	other threads:[~2006-03-30  6:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-30  6:12 [PATCH 0/5] powerpc: Cleanup htab code a little Michael Ellerman
2006-03-30  6:12 ` [PATCH 1/5] powerpc: Initialise ppc_md htab pointers earlier Michael Ellerman
2006-03-30  6:12 ` [PATCH 2/5] powerpc: Use ppc_md.hpte_insert() in htab_bolt_mapping() Michael Ellerman
2006-03-30  6:12 ` [PATCH 3/5] powerpc: Move create_(instruction|branch|function_call) into util.h Michael Ellerman
2006-03-30 18:10   ` Linas Vepstas
2006-03-30 22:43     ` Michael Ellerman
2006-03-30  6:13 ` [PATCH 4/5] powerpc: Use flush_icache_range() in create_instruction() Michael Ellerman
2006-03-30  6:13 ` Michael Ellerman [this message]
2006-05-02  1:09 ` [PATCH 0/5] powerpc: Cleanup htab code a little Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060330061315.9EE2A67B80@ozlabs.org \
    --to=michael@ellerman.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).