函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:The console driver calls this routine during kernel initialization* to register the console printing procedure with printk() and to* print any messages that were printed by the kernel before the* console driver was initialized

函数原型:void register_console(struct console *newcon)

返回类型:void

参数:

类型参数名称
struct console *newcon
2652  struct console * bcon = NULL
2656  如果console_driversr_each_console() allows you to iterate on each console(bcon)
2658  如果WARN(bcon == newcon, "console '%s%d' already registered\n", name, index)则返回
2667  如果console_driversflags按位与CON_BOOT
2670  如果非flags按位与CON_BOOT的值则
2671  打印信息("Too late to register bootconsole %s%d\n", name, index)
2673  返回
2678  如果console_driversflags按位与CON_BOOTbcon等于console_drivers
2681  如果非has_preferredbcon或非console_drivershas_preferred等于preferred_console大于等于0
2689  如果非has_preferred
2690  如果index小于0则index等于0
2692  如果setup恒等于NULLsetup(newcon, NULL)恒等于0则
2694  flags或等于CON_ENABLED
2695  如果device
2697  has_preferred = true
2706 i小于Array of consoles built from command line options (console=) Name of the driver [0]循环
2713  如果字符串比较不等于0则继续下一循环
2715  如果index大于等于0且index不等于 Minor dev. to use 则继续下一循环
2718  如果index小于0则index等于 Minor dev. to use
2721  如果_braille_register_console(newcon, c)则返回
2724  如果setupsetup(newcon, Options for the driver )不等于0则退出
2729  flags或等于CON_ENABLED
2730  如果i恒等于preferred_console
2732  has_preferred = true
2734  退出
2737  如果非flags按位与CON_ENABLED的值则返回
2746  如果bconflags按位与Last on the command line 按位或CON_BOOT的值的值恒等于Last on the command line flags与等于The interface for a console, or any other device that wants to capture* console messages (printer driver?)* If a console driver is marked CON_BOOT then it will be auto-unregistered* when the first real console is registered的反
2753  sole_lock - lock the console system for exclusive use.* Acquires a lock which guarantees that the caller has* exclusive access to the console system and the console_drivers list.* Can sleep, returns nothing.
2754  如果((flags & Last on the command line ) || console_drivers == NULL)则
2755  next等于console_drivers
2756  console_drivers等于newcon
2757  如果nextflags与等于Last on the command line 的反
2759  否则
2760  next等于next
2761  next等于newcon
2764  如果flags按位与Use the extended output format a la /dev/kmsg Number of registered extended console drivers. 自加
2767  如果flags按位与The interface for a console, or any other device that wants to capture* console messages (printer driver?)* If a console driver is marked CON_BOOT then it will be auto-unregistered* when the first real console is registered
2772  logbuf_lock_irqsave(flags)
2782  If exclusive_console is non-NULL then only this console is to be printed to.等于newcon
2783  exclusive_console_stop_seq等于he next printk record to write to the console
2784  he next printk record to write to the console 等于he next printk record to read by syslog(READ) or /proc/kmsg
2785  console_idx等于syslog_idx
2786  logbuf_unlock_irqrestore(flags)
2788  sole_unlock - unlock the console system* Releases the console_lock which the caller holds on the console system* and the console driver list.* While the console_lock was held, console output may have been buffered* by printk()
2789  console_sysfs_notify()
2798  打印信息("%sconsole [%s%d] enabled\n", (flags & CON_BOOT) ? "boot" : "", name, index)
2801  如果bconflags按位与Last on the command line 按位或CON_BOOT的值的值恒等于Last on the command line 且非keep_bootcon
2807  r_each_console() allows you to iterate on each console(bcon)
2808  如果flags按位与CON_BOOTunregister_console(bcon)
调用者
名称描述
kgdb_register_callbacks
early_console_register