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>
This commit is contained in:
parent
07630a37be
commit
411781a290
2 changed files with 115 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue