ARM: kprobes: Add BLX macro
authorJon Medhurst <tixy@yxit.co.uk>
Thu, 7 Jul 2011 13:03:08 +0000 (14:03 +0100)
committerTixy <tixy@medhuaa1.miniserver.com>
Wed, 13 Jul 2011 17:32:48 +0000 (17:32 +0000)
This is for use by inline assembler which will be added to kprobes-arm.c
It saves memory when used on newer ARM architectures and also provides
correct interworking should ARM probes be required on Thumb kernels in
the future.

Signed-off-by: Jon Medhurst <tixy@yxit.co.uk>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
arch/arm/kernel/kprobes-arm.c

index ea96214ef3418d427db19afc1477edf23c478c64..80a941100f8cb977311f0d7af2dbc24f7c53f0f4 100644 (file)
 
 #define branch_displacement(insn) sign_extend(((insn) & 0xffffff) << 2, 25)
 
+#if  __LINUX_ARM_ARCH__ >= 6
+#define BLX(reg)       "blx    "reg"           \n\t"
+#else
+#define BLX(reg)       "mov    lr, pc          \n\t"   \
+                       "mov    pc, "reg"       \n\t"
+#endif
+
 #define is_r15(insn, bitpos) (((insn) & (0xf << bitpos)) == (0xf << bitpos))
 
 #define PSR_fs (PSR_f|PSR_s)