diff options
author | Anju T <anju@linux.vnet.ibm.com> | 2017-02-08 14:27:30 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-02-10 13:28:03 +1100 |
commit | ebfa50df435eed18e1389a43e0596246228e7298 (patch) | |
tree | a901e3284d4bd0e26e541f39f873c6292f7862ba /arch/powerpc/include/asm/code-patching.h | |
parent | c233f5979b3dbb39a5b2473b5fcaf58baec8f1bd (diff) | |
download | linux-stable-ebfa50df435eed18e1389a43e0596246228e7298.tar.gz linux-stable-ebfa50df435eed18e1389a43e0596246228e7298.tar.bz2 linux-stable-ebfa50df435eed18e1389a43e0596246228e7298.zip |
powerpc: Add helper to check if offset is within relative branch range
To permit the use of relative branch instruction in powerpc, the target
address has to be relatively nearby, since the address is specified in an
immediate field (24 bit filed) in the instruction opcode itself. Here
nearby refers to 32MB on either side of the current instruction.
This patch verifies whether the target address is within +/- 32MB
range or not.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
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 2015b072422c..75ee4f4ac840 100644 --- a/arch/powerpc/include/asm/code-patching.h +++ b/arch/powerpc/include/asm/code-patching.h @@ -22,6 +22,7 @@ #define BRANCH_SET_LINK 0x1 #define BRANCH_ABSOLUTE 0x2 +bool is_offset_in_branch_range(long offset); unsigned int create_branch(const unsigned int *addr, unsigned long target, int flags); unsigned int create_cond_branch(const unsigned int *addr, |