vt_kern.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #ifndef _VT_KERN_H
  2. #define _VT_KERN_H
  3. /*
  4. * this really is an extension of the vc_cons structure in console.c, but
  5. * with information needed by the vt package
  6. */
  7. #include <linux/vt.h>
  8. #include <linux/kd.h>
  9. #include <linux/tty.h>
  10. #include <linux/mutex.h>
  11. #include <linux/console_struct.h>
  12. #include <linux/mm.h>
  13. /*
  14. * Presently, a lot of graphics programs do not restore the contents of
  15. * the higher font pages. Defining this flag will avoid use of them, but
  16. * will lose support for PIO_FONTRESET. Note that many font operations are
  17. * not likely to work with these programs anyway; they need to be
  18. * fixed. The linux/Documentation directory includes a code snippet
  19. * to save and restore the text font.
  20. */
  21. #ifdef CONFIG_VGA_CONSOLE
  22. #define BROKEN_GRAPHICS_PROGRAMS 1
  23. #endif
  24. extern void kd_mksound(unsigned int hz, unsigned int ticks);
  25. extern int kbd_rate(struct kbd_repeat *rep);
  26. extern int fg_console, last_console, want_console;
  27. /* console.c */
  28. int vc_allocate(unsigned int console);
  29. int vc_cons_allocated(unsigned int console);
  30. int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines);
  31. int vc_lock_resize(struct vc_data *vc, unsigned int cols, unsigned int lines);
  32. void vc_deallocate(unsigned int console);
  33. void reset_palette(struct vc_data *vc);
  34. void do_blank_screen(int entering_gfx);
  35. void do_unblank_screen(int leaving_gfx);
  36. void unblank_screen(void);
  37. void poke_blanked_console(void);
  38. int con_font_op(struct vc_data *vc, struct console_font_op *op);
  39. int con_set_cmap(unsigned char __user *cmap);
  40. int con_get_cmap(unsigned char __user *cmap);
  41. void scrollback(struct vc_data *vc, int lines);
  42. void scrollfront(struct vc_data *vc, int lines);
  43. void update_region(struct vc_data *vc, unsigned long start, int count);
  44. void redraw_screen(struct vc_data *vc, int is_switch);
  45. #define update_screen(x) redraw_screen(x, 0)
  46. #define switch_screen(x) redraw_screen(x, 1)
  47. struct tty_struct;
  48. int tioclinux(struct tty_struct *tty, unsigned long arg);
  49. /* consolemap.c */
  50. struct unimapinit;
  51. struct unipair;
  52. int con_set_trans_old(unsigned char __user * table);
  53. int con_get_trans_old(unsigned char __user * table);
  54. int con_set_trans_new(unsigned short __user * table);
  55. int con_get_trans_new(unsigned short __user * table);
  56. int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui);
  57. int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list);
  58. int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct, struct unipair __user *list);
  59. int con_set_default_unimap(struct vc_data *vc);
  60. void con_free_unimap(struct vc_data *vc);
  61. void con_protect_unimap(struct vc_data *vc, int rdonly);
  62. int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
  63. /* vt.c */
  64. int vt_waitactive(int vt);
  65. void change_console(struct vc_data *new_vc);
  66. void reset_vc(struct vc_data *vc);
  67. extern int unbind_con_driver(const struct consw *csw, int first, int last,
  68. int deflt);
  69. /*
  70. * vc_screen.c shares this temporary buffer with the console write code so that
  71. * we can easily avoid touching user space while holding the console spinlock.
  72. */
  73. #define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE)
  74. extern char con_buf[CON_BUF_SIZE];
  75. extern struct mutex con_buf_mtx;
  76. extern char vt_dont_switch;
  77. struct vt_spawn_console {
  78. spinlock_t lock;
  79. struct pid *pid;
  80. int sig;
  81. };
  82. extern struct vt_spawn_console vt_spawn_con;
  83. #endif /* _VT_KERN_H */