summaryrefslogtreecommitdiff
path: root/include/linux/console.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-07-03 08:44:16 -0500
committerThomas Gleixner <tglx@linutronix.de>2009-07-29 23:30:45 +0200
commit96cd28c9235962fa85b9ccb43cdb129152a2c38b (patch)
treeee9e7d536b6420618e7bf15a46b834cbd2021232 /include/linux/console.h
parent537b86b6c059b7b0a46979cc144134050d1da511 (diff)
downloadlwn-96cd28c9235962fa85b9ccb43cdb129152a2c38b.tar.gz
lwn-96cd28c9235962fa85b9ccb43cdb129152a2c38b.zip
printk: in_atomic fix
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/console.h')
-rw-r--r--include/linux/console.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/console.h b/include/linux/console.h
index 7c2c9ae848cc..81651ad6d326 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -93,6 +93,17 @@ void give_up_console(const struct consw *sw);
#define CON_BOOT (8)
#define CON_ANYTIME (16) /* Safe to call when cpu is offline */
#define CON_BRL (32) /* Used for a braille device */
+#define CON_ATOMIC (64) /* Safe to call in PREEMPT_RT atomic */
+
+#ifdef CONFIG_PREEMPT_RT
+# define console_atomic_safe(con) \
+ (((con)->flags & CON_ATOMIC) || \
+ (!in_atomic() && !irqs_disabled()) || \
+ (system_state != SYSTEM_RUNNING) || \
+ oops_in_progress)
+#else
+# define console_atomic_safe(con) (1)
+#endif
struct console {
char name[16];