函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:This function parses command lines in the format* crashkernel=ramsize-range:size[,...][@offset]* The function returns 0 on success and -EINVAL on failure.

函数原型:static int __init parse_crashkernel_mem(char *cmdline, unsigned long long system_ram, unsigned long long *crash_size, unsigned long long *crash_base)

返回类型:int

参数:

类型参数名称
char *cmdline
unsigned long longsystem_ram
unsigned long long *crash_size
unsigned long long *crash_base
41  cur等于cmdline
44  循环
45  end等于ULLONG_MAX
48  start等于memparse - parse a string with mem suffixes into a number*@ptr: Where parse begins*@retptr: (output) Optional pointer to next char after parse completes* Parses a string into a number. The number stored at @ptr is
49  如果cur恒等于tmp
50  打印警告信息("crashkernel: Memory value expected\n")
51  返回:负EINVAL
53  cur等于tmp
54  如果cur不等于'-'则
55  打印警告信息("crashkernel: '-' expected\n")
56  返回:负EINVAL
58  cur自加
61  如果cur不等于':'则
63  如果cur恒等于tmp
64  打印警告信息("crashkernel: Memory value expected\n")
65  返回:负EINVAL
67  cur等于tmp
68  如果end小于等于start
69  打印警告信息("crashkernel: end <= start\n")
70  返回:负EINVAL
74  如果cur不等于':'则
75  打印警告信息("crashkernel: ':' expected\n")
76  返回:负EINVAL
78  cur自加
80  size等于memparse - parse a string with mem suffixes into a number*@ptr: Where parse begins*@retptr: (output) Optional pointer to next char after parse completes* Parses a string into a number. The number stored at @ptr is
81  如果cur恒等于tmp
82  打印警告信息("Memory value expected\n")
83  返回:负EINVAL
85  cur等于tmp
86  如果size大于等于system_ram
87  打印警告信息("crashkernel: invalid size\n")
88  返回:负EINVAL
92  如果system_ram大于等于startsystem_ram小于end
93  crash_size等于size
94  退出
96 cur自加恒等于','循环
98  如果crash_size大于0则
99 curcur不等于' '且cur不等于'@'循环
100  cur自加
101  如果cur恒等于'@'则
102  cur自加
104  如果cur恒等于tmp
105  打印警告信息("Memory value expected after '@'\n")
106  返回:负EINVAL
109  否则打印信息("crashkernel size resulted in zero bytes\n")
112  返回:0
调用者
名称描述
__parse_crashkernel