From: Jon Medhurst Date: Thu, 7 Jul 2011 13:03:08 +0000 (+0100) Subject: ARM: kprobes: Add BLX macro X-Git-Tag: firefly_0821_release~3680^2~4950^2^2~2^2~21 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7be7ee2d295f6a069e1e92db95bf92eea2a173cf;p=firefly-linux-kernel-4.4.55.git ARM: kprobes: Add BLX macro 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 Acked-by: Nicolas Pitre --- diff --git a/arch/arm/kernel/kprobes-arm.c b/arch/arm/kernel/kprobes-arm.c index ea96214ef341..80a941100f8c 100644 --- a/arch/arm/kernel/kprobes-arm.c +++ b/arch/arm/kernel/kprobes-arm.c @@ -67,6 +67,13 @@ #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)