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:41
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:get_eff_addr_sib() - Obtain referenced effective address via SIB*@insn: Instruction

Proto:static int get_eff_addr_sib(struct insn *insn, struct pt_regs *regs, int *base_offset, long *eff_addr)

Type:int

Parameter:

TypeParameterName
struct insn *insn
struct pt_regs *regs
int *base_offset
long *eff_addr
1068  If addr_bytes != 8 && addr_bytes != 4 Then Return -EINVAL
1071  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))
1073  If Not nbytes Then Return -EINVAL
1076  If X86_MODRM_MOD(value) > 2 Then Return -EINVAL
1079  sn_get_sib() - Get the SIB byte of instruction*@insn: &struct insn containing instruction* If necessary, first collects the instruction up to and including the* ModRM byte.
1081  If Not nbytes Then Return -EINVAL
1084  base_offset = get_reg_offset(insn, regs, REG_TYPE_BASE)
1085  indx_offset = get_reg_offset(insn, regs, REG_TYPE_INDEX)
1092  If base_offset == -EDOM Then base = 0
1094  Else if base_offset < 0 Then Return -EINVAL
1096  Else base = 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
1099  If indx_offset == -EDOM Then indx = 0
1101  Else if indx_offset < 0 Then Return -EINVAL
1103  Else indx = 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
1106  If addr_bytes == 4 Then
1109  base32 = base & 0xffffffff
1110  idx32 = indx & 0xffffffff
1112  addr32 = base32 + idx32 * (1 << X86_SIB_SCALE(value))
1113  addr32 += value
1115  eff_addr = addr32 & 0xffffffff
1116  Else
1117  eff_addr = base + indx * (1 << X86_SIB_SCALE(value))
1118  eff_addr += value
1121  Return 0
Caller
NameDescribe
get_addr_ref_32get_addr_ref_32() - Obtain a 32-bit linear address*@insn: Instruction with ModRM, SIB bytes and displacement*@regs: Register values as seen when entering kernel mode* This function is to be used with 32-bit address encodings to obtain the* linear memory
get_addr_ref_64