vt_kern.h 3.2 KB

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