Function report |
Source Code:kernel\kexec_file.c |
Create Date:2022-07-28 11:04:26 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:kexec_calculate_store_digests
Proto:static int kexec_calculate_store_digests(struct kimage *image)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct kimage * | image |
| 710 | ret = 0 |
| 717 | If Not IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_ARCH_HAS_KEXEC_PURGATORY) Then Return 0 |
| 720 | zero_buf = __va(page_to_pfn(ZERO_PAGE(0)) << PAGE_SHIFT determines the page size ) |
| 721 | zero_buf_sz = PAGE_SIZE |
| 723 | tfm = crypto_alloc_shash("sha256", 0, 0) |
| 730 | desc = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc). |
| 731 | If Not desc Then |
| 733 | Go to out_free_tfm |
| 736 | sha_region_sz = The artificial cap on the number of segments passed to kexec_load. * sizeof(structkexec_sha_region) |
| 737 | sha_regions = vzalloc(sha_region_sz) |
| 738 | If Not sha_regions Then Go to out_free_desc |
| 744 | If ret < 0 Then Go to out_free_sha_regions |
| 747 | digest = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc). |
| 748 | If Not digest Then |
| 750 | Go to out_free_sha_regions |
| 753 | When i < nr_segments cycle |
| 761 | If kbuf == * Temporary, modifiable buffer for stripped purgatory used for * relocation. This memory can be freed post image load. Then Continue |
| 766 | If ret Then Break |
| 777 | If bytes > zero_buf_sz Then bytes = zero_buf_sz |
| 780 | If ret Then Break |
| 785 | If ret Then Break |
| 790 | j++ |
| 793 | If Not ret Then |
| 795 | If ret Then Go to out_free_digest |
| 797 | ret = kexec_purgatory_get_set_symbol(image, "purgatory_sha_regions", sha_regions, sha_region_sz, 0) |
| 799 | If ret Then Go to out_free_digest |
| 802 | ret = kexec_purgatory_get_set_symbol(image, "purgatory_sha256_digest", digest, SHA256_DIGEST_SIZE, 0) |
| 804 | If ret Then Go to out_free_digest |
| 808 | out_free_digest : |
| 810 | out_free_sha_regions : |
| 811 | vfree(sha_regions) |
| 812 | out_free_desc : |
| 814 | out_free_tfm : |
| 816 | out : |
| 817 | Return ret |
| Name | Describe |
|---|---|
| SYSCALL_DEFINE5 |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |