Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

455 lines
20 KiB

  1. /******************************************************************************
  2. *
  3. * Module: STRUCTS.H Mode/Monitor Structure Header Module
  4. *
  5. * Revision: 1.00
  6. *
  7. * Date: April 8, 1994
  8. *
  9. * Author: Randy Spurlock
  10. *
  11. *******************************************************************************
  12. *
  13. * Module Description:
  14. *
  15. * This module contains the structure declarations for
  16. * the mode/monitor functions.
  17. *
  18. *******************************************************************************
  19. *
  20. * Changes:
  21. *
  22. * DATE REVISION DESCRIPTION AUTHOR
  23. * -------- -------- -------------------------------------------------------
  24. * 04/08/94 1.00 Original Randy Spurlock
  25. *
  26. *******************************************************************************
  27. * Local Constants
  28. ******************************************************************************/
  29. //
  30. // Is this Windows NT or something else?
  31. //
  32. #ifndef WIN_NT
  33. #if NT_MINIPORT
  34. #define WIN_NT 1
  35. #else
  36. #define WIN_NT 0
  37. #endif
  38. #endif
  39. #if WIN_NT
  40. extern char *MODE_FILE;
  41. #else
  42. #define MODE_FILE "Mode.Ini" /* Controller mode filename */
  43. #endif
  44. #define MONITOR_FILE "Monitor.Ini" /* Monitor filename */
  45. #define HSYNC_POS 0x00 /* Positive horizontal sync. value */
  46. #define HSYNC_NEG 0x40 /* Negative horizontal sync. value */
  47. #define VSYNC_POS 0x00 /* Positive vertical sync. value */
  48. #define VSYNC_NEG 0x80 /* Negative vertical sync. value */
  49. #define END_TABLE 0x00 /* End of mode table opcode value */
  50. #define SET_BIOS_MODE 0x01 /* Set BIOS video mode opcode value */
  51. #define SINGLE_BYTE_INPUT 0x02 /* Single byte input opcode value */
  52. #define SINGLE_WORD_INPUT 0x03 /* Single word input opcode value */
  53. #define SINGLE_DWORD_INPUT 0x04 /* Single dword input opcode value */
  54. #define SINGLE_INDEXED_INPUT 0x05 /* Single indexed input opcode value */
  55. #define SINGLE_BYTE_OUTPUT 0x06 /* Single byte output opcode value */
  56. #define SINGLE_WORD_OUTPUT 0x07 /* Single word output opcode value */
  57. #define SINGLE_DWORD_OUTPUT 0x08 /* Single dword output opcode value */
  58. #define SINGLE_INDEXED_OUTPUT 0x09 /* Single indexed output opcode */
  59. #define HOLDING_BYTE_OUTPUT 0x0A /* Holding byte output opcode value */
  60. #define HOLDING_WORD_OUTPUT 0x0B /* Holding word output opcode value */
  61. #define HOLDING_DWORD_OUTPUT 0x0C /* Holding dword output opcode value */
  62. #define HOLDING_INDEXED_OUTPUT 0x0D /* Holding indexed output opcode */
  63. #define MULTIPLE_BYTE_OUTPUT 0x0E /* Multiple byte output opcode value */
  64. #define MULTIPLE_WORD_OUTPUT 0x0F /* Multiple word output opcode value */
  65. #define MULTIPLE_DWORD_OUTPUT 0x10 /* Multiple dword output opcode value*/
  66. #define MULTIPLE_INDEXED_OUTPUT 0x11 /* Multiple indexed output opcode */
  67. #define SINGLE_BYTE_READ 0x12 /* Single byte read opcode value */
  68. #define SINGLE_WORD_READ 0x13 /* Single word read opcode value */
  69. #define SINGLE_DWORD_READ 0x14 /* Single dword read opcode value */
  70. #define SINGLE_BYTE_WRITE 0x15 /* Single byte write opcode value */
  71. #define SINGLE_WORD_WRITE 0x16 /* Single word write opcode value */
  72. #define SINGLE_DWORD_WRITE 0x17 /* Single dword write opcode value */
  73. #define HOLDING_BYTE_WRITE 0x18 /* Holding byte write opcode value */
  74. #define HOLDING_WORD_WRITE 0x19 /* Holding word write opcode value */
  75. #define HOLDING_DWORD_WRITE 0x1A /* Holding dword write opcode value */
  76. #define MULTIPLE_BYTE_WRITE 0x1B /* Multiple byte write opcode value */
  77. #define MULTIPLE_WORD_WRITE 0x1C /* Multiple word write opcode value */
  78. #define MULTIPLE_DWORD_WRITE 0x1D /* Multiple dword write opcode value */
  79. #define PERFORM_OPERATION 0x1E /* Perform logical operation opcode */
  80. #define PERFORM_DELAY 0x1F /* Perform time delay opcode value */
  81. #define SUB_TABLE 0x20 /* Perform mode sub-table opcode */
  82. #define I2COUT_WRITE 0x21 /* Perform I2C Write */
  83. #define AND_OPERATION 0x00 /* Logical AND operation code value */
  84. #define OR_OPERATION 0x01 /* Logical OR operation code value */
  85. #define XOR_OPERATION 0x02 /* Logical XOR operation code value */
  86. /******************************************************************************
  87. * Type Definitions and Structures
  88. ******************************************************************************/
  89. #if WIN_NT && NT_MINIPORT // If NT miniport
  90. #pragma pack (push,1)
  91. #endif
  92. typedef struct tagMode /* Generic mode table structure */
  93. {
  94. BYTE Mode_Opcode; /* Mode table opcode value */
  95. WORD Mode_Count; /* Mode table count value */
  96. } Mode;
  97. typedef struct tagMTE /* Mode table end structure */
  98. {
  99. BYTE MTE_Opcode; /* Mode table end opcode value */
  100. } MTE;
  101. typedef struct tagSBM /* Set BIOS mode structure */
  102. {
  103. BYTE SBM_Opcode; /* Set BIOS mode opcode value */
  104. BYTE SBM_Mode; /* BIOS mode value */
  105. } SBM;
  106. typedef struct tagSBI /* Single byte input structure */
  107. {
  108. BYTE SBI_Opcode; /* Single byte input opcode value */
  109. WORD SBI_Port; /* Single byte input port address */
  110. } SBI;
  111. typedef struct tagSWI /* Single word input structure */
  112. {
  113. BYTE SWI_Opcode; /* Single word input opcode value */
  114. WORD SWI_Port; /* Single word input port address */
  115. } SWI;
  116. typedef struct tagSDI /* Single dword input structure */
  117. {
  118. BYTE SDI_Opcode; /* Single dword input opcode value */
  119. WORD SDI_Port; /* Single dword input port address */
  120. } SDI;
  121. typedef struct tagSII /* Single indexed input structure */
  122. {
  123. BYTE SII_Opcode; /* Single indexed input opcode value */
  124. WORD SII_Port; /* Single indexed input port address */
  125. BYTE SII_Index; /* Single indexed input index value */
  126. } SII;
  127. typedef struct tagSBO /* Single byte output structure */
  128. {
  129. BYTE SBO_Opcode; /* Single byte output opcode value */
  130. WORD SBO_Port; /* Single byte output port address */
  131. BYTE SBO_Value; /* Single byte output data value */
  132. } SBO;
  133. typedef struct tagSWO /* Single word output structure */
  134. {
  135. BYTE SWO_Opcode; /* Single word output opcode value */
  136. WORD SWO_Port; /* Single word output port address */
  137. WORD SWO_Value; /* Single word output data value */
  138. } SWO;
  139. typedef struct tagSDO /* Single dword output structure */
  140. {
  141. BYTE SDO_Opcode; /* Single dword output opcode value */
  142. WORD SDO_Port; /* Single dword output port address */
  143. DWORD SDO_Value; /* Single dword output data value */
  144. } SDO;
  145. typedef struct tagSIO /* Single indexed output structure */
  146. {
  147. BYTE SIO_Opcode; /* Single indexed output opcode */
  148. WORD SIO_Port; /* Single indexed output port addr. */
  149. BYTE SIO_Index; /* Single indexed output index value */
  150. BYTE SIO_Value; /* Single indexed output data value */
  151. } SIO;
  152. typedef struct tagHBO /* Holding byte output structure */
  153. {
  154. BYTE HBO_Opcode; /* Holding byte output opcode value */
  155. WORD HBO_Port; /* Holding byte output port address */
  156. } HBO;
  157. typedef struct tagHWO /* Holding word output structure */
  158. {
  159. BYTE HWO_Opcode; /* Holding word output opcode value */
  160. WORD HWO_Port; /* Holding word output port address */
  161. } HWO;
  162. typedef struct tagHDO /* Holding dword output structure */
  163. {
  164. BYTE HDO_Opcode; /* Holding dword output opcode value */
  165. WORD HDO_Port; /* Holding dword output port address */
  166. } HDO;
  167. typedef struct tagHIO /* Holding indexed output structure */
  168. {
  169. BYTE HIO_Opcode; /* Holding indexed output opcode */
  170. WORD HIO_Port; /* Holding indexed output port addr. */
  171. BYTE HIO_Index; /* Holding indexed output index */
  172. } HIO;
  173. typedef struct tagMBO /* Multiple byte output structure */
  174. {
  175. BYTE MBO_Opcode; /* Multiple byte output opcode value */
  176. WORD MBO_Count; /* Multiple byte output data count */
  177. WORD MBO_Port; /* Multiple byte output port address */
  178. } MBO;
  179. typedef struct tagMWO /* Multiple word output structure */
  180. {
  181. BYTE MWO_Opcode; /* Multiple word output opcode value */
  182. WORD MWO_Count; /* Multiple word output data count */
  183. WORD MWO_Port; /* Multiple word output port address */
  184. } MWO;
  185. typedef struct tagMDO /* Multiple dword output structure */
  186. {
  187. BYTE MDO_Opcode; /* Multiple dword output opcode value*/
  188. WORD MDO_Count; /* Multiple dword output data count */
  189. WORD MDO_Port; /* Multiple dword output port address*/
  190. } MDO;
  191. typedef struct tagMIO /* Multiple indexed output structure */
  192. {
  193. BYTE MIO_Opcode; /* Multiple indexed output opcode */
  194. WORD MIO_Count; /* Multiple indexed output count */
  195. WORD MIO_Port; /* Multiple indexed output port */
  196. BYTE MIO_Index; /* Multiple indexed output index */
  197. } MIO;
  198. typedef struct tagSBR /* Single byte read structure */
  199. {
  200. BYTE SBR_Opcode; /* Single byte read opcode value */
  201. WORD SBR_Address; /* Single byte read address value */
  202. } SBR;
  203. typedef struct tagSWR /* Single word read structure */
  204. {
  205. BYTE SWR_Opcode; /* Single word read opcode value */
  206. WORD SWR_Address; /* Single word read address value */
  207. } SWR;
  208. typedef struct tagSDR /* Single dword read structure */
  209. {
  210. BYTE SDR_Opcode; /* Single dword read opcode value */
  211. WORD SDR_Address; /* Single dword read address value */
  212. } SDR;
  213. typedef struct tagSBW /* Single byte write structure */
  214. {
  215. BYTE SBW_Opcode; /* Single byte write opcode value */
  216. WORD SBW_Address; /* Single byte write address value */
  217. WORD SBW_Value; /* Single word output data value */
  218. } SBW;
  219. typedef struct tagSWW /* Single word write structure */
  220. {
  221. BYTE SWW_Opcode; /* Single word write opcode value */
  222. WORD SWW_Address; /* Single word write address value */
  223. WORD SWW_Value; /* Single word write data value */
  224. } SWW;
  225. typedef struct tagSDW /* Single dword write structure */
  226. {
  227. BYTE SDW_Opcode; /* Single dword write opcode value */
  228. WORD SDW_Address; /* Single dword write address value */
  229. DWORD SDW_Value; /* Single dword write data value */
  230. } SDW;
  231. typedef struct tagHBW /* Holding byte write structure */
  232. {
  233. BYTE HBW_Opcode; /* Holding byte write opcode value */
  234. WORD HBW_Address; /* Holding byte write address value */
  235. } HBW;
  236. typedef struct tagHWW /* Holding word write structure */
  237. {
  238. BYTE HWW_Opcode; /* Holding word write opcode value */
  239. WORD HWW_Address; /* Holding word write address value */
  240. } HWW;
  241. typedef struct tagHDW /* Holding dword write structure */
  242. {
  243. BYTE HDW_Opcode; /* Holding dword write opcode value */
  244. WORD HDW_Address; /* Holding dword write address value */
  245. } HDW;
  246. typedef struct tagMBW /* Multiple byte write structure */
  247. {
  248. BYTE MBW_Opcode; /* Multiple byte write opcode value */
  249. WORD MBW_Count; /* Multiple byte write data count */
  250. WORD MBW_Address; /* Multiple byte write address value */
  251. } MBW;
  252. typedef struct tagMWW /* Multiple word write structure */
  253. {
  254. BYTE MWW_Opcode; /* Multiple word write opcode value */
  255. WORD MWW_Count; /* Multiple word write data count */
  256. WORD MWW_Address; /* Multiple word write address value */
  257. } MWW;
  258. typedef struct tagMDW /* Multiple dword write structure */
  259. {
  260. BYTE MDW_Opcode; /* Multiple dword write opcode value */
  261. WORD MDW_Count; /* Multiple dword write data count */
  262. WORD MDW_Address; /* Multiple dword write address value*/
  263. } MDW;
  264. typedef struct tagLO /* Logical operation structure */
  265. {
  266. BYTE LO_Opcode; /* Logical operation opcode value */
  267. BYTE LO_Operation; /* Logical operation operation value */
  268. DWORD LO_Value; /* Logical operation data value */
  269. } LO;
  270. typedef struct tagDO /* Delay operation structure */
  271. {
  272. BYTE DO_Opcode; /* Delay operation opcode value */
  273. WORD DO_Time; /* Delay operation time value */
  274. } DO;
  275. typedef struct tagMST /* Mode sub-table structure */
  276. {
  277. BYTE MST_Opcode; /* Mode sub-table opcode value */
  278. WORD MST_Pointer; /* Mode sub-table pointer value */
  279. } MST;
  280. typedef struct i2c {
  281. BYTE I2C_Opcode; /* This is the op_code */
  282. BYTE I2C_Addr; /* The 7 bit I2C Address */
  283. WORD I2C_Port; /* I2C Port to talk to */
  284. WORD I2C_Count; /* The number of commands */
  285. } I2C, * PI2C;
  286. typedef struct i2cdata {
  287. BYTE I2C_Reg; /* The I2C Register */
  288. BYTE I2C_Data; /* The I2C Data */
  289. } I2CDATA, * PI2CDATA;
  290. #if WIN_NT && NT_MINIPORT // If NT miniport
  291. #pragma pack (pop)
  292. #endif
  293. #if WIN_NT
  294. /******************************************************************************
  295. *
  296. * Module: STRUCTS.H Local Structures Header Module
  297. *
  298. * Revision: 1.00
  299. *
  300. * Date: April 14, 1994
  301. *
  302. * Author: Randy Spurlock
  303. *
  304. *******************************************************************************
  305. *
  306. * Module Description:
  307. *
  308. * This module contains local structure declarations.
  309. *
  310. *******************************************************************************
  311. *
  312. * Changes:
  313. *
  314. * DATE REVISION DESCRIPTION AUTHOR
  315. * -------- -------- -------------------------------------------------------
  316. * 04/14/94 1.00 Original Randy Spurlock
  317. *
  318. *******************************************************************************
  319. * Local Definitions
  320. ******************************************************************************/
  321. #define NAME_SIZE 64 /* Maximum filename size in bytes */
  322. #define BUFFER_SIZE 4096 /* Number of bytes in .INI buffer */
  323. #define ENTRY_LINE 0x00 /* Entry line flag value */
  324. #define SECTION_LINE 0x01 /* Section header line flag value */
  325. #define COMMENT_LINE 0x02 /* Comment line flag value */
  326. /******************************************************************************
  327. * Local Structures and Unions
  328. ******************************************************************************/
  329. typedef struct tagLineInfo /* Line information structure */
  330. {
  331. WORD nID; /* Buffer ID value */
  332. BYTE fType; /* Line type flags */
  333. BYTE nOffset; /* Section or entry offset value */
  334. BYTE nLength; /* Section or entry name length */
  335. BYTE nSize; /* Line length value */
  336. } LineInfo;
  337. typedef struct tagFreeInfo /* Free information structure */
  338. {
  339. WORD nID; /* Buffer ID value */
  340. DWORD nSize; /* Free space size value */
  341. } FreeInfo;
  342. typedef struct tagLineHeader /* Line header structure */
  343. {
  344. struct tagLineHeader *pPrev; /* Pointer to previous line header */
  345. struct tagLineHeader *pNext; /* Pointer to next line header */
  346. struct tagLineInfo Info; /* Line information structure */
  347. } LineHeader;
  348. typedef struct tagFreeHeader /* Free header structure */
  349. {
  350. struct tagFreeHeader *pPrev; /* Pointer to previous free header */
  351. struct tagFreeHeader *pNext; /* Pointer to next free header */
  352. struct tagFreeInfo Info; /* Free information structure */
  353. } FreeHeader;
  354. typedef struct tagIniBuffer /* Ini buffer structure */
  355. {
  356. struct tagIniBuffer *pPrev; /* Pointer to previous ini buffer */
  357. struct tagIniBuffer *pNext; /* Pointer to next ini buffer */
  358. char acData[BUFFER_SIZE]; /* Ini data buffer array */
  359. } IniBuffer;
  360. typedef struct tagIniPointer /* Ini pointer structure */
  361. {
  362. IniBuffer *pFirst; /* Pointer to first Ini buffer */
  363. IniBuffer *pLast; /* Pointer to last Ini buffer */
  364. } IniPointer;
  365. typedef struct tagLinePointer /* Line header pointer structure */
  366. {
  367. LineHeader *pFirst; /* Pointer to first line header */
  368. LineHeader *pLast; /* Pointer to last line header */
  369. } LinePointer;
  370. typedef struct tagFreePointer /* Free header pointer structure */
  371. {
  372. FreeHeader *pFirst; /* Pointer to first free header */
  373. FreeHeader *pLast; /* Pointer to last free header */
  374. } FreePointer;
  375. typedef struct tagIniCache /* Ini cache structure */
  376. {
  377. struct tagIniCache *pPrev; /* Pointer to previous ini cache */
  378. struct tagIniCache *pNext; /* Pointer to next ini cache */
  379. char sCacheFile[NAME_SIZE]; /* Cache filename */
  380. int nBufferID; /* Buffer ID value */
  381. BOOL bDirtyFlag; /* Cache dirty flag */
  382. IniPointer pIni; /* Ini buffer pointer structure */
  383. LinePointer pLine; /* Line header pointer structure */
  384. FreePointer pFree; /* Free header pointer structure */
  385. } IniCache;
  386. typedef struct tagCachePointer /* Cache pointer structure */
  387. {
  388. IniCache *pFirst; /* Pointer to first .INI cache */
  389. IniCache *pLast; /* Pointer to last .INI cache */
  390. } CachePointer;
  391. #endif
  392.