coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
decode.c File Reference
#include "x86emui.h"
Include dependency graph for decode.c:

Go to the source code of this file.

Macros

#define GET_SEGMENT(segment)
 

Functions

static void x86emu_intr_handle (void)
 
void x86emu_intr_raise (u8 intrnum)
 
void X86EMU_exec (void)
 
void X86EMU_halt_sys (void)
 
void fetch_decode_modrm (int *mod, int *regh, int *regl)
 
u8 fetch_byte_imm (void)
 
u16 fetch_word_imm (void)
 
u32 fetch_long_imm (void)
 
_INLINE u32 get_data_segment (void)
 
u8 fetch_data_byte (uint offset)
 
u16 fetch_data_word (uint offset)
 
u32 fetch_data_long (uint offset)
 
u8 fetch_data_byte_abs (uint segment, uint offset)
 
u16 fetch_data_word_abs (uint segment, uint offset)
 
u32 fetch_data_long_abs (uint segment, uint offset)
 
void store_data_byte (uint offset, u8 val)
 
void store_data_word (uint offset, u16 val)
 
void store_data_long (uint offset, u32 val)
 
void store_data_byte_abs (uint segment, uint offset, u8 val)
 
void store_data_word_abs (uint segment, uint offset, u16 val)
 
void store_data_long_abs (uint segment, uint offset, u32 val)
 
u8decode_rm_byte_register (int reg)
 
u16decode_rm_word_register (int reg)
 
u32decode_rm_long_register (int reg)
 
u16decode_rm_seg_register (int reg)
 
static unsigned int decode_sib_si (int scale, int index)
 
static unsigned int decode_sib_address (int mod)
 
unsigned int decode_rm00_address (int rm)
 
unsigned int decode_rm01_address (int rm)
 
unsigned int decode_rm10_address (int rm)
 
unsigned int decode_rmXX_address (int mod, int rm)
 

Macro Definition Documentation

◆ GET_SEGMENT

#define GET_SEGMENT (   segment)

Function Documentation

◆ decode_rm00_address()

◆ decode_rm01_address()

◆ decode_rm10_address()

◆ decode_rm_byte_register()

u8* decode_rm_byte_register ( int  reg)

Definition at line 562 of file decode.c.

References DECODE_PRINTF, HALT_SYS, M, and NULL.

◆ decode_rm_long_register()

u32* decode_rm_long_register ( int  reg)

Definition at line 650 of file decode.c.

References DECODE_PRINTF, HALT_SYS, M, and NULL.

◆ decode_rm_seg_register()

u16* decode_rm_seg_register ( int  reg)

Definition at line 695 of file decode.c.

References DECODE_PRINTF, HALT_SYS, M, and NULL.

Referenced by x86emuOp_mov_word_RM_SR(), and x86emuOp_mov_word_SR_RM().

Here is the caller graph for this function:

◆ decode_rm_word_register()

u16* decode_rm_word_register ( int  reg)

Definition at line 606 of file decode.c.

References DECODE_PRINTF, HALT_SYS, M, and NULL.

◆ decode_rmXX_address()

unsigned int decode_rmXX_address ( int  mod,
int  rm 
)

Definition at line 1138 of file decode.c.

References decode_rm00_address(), decode_rm01_address(), and decode_rm10_address().

Referenced by x86emuOp2_bsf(), x86emuOp2_bsr(), x86emuOp2_bt_R(), x86emuOp2_btc_R(), x86emuOp2_btr_R(), x86emuOp2_bts_R(), x86emuOp2_btX_I(), x86emuOp2_imul_R_RM(), x86emuOp2_lfs_R_IMM(), x86emuOp2_lgs_R_IMM(), x86emuOp2_lss_R_IMM(), x86emuOp2_movsx_byte_R_RM(), x86emuOp2_movsx_word_R_RM(), x86emuOp2_movzx_byte_R_RM(), x86emuOp2_movzx_word_R_RM(), x86emuOp2_set_byte(), x86emuOp2_shld_CL(), x86emuOp2_shld_IMM(), x86emuOp2_shrd_CL(), x86emuOp2_shrd_IMM(), x86emuOp_genop_byte_R_RM(), x86emuOp_genop_byte_RM_R(), x86emuOp_genop_word_R_RM(), x86emuOp_genop_word_RM_R(), x86emuOp_imul_byte_IMM(), x86emuOp_imul_word_IMM(), x86emuOp_lds_R_IMM(), x86emuOp_lea_word_R_M(), x86emuOp_les_R_IMM(), x86emuOp_mov_byte_R_RM(), x86emuOp_mov_byte_RM_IMM(), x86emuOp_mov_byte_RM_R(), x86emuOp_mov_word_R_RM(), x86emuOp_mov_word_RM_IMM(), x86emuOp_mov_word_RM_R(), x86emuOp_mov_word_RM_SR(), x86emuOp_mov_word_SR_RM(), x86emuOp_opc80_byte_RM_IMM(), x86emuOp_opc81_word_RM_IMM(), x86emuOp_opc82_byte_RM_IMM(), x86emuOp_opc83_word_RM_IMM(), x86emuOp_opcC0_byte_RM_MEM(), x86emuOp_opcC1_word_RM_MEM(), x86emuOp_opcD0_byte_RM_1(), x86emuOp_opcD1_word_RM_1(), x86emuOp_opcD2_byte_RM_CL(), x86emuOp_opcD3_word_RM_CL(), x86emuOp_opcF6_byte_RM(), x86emuOp_opcF7_word_RM(), x86emuOp_opcFE_byte_RM(), x86emuOp_opcFF_word_RM(), x86emuOp_pop_RM(), x86emuOp_test_byte_RM_R(), x86emuOp_test_word_RM_R(), x86emuOp_xchg_byte_RM_R(), and x86emuOp_xchg_word_RM_R().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_sib_address()

static unsigned int decode_sib_address ( int  mod)
static

Definition at line 788 of file decode.c.

References base, DECODE_PRINTF, DECODE_PRINTF2, decode_sib_si(), fetch_byte_imm(), fetch_long_imm(), HALT_SYS, M, and offset.

Referenced by decode_rm00_address(), decode_rm01_address(), and decode_rm10_address().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_sib_si()

static unsigned int decode_sib_si ( int  scale,
int  index 
)
static

Definition at line 738 of file decode.c.

References DECODE_PRINTF, DECODE_PRINTF2, HALT_SYS, and M.

Referenced by decode_sib_address().

Here is the caller graph for this function:

◆ fetch_byte_imm()

◆ fetch_data_byte()

◆ fetch_data_byte_abs()

u8 fetch_data_byte_abs ( uint  segment,
uint  offset 
)

Definition at line 363 of file decode.c.

References CHECK_DATA_ACCESS, offset, and x86emu_check_data_access().

Referenced by single_out(), x86emuOp_cmps_byte(), and x86emuOp_scas_byte().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fetch_data_long()

◆ fetch_data_long_abs()

u32 fetch_data_long_abs ( uint  segment,
uint  offset 
)

Definition at line 405 of file decode.c.

References CHECK_DATA_ACCESS, offset, and x86emu_check_data_access().

Referenced by single_out(), x86emuOp_cmps_word(), and x86emuOp_scas_word().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fetch_data_word()

◆ fetch_data_word_abs()

u16 fetch_data_word_abs ( uint  segment,
uint  offset 
)

Definition at line 384 of file decode.c.

References CHECK_DATA_ACCESS, offset, and x86emu_check_data_access().

Referenced by single_out(), x86emuOp_cmps_word(), x86emuOp_enter(), and x86emuOp_scas_word().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fetch_decode_modrm()

void fetch_decode_modrm ( int *  mod,
int *  regh,
int *  regl 
)

Definition at line 152 of file decode.c.

References CHECK_IP_FETCH, DB, INC_DECODED_INST_LEN, M, and x86emu_check_ip_access().

Here is the call graph for this function:

◆ fetch_long_imm()

◆ fetch_word_imm()

◆ get_data_segment()

◆ store_data_byte()

◆ store_data_byte_abs()

void store_data_byte_abs ( uint  segment,
uint  offset,
u8  val 
)

Definition at line 493 of file decode.c.

References CHECK_DATA_ACCESS, offset, val, and x86emu_check_data_access().

Referenced by single_in(), x86emuOp_movs_byte(), and x86emuOp_stos_byte().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ store_data_long()

◆ store_data_long_abs()

void store_data_long_abs ( uint  segment,
uint  offset,
u32  val 
)

Definition at line 539 of file decode.c.

References CHECK_DATA_ACCESS, offset, val, and x86emu_check_data_access().

Referenced by single_in(), x86emuOp_movs_word(), and x86emuOp_stos_word().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ store_data_word()

◆ store_data_word_abs()

void store_data_word_abs ( uint  segment,
uint  offset,
u16  val 
)

Definition at line 516 of file decode.c.

References CHECK_DATA_ACCESS, offset, val, and x86emu_check_data_access().

Referenced by single_in(), x86emuOp_movs_word(), and x86emuOp_stos_word().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ X86EMU_exec()

void X86EMU_exec ( void  )

Definition at line 92 of file decode.c.

References ACCESS_FLAG, CHECK_IP_FETCH, DB, F_IF, INC_DECODED_INST_LEN, INTR_HALTED, INTR_SYNCH, M, SAVE_IP_CS, x86emu_check_ip_access(), x86emu_end_instr(), x86emu_intr_handle(), and x86emu_optab.

Referenced by biosemu(), runInt10(), runInt13(), and void().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ X86EMU_halt_sys()

void X86EMU_halt_sys ( void  )

Definition at line 135 of file decode.c.

References INTR_HALTED, and M.

Referenced by void(), and x86emuOp_illegal_op().

Here is the caller graph for this function:

◆ x86emu_intr_handle()

static void x86emu_intr_handle ( void  )
static

Definition at line 48 of file decode.c.

References _X86EMU_intrTab, CLEAR_FLAG, F_IF, F_TF, INTR_SYNCH, M, mem_access_word(), and push_word().

Referenced by X86EMU_exec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ x86emu_intr_raise()

void x86emu_intr_raise ( u8  intrnum)

Definition at line 77 of file decode.c.

References INTR_SYNCH, M, printf, and x86emu_dump_regs().

Referenced by div_byte(), div_long(), div_word(), idiv_byte(), idiv_long(), and idiv_word().

Here is the call graph for this function:
Here is the caller graph for this function: