arm64: ptrace: add is_wide_instruction() macro
authorAlex Van Brunt <avanbrunt@nvidia.com>
Wed, 29 Jan 2014 21:45:20 +0000 (13:45 -0800)
committerGreg Hackmann <ghackmann@google.com>
Fri, 12 Sep 2014 20:58:11 +0000 (13:58 -0700)
Add the is_wide_instruction() macro. This was copied from the arm
architecture.

Change-Id: I28f83b47f5c587fe778dc2846df77673f8dd918b
Signed-off-by: Alex Van Brunt <avanbrunt@nvidia.com>
Reviewed-on: http://git-master/r/361737
Reviewed-by: Peng Du <pdu@nvidia.com>
Reviewed-on: http://git-master/r/365060
Reviewed-by: Richard Wiley <rwiley@nvidia.com>
Tested-by: Oskari Jaaskelainen <oskarij@nvidia.com>
arch/arm64/include/asm/ptrace.h

index 41e59e2459ffcb7109339f56f60ed9b69387133b..fff28950e660bfaedb074659a39943a1fda66ea4 100644 (file)
@@ -171,5 +171,13 @@ extern unsigned long profile_pc(struct pt_regs *regs);
 #define profile_pc(regs) instruction_pointer(regs)
 #endif
 
+/*
+ * True if instr is a 32-bit thumb instruction. This works if instr
+ * is the first or only half-word of a thumb instruction. It also works
+ * when instr holds all 32-bits of a wide thumb instruction if stored
+ * in the form (first_half<<16)|(second_half)
+ */
+#define is_wide_instruction(instr)     ((unsigned)(instr) >= 0xe800)
+
 #endif /* __ASSEMBLY__ */
 #endif