1 #ifndef _ASM_X86_INSN_H 2 #define _ASM_X86_INSN_H 72 #define MAX_INSN_SIZE 15 74 #define X86_MODRM_MOD(modrm) (((modrm) & 0xc0) >> 6) 75 #define X86_MODRM_REG(modrm) (((modrm) & 0x38) >> 3) 76 #define X86_MODRM_RM(modrm) ((modrm) & 0x07) 78 #define X86_SIB_SCALE(sib) (((sib) & 0xc0) >> 6) 79 #define X86_SIB_INDEX(sib) (((sib) & 0x38) >> 3) 80 #define X86_SIB_BASE(sib) ((sib) & 0x07) 82 #define X86_REX_W(rex) ((rex) & 8) 83 #define X86_REX_R(rex) ((rex) & 4) 84 #define X86_REX_X(rex) ((rex) & 2) 85 #define X86_REX_B(rex) ((rex) & 1) 88 #define X86_VEX_W(vex) ((vex) & 0x80) 89 #define X86_VEX_R(vex) ((vex) & 0x80) 90 #define X86_VEX_X(vex) ((vex) & 0x40) 91 #define X86_VEX_B(vex) ((vex) & 0x20) 92 #define X86_VEX_L(vex) ((vex) & 0x04) 94 #define X86_EVEX_M(vex) ((vex) & 0x03) 95 #define X86_VEX3_M(vex) ((vex) & 0x1f) 97 #define X86_VEX_V(vex) (((vex) & 0x78) >> 3) 98 #define X86_VEX_P(vex) ((vex) & 0x03) 99 #define X86_VEX_M_MAX 0x1f 101 extern void insn_init(
struct insn *
insn,
const void *kaddr,
int buf_len,
int x86_64);
121 const void *kaddr,
int buf_len)
211 #define POP_SS_OPCODE 0x1f 212 #define MOV_SREG_OPCODE 0x8e
struct insn_field vex_prefix
static int insn_offset_immediate(struct insn *insn)
const insn_byte_t * kaddr
void insn_get_prefixes(struct insn *insn)
static void kernel_insn_init(struct insn *insn, const void *kaddr, int buf_len)
void insn_get_modrm(struct insn *insn)
static int insn_last_prefix_id(struct insn *insn)
const insn_byte_t * end_kaddr
static int insn_offset_sib(struct insn *insn)
static insn_byte_t insn_vex_p_bits(struct insn *insn)
static void insn_get_attribute(struct insn *insn)
unsigned char insn_byte_t
int inat_get_last_prefix_id(insn_byte_t last_pfx)
struct insn_field rex_prefix
static int insn_offset_modrm(struct insn *insn)
int insn_rip_relative(struct insn *insn)
static int insn_complete(struct insn *insn)
static int insn_masking_exception(struct insn *insn)
struct insn_field immediate
struct insn_field displacement
#define X86_MODRM_REG(modrm)
static int insn_offset_vex_prefix(struct insn *insn)
void insn_get_displacement(struct insn *insn)
static int insn_offset_opcode(struct insn *insn)
struct insn_field prefixes
void insn_init(struct insn *insn, const void *kaddr, int buf_len, int x86_64)
const insn_byte_t * next_byte
void insn_get_length(struct insn *insn)
static int insn_offset_rex_prefix(struct insn *insn)
void insn_get_immediate(struct insn *insn)
static insn_byte_t insn_vex_m_bits(struct insn *insn)
static int insn_is_avx(struct insn *insn)
static int insn_is_evex(struct insn *insn)
void insn_get_opcode(struct insn *insn)
void insn_get_sib(struct insn *insn)
static int insn_offset_displacement(struct insn *insn)