vt_kern.h 3.9 KB

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