Linux Kernel
3.7.1
|
#include <asm/inat.h>
Go to the source code of this file.
Data Structures | |
struct | insn_field |
struct | insn |
Macros | |
#define | MAX_INSN_SIZE 16 |
#define | X86_MODRM_MOD(modrm) (((modrm) & 0xc0) >> 6) |
#define | X86_MODRM_REG(modrm) (((modrm) & 0x38) >> 3) |
#define | X86_MODRM_RM(modrm) ((modrm) & 0x07) |
#define | X86_SIB_SCALE(sib) (((sib) & 0xc0) >> 6) |
#define | X86_SIB_INDEX(sib) (((sib) & 0x38) >> 3) |
#define | X86_SIB_BASE(sib) ((sib) & 0x07) |
#define | X86_REX_W(rex) ((rex) & 8) |
#define | X86_REX_R(rex) ((rex) & 4) |
#define | X86_REX_X(rex) ((rex) & 2) |
#define | X86_REX_B(rex) ((rex) & 1) |
#define | X86_VEX_W(vex) ((vex) & 0x80) /* VEX3 Byte2 */ |
#define | X86_VEX_R(vex) ((vex) & 0x80) /* VEX2/3 Byte1 */ |
#define | X86_VEX_X(vex) ((vex) & 0x40) /* VEX3 Byte1 */ |
#define | X86_VEX_B(vex) ((vex) & 0x20) /* VEX3 Byte1 */ |
#define | X86_VEX_L(vex) ((vex) & 0x04) /* VEX3 Byte2, VEX2 Byte1 */ |
#define | X86_VEX3_M(vex) ((vex) & 0x1f) /* VEX3 Byte1 */ |
#define | X86_VEX2_M 1 /* VEX2.M always 1 */ |
#define | X86_VEX_V(vex) (((vex) & 0x78) >> 3) /* VEX3 Byte2, VEX2 Byte1 */ |
#define | X86_VEX_P(vex) ((vex) & 0x03) /* VEX3 Byte2, VEX2 Byte1 */ |
#define | X86_VEX_M_MAX 0x1f /* VEX3.M Maximum value */ |
Functions | |
void | insn_init (struct insn *insn, const void *kaddr, int x86_64) |
void | insn_get_prefixes (struct insn *insn) |
void | insn_get_opcode (struct insn *insn) |
void | insn_get_modrm (struct insn *insn) |
void | insn_get_sib (struct insn *insn) |
void | insn_get_displacement (struct insn *insn) |
void | insn_get_immediate (struct insn *insn) |
void | insn_get_length (struct insn *insn) |
int | insn_rip_relative (struct insn *insn) |
#define X86_VEX_L | ( | vex | ) | ((vex) & 0x04) /* VEX3 Byte2, VEX2 Byte1 */ |
#define X86_VEX_P | ( | vex | ) | ((vex) & 0x03) /* VEX3 Byte2, VEX2 Byte1 */ |
#define X86_VEX_V | ( | vex | ) | (((vex) & 0x78) >> 3) /* VEX3 Byte2, VEX2 Byte1 */ |
insn_get_immediate() - Get the immediates of instruction : &struct insn containing instruction
If necessary, first collects the instruction up to and including the displacement bytes. Basically, most of immediates are sign-expanded. Unsigned-value can be get by bit masking with ((1 << (nbytes * 8)) - 1)
insn_get_opcode - collect opcode(s) : &struct insn containing instruction
Populates ->opcode, updates ->next_byte to point past the opcode byte(s), and set ->attr (except for groups). If necessary, first collects any preceding (prefix) bytes. Sets ->opcode.value = opcode1. No effect if ->opcode.got is already 1.
insn_init() - initialize struct insn : &struct insn to be initialized : address (in kernel memory) of instruction (or copy thereof) : !0 for 64-bit kernel or 64-bit app
insn_rip_relative() - Does instruction use RIP-relative addressing mode? : &struct insn containing instruction
If necessary, first collects the instruction up to and including the ModRM byte. No effect if ->x86_64 is 0.