00001 #ifndef _LINUX_KD_H 00002 #define _LINUX_KD_H 00003 00004 /// 0x4B is 'K', to avoid collision with termios and vt 00005 00006 #define SWAPMONO 0x4B00 ///< use mca as output device 00007 #define SWAPCGA 0x4B01 ///< use cga as output device 00008 #define SWAPEGA 0x4B02 ///< use ega as output device 00009 #define SWAPVGA 0x4B03 ///< use vga as output device 00010 #define CONS_CURRENT 0x4B04 ///< return current output device 00011 #define MONO 0x01 00012 #define CGA 0x02 00013 #define EGA 0x03 00014 00015 #define SW_B40x25 0x4B05 ///< 40x25 mono text (cga/ega) 00016 #define SW_C40x25 0x4B06 ///< 40x24 color text (cga/ega) 00017 #define SW_B80x25 0x4B07 ///< 80x25 mono text (cga/ega) 00018 #define SW_C80x25 0x4B08 ///< 80x25 color text (cga/ega) 00019 #define SW_BG320 0x4B09 ///< 320x200 mono graphics (cga/ega) 00020 #define SW_CG320 0x4B0A ///< 320x200 color graphics (cga/ega) 00021 #define SW_BG640 0x4B0B ///< 640x200 mono graphics (cga/ega) 00022 #define SW_CG320_D 0x4B0C ///< 320x200 graphics (ega mode d) 00023 #define SW_CG640_E 0x4B0D ///< 640x200 graphics (ega mode e) 00024 #define SW_EGAMONOAPA 0x4B0E ///< 640x350 graphics (ega mode f) 00025 #define SW_ENH_MONOAPA2 0x4B0F ///< 640x350 graphics extd mem (ega mode f*) 00026 #define SW_CG640x350 0x4B10 ///< 640x350 graphics (ega mode 10) 00027 #define SW_ENH_CG640 0x4B11 ///< 640x350 graphics extd mem (ega mode 10*) 00028 #define SW_EGAMONO80x25 0x4B12 ///< 80x25 mono text (ega mode 7) 00029 #define SW_ENHB40x25 0x4B13 ///< enhanced 40x25 mono text (ega) 00030 #define SW_ENHC40x25 0x4B14 ///< enhanced 40x25 color text (ega) 00031 #define SW_ENHB80x25 0x4B15 ///< enhanced 80x25 mono text (ega) 00032 #define SW_ENHC80x25 0x4B16 ///< enhanced 80x25 color text (ega) 00033 #define SW_ENHB80x43 0x4B17 ///< enhanced 80x43 mono text (ega) 00034 #define SW_ENHC80x43 0x4B18 ///< enhanced 80x43 color text (ega) 00035 #define SW_MCAMODE 0x4B19 ///< reinit mca 00036 #define SW_ATT640 0x4B1A ///< 640x400 16color 00037 /// should add more vga modes, etc 00038 00039 #define CONS_GET 0x4B1B ///< get current display mode 00040 #define M_B40x25 0 ///< 40x25 mono (cga/ega) 00041 #define M_C40x25 1 ///< 40x25 color (cga/ega) 00042 #define M_B80x25 2 ///< 80x25 mono (cga/ega) 00043 #define M_C80x25 3 ///< 80x25 color (cga/ega) 00044 #define M_BG320 4 ///< 320x200 mono (cga/ega) 00045 #define M_CG320 5 ///< 320x200 color (cga/ega) 00046 #define M_BG640 6 ///< 640x200 mono (cga/ega) 00047 #define M_EGAMONO80x25 7 ///< 80x25 mono (ega) 00048 #define M_CG320_D 13 ///< ega mode d 00049 #define M_CG640_E 14 ///< ega mode e 00050 #define M_EFAMONOAPA 15 ///< ega mode f 00051 #define M_CG640x350 16 ///< ega mode 10 00052 #define M_ENHMONOAPA2 17 ///< ega mode f with ext mem 00053 #define M_ENH_CG640 18 ///< ega mode 10* 00054 #define M_ENH_B40x25 19 ///< ega enh 40x25 mono 00055 #define M_ENH_C40x25 20 ///< ega enh 40x25 color 00056 #define M_ENH_B80x25 21 ///< ega enh 80x25 mono 00057 #define M_ENH_C80x25 22 ///< ega enh 80x25 color 00058 #define M_ENH_B80x43 0x70 ///< ega enh 80x43 mono 00059 #define M_ENH_C80x43 0x71 ///< ega enh 80x43 color 00060 #define M_MCA_MODE 0xff ///< monochrome adapter mode 00061 #define MCA_GET 0x4B1C ///< get mca display mode 00062 #define CGA_GET 0x4B1D ///< get cga display mode 00063 #define EGA_GET 0x4B1E ///< get ega display mode 00064 00065 #define MAPCONS 0x4B1F ///< map current video mem into address space 00066 #define MAPMONO 0x4B20 ///< map mca video mem into address space 00067 #define MAPCGA 0x4B21 ///< map cga video mem into address space 00068 #define MAPEGA 0x4B22 ///< map ega video mem into address space 00069 #define MAPVGA 0x4B23 ///< map vga video mem into address space 00070 00071 struct port_io_struc { 00072 char dir; ///< direction in vs out 00073 unsigned short port; 00074 char data; 00075 }; 00076 #define IN_ON_PORT 0x00 00077 #define OUT_ON_PORT 0x01 00078 struct port_io_arg { 00079 struct port_io_struc args[4]; 00080 }; 00081 #define MCAIO 0x4B24 ///< i/o to mca video board 00082 #define CGAIO 0x4B25 ///< i/o to cga video board 00083 #define EGAIO 0x4B26 ///< i/o to ega video board 00084 #define VGAIO 0x4B27 ///< i/o to vga video board 00085 00086 #define GIO_FONT8x8 0x4B28 ///< gets current 8x8 font used 00087 #define PIO_FONT8x8 0x4B29 ///< use supplied 8x8 font 00088 #define GIO_FONT8x14 0x4B2A ///< gets current 8x14 font used 00089 #define PIO_FONT8x14 0x4B2B ///< use supplied 8x14 font 00090 #define GIO_FONT8x16 0x4B2C ///< gets current 8x16 font used 00091 #define PIO_FONT8x16 0x4B2D ///< use supplied 8x16 font 00092 00093 #define GIO_FONT 0x4B60 ///< gets font in expanded form 00094 #define PIO_FONT 0x4B61 ///< use font in expanded form 00095 00096 #define MKDIOADDR 32 ///< io bitmap size from <linux/sched.h> 00097 struct kd_disparam { 00098 long type; ///< type of display 00099 char *addr; ///< display mem address 00100 ushort ioaddr[MKDIOADDR]; ///< valid i/o addresses 00101 }; 00102 #define KDDISPTYPE 0x4B2E ///< gets display info 00103 #define KD_MONO 0x01 00104 #define KD_HERCULES 0x02 00105 #define KD_CGA 0x03 00106 #define KD_EGA 0x04 00107 00108 #define KIOCSOUND 0x4B2F ///< start sound generation (0 for off) 00109 #define KDMKTONE 0x4B30 ///< generate tone 00110 00111 #define KDGETLED 0x4B31 ///< return current led flags 00112 #define KDSETLED 0x4B32 ///< set current led flags 00113 #define LED_SCR 0x01 ///< scroll lock 00114 #define LED_CAP 0x04 ///< caps lock 00115 #define LED_NUM 0x02 ///< num lock 00116 00117 #define KDGKBTYPE 0x4B33 ///< get keyboard type 00118 #define KB_84 0x01 00119 #define KB_101 0x02 00120 #define KB_OTHER 0x03 00121 00122 #define KDADDIO 0x4B34 ///< add i/o port as valid 00123 #define KDDELIO 0x4B35 ///< del i/o port as valid 00124 #define KDENABIO 0x4B36 ///< enable i/o to video board 00125 #define KDDISABIO 0x4B37 ///< disable i/o to video board 00126 00127 struct kd_quemode { 00128 int qsize; ///< desired # elem in queue 00129 int signo; ///< signal to send when queue not empty 00130 char *qaddr; ///< user virt addr of queue 00131 }; 00132 #define KDQUEMODE 0x4B38 ///< enable/disable special queue mode 00133 00134 #define KDSBORDER 0x4B39 ///< set screen boarder in ega text mode 00135 00136 #define KDSETMODE 0x4B3A ///< set text/grahics mode 00137 #define KD_TEXT 0x00 00138 #define KD_GRAPHICS 0x01 00139 #define KD_TEXT0 0x02 ///< ? 00140 #define KD_TEXT1 0x03 ///< ? 00141 #define KDGETMODE 0x4B3B ///< get current mode 00142 00143 struct kd_memloc { 00144 char *vaddr; ///< virt addr to map to 00145 char *physaddr; ///< phys addr to map from 00146 long length; ///< number of bytes 00147 long ioflg; ///< enable i/o if set 00148 }; 00149 #define KDMAPDISP 0x4B3C ///< map display into address space 00150 #define KDUNMAPDISP 0x4B3D ///< unmap display from address space 00151 00152 #define KDVDCTYPE 0x4B3E ///< return vdc controller/display info 00153 00154 #define KIOCINFO 0x4B3F ///< tell what the device is 00155 00156 typedef char scrnmap_t; 00157 #define E_TABSZ 256 00158 #define GIO_SCRNMAP 0x4B40 ///< get screen mapping from kernel 00159 #define PIO_SCRNMAP 0x4B41 ///< put screen mapping table in kernel 00160 00161 #define GIO_ATTR 0x4B42 ///< get screen attributes 00162 #define GIO_COLOR 0x4B43 ///< return nonzero if display is color 00163 00164 #define K_RAW 0x00 00165 #define K_XLATE 0x01 00166 #define K_MEDIUMRAW 0x02 00167 #define KDGKBMODE 0x4B44 ///< gets current keyboard mode 00168 #define KDSKBMODE 0x4B45 ///< sets current keyboard mode 00169 00170 /// merge with previous pair of ioctls? 00171 #define K_METABIT 0x03 00172 #define K_ESCPREFIX 0x04 00173 #define KDGKBMETA 0x4B62 ///< gets meta key handling mode 00174 #define KDSKBMETA 0x4B63 ///< sets meta key handling mode 00175 00176 struct kbentry { 00177 u_char kb_table; 00178 u_char kb_index; 00179 u_short kb_value; 00180 }; 00181 #define K_NORMTAB 0x00 00182 #define K_SHIFTTAB 0x01 00183 #define K_ALTTAB 0x02 00184 #define K_ALTSHIFTTAB 0x03 00185 #define K_SRQTAB 0x04 00186 #define KDGKBENT 0x4B46 ///< gets one entry in translation table 00187 #define KDSKBENT 0x4B47 ///< sets one entry in translation table 00188 00189 struct kbsentry { 00190 u_char kb_func; 00191 u_char kb_string[512]; ///< FUNC_BUFSIZE from keyboard.h 00192 }; 00193 #define KDGKBSENT 0x4B48 ///< gets one function key string entry 00194 #define KDSKBSENT 0x4B49 ///< sets one function key string entry 00195 00196 struct kbdiacr { 00197 u_char diacr, base, result; 00198 }; 00199 struct kbdiacrs { 00200 unsigned int kb_cnt; ///< number of entries in following array 00201 struct kbdiacr kbdiacr[256]; ///< MAX_DIACR from keyboard.h 00202 }; 00203 #define KDGKBDIACR 0x4B4A ///< read kernel accent table 00204 #define KDSKBDIACR 0x4B4B ///< write kernel accent table 00205 00206 /** 00207 * 00208 note: 0x4B60 and 0x4B61 used above for GIO_FONT and PIO_FONT 00209 00210 00211 */ 00212 00213 #endif // _LINUX_KD_H
1.4.6-5