Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\printk\printk.c Create Date:2022-07-28 10:06:49
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Set up a console. Called via do_early_param() in init/main.c* for each "console=" parameter in the boot command line.

Proto:static int __init console_setup(char *str)

Type:int

Parameter:

TypeParameterName
char *str
2165  char * s, * options, * brl_options = NULL
2168  If _braille_console_setup( & str, & brl_options) Then Return 1
2174  If str[0] >= '0' && str[0] <= '9' Then
2175  strcpy(buf, "ttyS")
2176  strncpy(buf + 4, str, size of buf - 5)
2177  Else
2178  strncpy(buf, str, size of buf - 1)
2180  buf[ size of buf - 1] = 0
2181  options = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
2182  If options Then * options++ = 0
2190  When s cycle If isdigit( * s) || s == ',' Then
2192  Break
2193  idx = simple_strtoul - convert a string to an unsigned long*@cp: The start of the string*@endp: A pointer to the end of the parsed string will be placed here*@base: The number base to use* This function is obsolete. Please use kstrtoul instead.
2194  s = 0
2196  __add_preferred_console(buf, idx, options, brl_options)
2197  console_set_on_cmdline = 1
2198  Return 1