1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * intel_pt_insn_decoder.h: Intel Processor Trace support
4 * Copyright (c) 2013-2014, Intel Corporation.
7 #ifndef INCLUDE__INTEL_PT_INSN_DECODER_H__
8 #define INCLUDE__INTEL_PT_INSN_DECODER_H__
13 #define INTEL_PT_INSN_DESC_MAX 32
14 #define INTEL_PT_INSN_BUF_SZ 16
16 enum intel_pt_insn_op {
30 enum intel_pt_insn_branch {
31 INTEL_PT_BR_NO_BRANCH,
33 INTEL_PT_BR_CONDITIONAL,
34 INTEL_PT_BR_UNCONDITIONAL,
37 struct intel_pt_insn {
38 enum intel_pt_insn_op op;
39 enum intel_pt_insn_branch branch;
42 unsigned char buf[INTEL_PT_INSN_BUF_SZ];
45 int intel_pt_get_insn(const unsigned char *buf, size_t len, int x86_64,
46 struct intel_pt_insn *intel_pt_insn);
48 const char *intel_pt_insn_name(enum intel_pt_insn_op op);
50 int intel_pt_insn_desc(const struct intel_pt_insn *intel_pt_insn, char *buf,
53 int intel_pt_insn_type(enum intel_pt_insn_op op);