|
15 | 15 | #define _LINUX_CONSOLE_H_ 1
|
16 | 16 |
|
17 | 17 | #include <linux/atomic.h>
|
| 18 | +#include <linux/bits.h> |
18 | 19 | #include <linux/rculist.h>
|
19 | 20 | #include <linux/types.h>
|
20 | 21 |
|
@@ -125,18 +126,43 @@ static inline int con_debug_leave(void)
|
125 | 126 | /*
|
126 | 127 | * The interface for a console, or any other device that wants to capture
|
127 | 128 | * console messages (printer driver?)
|
128 |
| - * |
129 |
| - * If a console driver is marked CON_BOOT then it will be auto-unregistered |
130 |
| - * when the first real console is registered. This is for early-printk drivers. |
131 | 129 | */
|
132 | 130 |
|
133 |
| -#define CON_PRINTBUFFER (1) |
134 |
| -#define CON_CONSDEV (2) /* Preferred console, /dev/console */ |
135 |
| -#define CON_ENABLED (4) |
136 |
| -#define CON_BOOT (8) |
137 |
| -#define CON_ANYTIME (16) /* Safe to call when cpu is offline */ |
138 |
| -#define CON_BRL (32) /* Used for a braille device */ |
139 |
| -#define CON_EXTENDED (64) /* Use the extended output format a la /dev/kmsg */ |
| 131 | +/** |
| 132 | + * cons_flags - General console flags |
| 133 | + * @CON_PRINTBUFFER: Used by newly registered consoles to avoid duplicate |
| 134 | + * output of messages that were already shown by boot |
| 135 | + * consoles or read by userspace via syslog() syscall. |
| 136 | + * @CON_CONSDEV: Indicates that the console driver is backing |
| 137 | + * /dev/console. |
| 138 | + * @CON_ENABLED: Indicates if a console is allowed to print records. If |
| 139 | + * false, the console also will not advance to later |
| 140 | + * records. |
| 141 | + * @CON_BOOT: Marks the console driver as early console driver which |
| 142 | + * is used during boot before the real driver becomes |
| 143 | + * available. It will be automatically unregistered |
| 144 | + * when the real console driver is registered unless |
| 145 | + * "keep_bootcon" parameter is used. |
| 146 | + * @CON_ANYTIME: A misnomed historical flag which tells the core code |
| 147 | + * that the legacy @console::write callback can be invoked |
| 148 | + * on a CPU which is marked OFFLINE. That is misleading as |
| 149 | + * it suggests that there is no contextual limit for |
| 150 | + * invoking the callback. The original motivation was |
| 151 | + * readiness of the per-CPU areas. |
| 152 | + * @CON_BRL: Indicates a braille device which is exempt from |
| 153 | + * receiving the printk spam for obvious reasons. |
| 154 | + * @CON_EXTENDED: The console supports the extended output format of |
| 155 | + * /dev/kmesg which requires a larger output buffer. |
| 156 | + */ |
| 157 | +enum cons_flags { |
| 158 | + CON_PRINTBUFFER = BIT(0), |
| 159 | + CON_CONSDEV = BIT(1), |
| 160 | + CON_ENABLED = BIT(2), |
| 161 | + CON_BOOT = BIT(3), |
| 162 | + CON_ANYTIME = BIT(4), |
| 163 | + CON_BRL = BIT(5), |
| 164 | + CON_EXTENDED = BIT(6), |
| 165 | +}; |
140 | 166 |
|
141 | 167 | struct console {
|
142 | 168 | char name[16];
|
|
0 commit comments