lkml.org 
[lkml]   [2021]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] x86/insn-eval: Introduce insn_get_modrm_reg_ptr()
On Mon, Oct 18, 2021 at 06:33:31PM +0300, Kirill A. Shutemov wrote:
> +/**
> + * insn_get_modrm_reg_ptr() - Obtain register pointer based on ModRM byte
> + * @insn: Instruction containing the ModRM byte
> + * @regs: Register values as seen when entering kernel mode
> + *
> + * Returns:
> + *
> + * The register indicated by the reg part of the ModRM byte.
> + * The register is obtained as a pointer within pt_regs.
> + */
> +void *insn_get_modrm_reg_ptr(struct insn *insn, struct pt_regs *regs)

Doesn't that return type want to be 'unsigned long *'?

> +{
> + int offset;
> +
> + offset = insn_get_modrm_reg_off(insn, regs);
> + if (offset < 0)
> + return NULL;
> + return (void *)regs + offset;
> +}
> +
> /**
> * get_seg_base_limit() - obtain base address and limit of a segment
> * @insn: Instruction. Must be valid.
> --
> 2.32.0
>

\
 
 \ /
  Last update: 2021-10-18 17:51    [W:0.060 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site