Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christophe Leroy and committed by
Michael Ellerman
082e2869 cc4ebf5c

+5
+5
arch/powerpc/include/asm/code-patching.h
··· 36 36 int patch_instruction_site(s32 *addr, unsigned int instr); 37 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 44 int instr_is_relative_branch(unsigned int instr); 40 45 int instr_is_relative_link_branch(unsigned int instr); 41 46 int instr_is_branch_to_addr(const unsigned int *instr, unsigned long addr);