From 93a2d85f93059cb8e534594281217ddc8b84dcfa Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 3 Feb 2004 18:31:40 -0800 Subject: [PATCH] VT locking fixes From: Benjamin Herrenschmidt - Make sure that all console operations are approriately protected under console_sem. - Adds checks to make sure that people are taking console_sem when it is expected to be held. --- include/linux/console.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/linux/console.h') diff --git a/include/linux/console.h b/include/linux/console.h index 6db0056fb4c9..f6ff116ccfb3 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -102,6 +102,14 @@ extern void acquire_console_sem(void); extern void release_console_sem(void); extern void console_conditional_schedule(void); extern void console_unblank(void); +extern int is_console_locked(void); + +/* Some debug stub to catch some of the obvious races in the VT code */ +#if 1 +#define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress) +#else +#define WARN_CONSOLE_UNLOCKED() +#endif /* VESA Blanking Levels */ #define VESA_NO_BLANKING 0 -- cgit v1.2.3