hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/include/linux/console.h
....@@ -24,16 +24,12 @@
2424 struct tty_struct;
2525 struct notifier_block;
2626
27
-/*
28
- * this is what the terminal answers to a ESC-Z or csi0c query.
29
- */
30
-#define VT100ID "\033[?1;2c"
31
-#define VT102ID "\033[?6c"
32
-
3327 enum con_scroll {
3428 SM_UP,
3529 SM_DOWN,
3630 };
31
+
32
+enum vc_intensity;
3733
3834 /**
3935 * struct consw - callbacks for consoles
....@@ -74,10 +70,11 @@
7470 void (*con_scrolldelta)(struct vc_data *vc, int lines);
7571 int (*con_set_origin)(struct vc_data *vc);
7672 void (*con_save_screen)(struct vc_data *vc);
77
- u8 (*con_build_attr)(struct vc_data *vc, u8 color, u8 intensity,
78
- u8 blink, u8 underline, u8 reverse, u8 italic);
73
+ u8 (*con_build_attr)(struct vc_data *vc, u8 color,
74
+ enum vc_intensity intensity,
75
+ bool blink, bool underline, bool reverse, bool italic);
7976 void (*con_invert_region)(struct vc_data *vc, u16 *p, int count);
80
- u16 *(*con_screen_pos)(struct vc_data *vc, int offset);
77
+ u16 *(*con_screen_pos)(const struct vc_data *vc, int offset);
8178 unsigned long (*con_getxy)(struct vc_data *vc, unsigned long position,
8279 int *px, int *py);
8380 /*
....@@ -101,7 +98,6 @@
10198 extern const struct consw dummy_con; /* dummy console buffer */
10299 extern const struct consw vga_con; /* VGA text console */
103100 extern const struct consw newport_con; /* SGI Newport console */
104
-extern const struct consw prom_con; /* SPARC PROM console */
105101
106102 int con_is_bound(const struct consw *csw);
107103 int do_unregister_con_driver(const struct consw *csw);
....@@ -135,15 +131,12 @@
135131 */
136132
137133 #define CON_PRINTBUFFER (1)
138
-#define CON_CONSDEV (2) /* Last on the command line */
134
+#define CON_CONSDEV (2) /* Preferred console, /dev/console */
139135 #define CON_ENABLED (4)
140136 #define CON_BOOT (8)
141137 #define CON_ANYTIME (16) /* Safe to call when cpu is offline */
142138 #define CON_BRL (32) /* Used for a braille device */
143139 #define CON_EXTENDED (64) /* Use the extended output format a la /dev/kmsg */
144
-#ifdef CONFIG_PSTORE_CONSOLE_FORCE
145
-#define CON_PSTORE (128) /* Print to pstore console anyway */
146
-#endif
147140
148141 struct console {
149142 char name[16];
....@@ -152,6 +145,7 @@
152145 struct tty_driver *(*device)(struct console *, int *);
153146 void (*unblank)(void);
154147 int (*setup)(struct console *, char *);
148
+ int (*exit)(struct console *);
155149 int (*match)(struct console *, char *name, int idx, char *options);
156150 short flags;
157151 short index;
....@@ -169,6 +163,11 @@
169163 extern int console_set_on_cmdline;
170164 extern struct console *early_console;
171165
166
+enum con_flush_mode {
167
+ CONSOLE_FLUSH_PENDING,
168
+ CONSOLE_REPLAY_ALL,
169
+};
170
+
172171 extern int add_preferred_console(char *name, int idx, char *options);
173172 extern void register_console(struct console *);
174173 extern int unregister_console(struct console *);
....@@ -178,7 +177,7 @@
178177 extern void console_unlock(void);
179178 extern void console_conditional_schedule(void);
180179 extern void console_unblank(void);
181
-extern void console_flush_on_panic(void);
180
+extern void console_flush_on_panic(enum con_flush_mode mode);
182181 extern struct tty_driver *console_device(int *);
183182 extern void console_stop(struct console *);
184183 extern void console_start(struct console *);
....@@ -199,7 +198,6 @@
199198 extern void resume_console(void);
200199
201200 int mda_console_init(void);
202
-void prom_con_init(void);
203201
204202 void vcs_make_sysfs(int index);
205203 void vcs_remove_sysfs(int index);