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.

115 lines
5.3 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: hw.h
  3. *
  4. * All the hardware specific driver file stuff.
  5. *
  6. * Copyright (c) 1992-1995 Microsoft Corporation
  7. \**************************************************************************/
  8. // Miscellaneous Registers used only at EGA/VGA initialization time
  9. #define MISC_OUTPUT 0x0C2 // Miscellaneous Output Register
  10. #define CRTC_ADDR 0x0D4 // CRTC Address Register for color mode
  11. #define CRTC_DATA 0x0D5 // CRTC Data Register for color mode
  12. #define GRAF_1_POS 0x0CC // Graphics 1 Address Register
  13. #define GRAF_2_POS 0x0CA // Graphics 2 Address Register
  14. #define ATTR_READ 0x0DA // Attribute Controler Read Address
  15. #define ATTR_WRITE 0x0C0 // Attribute Controler Write Address
  16. #define IN_STAT_0 0x0C2 // Input Status Register 0
  17. #define IN_STAT_1 0x0DA // Input Status Register 1
  18. // EGA/VGA Register Definitions.
  19. //
  20. // The following definitions are the EGA/VGA registers and values
  21. // used by this driver. All other registers are set up at
  22. // when the EGA/VGA is placed into graphics mode and never altered
  23. // afterwards.
  24. //
  25. // All unspecified bits in the following registers must be 0.
  26. #define EGA_BASE 0x300 // Base address of the EGA (3xx)
  27. #define VGA_BASE 0x300 // Base address of the VGA (3xx)
  28. // SEQUencer Registers Used
  29. #define SEQ_ADDR 0xC4 // SEQUencer Address Register
  30. #define SEQ_DATA 0xC5 // SEQUencer Data Register
  31. #define SEQ_MAP_MASK 0x02 // Write Plane Enable Mask
  32. #define MM_C0 0x01 // C0 plane enable
  33. #define MM_C1 0x02 // C1 plane enable
  34. #define MM_C2 0x04 // C2 plane enable
  35. #define MM_C3 0x08 // C3 plane enable
  36. #define MM_ALL 0x0f // All planes
  37. #define SEQ_MODE 0x04 // Memory Mode
  38. #define SM_ALPHA 0x01 // Char map select enable
  39. #define SM_EXTENDED 0x02 // Extended memory present
  40. #define SM_ODD_PLANE 0x04 // Odd/even bytes to same plane
  41. // Graphics Controller Registers Used
  42. #define GRAF_ADDR 0xCE // Graphics Controller Address Register
  43. #define GRAF_DATA 0xCF // Graphics Controller Data Register
  44. #define GRAF_SET_RESET 0x00 // Set/Reset Plane Color
  45. #define GRAF_ENAB_SR 0x01 // Set/Reset Enable
  46. #define GRAF_COL_COMP 0x02 // Color Compare Register
  47. #define GRAF_DATA_ROT 0x03 // Data Rotate Register
  48. #define DR_ROT_CNT 0x07 // Data Rotate Count
  49. #define DR_SET 0x00 // Data Unmodified
  50. #define DR_AND 0x08 // Data ANDed with latches
  51. #define DR_OR 0x10 // Data ORed with latches
  52. #define DR_XOR 0x18 // Data XORed with latches
  53. #define GRAF_READ_MAP 0x04 // Read Map Select Register
  54. #define RM_C0 0x00 // Read C0 plane
  55. #define RM_C1 0x01 // Read C1 plane
  56. #define RM_C2 0x02 // Read C2 plane
  57. #define RM_C3 0x03 // Read C3 plane
  58. #define GRAF_MODE 0x05 // Mode Register
  59. #define M_PROC_WRITE 0x00 // Write processor data rotated
  60. #define M_LATCH_WRITE 0x01 // Write latched data
  61. #define M_COLOR_WRITE 0x02 // Write processor data as color
  62. #define M_AND_WRITE 0x03 // Write (procdata AND bitmask)
  63. #define M_DATA_READ 0x00 // Read selected plane
  64. #define M_COLOR_READ 0x08 // Read color compare
  65. #define GRAF_MISC 0x06 // Miscellaneous Register
  66. #define MS_NON_ALPHA 0x01 // Char generator disabled
  67. #define MS_ODD_EVEN 0x02 // Map odd addresses to even
  68. #define MS_A0000_128K 0x00 // Memory present at A0000, 128kb
  69. #define MS_A0000_64K 0x04 // Memory present at A0000, 64kb
  70. #define MS_B0000_32K 0x08 // Memory present at B0000, 32kb
  71. #define MS_B8000_32K 0x0C // Memory present at B8000, 32kb
  72. #define MS_ADDR_MASK 0x0C
  73. #define GRAF_CDC 0x07 // Color Don't Care Register
  74. #define GRAF_BIT_MASK 0x08 // Bit Mask Register
  75. // pdev->pjBase is set to this value before it is actually initialized
  76. #define INVALID_BASE_ADDRESS (UCHAR *)( -1 )
  77. ////////////////////////////////////////////////////////////////////////
  78. // Direct access macros
  79. //
  80. #define OUT_WORD(pjBase, addr, w) \
  81. { \
  82. MEMORY_BARRIER(); \
  83. WRITE_PORT_USHORT((BYTE*) (pjBase) + (addr), (USHORT) (w)); \
  84. }
  85. #define OUT_BYTE(pjBase, addr, j) \
  86. { \
  87. MEMORY_BARRIER(); \
  88. WRITE_PORT_UCHAR((BYTE*) (pjBase) + (addr), (UCHAR) (j)); \
  89. }
  90. #define WRITE_WORD(pwAddr, w) \
  91. WRITE_REGISTER_USHORT((USHORT*) (pwAddr), (USHORT) (w))