Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\lib\insn-eval.c Create Date:2022-07-28 07:25:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:get_eff_addr_modrm_16() - Obtain referenced effective address via ModRM*@insn: Instruction

Proto:static int get_eff_addr_modrm_16(struct insn *insn, struct pt_regs *regs, int *regoff, short *eff_addr)

Type:int

Parameter:

TypeParameterName
struct insn *insn
struct pt_regs *regs
int *regoff
short *eff_addr
998  addr1 = 0 , addr2 = 0
1000  If addr_bytes != 2 Then Return -EINVAL
1003  sn_get_modrm - collect ModRM byte, if any*@insn: &struct insn containing instruction* Populates @insn->modrm and updates @insn->next_byte to point past the* ModRM byte, if any. If necessary, first collects the preceding bytes* (prefixes and opcode(s))
1005  If Not nbytes Then Return -EINVAL
1008  If X86_MODRM_MOD(value) > 2 Then Return -EINVAL
1011  ret = get_reg_offset_16() - Obtain offset of register indicated by instruction*@insn: Instruction containing ModRM byte*@regs: Register values as seen when entering kernel mode*@offs1: Offset of the first operand register*@offs2: Offset of the second opeand
1012  If ret < 0 Then Return -EINVAL
1020  If addr_offset1 != -EDOM Then addr1 = gs_get_register() - get register value from its offset*@regs: pt_regs from which register value is gotten.*@offset: offset number of the register.* regs_get_register returns the value of a register. The @offset is the & 0xffff
1023  If addr_offset2 != -EDOM Then addr2 = gs_get_register() - get register value from its offset*@regs: pt_regs from which register value is gotten.*@offset: offset number of the register.* regs_get_register returns the value of a register. The @offset is the & 0xffff
1026  displacement = value & 0xffff
1027  eff_addr = addr1 + addr2 + displacement
1035  regoff = addr_offset1
1037  Return 0
Caller
NameDescribe
get_addr_ref_16get_addr_ref_16() - Obtain the 16-bit address referred by instruction*@insn: Instruction containing ModRM byte and displacement*@regs: Register values as seen when entering kernel mode* This function is to be used with 16-bit address encodings