Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:void register_console(struct console *newcon)

Type:void

Parameter:

TypeParameterName
struct console *newcon
2652  struct console * bcon = NULL
2656  If console_drivers Then r_each_console() allows you to iterate on each console(bcon)
2658  If WARN(bcon == newcon, "console '%s%d' already registered\n", name, index) Then Return
2667  If console_drivers && flags & CON_BOOT Then
2670  If Not (flags & CON_BOOT) Then
2671  pr_info("Too late to register bootconsole %s%d\n", name, index)
2673  Return
2678  If console_drivers && flags & CON_BOOT Then bcon = console_drivers
2681  If Not has_preferred || bcon || Not console_drivers Then has_preferred = preferred_console >= 0
2689  If Not has_preferred Then
2690  If index < 0 Then index = 0
2692  If setup == NULL || setup(newcon, NULL) == 0 Then
2694  flags |= CON_ENABLED
2695  If device Then
2706  When i < Array of consoles built from command line options (console=) && Name of the driver [0] cycle
2713  If strcmp( Name of the driver , name) != 0 Then Continue
2715  If index >= 0 && index != Minor dev. to use Then Continue
2718  If index < 0 Then index = Minor dev. to use
2721  If _braille_register_console(newcon, c) Then Return
2724  If setup && setup(newcon, Options for the driver ) != 0 Then Break
2729  flags |= CON_ENABLED
2730  If i == preferred_console Then
2732  has_preferred = true
2734  Break
2737  If Not (flags & CON_ENABLED) Then Return
2746  If bcon && (flags & (Last on the command line | CON_BOOT)) == Last on the command line Then 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  If ((flags & Last on the command line ) || console_drivers == NULL) Then
2755  next = console_drivers
2756  console_drivers = newcon
2757  If next Then flags &= ~Last on the command line
2759  Else
2760  next = next
2761  next = newcon
2764  If flags & Use the extended output format a la /dev/kmsg Then Number of registered extended console drivers. ++
2767  If 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 Then
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  pr_info("%sconsole [%s%d] enabled\n", (flags & CON_BOOT) ? "boot" : "", name, index)
2801  If bcon && (flags & (Last on the command line | CON_BOOT)) == Last on the command line && Not keep_bootcon Then
2807  r_each_console() allows you to iterate on each console(bcon)
2808  If flags & CON_BOOT Then unregister_console(bcon)
Caller
NameDescribe
kgdb_register_callbacks