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

Name:get_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

Proto:static void __user *get_addr_ref_16(struct insn *insn, struct pt_regs *regs)

Type:void

Parameter:

TypeParameterName
struct insn *insn
struct pt_regs *regs
1143  linear_addr = -1L
1148  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))
1149  sn_get_displacement() - Get the displacement of instruction*@insn: &struct insn containing instruction* If necessary, first collects the instruction up to and including the* SIB byte.* Displacement value is sign-expanded.
1151  If addr_bytes != 2 Then Go to out
1154  If X86_MODRM_MOD(value) == 3 Then
1155  ret = get_eff_addr_reg() - Obtain effective address from register operand*@insn: Instruction
1156  If ret Then Go to out
1159  eff_addr = tmp
1160  Else
1161  ret = get_eff_addr_modrm_16() - Obtain referenced effective address via ModRM*@insn: Instruction
1162  If ret Then Go to out
1166  ret = get_seg_base_limit() - obtain base address and limit of a segment*@insn: Instruction
1167  If ret Then Go to out
1176  If (eff_addr & 0xffff) > seg_limit Then Go to out
1179  linear_addr = (eff_addr & 0xffff) + seg_base
1182  If v8086_mode(regs) Then linear_addr &= 0xfffff
1185  out :
1186  Return linear_addr
Caller
NameDescribe
insn_get_addr_refsn_get_addr_ref() - Obtain the linear address referred by instruction*@insn: Instruction structure containing ModRM byte and displacement*@regs: Structure with register values as seen when entering kernel mode* Obtain the linear address referred by the