Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\boot\cmdline.c Create Date:2022-07-28 07:26:31
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Find a boolean option (like quiet,noapic,nosmp....)* Returns the position of that option (starts counting with 1)* or 0 on not found

Proto:int __cmdline_find_option_bool(unsigned long cmdline_ptr, const char *option)

Type:int

Parameter:

TypeParameterName
unsigned longcmdline_ptr
const char *option
104  pos = 0 , wstart = 0
105  const char * opptr = NULL
106  enum{st_wordstart, st_wordcmp, st_wordskip, state = st_wordstart
112  If Not cmdline_ptr Then Return -1
115  cptr = cmdline_ptr & 0xf
116  set_fs(cmdline_ptr >> 4)
118  When cptr < 0x10000 cycle
119  c = rdfs8(cptr++)
120  pos++
123  Case state == st_wordstart
124  If Not c Then Return 0
129  state = st_wordcmp
130  opptr = option
131  wstart = pos
134  Case state == st_wordcmp
137  Return wstart
138  Else state = st_wordskip
140  Else if Not c Then Return 0
142  Else if c != opptr++ Then state = st_wordskip
144  Break
146  Case state == st_wordskip
147  If Not c Then Return 0
151  Break
155  Return 0
Caller
NameDescribe
cmdline_find_option_bool