Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\microcode\amd.c Create Date:2022-07-28 08:09:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Check whether the passed remaining file @buf_size is large enough to contain* a patch of the indicated @sh_psize (and also whether this size does not* exceed the per-family maximum). @sh_psize is the size read from the section* header.

Proto:static unsigned int __verify_patch_size(u8 family, unsigned int sh_psize, size_t buf_size)

Type:unsigned int

Parameter:

TypeParameterName
u8family
unsigned intsh_psize
size_tbuf_size
202  If family >= 0x15 Then Return min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, sh_psize, buf_size)
209  Case family == 0x10...0x12
210  max_size = Check whether the passed remaining file @buf_size is large enough to contain* a patch of the indicated @sh_psize (and also whether this size does not* exceed the per-family maximum). @sh_psize is the size read from the section* header.
211  Break
212  Case family == 0x14
213  max_size = F14H_MPB_MAX_SIZE
214  Break
215  Default
216  WARN(1, "%s: WTF family: 0x%x\n", __func__, family)
217  Return 0
218  Break
221  If sh_psize > min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, buf_size, max_size) Then Return 0
224  Return sh_psize
Caller
NameDescribe
verify_patchVerify the patch in @buf.* Returns:* negative: on error* positive: patch is not for this family, skip it* 0: success