diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2018-10-19 02:55:04 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-10-26 06:58:58 -0400 |
commit | 082e2869fc022de4db9977e06558da78384ea98c (patch) | |
tree | 077a560066417e1d08a05ad3b25d0da1ef12f454 | |
parent | cc4ebf5c0a3440ed0a32d25c55ebdb6ce5f3c0bc (diff) |
powerpc/code-patching: Add a helper to get the address of a patch_site
This patch adds a helper to get the address of a patch_site.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
[mpe: Call it "patch site" addr]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/include/asm/code-patching.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/code-patching.h b/arch/powerpc/include/asm/code-patching.h index 31733a95bbd0..3d5acd2b113a 100644 --- a/arch/powerpc/include/asm/code-patching.h +++ b/arch/powerpc/include/asm/code-patching.h | |||
@@ -36,6 +36,11 @@ int raw_patch_instruction(unsigned int *addr, unsigned int instr); | |||
36 | int patch_instruction_site(s32 *addr, unsigned int instr); | 36 | int patch_instruction_site(s32 *addr, unsigned int instr); |
37 | int patch_branch_site(s32 *site, unsigned long target, int flags); | 37 | int patch_branch_site(s32 *site, unsigned long target, int flags); |
38 | 38 | ||
39 | static inline unsigned long patch_site_addr(s32 *site) | ||
40 | { | ||
41 | return (unsigned long)site + *site; | ||
42 | } | ||
43 | |||
39 | int instr_is_relative_branch(unsigned int instr); | 44 | int instr_is_relative_branch(unsigned int instr); |
40 | int instr_is_relative_link_branch(unsigned int instr); | 45 | int instr_is_relative_link_branch(unsigned int instr); |
41 | int instr_is_branch_to_addr(const unsigned int *instr, unsigned long addr); | 46 | int instr_is_branch_to_addr(const unsigned int *instr, unsigned long addr); |