- 论坛徽章:
- 0
|
我看到int __cmdline_find_option(u32 cmdline_ptr, const char *option, char *buffer, int bufsize)这个函数..
我想问下他到底是干嘛的- -.....
/*
* Find a non-boolean option, that is, "option=argument". In accordance
* with standard Linux practice, if this option is repeated, this returns
* the last instance on the command line.
*
* Returns the length of the argument (regardless of if it was
* truncated to fit in the buffer), or -1 on not found.
*/
这是英文注释- -我在看资料的时候,,他说找option?..
比如这里
if (cmdline_find_option("console", optstr, sizeof optstr) <= 0)
return;
options = optstr;
if (!strncmp(options, "uart8250,io,", 12))
我有点想不明白- - 因为我看到__cmdline_find_option中的
case st_wordcmp:
if (c == '=' && !*opptr) {
len = 0;
bufptr = buffer;
state = st_bufcpy;
} else if (myisspace(c)) {
state = st_wordstart;
} else if (c != *opptr++) {
state = st_wordskip;
}
break;
这一段,,,他好像是比较读取出来的字符c 和option进行比较? 如果不一样的话就跳过...这是什么意思? ..查找option的字符? 然后复制到buffer? |
|