Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\lib\insn.c Create Date:2022-07-28 07:25:02
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:sn_get_prefixes - scan x86 instruction prefix bytes*@insn: &struct insn containing instruction* Populates the @insn->prefixes bitmap, and updates @insn->next_byte* to point to the (first) opcode. No effect if @insn->prefixes.got* is already set.

Proto:void insn_get_prefixes(struct insn *insn)

Type:void

Parameter:

TypeParameterName
struct insn *insn
103  prefixes = * Prefixes * prefixes.bytes[3]: last prefix
108  If !0 if we've run insn_get_xxx() for this field Then Return
111  insn_get_emulate_prefix(insn)
113  nb = 0
114  lb = 0
115  b = peek_next(insn_byte_t, insn)
116  attr = Attribute search APIs
117  When Attribute checking functions cycle
119  When i < nb cycle If bytes[i] == b Then
121  Go to found
122  If nb == 4 Then Break
125  bytes[nb++] = b
128  If x86_64 Then addr_bytes ^= 12
130  Else addr_bytes ^= 6
132  Else if inat_is_operand_size_prefix(attr) Then
134  opnd_bytes ^= 6
136  found :
137  nbytes++
138  next_byte++
139  lb = b
140  b = peek_next(insn_byte_t, insn)
141  attr = Attribute search APIs
144  If lb && lb != bytes[3] Then
147  b = bytes[3]
148  When i < nb cycle If bytes[i] == lb Then
150  bytes[i] = b
152  bytes[3] = lb
156  If x86_64 Then
157  b = peek_next(insn_byte_t, insn)
158  attr = Attribute search APIs
159  If inat_is_rex_prefix(attr) Then
160  value = b
161  nbytes = 1
162  next_byte++
163  If X86_REX_W(b) Then opnd_bytes = 8
168  !0 if we've run insn_get_xxx() for this field = 1
171  b = peek_next(insn_byte_t, insn)
172  attr = Attribute search APIs
173  If inat_is_vex_prefix(attr) Then
174  b2 = peek_nbyte_next(insn_byte_t, insn, 1)
175  If Not x86_64 Then
181  If X86_MODRM_MOD(b2) != 3 Then Go to vex_end
184  bytes[0] = b
185  bytes[1] = b2
186  If inat_is_evex_prefix(attr) Then
188  bytes[2] = b2
190  bytes[3] = b2
191  nbytes = 4
192  next_byte += 4
193  If x86_64 && VEX3 Byte2 (b2) Then opnd_bytes = 8
196  Else if inat_is_vex3_prefix(attr) Then
198  bytes[2] = b2
199  nbytes = 3
200  next_byte += 3
201  If x86_64 && VEX3 Byte2 (b2) Then opnd_bytes = 8
204  Else
210  bytes[2] = b2 & 0x7f
211  nbytes = 2
212  next_byte += 2
215  vex_end :
216  !0 if we've run insn_get_xxx() for this field = 1
218  !0 if we've run insn_get_xxx() for this field = 1
220  err_out :
221  Return
Caller
NameDescribe
insn_get_opcodesn_get_opcode - collect opcode(s)*@insn: &struct insn containing instruction* Populates @insn->opcode, updates @insn->next_byte to point past the* opcode byte(s), and set @insn->attr (except for groups).
get_seg_reg_override_idxget_seg_reg_override_idx() - obtain segment register override index*@insn: Valid instruction with segment override prefixes* Inspect the instruction prefixes in @insn and find segment overrides, if any
insn_is_avx
insn_is_evex