summaryrefslogtreecommitdiff
path: root/tools/arch/x86/include
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2021-03-26 18:12:00 +0300
committerBorislav Petkov <bp@suse.de>2021-03-31 17:20:22 +0300
commit52fa82c21f64e900a72437269a5cc9e0034b424e (patch)
treeb2a122854db8fa1ed6adc80be5e5dee1dc3ab22f /tools/arch/x86/include
parent2304d14db6595bea5292bece06c4c625b12d8f89 (diff)
downloadlinux-52fa82c21f64e900a72437269a5cc9e0034b424e.tar.xz
x86: Add insn_decode_kernel()
Add a helper to decode kernel instructions; there's no point in endlessly repeating those last two arguments. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20210326151259.379242587@infradead.org
Diffstat (limited to 'tools/arch/x86/include')
-rw-r--r--tools/arch/x86/include/asm/insn.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/arch/x86/include/asm/insn.h b/tools/arch/x86/include/asm/insn.h
index c9f3eeebb53b..dc632b41f135 100644
--- a/tools/arch/x86/include/asm/insn.h
+++ b/tools/arch/x86/include/asm/insn.h
@@ -150,6 +150,8 @@ enum insn_mode {
extern int insn_decode(struct insn *insn, const void *kaddr, int buf_len, enum insn_mode m);
+#define insn_decode_kernel(_insn, _ptr) insn_decode((_insn), (_ptr), MAX_INSN_SIZE, INSN_MODE_KERN)
+
/* Attribute will be determined after getting ModRM (for opcode groups) */
static inline void insn_get_attribute(struct insn *insn)
{