diff options
author | Peter Zijlstra <peterz@infradead.org> | 2021-03-26 16:12:00 +0100 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2021-03-31 16:20:22 +0200 |
commit | 52fa82c21f64e900a72437269a5cc9e0034b424e (patch) | |
tree | b2a122854db8fa1ed6adc80be5e5dee1dc3ab22f /tools/arch | |
parent | 2304d14db6595bea5292bece06c4c625b12d8f89 (diff) |
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')
-rw-r--r-- | tools/arch/x86/include/asm/insn.h | 2 |
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) { |