Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\module.c Create Date:2022-07-28 10:59:11
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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'.

Proto:static noinline int do_init_module(struct module *mod)

Type:int

Parameter:

TypeParameterName
struct module *mod
3563  ret = 0
3566  freeinit = Allocation memory
3567  If Not freeinit Then
3568  ret = -ENOMEM
3569  Go to fail
3571  module_init = The actual code + data.
3577  flags &= ~Used async_schedule*(), used by module init
3579  Call module constructors.
3581  If (init != NULL) Then ret = Defined in init/main.c
3583  If ret < 0 Then
3584  Go to fail_free_freeinit
3586  If ret > 0 Then
3587  pr_warn("%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  If Not async_probe_requested && flags & Used async_schedule*(), used by module init Then 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  If llist_add - add a new entry*@new: new entry to be added*@head: the head for your lock-less list* Returns true if the list was empty prior to adding this entry. Then 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  Return 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  Return ret
Caller
NameDescribe
load_moduleAllocate and load the module: note that size of section 0 is alwayszero, and we rely on this for optional sections.