LCOV - code coverage report
Current view: top level - kernel - crash_dump.c (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 8 0.0 %
Date: 2022-03-28 16:04:14 Functions: 0 1 0.0 %
Branches: 0 6 0.0 %

           Branch data     Line data    Source code
       1                 :            : // SPDX-License-Identifier: GPL-2.0-only
       2                 :            : #include <linux/kernel.h>
       3                 :            : #include <linux/crash_dump.h>
       4                 :            : #include <linux/init.h>
       5                 :            : #include <linux/errno.h>
       6                 :            : #include <linux/export.h>
       7                 :            : 
       8                 :            : /*
       9                 :            :  * If we have booted due to a crash, max_pfn will be a very low value. We need
      10                 :            :  * to know the amount of memory that the previous kernel used.
      11                 :            :  */
      12                 :            : unsigned long saved_max_pfn;
      13                 :            : 
      14                 :            : /*
      15                 :            :  * stores the physical address of elf header of crash image
      16                 :            :  *
      17                 :            :  * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by
      18                 :            :  * is_kdump_kernel() to determine if we are booting after a panic. Hence put
      19                 :            :  * it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE.
      20                 :            :  */
      21                 :            : unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
      22                 :            : EXPORT_SYMBOL_GPL(elfcorehdr_addr);
      23                 :            : 
      24                 :            : /*
      25                 :            :  * stores the size of elf header of crash image
      26                 :            :  */
      27                 :            : unsigned long long elfcorehdr_size;
      28                 :            : 
      29                 :            : /*
      30                 :            :  * elfcorehdr= specifies the location of elf core header stored by the crashed
      31                 :            :  * kernel. This option will be passed by kexec loader to the capture kernel.
      32                 :            :  *
      33                 :            :  * Syntax: elfcorehdr=[size[KMG]@]offset[KMG]
      34                 :            :  */
      35                 :          0 : static int __init setup_elfcorehdr(char *arg)
      36                 :            : {
      37                 :          0 :         char *end;
      38         [ #  # ]:          0 :         if (!arg)
      39                 :            :                 return -EINVAL;
      40                 :          0 :         elfcorehdr_addr = memparse(arg, &end);
      41         [ #  # ]:          0 :         if (*end == '@') {
      42                 :          0 :                 elfcorehdr_size = elfcorehdr_addr;
      43                 :          0 :                 elfcorehdr_addr = memparse(end + 1, &end);
      44                 :            :         }
      45         [ #  # ]:          0 :         return end > arg ? 0 : -EINVAL;
      46                 :            : }
      47                 :            : early_param("elfcorehdr", setup_elfcorehdr);

Generated by: LCOV version 1.14