diff options
author | Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> | 2021-10-06 01:55:20 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-10-07 18:52:33 +1100 |
commit | 4549c3ea3160fa8b3f37dfe2f957657bb265eda9 (patch) | |
tree | 7c483a082777354694a7488ba5e5de32e9e5bbc5 /arch/powerpc/include/asm/code-patching.h | |
parent | 23c216b335d1fbd716076e8263b54a714ea3cf0e (diff) | |
download | linux-4549c3ea3160fa8b3f37dfe2f957657bb265eda9.tar.bz2 |
powerpc/lib: Add helper to check if offset is within conditional branch range
Add a helper to check if a given offset is within the branch range for a
powerpc conditional branch instruction, and update some sites to use the
new helper.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/442b69a34ced32ca346a0d9a855f3f6cfdbbbd41.1633464148.git.naveen.n.rao@linux.vnet.ibm.com
Diffstat (limited to 'arch/powerpc/include/asm/code-patching.h')
-rw-r--r-- | arch/powerpc/include/asm/code-patching.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/code-patching.h b/arch/powerpc/include/asm/code-patching.h index a95f63788c6b..4ba834599c4d 100644 --- a/arch/powerpc/include/asm/code-patching.h +++ b/arch/powerpc/include/asm/code-patching.h @@ -23,6 +23,7 @@ #define BRANCH_ABSOLUTE 0x2 bool is_offset_in_branch_range(long offset); +bool is_offset_in_cond_branch_range(long offset); int create_branch(struct ppc_inst *instr, const u32 *addr, unsigned long target, int flags); int create_cond_branch(struct ppc_inst *instr, const u32 *addr, |