函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\module.c Create Date:2022-07-27 11:59:45
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:This is where the real work happens.* Keep it uninlined to provide a reliable breakpoint target, e.g. for the gdb* helper command 'lx-symbols'.

函数原型:static noinline int do_init_module(struct module *mod)

返回类型:int

参数:

类型参数名称
struct module *mod
3563  ret等于0
3566  freeinit等于开辟内存
3567  如果非freeinit
3568  ret等于负ENOMEM
3569  转到:fail
3571  module_init等于 The actual code + data.
3577  flags与等于Used async_schedule*(), used by module init 的反
3579  Call module constructors.
3581  如果(init != NULL)则ret等于Defined in init/main.c
3583  如果ret小于0则
3584  转到:fail_free_freeinit
3586  如果ret大于0则
3587  打印警告信息("%s: '%s'->init suspiciously returned %d, it should follow 0/-E convention\n%s: loading module anyway...\n", __func__, Unique handle for this module , ret, __func__)
3591  dump_stack()
3595  state等于 Normal state.
3596  blocking_notifier_call_chain( & module_notify_list, Normal state. , mod)
3616  如果非async_probe_requestedflags按位与Used async_schedule*(), used by module init async_synchronize_full - synchronize all asynchronous function calls* This function waits until all asynchronous function calls have been done.
3619  ftrace_free_mem(mod, The actual code + data. , The actual code + data. + Total size. )
3621  mutex_lock( & Mutex protects:* 1) List of modules (also safely readable with preempt_disable),* 2) module_use links,* 3) module_addr_min/module_addr_max.* (delete and add uses RCU list operations). )
3623  module_put(mod)
3624  If the exception table is sorted, any referring to the module init* will be at the beginning or the end.
3629  module_enable_ro(mod, true)
3630  mod_tree_remove_init(mod)
3631  module_arch_freeing_init(mod)
3632  The actual code + data. = NULL
3633  Total size. 等于0
3634  Size of RO section of the module (text+rodata) 等于0
3635  Size of RO after init section 等于0
3636  The size of the executable code. 等于0
3650  如果添加列表项schedule_work - put work task in global workqueue*@work: job to be done* Returns %false if @work was already on the kernel-global workqueue and* %true otherwise
3653  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
3654  wake_up_all( & Waiting for a module to finish initializing? )
3656  返回:0
3658  fail_free_freeinit :
3659  kfree(freeinit)
3660  fail :
3662  state等于 Going away.
3663  Wait for a grace period to elapse. But it is illegal to invoke* synchronize_rcu() from within an RCU read-side critical section.* Therefore, any legal call to synchronize_rcu() is a quiescent
3664  module_put(mod)
3665  blocking_notifier_call_chain( & module_notify_list, Going away. , mod)
3667  klp_module_going(mod)
3668  ftrace_release_mod(mod)
3669  Free a module, remove from lists, etc.
3670  wake_up_all( & Waiting for a module to finish initializing? )
3671  返回:ret
调用者
名称描述
load_moduleAllocate and load the module: note that size of section 0 is alwayszero, and we rely on this for optional sections.