]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Add helper to check if offset is within relative branch range
authorAnju T <anju@linux.vnet.ibm.com>
Wed, 8 Feb 2017 08:57:30 +0000 (14:27 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 10 Feb 2017 02:28:03 +0000 (13:28 +1100)
commit98eed5c5cf47105a9199c558ddc560c539284010
treea901e3284d4bd0e26e541f39f873c6292f7862ba
parent9ba31b9b4d7f039243eda73f9186bd03c32d6c7f
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>
arch/powerpc/include/asm/code-patching.h
arch/powerpc/lib/code-patching.c