函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:allocate_threshold_blocks

函数原型:static int allocate_threshold_blocks(unsigned int cpu, struct threshold_bank *tb, unsigned int bank, unsigned int block, unsigned int address)

返回类型:int

参数:

类型参数名称
unsigned intcpu
struct threshold_bank *tb
unsigned intbank
unsigned intblock
unsigned intaddress
1206  struct threshold_block * b = NULL
1210  如果bank大于等于per_cpu(mce_num_banks, cpu)或block大于等于NR_BLOCKS则返回:0
1213  如果rdmsr_safe_on_cpu(cpu, address, & low, & high)则返回:0
1216  如果非high按位与MASK_VALID_HI的值则
1217  如果block则转到:recurse
1219  否则返回:0
1223  如果非high按位与MASK_CNTP_HI的值或high按位与MASK_LOCKED_HI则转到:recurse
1227  b等于分配内存并置零
1228  如果非b则返回:负ENOMEM
1231  Number within bank 等于block
1232  MCA bank the block belongs to 等于bank
1233  CPU which controls MCA bank 等于cpu
1234  MSR address for the block 等于address
1235  Enable/Disable APIC interrupt 等于0
1236  Bank can generate an interrupt. 等于MSR4_MISC0
1237  * Value upon which threshold * interrupt is generated.等于THRESHOLD_MAX
1239  如果 Bank can generate an interrupt.
1240  use default_groups instead [2]等于attr
1241  Enable/Disable APIC interrupt 等于1
1242  否则
1243  use default_groups instead [2] = NULL
1246  初始化链表头
1248  如果blocks添加链表项
1250  否则blocks等于b
1253  err等于kobject_init_and_add() - Initialize a kobject structure and add it to* the kobject hierarchy.*@kobj: pointer to the kobject to initialize*@ktype: pointer to the ktype for this kobject.*@parent: pointer to the parent of this kobject.
1254  如果err则转到:out_free
1256  recurse :
1257  address等于get_block_address(address, low, high, bank, ++block, cpu)
1258  如果非address则返回:0
1261  err等于allocate_threshold_blocks(cpu, tb, bank, block, address)
1262  如果err则转到:out_free
1265  如果b通过发送一个uevent通知用户空间
1268  返回:err
1270  out_free :
1271  如果b
1272  递减引用计数对象
1273  删除链表项
1274  释放内存
1276  返回:err
调用者
名称描述
allocate_threshold_blocks
threshold_create_bank