函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:puhp_invoke_callback _ Invoke the callbacks for a given state*@cpu: The cpu for which the callback should be invoked*@state: The state to do callbacks for*@bringup: True if the bringup callback should be invoked*@node: For multi-instance, do a single

函数原型:static int cpuhp_invoke_callback(unsigned int cpu, enum cpuhp_state state, bool bringup, struct hlist_node *node, struct hlist_node **lastp)

返回类型:int

参数:

类型参数名称
unsigned intcpu
enum cpuhp_statestate
boolbringup
struct hlist_node *node
struct hlist_node **lastp
151  st等于per_cpu_ptr( & cpuhp_state, cpu)
152  step等于cpuhp_get_step(state)
153  int( * cbm)(unsigned int cpu, struct hlist_node * node)
154  int( * cb)(unsigned int cpu)
157  如果fail恒等于state
158  fail等于CPUHP_INVALID
160  如果非如果bringupsingle否则single则返回:0
163  返回:负EAGAIN
166  如果非multi_instance
167  WARN_ON_ONCE(lastp && * lastp)
168  cb等于如果bringupsingle否则single
169  如果非cb则返回:0
171  trace_cpuhp_enter(cpu, target, state, cb)
172  ret等于cb(cpu)
173  trace_cpuhp_exit(cpu, state, state, ret)
174  返回:ret
176  cbm等于如果bringupmulti否则multi
177  如果非cbm则返回:0
181  如果node
182  WARN_ON_ONCE(lastp && * lastp)
183  trace_cpuhp_multi_enter(cpu, target, state, cbm, node)
184  ret等于cbm(cpu, node)
185  trace_cpuhp_exit(cpu, state, state, ret)
186  返回:ret
190  cnt等于0
192  如果lastpnode恒等于lastp退出
195  trace_cpuhp_multi_enter(cpu, target, state, cbm, node)
196  ret等于cbm(cpu, node)
197  trace_cpuhp_exit(cpu, state, state, ret)
198  如果ret
199  如果非lastp则转到:err
202  lastp等于node
203  返回:ret
205  cnt自加
207  如果lastp则 * lastp = NULL
209  返回:0
210  err :
212  cbm等于如果非bringupmulti否则multi
213  如果非cbm则返回:ret
217  如果非cnt自减则退出
220  trace_cpuhp_multi_enter(cpu, target, state, cbm, node)
221  ret等于cbm(cpu, node)
222  trace_cpuhp_exit(cpu, state, state, ret)
226  WARN_ON_ONCE(ret)
228  返回:ret
调用者
名称描述
cpuhp_issue_callCall the startup/teardown function for a step either on the AP or* on the current CPU.