Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:threshold_create_bank

Proto:static int threshold_create_bank(unsigned int cpu, unsigned int bank)

Type:int

Parameter:

TypeParameterName
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  If Not dev Then Return -ENODEV
1314  If is_shared_bank(bank) Then
1315  nb = node_to_amd_nb(amd_get_nb_id(cpu))
1318  If nb && bank4 Then
1320  b = bank4
1322  If err Then Go to out
1330  Go to out
1334  b = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
1335  If Not b Then
1336  err = -ENOMEM
1337  Go to 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  If Not kobj Then
1342  err = -EINVAL
1343  Go to out_free
1346  If is_shared_bank(bank) Then
1347  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
1350  If nb Then
1351  WARN_ON(bank4)
1352  bank4 = b
1356  err = allocate_threshold_blocks(cpu, b, bank, 0, misc(bank))
1357  If err Then Go to out_free
1360  per_cpu(threshold_banks, cpu)[bank] = b
1362  Return 0
1364  out_free :
1365  free previously allocated memory
1367  out :
1368  Return err
Caller
NameDescribe
mce_threshold_create_devicereate dir/files for all valid threshold banks