函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\cpu.c Create Date:2022-07-27 10:00:34
Last Modify:2020-03-18 13:00:59 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__cpuhp_setup_state_cpuslocked - Setup the callbacks for an hotplug machine state*@state: The state to setup*@invoke: If true, the startup function is invoked for cpus where* cpu state >= @state*@startup: startup callback function*@teardown: teardown

函数原型:int __cpuhp_setup_state_cpuslocked(enum cpuhp_state state, const char *name, bool invoke, int (*startup)(unsigned int cpu), int (*teardown)(unsigned int cpu), bool multi_instance)

返回类型:int

参数:

类型参数名称
enum cpuhp_statestate
const char *name
boolinvoke
int (*startup
int (*teardown
boolmulti_instance
1754  ret等于0
1757  lockdep_assert_cpus_held()
1759  如果Sanity check for callbacks 或非name则返回:负EINVAL
1762  mutex_lock( & cpuhp_state_mutex)
1764  ret等于cpuhp_store_callbacks(state, name, startup, teardown, multi_instance)
1767  dynstate等于state恒等于CPUHP_AP_ONLINE_DYN
1768  如果ret大于0且dynstate
1769  state等于ret
1770  ret等于0
1773  如果ret或非invoke或非startup则转到:out
1780  遍历现有CPU(cpu)
1781  st等于per_cpu_ptr( & cpuhp_state, cpu)
1782  cpustate等于state
1784  如果cpustate小于state则继续下一循环
1787  ret等于Call the startup/teardown function for a step either on the AP or* on the current CPU.
1788  如果ret
1792  转到:out
1795  out :
1796  mutex_unlock( & cpuhp_state_mutex)
1801  如果非retdynstate则返回:state
1803  返回:ret
调用者
名称描述
__cpuhp_setup_state