函数逻辑报告 |
Source Code:arch\x86\kernel\kexec-bzimage64.c |
Create Date:2022-07-27 09:37:02 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:bzImage64_load
函数原型:static void *bzImage64_load(struct kimage *image, char *kernel, unsigned long kernel_len, char *initrd, unsigned long initrd_len, char *cmdline, unsigned long cmdline_len)
返回类型:void
参数:
类型 | 参数 | 名称 |
---|---|---|
struct kimage * | image | |
char * | kernel | |
unsigned long | kernel_len | |
char * | initrd | |
unsigned long | initrd_len | |
char * | cmdline | |
unsigned long | cmdline_len |
342 | ret等于0 |
349 | setup_hdr_offset等于offsetof(structboot_params, hdr) |
356 | header等于kernel加setup_hdr_offset |
357 | setup_sects等于安装信息设置标志 |
358 | 如果setup_sects恒等于0则setup_sects等于4 |
361 | kern16_size等于setup_sects加1的和乘512 |
362 | 如果kernel_len小于kern16_size则 |
367 | 如果cmdline_len大于命令行长度则 |
376 | 如果cmdline_len加lfcorehdr=0x<64bit-value> 大于命令行长度则 |
377 | pr_debug("Appending elfcorehdr=<addr> to command line exceeds maximum allowed length\n") |
378 | 返回:错误号 |
383 | ret等于crash_load_segments(image) |
392 | ret等于kexec_load_purgatory(image, & pbuf) |
393 | 如果ret则 |
413 | bufsz等于params_cmdline_sz加@a is a power of 2 value (efi_map_sz, 16)加sizeof(structsetup_data)加sizeof(structefi_setup_data) |
424 | setup_header_size等于0x0202加kernel[0x0201]减setup_hdr_offset |
427 | memcpy( & 启动头, (kernel + setup_hdr_offset), setup_header_size) |
431 | buf_align等于16 |
433 | ret等于kexec_add_buffer( & kbuf) |
434 | 如果ret则转到:out_free_params |
436 | bootparam_load_addr等于mem |
437 | pr_debug("Loaded boot_param, command line and misc at 0x%lx bufsz=0x%lx memsz=0x%lx\n", bootparam_load_addr, bufsz, bufsz) |
441 | buffer等于kernel加kern16_size |
442 | bufsz等于kernel_len减kern16_size |
446 | mem等于If kexec_buf.mem is set to this value, kexec_locate_mem_hole()* will try to allocate free memory. Arch may overwrite it. |
447 | ret等于kexec_add_buffer( & kbuf) |
448 | 如果ret则转到:out_free_params |
450 | kernel_load_addr等于mem |
452 | pr_debug("Loaded 64bit kernel at 0x%lx bufsz=0x%lx memsz=0x%lx\n", kernel_load_addr, bufsz, memsz) |
456 | 如果initrd则 |
458 | bufsz等于memsz等于initrd_len |
461 | mem等于If kexec_buf.mem is set to this value, kexec_locate_mem_hole()* will try to allocate free memory. Arch may overwrite it. |
462 | ret等于kexec_add_buffer( & kbuf) |
463 | 如果ret则转到:out_free_params |
465 | initrd_load_addr等于mem |
467 | pr_debug("Loaded initrd at 0x%lx bufsz=0x%lx memsz=0x%lx\n", initrd_load_addr, initrd_len, initrd_len) |
473 | setup_cmdline(image, params, bootparam_load_addr, boot_params的长度, cmdline, cmdline_len) |
477 | 内核载入类型等于0x0D左移4位 |
478 | 内核载入标志等于0 |
481 | ret等于kexec_purgatory_get_set_symbol(image, "entry64_regs", & regs64, regs64的长度, 1) |
483 | 如果ret则转到:out_free_params |
486 | rbx等于0 |
487 | rsi等于bootparam_load_addr |
488 | rip等于kernel_load_addr加0x200 |
489 | stack等于kexec_purgatory_get_symbol_addr(image, "stack_end") |
490 | 如果是错误则 |
497 | ret等于kexec_purgatory_get_set_symbol(image, "entry64_regs", & regs64, regs64的长度, 0) |
499 | 如果ret则转到:out_free_params |
502 | ret等于setup_boot_parameters(image, params, bootparam_load_addr, efi_map_offset, efi_map_sz, efi_setup_data_offset) |
505 | 如果ret则转到:out_free_params |
510 | 如果非ldata则 |
512 | 转到:out_free_params |
520 | Temporary buffer to hold bootparams buffer. This should be* freed once the bootparam segment has been loaded.等于params |
521 | 返回:ldata |
523 | out_free_params : |
524 | 释放内存 |
525 | 返回:错误号 |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |