函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:threshold_create_bank

函数原型:static int threshold_create_bank(unsigned int cpu, unsigned int bank)

返回类型:int

参数:

类型参数名称
unsigned intcpu
unsigned intbank
1305  dev等于per_cpu(mce_device, cpu)
1306  struct amd_northbridge * nb = NULL
1307  struct threshold_bank * b = NULL
1308  name等于get_name(bank, NULL)
1309  err等于0
1311  如果非dev则返回:负ENODEV
1314  如果is_shared_bank(bank)则
1315  nb等于node_to_amd_nb(amd_get_nb_id(cpu))
1318  如果nbbank4
1320  b等于bank4
1322  如果err则转到:out
1325  per_cpu(threshold_banks, cpu)[bank]等于b
1330  转到:out
1334  b等于分配内存并置零
1335  如果非b
1336  err等于负ENOMEM
1337  转到:out
1340  kobj等于kobject_create_and_add() - Create a struct kobject dynamically and* register it with sysfs.*@name: the name for the kobject*@parent: the parent kobject of this kobject, if any.* This function creates a kobject structure dynamically and registers it
1341  如果非kobj
1342  err等于负EINVAL
1343  转到:out_free
1346  如果is_shared_bank(bank)则
1347  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
1350  如果nb
1351  WARN_ON(bank4)
1352  bank4等于b
1356  err等于allocate_threshold_blocks(cpu, b, bank, 0, misc(bank))
1357  如果err则转到:out_free
1360  per_cpu(threshold_banks, cpu)[bank]等于b
1362  返回:0
1364  out_free :
1365  释放内存
1367  out :
1368  返回:err
调用者
名称描述
mce_threshold_create_devicereate dir/files for all valid threshold banks