diff -urNX dontdiff linux-2.6.5/drivers/char/vt_ioctl.c linux/drivers/char/vt_ioctl.c --- linux-2.6.5/drivers/char/vt_ioctl.c 2004-04-03 22:37:37.000000000 -0500 +++ linux/drivers/char/vt_ioctl.c 2004-05-02 20:45:16.000000000 -0400 @@ -357,6 +357,27 @@ return 0; } +void vt_kdsetmode(unsigned int console, unsigned char mode) +{ + if (vt_cons[console]->vc_mode == (unsigned char) mode) + return; + vt_cons[console]->vc_mode = (unsigned char) mode; + if (console != fg_console) + return; + /* + * explicitly blank/unblank the screen if switching modes + */ + if (mode == KD_TEXT) + do_unblank_screen(1); + else + do_blank_screen(1); +} + +unsigned char vt_kdgetmode(unsigned int console) +{ + return vt_cons[console]->vc_mode; +} + /* * We handle the console-specific ioctl's here. We allow the * capability to modify any console, not just the fg_console. @@ -487,24 +508,13 @@ default: return -EINVAL; } - if (vt_cons[console]->vc_mode == (unsigned char) arg) - return 0; - vt_cons[console]->vc_mode = (unsigned char) arg; - if (console != fg_console) - return 0; - /* - * explicitly blank/unblank the screen if switching modes - */ acquire_console_sem(); - if (arg == KD_TEXT) - do_unblank_screen(1); - else - do_blank_screen(1); + vt_kdsetmode(console, (unsigned char)arg); release_console_sem(); return 0; case KDGETMODE: - ucval = vt_cons[console]->vc_mode; + ucval = vt_kdgetmode(console); goto setint; case KDMAPDISP: diff -urNX dontdiff linux-2.6.5/include/linux/vt_kern.h linux/include/linux/vt_kern.h --- linux-2.6.5/include/linux/vt_kern.h 2004-04-03 22:38:12.000000000 -0500 +++ linux/include/linux/vt_kern.h 2004-05-02 20:42:42.000000000 -0400 @@ -83,5 +83,7 @@ int vt_waitactive(int vt); void change_console(unsigned int); void reset_vc(unsigned int new_console); +void vt_kdsetmode(unsigned int console, unsigned char mode); +unsigned char vt_kdgetmode(unsigned int console); #endif /* _VT_KERN_H */