函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:reserve_crashkernel

函数原型:static void __init reserve_crashkernel(void)

返回类型:void

参数:

545  bool high = false
548  total_mem等于memblock_phys_mem_size()
551  ret等于parse_crashkernel(boot_command_line, total_mem, & crash_size, & crash_base)
552  如果ret不等于0或crash_size小于等于0则
554  ret等于parse_crashkernel_high(boot_command_line, total_mem, & crash_size, & crash_base)
556  如果ret不等于0或crash_size小于等于0则返回
558  high = true
561  如果xen_pv_domain()则
562  打印信息("Ignoring crashkernel for a Xen PV domain\n")
563  返回
567  如果非crash_base
576  如果非highcrash_base等于memblock_find_in_range(16M alignment for crash kernel regions , Keep the crash kernel below this limit.* On 32 bits earlier kernels would limit the kernel to the low 512 MiB* due to mapping restrictions.* On 64bit, kdump kernel need be restricted to be under 64TB, which is, crash_size, 16M alignment for crash kernel regions )
580  如果非crash_basecrash_base等于memblock_find_in_range(16M alignment for crash kernel regions , CRASH_ADDR_HIGH_MAX, crash_size, 16M alignment for crash kernel regions )
584  如果非crash_base
585  打印信息("crashkernel reservation failed - No suitable area found.\n")
586  返回
588  否则
591  start等于memblock_find_in_range(crash_base, crash_base + crash_size, crash_size, 1 << 20)
594  如果start不等于crash_base
595  打印信息("crashkernel reservation failed - memory is in use.\n")
596  返回
599  ret等于准备内存空间
600  如果ret
601  打印错误信息("%s: Error reserving crashkernel memblock.\n", __func__)
602  返回
605  如果crash_base大于等于1ULL左移32位且reserve_crashkernel_low()则
606  memblock_free(crash_base, crash_size)
607  返回
610  打印信息("Reserving %ldMB of memory at %ldMB for crashkernel (System RAM: %ldMB)\n", (unsignedlong)(crash_size >> 20), (unsignedlong)(crash_base >> 20), (unsignedlong)(total_mem >> 20))
615  start等于crash_base
616  end等于crash_basecrash_size减1
617  insert_resource( & iomem_resource, & Location of a reserved region to hold the crash kernel.)
调用者
名称描述
setup_arch平台相关启动