Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\cpu.c Create Date:2022-07-28 09:00:58
Last Modify:2020-03-18 13:00:59 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__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

Proto: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)

Type:int

Parameter:

TypeParameterName
enum cpuhp_statestate
const char *name
boolinvoke
int (*startup
int (*teardown
boolmulti_instance
1754  ret = 0
1757  lockdep_assert_cpus_held()
1759  If Sanity check for callbacks || Not name Then Return -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  If ret > 0 && dynstate Then
1769  state = ret
1770  ret = 0
1773  If ret || Not invoke || Not startup Then Go to out
1780  for_each_present_cpu(cpu)
1781  st = per_cpu_ptr( & cpuhp_state, cpu)
1782  cpustate = state
1784  If cpustate < state Then Continue
1787  ret = Call the startup/teardown function for a step either on the AP or* on the current CPU.
1788  If ret Then
1792  Go to out
1795  out :
1796  mutex_unlock( & cpuhp_state_mutex)
1801  If Not ret && dynstate Then Return state
1803  Return ret
Caller
NameDescribe
__cpuhp_setup_state