kd.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. #ifndef _LINUX_KD_H
  2. #define _LINUX_KD_H
  3. #include <linux/types.h>
  4. #include <linux/compiler.h>
  5. /* 0x4B is 'K', to avoid collision with termios and vt */
  6. #define GIO_FONT 0x4B60 /* gets font in expanded form */
  7. #define PIO_FONT 0x4B61 /* use font in expanded form */
  8. #define GIO_FONTX 0x4B6B /* get font using struct consolefontdesc */
  9. #define PIO_FONTX 0x4B6C /* set font using struct consolefontdesc */
  10. struct consolefontdesc {
  11. unsigned short charcount; /* characters in font (256 or 512) */
  12. unsigned short charheight; /* scan lines per character (1-32) */
  13. char __user *chardata; /* font data in expanded form */
  14. };
  15. #define PIO_FONTRESET 0x4B6D /* reset to default font */
  16. #define GIO_CMAP 0x4B70 /* gets colour palette on VGA+ */
  17. #define PIO_CMAP 0x4B71 /* sets colour palette on VGA+ */
  18. #define KIOCSOUND 0x4B2F /* start sound generation (0 for off) */
  19. #define KDMKTONE 0x4B30 /* generate tone */
  20. #define KDGETLED 0x4B31 /* return current led state */
  21. #define KDSETLED 0x4B32 /* set led state [lights, not flags] */
  22. #define LED_SCR 0x01 /* scroll lock led */
  23. #define LED_NUM 0x02 /* num lock led */
  24. #define LED_CAP 0x04 /* caps lock led */
  25. #define KDGKBTYPE 0x4B33 /* get keyboard type */
  26. #define KB_84 0x01
  27. #define KB_101 0x02 /* this is what we always answer */
  28. #define KB_OTHER 0x03
  29. #define KDADDIO 0x4B34 /* add i/o port as valid */
  30. #define KDDELIO 0x4B35 /* del i/o port as valid */
  31. #define KDENABIO 0x4B36 /* enable i/o to video board */
  32. #define KDDISABIO 0x4B37 /* disable i/o to video board */
  33. #define KDSETMODE 0x4B3A /* set text/graphics mode */
  34. #define KD_TEXT 0x00
  35. #define KD_GRAPHICS 0x01
  36. #define KD_TEXT0 0x02 /* obsolete */
  37. #define KD_TEXT1 0x03 /* obsolete */
  38. #define KDGETMODE 0x4B3B /* get current mode */
  39. #define KDMAPDISP 0x4B3C /* map display into address space */
  40. #define KDUNMAPDISP 0x4B3D /* unmap display from address space */
  41. typedef char scrnmap_t;
  42. #define E_TABSZ 256
  43. #define GIO_SCRNMAP 0x4B40 /* get screen mapping from kernel */
  44. #define PIO_SCRNMAP 0x4B41 /* put screen mapping table in kernel */
  45. #define GIO_UNISCRNMAP 0x4B69 /* get full Unicode screen mapping */
  46. #define PIO_UNISCRNMAP 0x4B6A /* set full Unicode screen mapping */
  47. #define GIO_UNIMAP 0x4B66 /* get unicode-to-font mapping from kernel */
  48. struct unipair {
  49. unsigned short unicode;
  50. unsigned short fontpos;
  51. };
  52. struct unimapdesc {
  53. unsigned short entry_ct;
  54. struct unipair __user *entries;
  55. };
  56. #define PIO_UNIMAP 0x4B67 /* put unicode-to-font mapping in kernel */
  57. #define PIO_UNIMAPCLR 0x4B68 /* clear table, possibly advise hash algorithm */
  58. struct unimapinit {
  59. unsigned short advised_hashsize; /* 0 if no opinion */
  60. unsigned short advised_hashstep; /* 0 if no opinion */
  61. unsigned short advised_hashlevel; /* 0 if no opinion */
  62. };
  63. #define UNI_DIRECT_BASE 0xF000 /* start of Direct Font Region */
  64. #define UNI_DIRECT_MASK 0x01FF /* Direct Font Region bitmask */
  65. #define K_RAW 0x00
  66. #define K_XLATE 0x01
  67. #define K_MEDIUMRAW 0x02
  68. #define K_UNICODE 0x03
  69. #define KDGKBMODE 0x4B44 /* gets current keyboard mode */
  70. #define KDSKBMODE 0x4B45 /* sets current keyboard mode */
  71. #define K_METABIT 0x03
  72. #define K_ESCPREFIX 0x04
  73. #define KDGKBMETA 0x4B62 /* gets meta key handling mode */
  74. #define KDSKBMETA 0x4B63 /* sets meta key handling mode */
  75. #define K_SCROLLLOCK 0x01
  76. #define K_NUMLOCK 0x02
  77. #define K_CAPSLOCK 0x04
  78. #define KDGKBLED 0x4B64 /* get led flags (not lights) */
  79. #define KDSKBLED 0x4B65 /* set led flags (not lights) */
  80. struct kbentry {
  81. unsigned char kb_table;
  82. unsigned char kb_index;
  83. unsigned short kb_value;
  84. };
  85. #define K_NORMTAB 0x00
  86. #define K_SHIFTTAB 0x01
  87. #define K_ALTTAB 0x02
  88. #define K_ALTSHIFTTAB 0x03
  89. #define KDGKBENT 0x4B46 /* gets one entry in translation table */
  90. #define KDSKBENT 0x4B47 /* sets one entry in translation table */
  91. struct kbsentry {
  92. unsigned char kb_func;
  93. unsigned char kb_string[512];
  94. };
  95. #define KDGKBSENT 0x4B48 /* gets one function key string entry */
  96. #define KDSKBSENT 0x4B49 /* sets one function key string entry */
  97. struct kbdiacr {
  98. unsigned char diacr, base, result;
  99. };
  100. struct kbdiacrs {
  101. unsigned int kb_cnt; /* number of entries in following array */
  102. struct kbdiacr kbdiacr[256]; /* MAX_DIACR from keyboard.h */
  103. };
  104. #define KDGKBDIACR 0x4B4A /* read kernel accent table */
  105. #define KDSKBDIACR 0x4B4B /* write kernel accent table */
  106. struct kbkeycode {
  107. unsigned int scancode, keycode;
  108. };
  109. #define KDGETKEYCODE 0x4B4C /* read kernel keycode table entry */
  110. #define KDSETKEYCODE 0x4B4D /* write kernel keycode table entry */
  111. #define KDSIGACCEPT 0x4B4E /* accept kbd generated signals */
  112. struct kbd_repeat {
  113. int delay; /* in msec; <= 0: don't change */
  114. int period; /* in msec; <= 0: don't change */
  115. /* earlier this field was misnamed "rate" */
  116. };
  117. #define KDKBDREP 0x4B52 /* set keyboard delay/repeat rate;
  118. * actually used values are returned */
  119. #define KDFONTOP 0x4B72 /* font operations */
  120. struct console_font_op {
  121. unsigned int op; /* operation code KD_FONT_OP_* */
  122. unsigned int flags; /* KD_FONT_FLAG_* */
  123. unsigned int width, height; /* font size */
  124. unsigned int charcount;
  125. unsigned char __user *data; /* font data with height fixed to 32 */
  126. };
  127. struct console_font {
  128. unsigned int width, height; /* font size */
  129. unsigned int charcount;
  130. unsigned char *data; /* font data with height fixed to 32 */
  131. };
  132. #define KD_FONT_OP_SET 0 /* Set font */
  133. #define KD_FONT_OP_GET 1 /* Get font */
  134. #define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */
  135. #define KD_FONT_OP_COPY 3 /* Copy from another console */
  136. #define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */
  137. #ifdef __KERNEL__
  138. #define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface [compat] */
  139. #endif
  140. /* note: 0x4B00-0x4B4E all have had a value at some time;
  141. don't reuse for the time being */
  142. /* note: 0x4B60-0x4B6D, 0x4B70-0x4B72 used above */
  143. #endif /* _LINUX_KD_H */