.. | .. |
---|
16 | 16 | |
---|
17 | 17 | #include <linux/atomic.h> |
---|
18 | 18 | #include <linux/types.h> |
---|
| 19 | +#include <linux/printk.h> |
---|
19 | 20 | |
---|
20 | 21 | struct vc_data; |
---|
21 | 22 | struct console_font_op; |
---|
.. | .. |
---|
24 | 25 | struct tty_struct; |
---|
25 | 26 | struct notifier_block; |
---|
26 | 27 | |
---|
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 | | - |
---|
33 | 28 | enum con_scroll { |
---|
34 | 29 | SM_UP, |
---|
35 | 30 | SM_DOWN, |
---|
36 | 31 | }; |
---|
| 32 | + |
---|
| 33 | +enum vc_intensity; |
---|
37 | 34 | |
---|
38 | 35 | /** |
---|
39 | 36 | * struct consw - callbacks for consoles |
---|
.. | .. |
---|
74 | 71 | void (*con_scrolldelta)(struct vc_data *vc, int lines); |
---|
75 | 72 | int (*con_set_origin)(struct vc_data *vc); |
---|
76 | 73 | 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); |
---|
| 74 | + u8 (*con_build_attr)(struct vc_data *vc, u8 color, |
---|
| 75 | + enum vc_intensity intensity, |
---|
| 76 | + bool blink, bool underline, bool reverse, bool italic); |
---|
79 | 77 | void (*con_invert_region)(struct vc_data *vc, u16 *p, int count); |
---|
80 | | - u16 *(*con_screen_pos)(struct vc_data *vc, int offset); |
---|
| 78 | + u16 *(*con_screen_pos)(const struct vc_data *vc, int offset); |
---|
81 | 79 | unsigned long (*con_getxy)(struct vc_data *vc, unsigned long position, |
---|
82 | 80 | int *px, int *py); |
---|
83 | 81 | /* |
---|
.. | .. |
---|
101 | 99 | extern const struct consw dummy_con; /* dummy console buffer */ |
---|
102 | 100 | extern const struct consw vga_con; /* VGA text console */ |
---|
103 | 101 | extern const struct consw newport_con; /* SGI Newport console */ |
---|
104 | | -extern const struct consw prom_con; /* SPARC PROM console */ |
---|
105 | 102 | |
---|
106 | 103 | int con_is_bound(const struct consw *csw); |
---|
107 | 104 | int do_unregister_con_driver(const struct consw *csw); |
---|
.. | .. |
---|
135 | 132 | */ |
---|
136 | 133 | |
---|
137 | 134 | #define CON_PRINTBUFFER (1) |
---|
138 | | -#define CON_CONSDEV (2) /* Last on the command line */ |
---|
| 135 | +#define CON_CONSDEV (2) /* Preferred console, /dev/console */ |
---|
139 | 136 | #define CON_ENABLED (4) |
---|
140 | 137 | #define CON_BOOT (8) |
---|
141 | 138 | #define CON_ANYTIME (16) /* Safe to call when cpu is offline */ |
---|
142 | 139 | #define CON_BRL (32) /* Used for a braille device */ |
---|
143 | 140 | #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 |
---|
| 141 | +#define CON_HANDOVER (128) /* Device was previously a boot console. */ |
---|
147 | 142 | |
---|
148 | 143 | struct console { |
---|
149 | 144 | char name[16]; |
---|
150 | 145 | void (*write)(struct console *, const char *, unsigned); |
---|
| 146 | + void (*write_atomic)(struct console *co, const char *s, unsigned int count); |
---|
151 | 147 | int (*read)(struct console *, char *, unsigned); |
---|
152 | 148 | struct tty_driver *(*device)(struct console *, int *); |
---|
153 | 149 | void (*unblank)(void); |
---|
154 | 150 | int (*setup)(struct console *, char *); |
---|
| 151 | + int (*exit)(struct console *); |
---|
155 | 152 | int (*match)(struct console *, char *name, int idx, char *options); |
---|
156 | 153 | short flags; |
---|
157 | 154 | short index; |
---|
158 | 155 | int cflag; |
---|
| 156 | +#ifdef CONFIG_PRINTK |
---|
| 157 | + char sync_buf[CONSOLE_LOG_MAX]; |
---|
| 158 | +#endif |
---|
| 159 | + atomic64_t printk_seq; |
---|
| 160 | + struct task_struct *thread; |
---|
159 | 161 | void *data; |
---|
160 | 162 | struct console *next; |
---|
161 | 163 | }; |
---|
.. | .. |
---|
169 | 171 | extern int console_set_on_cmdline; |
---|
170 | 172 | extern struct console *early_console; |
---|
171 | 173 | |
---|
| 174 | +enum con_flush_mode { |
---|
| 175 | + CONSOLE_FLUSH_PENDING, |
---|
| 176 | + CONSOLE_REPLAY_ALL, |
---|
| 177 | +}; |
---|
| 178 | + |
---|
172 | 179 | extern int add_preferred_console(char *name, int idx, char *options); |
---|
173 | 180 | extern void register_console(struct console *); |
---|
174 | 181 | extern int unregister_console(struct console *); |
---|
.. | .. |
---|
178 | 185 | extern void console_unlock(void); |
---|
179 | 186 | extern void console_conditional_schedule(void); |
---|
180 | 187 | extern void console_unblank(void); |
---|
181 | | -extern void console_flush_on_panic(void); |
---|
| 188 | +extern void console_flush_on_panic(enum con_flush_mode mode); |
---|
182 | 189 | extern struct tty_driver *console_device(int *); |
---|
183 | 190 | extern void console_stop(struct console *); |
---|
184 | 191 | extern void console_start(struct console *); |
---|
.. | .. |
---|
199 | 206 | extern void resume_console(void); |
---|
200 | 207 | |
---|
201 | 208 | int mda_console_init(void); |
---|
202 | | -void prom_con_init(void); |
---|
203 | 209 | |
---|
204 | 210 | void vcs_make_sysfs(int index); |
---|
205 | 211 | void vcs_remove_sysfs(int index); |
---|
.. | .. |
---|
232 | 238 | void dummycon_register_output_notifier(struct notifier_block *nb); |
---|
233 | 239 | void dummycon_unregister_output_notifier(struct notifier_block *nb); |
---|
234 | 240 | |
---|
| 241 | +extern void console_atomic_lock(unsigned int *flags); |
---|
| 242 | +extern void console_atomic_unlock(unsigned int flags); |
---|
| 243 | + |
---|
235 | 244 | #endif /* _LINUX_CONSOLE_H */ |
---|