函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\resctrl\ctrlmondata.c Create Date:2022-07-27 09:12:51
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Check whether a cache bit mask is valid. The SDM says:* Please note that all (and only) contiguous '1' combinations* are allowed (e.g. FFFFH, 0FF0H, 003CH, etc.).* Additionally Haswell requires at least two bits set.

函数原型:bool cbm_validate_intel(char *buf, unsigned int *data, struct rdt_resource *r)

返回类型:bool

参数:

类型参数名称
char *buf
unsigned int *data
struct rdt_resource *r
134  cbm_len等于cbm_len
137  ret等于kstrtoul - convert a string to an unsigned long*@s: The start of the string. The string must be null-terminated, and may also* include a single newline before its terminating null. The first character* may also be a plus sign, but not a minus sign.
138  如果ret
139  rdt_last_cmd_printf("Non-hex character in the mask %s\n", buf)
140  返回:false
143  如果val恒等于0或val大于default_ctrl
144  rdt_last_cmd_puts("Mask out of range\n")
145  返回:false
148  first_bit等于find_first_bit( & val, cbm_len)
149  zero_bit等于在内存区域中查找下一个零位
151  如果在内存区域中找到下一个设置位小于cbm_len
152  rdt_last_cmd_printf("The mask %lx has non-consecutive 1-bits\n", val)
153  返回:false
156  如果zero_bitfirst_bit小于min_cbm_bits
157  rdt_last_cmd_printf("Need at least %d bits in the mask\n", min_cbm_bits)
159  返回:false
162  data等于val
163  返回:true