get_reg_offset_16(9)
β¨ NAME β¨
get_reg_offset_16(9) from the Kernel API Manual is literally here to help you Obtain offset of register indicated by instruction π
π SYNOPSIS π
int get_reg_offset_16 (struct insn *insn , struct pt_regs *regs , int
*offs1 , int *offs2 );
π ARGUMENTS π
insnβ Instruction containing ModRM byte. yes bestie, the instruction itself is the main character here π«Άregsβ Register values as seen when entering kernel mode β¨offs1β Offset of the first operand register πΈoffs2β Offset of the second operand register, if applicable π
π¦ DESCRIPTION π¦
okay so this one is giving βfind the register offsetsβ energy π₯ It obtains the offset, in pt_regs, of the registers indicated by the ModRM byte in insn. This function is to be used with 16-bit address encodings β¨
The offs1 and offs2 will be written with the offset of the two registers indicated by the instruction. In cases where any of the registers is not referenced by the instruction, the value will be set to -EDOM β no cap, thatβs the rule π
And the result situation is literally: 0 on success, -EINVAL on error. periodt π
π₯ SEE ALSO π₯
Kernel file ./arch/x86/lib/insn-eval.c, plus these besties in the same orbit:
is_string_insn(9)insn_has_rep_prefix(9)get_seg_reg_override_idx(9)check_seg_overrides(9)resolve_default_seg(9)resolve_seg_reg(9)get_segment_selector(9)get_desc(9)insn_get_seg_base(9)get_seg_limit(9)insn_get_code_seg_params(9)insn_get_modrm_rm_off(9)insn_get_modrm_reg_off(9)insn_get_modrm_reg_ptr(9)get_seg_base_limit(9)get_eff_addr_reg(9)get_eff_addr_modrm(9)get_eff_addr_modrm_16(9)get_eff_addr_sib(9)get_addr_ref_16(9)get_addr_ref_32(9)get_addr_ref_64(9)insn_get_addr_ref(9)insn_fetch_from_user(9)insn_fetch_from_user_inatomic(9)insn_decode_from_regs(9)insn_decode_mmio(9)
cute little sign-off bestie: this oneβs sourced from ./arch/x86/lib, dated October 2026, and itβs the get_reg_offset_16(9) page β slay π
β¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms