diff options
Diffstat (limited to 'include/linux/console.h')
-rw-r--r-- | include/linux/console.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/console.h b/include/linux/console.h index 20874db50bc8..851daf13de0a 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -16,6 +16,19 @@ #include <linux/atomic.h> #include <linux/types.h> +#include <linux/printk.h> +#include <linux/seqlock.h> + +#ifdef CONFIG_PRINTK_NMI +#define PRINTK_CTX_NUM 2 +#else +#define PRINTK_CTX_NUM 1 +#endif + +struct latched_seq { + seqcount_latch_t latch; + u64 val[2]; +}; struct vc_data; struct console_font_op; @@ -136,10 +149,12 @@ static inline int con_debug_leave(void) #define CON_ANYTIME (16) /* Safe to call when cpu is offline */ #define CON_BRL (32) /* Used for a braille device */ #define CON_EXTENDED (64) /* Use the extended output format a la /dev/kmsg */ +#define CON_HANDOVER (128) /* Device was previously a boot console. */ struct console { char name[16]; void (*write)(struct console *, const char *, unsigned); + void (*write_atomic)(struct console *co, const char *s, unsigned int count); int (*read)(struct console *, char *, unsigned); struct tty_driver *(*device)(struct console *, int *); void (*unblank)(void); @@ -149,6 +164,13 @@ struct console { short flags; short index; int cflag; +#ifdef CONFIG_PRINTK + char sync_buf[CONSOLE_LOG_MAX]; +#endif + struct latched_seq printk_seq; + struct latched_seq printk_sync_seq[PRINTK_CTX_NUM]; + + struct task_struct *thread; void *data; struct console *next; }; @@ -229,4 +251,8 @@ extern void console_init(void); void dummycon_register_output_notifier(struct notifier_block *nb); void dummycon_unregister_output_notifier(struct notifier_block *nb); +extern void console_atomic_lock(unsigned int *flags); +extern void console_atomic_unlock(unsigned int flags); +extern bool console_atomic_kgdb_cpu_delay(unsigned int cpu); + #endif /* _LINUX_CONSOLE_H */ |