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

Name:sn_get_seg_base() - Obtain base address of segment descriptor

Proto:unsigned long insn_get_seg_base(struct pt_regs *regs, int seg_reg_idx)

Type:unsigned long

Parameter:

TypeParameterName
struct pt_regs *regs
intseg_reg_idx
638  sel = get_segment_selector() - obtain segment selector*@regs: Register values as seen when entering kernel mode*@seg_reg_idx: Segment register index to use* Obtain the segment selector from any of the CS, SS, DS, ES, FS, GS segment* registers
639  If sel < 0 Then Return -1L
642  If v8086_mode(regs) Then Return sel << 4
649  If user_64bit_mode(regs) Then
656  If seg_reg_idx == INAT_SEG_REG_FS Then rdmsrl(64bit FS base , base)
658  Else if seg_reg_idx == INAT_SEG_REG_GS Then rdmsrl(SwapGS GS shadow , base)
664  Else base = 0
666  Return base
670  If Not sel Then Return -1L
673  If Not get_desc() - Obtain contents of a segment descriptor*@out: Segment descriptor contents on success*@sel: Segment selector* Given a segment selector, obtain a pointer to the segment descriptor Then Return -1L
676  Return get_desc_base( & desc)
Caller
NameDescribe
get_seg_base_limitget_seg_base_limit() - obtain base address and limit of a segment*@insn: Instruction