kd.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. #ifndef _LINUX_KD_H
  2. #define _LINUX_KD_H
  3. #include <linux/types.h>
  4. /* 0x4B is 'K', to avoid collision with termios and vt */
  5. #define GIO_FONT 0x4B60 /* gets font in expanded form */
  6. #define PIO_FONT 0x4B61 /* use font in expanded form */
  7. #define GIO_FONTX 0x4B6B /* get font using struct consolefontdesc */
  8. #define PIO_FONTX 0x4B6C /* set font using struct consolefontdesc */
  9. struct consolefontdesc {
  10. unsigned short charcount; /* characters in font (256 or 512) */
  11. unsigned short charheight; /* scan lines per character (1-32) */
  12. char *chardata; /* font data in expanded form */
  13. };
  14. #define PIO_FONTRESET 0x4B6D /* reset to default font */
  15. #define GIO_CMAP 0x4B70 /* gets colour palette on VGA+ */
  16. #define PIO_CMAP 0x4B71 /* sets colour palette on VGA+ */
  17. #define KIOCSOUND 0x4B2F /* start sound generation (0 for off) */
  18. #define KDMKTONE 0x4B30 /* generate tone */
  19. #define KDGETLED 0x4B31 /* return current led state */
  20. #define KDSETLED 0x4B32 /* set led state [lights, not flags] */
  21. #define LED_SCR 0x01 /* scroll lock led */
  22. #define LED_NUM 0x02 /* num lock led */
  23. #define LED_CAP 0x04 /* caps lock led */
  24. #define KDGKBTYPE 0x4B33 /* get keyboard type */
  25. #define KB_84 0x01
  26. #define KB_101 0x02 /* this is what we always answer */
  27. #define KB_OTHER 0x03
  28. #define KDADDIO 0x4B34 /* add i/o port as valid */
  29. #define KDDELIO 0x4B35 /* del i/o port as valid */
  30. #define KDENABIO 0x4B36 /* enable i/o to video board */
  31. #define KDDISABIO 0x4B37 /* disable i/o to video board */
  32. #define KDSETMODE 0x4B3A /* set text/graphics mode */
  33. #define KD_TEXT 0x00
  34. #define KD_GRAPHICS 0x01
  35. #define KD_TEXT0 0x02 /* obsolete */
  36. #define KD_TEXT1 0x03 /* obsolete */
  37. #define KDGETMODE 0x4B3B /* get current mode */
  38. #define KDMAPDISP 0x4B3C /* map display into address space */
  39. #define KDUNMAPDISP 0x4B3D /* unmap display from address space */
  40. typedef char scrnmap_t;
  41. #define E_TABSZ 256
  42. #define GIO_SCRNMAP 0x4B40 /* get screen mapping from kernel */
  43. #define PIO_SCRNMAP 0x4B41 /* put screen mapping table in kernel */
  44. #define GIO_UNISCRNMAP 0x4B69 /* get full Unicode screen mapping */
  45. #define PIO_UNISCRNMAP 0x4B6A /* set full Unicode screen mapping */
  46. #define GIO_UNIMAP 0x4B66 /* get unicode-to-font mapping from kernel */
  47. struct unipair {
  48. unsigned short unicode;
  49. unsigned short fontpos;
  50. };
  51. struct unimapdesc {
  52. unsigned short entry_ct;
  53. struct unipair *entries;
  54. };
  55. #define PIO_UNIMAP 0x4B67 /* put unicode-to-font mapping in kernel */
  56. #define PIO_UNIMAPCLR 0x4B68 /* clear table, possibly advise hash algorithm */
  57. struct unimapinit {
  58. unsigned short advised_hashsize; /* 0 if no opinion */
  59. unsigned short advised_hashstep; /* 0 if no opinion */
  60. unsigned short advised_hashlevel; /* 0 if no opinion */
  61. };
  62. #define UNI_DIRECT_BASE 0xF000 /* start of Direct Font Region */
  63. #define UNI_DIRECT_MASK 0x01FF /* Direct Font Region bitmask */
  64. #define K_RAW 0x00
  65. #define K_XLATE 0x01
  66. #define K_MEDIUMRAW 0x02
  67. #define K_UNICODE 0x03
  68. #define K_OFF 0x04
  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 kbdiacruc {
  107. unsigned int diacr, base, result;
  108. };
  109. struct kbdiacrsuc {
  110. unsigned int kb_cnt; /* number of entries in following array */
  111. struct kbdiacruc kbdiacruc[256]; /* MAX_DIACR from keyboard.h */
  112. };
  113. #define KDGKBDIACRUC 0x4BFA /* read kernel accent table - UCS */
  114. #define KDSKBDIACRUC 0x4BFB /* write kernel accent table - UCS */
  115. struct kbkeycode {
  116. unsigned int scancode, keycode;
  117. };
  118. #define KDGETKEYCODE 0x4B4C /* read kernel keycode table entry */
  119. #define KDSETKEYCODE 0x4B4D /* write kernel keycode table entry */
  120. #define KDSIGACCEPT 0x4B4E /* accept kbd generated signals */
  121. struct kbd_repeat {
  122. int delay; /* in msec; <= 0: don't change */
  123. int period; /* in msec; <= 0: don't change */
  124. /* earlier this field was misnamed "rate" */
  125. };
  126. #define KDKBDREP 0x4B52 /* set keyboard delay/repeat rate;
  127. * actually used values are returned */
  128. #define KDFONTOP 0x4B72 /* font operations */
  129. struct console_font_op {
  130. unsigned int op; /* operation code KD_FONT_OP_* */
  131. unsigned int flags; /* KD_FONT_FLAG_* */
  132. unsigned int width, height; /* font size */
  133. unsigned int charcount;
  134. unsigned char *data; /* font data with height fixed to 32 */
  135. };
  136. struct console_font {
  137. unsigned int width, height; /* font size */
  138. unsigned int charcount;
  139. unsigned char *data; /* font data with height fixed to 32 */
  140. };
  141. #define KD_FONT_OP_SET 0 /* Set font */
  142. #define KD_FONT_OP_GET 1 /* Get font */
  143. #define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */
  144. #define KD_FONT_OP_COPY 3 /* Copy from another console */
  145. #define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */
  146. /* note: 0x4B00-0x4B4E all have had a value at some time;
  147. don't reuse for the time being */
  148. /* note: 0x4B60-0x4B6D, 0x4B70-0x4B72 used above */
  149. #endif /* _LINUX_KD_H */