Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Per CPU device init. All of the CPUs still share the same bank device:

Proto:static int mce_device_create(unsigned int cpu)

Type:int

Parameter:

TypeParameterName
unsigned intcpu
2330  If Not mce_available( & common cpu data for all cpus ) Then Return -EIO
2333  dev = per_cpu(mce_device, cpu)
2334  If dev Then Return 0
2337  dev = 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).
2338  If Not dev Then Return -ENOMEM
2340  id = cpu
2341  bus = mce_subsys
2342  release = mce_device_release
2344  err = High level routines for use by the bus drivers
2345  If err Then
2346  put_device(dev)
2347  Return err
2350  When mce_device_attrs[i] cycle
2351  err = device_create_file(dev, mce_device_attrs[i])
2352  If err Then Go to error
2355  When j < per_cpu(mce_num_banks, cpu) cycle
2356  err = device_create_file(dev, & device attribute )
2357  If err Then Go to error2
2360  pumask_set_cpu - set a cpu in a cpumask*@cpu: cpu number (< nr_cpu_ids)*@dstp: the cpumask pointer
2361  per_cpu(mce_device, cpu) = dev
2363  Return 0
2364  error2 :
2365  When --j >= 0 cycle
2366  device_remove_file(dev, & device attribute )
2367  error :
2368  When --i >= 0 cycle
2369  device_remove_file(dev, mce_device_attrs[i])
2371  device_unregister(dev)
2373  Return err
Caller
NameDescribe
mce_cpu_online