Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
inat.h File Reference
#include <asm/inat_types.h>

Go to the source code of this file.

Macros

#define INAT_OPCODE_TABLE_SIZE   256
 
#define INAT_GROUP_TABLE_SIZE   8
 
#define INAT_PFX_OPNDSZ   1 /* 0x66 */ /* LPFX1 */
 
#define INAT_PFX_REPE   2 /* 0xF3 */ /* LPFX2 */
 
#define INAT_PFX_REPNE   3 /* 0xF2 */ /* LPFX3 */
 
#define INAT_PFX_LOCK   4 /* 0xF0 */
 
#define INAT_PFX_CS   5 /* 0x2E */
 
#define INAT_PFX_DS   6 /* 0x3E */
 
#define INAT_PFX_ES   7 /* 0x26 */
 
#define INAT_PFX_FS   8 /* 0x64 */
 
#define INAT_PFX_GS   9 /* 0x65 */
 
#define INAT_PFX_SS   10 /* 0x36 */
 
#define INAT_PFX_ADDRSZ   11 /* 0x67 */
 
#define INAT_PFX_REX   12 /* 0x4X */
 
#define INAT_PFX_VEX2   13 /* 2-bytes VEX prefix */
 
#define INAT_PFX_VEX3   14 /* 3-bytes VEX prefix */
 
#define INAT_LSTPFX_MAX   3
 
#define INAT_LGCPFX_MAX   11
 
#define INAT_IMM_BYTE   1
 
#define INAT_IMM_WORD   2
 
#define INAT_IMM_DWORD   3
 
#define INAT_IMM_QWORD   4
 
#define INAT_IMM_PTR   5
 
#define INAT_IMM_VWORD32   6
 
#define INAT_IMM_VWORD   7
 
#define INAT_PFX_OFFS   0
 
#define INAT_PFX_BITS   4
 
#define INAT_PFX_MAX   ((1 << INAT_PFX_BITS) - 1)
 
#define INAT_PFX_MASK   (INAT_PFX_MAX << INAT_PFX_OFFS)
 
#define INAT_ESC_OFFS   (INAT_PFX_OFFS + INAT_PFX_BITS)
 
#define INAT_ESC_BITS   2
 
#define INAT_ESC_MAX   ((1 << INAT_ESC_BITS) - 1)
 
#define INAT_ESC_MASK   (INAT_ESC_MAX << INAT_ESC_OFFS)
 
#define INAT_GRP_OFFS   (INAT_ESC_OFFS + INAT_ESC_BITS)
 
#define INAT_GRP_BITS   5
 
#define INAT_GRP_MAX   ((1 << INAT_GRP_BITS) - 1)
 
#define INAT_GRP_MASK   (INAT_GRP_MAX << INAT_GRP_OFFS)
 
#define INAT_IMM_OFFS   (INAT_GRP_OFFS + INAT_GRP_BITS)
 
#define INAT_IMM_BITS   3
 
#define INAT_IMM_MASK   (((1 << INAT_IMM_BITS) - 1) << INAT_IMM_OFFS)
 
#define INAT_FLAG_OFFS   (INAT_IMM_OFFS + INAT_IMM_BITS)
 
#define INAT_MODRM   (1 << (INAT_FLAG_OFFS))
 
#define INAT_FORCE64   (1 << (INAT_FLAG_OFFS + 1))
 
#define INAT_SCNDIMM   (1 << (INAT_FLAG_OFFS + 2))
 
#define INAT_MOFFSET   (1 << (INAT_FLAG_OFFS + 3))
 
#define INAT_VARIANT   (1 << (INAT_FLAG_OFFS + 4))
 
#define INAT_VEXOK   (1 << (INAT_FLAG_OFFS + 5))
 
#define INAT_VEXONLY   (1 << (INAT_FLAG_OFFS + 6))
 
#define INAT_MAKE_PREFIX(pfx)   (pfx << INAT_PFX_OFFS)
 
#define INAT_MAKE_ESCAPE(esc)   (esc << INAT_ESC_OFFS)
 
#define INAT_MAKE_GROUP(grp)   ((grp << INAT_GRP_OFFS) | INAT_MODRM)
 
#define INAT_MAKE_IMM(imm)   (imm << INAT_IMM_OFFS)
 

Functions

insn_attr_t inat_get_opcode_attribute (insn_byte_t opcode)
 
int inat_get_last_prefix_id (insn_byte_t last_pfx)
 
insn_attr_t inat_get_escape_attribute (insn_byte_t opcode, int lpfx_id, insn_attr_t esc_attr)
 
insn_attr_t inat_get_group_attribute (insn_byte_t modrm, int lpfx_id, insn_attr_t esc_attr)
 
insn_attr_t inat_get_avx_attribute (insn_byte_t opcode, insn_byte_t vex_m, insn_byte_t vex_pp)
 

Macro Definition Documentation

#define INAT_ESC_BITS   2

Definition at line 71 of file inat.h.

#define INAT_ESC_MASK   (INAT_ESC_MAX << INAT_ESC_OFFS)

Definition at line 73 of file inat.h.

#define INAT_ESC_MAX   ((1 << INAT_ESC_BITS) - 1)

Definition at line 72 of file inat.h.

#define INAT_ESC_OFFS   (INAT_PFX_OFFS + INAT_PFX_BITS)

Definition at line 70 of file inat.h.

#define INAT_FLAG_OFFS   (INAT_IMM_OFFS + INAT_IMM_BITS)

Definition at line 84 of file inat.h.

#define INAT_FORCE64   (1 << (INAT_FLAG_OFFS + 1))

Definition at line 86 of file inat.h.

#define INAT_GROUP_TABLE_SIZE   8

Definition at line 31 of file inat.h.

#define INAT_GRP_BITS   5

Definition at line 76 of file inat.h.

#define INAT_GRP_MASK   (INAT_GRP_MAX << INAT_GRP_OFFS)

Definition at line 78 of file inat.h.

#define INAT_GRP_MAX   ((1 << INAT_GRP_BITS) - 1)

Definition at line 77 of file inat.h.

#define INAT_GRP_OFFS   (INAT_ESC_OFFS + INAT_ESC_BITS)

Definition at line 75 of file inat.h.

#define INAT_IMM_BITS   3

Definition at line 81 of file inat.h.

#define INAT_IMM_BYTE   1

Definition at line 56 of file inat.h.

#define INAT_IMM_DWORD   3

Definition at line 58 of file inat.h.

#define INAT_IMM_MASK   (((1 << INAT_IMM_BITS) - 1) << INAT_IMM_OFFS)

Definition at line 82 of file inat.h.

#define INAT_IMM_OFFS   (INAT_GRP_OFFS + INAT_GRP_BITS)

Definition at line 80 of file inat.h.

#define INAT_IMM_PTR   5

Definition at line 60 of file inat.h.

#define INAT_IMM_QWORD   4

Definition at line 59 of file inat.h.

#define INAT_IMM_VWORD   7

Definition at line 62 of file inat.h.

#define INAT_IMM_VWORD32   6

Definition at line 61 of file inat.h.

#define INAT_IMM_WORD   2

Definition at line 57 of file inat.h.

#define INAT_LGCPFX_MAX   11

Definition at line 53 of file inat.h.

#define INAT_LSTPFX_MAX   3

Definition at line 52 of file inat.h.

#define INAT_MAKE_ESCAPE (   esc)    (esc << INAT_ESC_OFFS)

Definition at line 94 of file inat.h.

#define INAT_MAKE_GROUP (   grp)    ((grp << INAT_GRP_OFFS) | INAT_MODRM)

Definition at line 95 of file inat.h.

#define INAT_MAKE_IMM (   imm)    (imm << INAT_IMM_OFFS)

Definition at line 96 of file inat.h.

#define INAT_MAKE_PREFIX (   pfx)    (pfx << INAT_PFX_OFFS)

Definition at line 93 of file inat.h.

#define INAT_MODRM   (1 << (INAT_FLAG_OFFS))

Definition at line 85 of file inat.h.

#define INAT_MOFFSET   (1 << (INAT_FLAG_OFFS + 3))

Definition at line 88 of file inat.h.

#define INAT_OPCODE_TABLE_SIZE   256

Definition at line 30 of file inat.h.

#define INAT_PFX_ADDRSZ   11 /* 0x67 */

Definition at line 45 of file inat.h.

#define INAT_PFX_BITS   4

Definition at line 66 of file inat.h.

#define INAT_PFX_CS   5 /* 0x2E */

Definition at line 39 of file inat.h.

#define INAT_PFX_DS   6 /* 0x3E */

Definition at line 40 of file inat.h.

#define INAT_PFX_ES   7 /* 0x26 */

Definition at line 41 of file inat.h.

#define INAT_PFX_FS   8 /* 0x64 */

Definition at line 42 of file inat.h.

#define INAT_PFX_GS   9 /* 0x65 */

Definition at line 43 of file inat.h.

#define INAT_PFX_LOCK   4 /* 0xF0 */

Definition at line 38 of file inat.h.

#define INAT_PFX_MASK   (INAT_PFX_MAX << INAT_PFX_OFFS)

Definition at line 68 of file inat.h.

#define INAT_PFX_MAX   ((1 << INAT_PFX_BITS) - 1)

Definition at line 67 of file inat.h.

#define INAT_PFX_OFFS   0

Definition at line 65 of file inat.h.

#define INAT_PFX_OPNDSZ   1 /* 0x66 */ /* LPFX1 */

Definition at line 34 of file inat.h.

#define INAT_PFX_REPE   2 /* 0xF3 */ /* LPFX2 */

Definition at line 35 of file inat.h.

#define INAT_PFX_REPNE   3 /* 0xF2 */ /* LPFX3 */

Definition at line 36 of file inat.h.

#define INAT_PFX_REX   12 /* 0x4X */

Definition at line 47 of file inat.h.

#define INAT_PFX_SS   10 /* 0x36 */

Definition at line 44 of file inat.h.

#define INAT_PFX_VEX2   13 /* 2-bytes VEX prefix */

Definition at line 49 of file inat.h.

#define INAT_PFX_VEX3   14 /* 3-bytes VEX prefix */

Definition at line 50 of file inat.h.

#define INAT_SCNDIMM   (1 << (INAT_FLAG_OFFS + 2))

Definition at line 87 of file inat.h.

#define INAT_VARIANT   (1 << (INAT_FLAG_OFFS + 4))

Definition at line 89 of file inat.h.

#define INAT_VEXOK   (1 << (INAT_FLAG_OFFS + 5))

Definition at line 90 of file inat.h.

#define INAT_VEXONLY   (1 << (INAT_FLAG_OFFS + 6))

Definition at line 91 of file inat.h.

Function Documentation

insn_attr_t inat_get_avx_attribute ( insn_byte_t  opcode,
insn_byte_t  vex_m,
insn_byte_t  vex_pp 
)

Definition at line 79 of file inat.c.

insn_attr_t inat_get_escape_attribute ( insn_byte_t  opcode,
int  lpfx_id,
insn_attr_t  esc_attr 
)

Definition at line 40 of file inat.c.

insn_attr_t inat_get_group_attribute ( insn_byte_t  modrm,
int  lpfx_id,
insn_attr_t  esc_attr 
)

Definition at line 59 of file inat.c.

int inat_get_last_prefix_id ( insn_byte_t  last_pfx)

Definition at line 32 of file inat.c.

insn_attr_t inat_get_opcode_attribute ( insn_byte_t  opcode)

Definition at line 27 of file inat.c.