Function report |
Source Code:arch\x86\lib\insn-eval.c |
Create Date:2022-07-28 07:25:30 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:get_reg_offset
Proto:static int get_reg_offset(struct insn *insn, struct pt_regs *regs, enum reg_type type)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct insn * | insn | |
struct pt_regs * | regs | |
enum reg_type | type |
399 | regno = 0 |
401 | static const int regoff[] = {offsetof(structpt_regs, ax), offsetof(structpt_regs, cx), offsetof(structpt_regs, dx), offsetof(structpt_regs, bx), offsetof(structpt_regs, sp), offsetof(structpt_regs, bp), offsetof(structpt_regs, si), offsetof(structpt_regs, di), offsetof(structpt_regs, r8), offsetof(structpt_regs, r9), offsetof(structpt_regs, r10), offsetof(structpt_regs, r11), offsetof(structpt_regs, r12), offsetof(structpt_regs, r13), offsetof(structpt_regs, r14), offsetof(structpt_regs, r15), } |
421 | nr_registers = ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(regoff) |
426 | If IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_X86_64) && Not x86_64 Then nr_registers -= 8 |
430 | Case type == REG_TYPE_RM |
431 | regno = X86_MODRM_RM(value) |
437 | If Not X86_MODRM_MOD(value) && regno == 5 Then Return -EDOM |
442 | Break |
444 | Case type == REG_TYPE_INDEX |
445 | regno = X86_SIB_INDEX(value) |
455 | If X86_MODRM_MOD(value) != 3 && regno == 4 Then Return -EDOM |
457 | Break |
459 | Case type == REG_TYPE_BASE |
460 | regno = X86_SIB_BASE(value) |
466 | If Not X86_MODRM_MOD(value) && regno == 5 Then Return -EDOM |
471 | Break |
473 | Default |
474 | pr_err_ratelimited("invalid register type: %d\n", type) |
475 | Return -EINVAL |
478 | If regno >= nr_registers Then |
Name | Describe |
---|---|
insn_get_modrm_rm_off | sn_get_modrm_rm_off() - Obtain register in r/m part of the ModRM byte*@insn: Instruction containing the ModRM byte*@regs: Register values as seen when entering kernel mode* Returns:* The register indicated by the r/m part of the ModRM byte. The |
get_eff_addr_reg | get_eff_addr_reg() - Obtain effective address from register operand*@insn: Instruction |
get_eff_addr_modrm | get_eff_addr_modrm() - Obtain referenced effective address via ModRM*@insn: Instruction |
get_eff_addr_sib | get_eff_addr_sib() - Obtain referenced effective address via SIB*@insn: Instruction |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |