summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2008-06-24 03:32:29 +0200
committerPaul Mackerras <paulus@samba.org>2008-07-01 03:28:21 +0200
commit411781a290b0d0a31fd73826b3ee110f1e3cc3b6 (patch)
tree4a5eb482d99916c17f19a013b52cf808161f32ea /include
parentpowerpc: Add ppc_function_entry() which gets the entry point for a function (diff)
downloadlinux-411781a290b0d0a31fd73826b3ee110f1e3cc3b6.tar.xz
linux-411781a290b0d0a31fd73826b3ee110f1e3cc3b6.zip
powerpc: Add new code patching routines
This commit adds some new routines for patching code, which will be used in a following commit. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-powerpc/code-patching.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/asm-powerpc/code-patching.h b/include/asm-powerpc/code-patching.h
index a45a7ff78725..40ad46b1dd9d 100644
--- a/include/asm-powerpc/code-patching.h
+++ b/include/asm-powerpc/code-patching.h
@@ -23,9 +23,17 @@
unsigned int create_branch(const unsigned int *addr,
unsigned long target, int flags);
+unsigned int create_cond_branch(const unsigned int *addr,
+ unsigned long target, int flags);
void patch_branch(unsigned int *addr, unsigned long target, int flags);
void patch_instruction(unsigned int *addr, unsigned int instr);
+int instr_is_relative_branch(unsigned int instr);
+int instr_is_branch_to_addr(const unsigned int *instr, unsigned long addr);
+unsigned long branch_target(const unsigned int *instr);
+unsigned int translate_branch(const unsigned int *dest,
+ const unsigned int *src);
+
static inline unsigned long ppc_function_entry(void *func)
{
#ifdef CONFIG_PPC64