vt_kern.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. 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. #ifdef CONFIG_CONSOLE_TRANSLATIONS
  50. /* consolemap.c */
  51. struct unimapinit;
  52. struct unipair;
  53. int con_set_trans_old(unsigned char __user * table);
  54. int con_get_trans_old(unsigned char __user * table);
  55. int con_set_trans_new(unsigned short __user * table);
  56. int con_get_trans_new(unsigned short __user * table);
  57. int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui);
  58. int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list);
  59. int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct, struct unipair __user *list);
  60. int con_set_default_unimap(struct vc_data *vc);
  61. void con_free_unimap(struct vc_data *vc);
  62. void con_protect_unimap(struct vc_data *vc, int rdonly);
  63. int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
  64. #define vc_translate(vc, c) ((vc)->vc_translate[(c) | \
  65. ((vc)->vc_toggle_meta ? 0x80 : 0)])
  66. #else
  67. #define con_set_trans_old(arg) (0)
  68. #define con_get_trans_old(arg) (-EINVAL)
  69. #define con_set_trans_new(arg) (0)
  70. #define con_get_trans_new(arg) (-EINVAL)
  71. #define con_clear_unimap(vc, ui) (0)
  72. #define con_set_unimap(vc, ct, list) (0)
  73. #define con_set_default_unimap(vc) (0)
  74. #define con_copy_unimap(d, s) (0)
  75. #define con_get_unimap(vc, ct, uct, list) (-EINVAL)
  76. #define con_free_unimap(vc) do { ; } while (0)
  77. #define con_protect_unimap(vc, rdonly) do { ; } while (0)
  78. #define vc_translate(vc, c) (c)
  79. #endif
  80. /* vt.c */
  81. void vt_event_post(unsigned int event, unsigned int old, unsigned int new);
  82. int vt_waitactive(int n);
  83. void change_console(struct vc_data *new_vc);
  84. void reset_vc(struct vc_data *vc);
  85. extern int unbind_con_driver(const struct consw *csw, int first, int last,
  86. int deflt);
  87. int vty_init(const struct file_operations *console_fops);
  88. /*
  89. * vc_screen.c shares this temporary buffer with the console write code so that
  90. * we can easily avoid touching user space while holding the console spinlock.
  91. */
  92. #define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE)
  93. extern char con_buf[CON_BUF_SIZE];
  94. extern struct mutex con_buf_mtx;
  95. extern char vt_dont_switch;
  96. extern int default_utf8;
  97. struct vt_spawn_console {
  98. spinlock_t lock;
  99. struct pid *pid;
  100. int sig;
  101. };
  102. extern struct vt_spawn_console vt_spawn_con;
  103. extern int vt_move_to_console(unsigned int vt, int alloc);
  104. #endif /* _VT_KERN_H */